Questions

The difference between fork(), vfork(), exec() and clone()

I was looking to find the difference between these four on Google and I expected there to be a huge amount of information on this, but there really wasn't any solid comparison between the four calls. ...

11 Sep at 10:18

Get Enum from Description attribute

> [Finding an enum value by its Description Attribute](https://stackoverflow.com/questions/3422407/finding-an-enum-value-by-its-description-attribute) I have a generic extension method which g...

23 May at 12:18

Warning: mysql_connect(): [2002] No such file or directory (trying to connect via unix:///tmp/mysql.sock) in

I'm trying to connect to my MySQL DB with the Terminal on my Apple (With PHP). Yesterday it worked fine, and now I suddenly get the error in the title. The script works when I use my browser to run ...

4 Dec at 00:20

Viewing all `git diffs` with vimdiff

I setup `git diff` to wrap into vimdiff, using "[Git Diff with Vimdiff](http://technotales.wordpress.com/2009/05/17/git-diff-with-vimdiff/)" as a guide, and it's working as expected unless there are m...

20 Apr at 16:34

Only get hash value using md5sum (without filename)

I use [md5sum](https://linux.die.net/man/1/md5sum) to generate a hash value for a file. But I only need to receive the hash value, not the file name. ``` md5=`md5sum ${my_iso_file}` echo ${md5} ``` O...

19 Apr at 15:20

Remove insignificant trailing zeros from a number?

Have I missed a standard API call that removes trailing insignificant zeros from a number? ``` var x = 1.234000; // to become 1.234 var y = 1.234001; // stays 1.234001 ``` `Number.toFixed()` and `Num...

22 Sep at 07:42

Scoping in Python 'for' loops

I'm not asking about Python's scoping rules; I understand generally scoping works in Python for loops. My question is the design decisions were made in this way. For example (no pun intended): ``` ...

31 Aug at 17:52

How to remove all white space from the beginning or end of a string?

How can I remove all white space from the beginning and end of a string? Like so: `"hello"` returns `"hello"` `"hello "` returns `"hello"` `" hello "` returns `"hello"` `" hello world "` returns `"h...

27 Jun at 14:30

How can I get the line number which threw exception?

In a `catch` block, how can I get the line number which threw an exception?

15 Nov at 14:7

MySQL ON DUPLICATE KEY UPDATE for multiple rows insert in single query

I have a SQL query where I want to insert multiple rows in single query. so I used something like: ``` $sql = "INSERT INTO beautiful (name, age) VALUES ('Helen', 24), ('Katrina', 21), ('Samia...

17 May at 21:47

Make UINavigationBar transparent

How do you make a ? Though I want its bar items to remain visible.

How to change the Push and Pop animations in a navigation based app

I have a navigation based application and I want to change the animation of the push and pop animations. How would I do that? There have been many answers to this question and it's been quite awhil...

16 Nov at 17:39

Is it possible to listen to a "style change" event?

Is it possible to create an event listener in jQuery that can be bound to any style changes? For example, if I want to "do" something when an element changes dimensions, or any other changes in the st...

19 Aug at 13:1

How to break nested loops in JavaScript?

I tried this: ``` for(i = 0; i < 5; i++){ for(j = i + 1; j < 5; j++){ break(2); } alert(1); } ``` only to get: > `SyntaxError`: missing `;` before statement So, how would I br...

2 Mar at 13:43

How do I create a DataTable, then add rows to it?

I've tried creating a `DataTable` and adding rows to it like this: ``` DataTable dt = new DataTable(); dt.clear(); dt.Columns.Add("Name"); dt.Columns.Add("Marks"); ``` How do I see the structure o...

4 Mar at 11:13

Split string, convert ToList<int>() in one line

I have a string that has numbers ``` string sNumbers = "1,2,3,4,5"; ``` I can split it then convert it to `List<int>` ``` sNumbers.Split( new[] { ',' } ).ToList<int>(); ``` How can I convert str...

4 Nov at 03:50

What is the best Java email address validation method?

What are the good email address validation libraries for Java? Are there any alternatives to [commons validator](http://commons.apache.org/proper/commons-validator/apidocs/org/apache/commons/validato...

29 Jun at 14:14

Performance of Arrays vs. Lists

Say you need to have a list/array of integers which you need iterate frequently, and I mean extremely often. The reasons may vary, but say it's in the heart of the inner most loop of a high volume pro...

28 Jun at 08:43

How to build query string with Javascript

Just wondering if there is anything built-in to Javascript that can take a Form and return the query parameters, eg: `"var1=value&var2=value2&arr[]=foo&arr[]=bar..."` I've been wondering this for yea...

13 May at 15:54

BindingFlags.IgnoreCase not working for Type.GetProperty()?

Imagine the following A type T has a field Company. When executing the following method it works perfectly: ``` Type t = typeof(T); t.GetProperty("Company") ``` Whith the following call I get null...

What's the best way to check if a String represents an integer in Java?

I normally use the following idiom to check if a String can be converted to an integer. ``` public boolean isInteger( String input ) { try { Integer.parseInt( input ); return true...

28 Oct at 06:35

Advantages to Using Private Static Methods

When creating a class that has internal private methods, usually to reduce code duplication, that don't require the use of any instance fields, are there performance or memory advantages to declaring ...

26 Oct at 22:37

How to implement WiX installer upgrade?

At work we use [WiX](http://en.wikipedia.org/wiki/WiX) for building installation packages. We want that installation of product X would result in uninstall of the previous version of that product on t...

31 Jan at 01:15

What are the main performance differences between varchar and nvarchar SQL Server data types?

I'm working on a database for a small web app at my school using `SQL Server 2005`. I see a couple of schools of thought on the issue of `varchar` vs `nvarchar`: 1. Use varchar unless you deal with ...

DeprecationWarning: Buffer() is deprecated due to security and usability issues when I move my script to another server

Getting error when script move to other server. > (node:15707) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocU...

14 Dec at 14:13