When is assembly faster than C?
One of the stated reasons for knowing assembler is that, on occasion, it can be employed to write code that will be more performant than writing that code in a higher-level language, C in particular. ...
- Modified
- 3 Jan at 15:58
How to mount a single file in a volume
I am trying to dockerize a PHP application. In the dockerfile, I download the archive, extract it, etc. Everything works fine. However, if a new version gets released and I update the dockerfile, I ha...
- Modified
- 6 Oct at 00:19
How should I resolve --secure-file-priv in MySQL?
I am learning MySQL and tried using a `LOAD DATA` clause. When I used it as below: ``` LOAD DATA INFILE "text.txt" INTO table mytable; ``` I got the following error: > The MySQL server is running ...
How to delete a column from a table in MySQL
Given the table created using: ``` CREATE TABLE tbl_Country ( CountryId INT NOT NULL AUTO_INCREMENT, IsDeleted bit, PRIMARY KEY (CountryId) ) ``` How can I delete the column `IsDeleted`?
- Modified
- 15 Sep at 11:58
How to write trycatch in R
I want to write `trycatch` code to deal with error in downloading from the web. ``` url <- c( "http://stat.ethz.ch/R-manual/R-devel/library/base/html/connections.html", "http://en.wikipedia.o...
WCF vs ASP.NET Web API
I've spent a few months trying to grasp the concepts behind WCF and recently I've developed my first WCF service application. I've struggled quite a bit to understand all the settings in the config ...
- Modified
- 16 Apr at 12:24
Xcode warning: "Multiple build commands for output file"
I am getting an error like this: > [WARN]Warning: Multiple build commands for output file /Developer/B/Be/build/Release-iphonesimulator/BB.app/no.png[WARN]Warning: Multiple build commands for output f...
Regex: match everything but a specific pattern
I need a regular expression able to match everything a string starting with a specific pattern (specifically `index.php` and what follows, like `index.php?id=2342343`).
- Modified
- 23 Feb at 22:19
Simple tool to 'accept theirs' or 'accept mine' on a whole file using git
I don't want a visual merge tool, and I also don't want to have to vi the conflicted file and manually choose the between HEAD (mine) and the imported change (theirs). Most of the time I either want ...
Convert HTML to PDF in .NET
I want to generate a PDF by passing HTML contents to a function. I have made use of iTextSharp for this but it does not perform well when it encounters tables and the layout just gets messy. Is there...
Error related to only_full_group_by when executing a query in MySql
I have upgraded my system and have installed MySql 5.7.9 with php for a web application I am working on. I have a query that is dynamically created, and when run in older versions of MySQL it works fi...
- Modified
- 21 Jul at 22:35
How to change spinner text size and text color?
In my Android application, I am using spinner, and I have loaded data from the SQLite database into the spinner, and it's working properly. Here is the code for that. ``` Spinner spinner = (Spinner) ...
Print a list in reverse order with range()?
How can you produce the following list with `range()` in Python? ``` [9, 8, 7, 6, 5, 4, 3, 2, 1, 0] ```
Folder management with r : Check existence of directory and create it if it doesn't exist
I often find myself writing R scripts that generate a lot of output. I find it cleaner to put this output into its own directory(s). What I've written below will check for the existence of a directory...
- Modified
- 8 Feb at 20:31
How can one print a size_t variable portably using the printf family?
I have a variable of type `size_t`, and I want to print it using `printf()`. What format specifier do I use to print it portably? In 32-bit machine, `%u` seems right. I compiled with `g++ -g -W -Wal...
Using LIMIT within GROUP BY to get N results per group?
The following query: ``` SELECT year, id, rate FROM h WHERE year BETWEEN 2000 AND 2009 AND id IN (SELECT rid FROM table2) GROUP BY id, year ORDER BY id, rate DESC ``` yields: ``` year id rate ...
- Modified
- 29 Sep at 09:53
What is the difference between instanceof and Class.isAssignableFrom(...)?
Which of the following is better? ``` a instanceof B ``` or ``` B.class.isAssignableFrom(a.getClass()) ``` The only difference that I know of is, when 'a' is null, the first returns false, while...
- Modified
- 30 Jan at 19:44
Why is HttpClient BaseAddress not working?
Consider the following code, where the `BaseAddress` defines a partial URI path. ``` using (var handler = new HttpClientHandler()) using (var client = new HttpClient(handler)) { client.BaseAddres...
- Modified
- 23 May at 12:10
LINQ Orderby Descending Query
I have a LINQ query that I want to order by the most recently created date. I tried: ``` var itemList = from t in ctn.Items where !t.Items && t.DeliverySelection ...
- Modified
- 30 May at 14:0
z-index not working with fixed positioning
I have a `div` with default positioning (i.e. `position:static`) and a `div` with a `fixed` position. If I set the z-indexes of the elements, it seems impossible to make the fixed element go behind th...
How to map/collect with index in Ruby?
What is the easiest way to convert ``` [x1, x2, x3, ... , xN] ``` to ``` [[x1, 2], [x2, 3], [x3, 4], ... , [xN, N+1]] ```
How to make a HTML Page in A4 paper size page(s)?
Is it possible to make a HTML page behave, for example, like a A4-sized page in MS Word? Essentially, I want to be able to show the HTML page in the browser, and outline the content in the dimensions...
What is the difference between typeof and instanceof and when should one be used vs. the other?
In my particular case: ``` callback instanceof Function ``` or ``` typeof callback == "function" ``` does it even matter, what's the difference? JavaScript-Garden [typeof](http://bonsaiden.g...
- Modified
- 28 Nov at 00:21
What do the terms "CPU bound" and "I/O bound" mean?
What do the terms "CPU bound" and "I/O bound" mean?
- Modified
- 2 Nov at 18:33
C pointer to array/array of pointers disambiguation
What is the difference between the following declarations: ``` int* arr1[8]; int (*arr2)[8]; int *(arr3[8]); ``` What is the general rule for understanding more complex declarations?
- Modified
- 12 Dec at 06:12