Most Popular
1500 questions
1262
votes
3 answers
How do I get started with Node.js
Are there any good resources to get started with Node.JS? Any good tutorials, blogs or books?
Of course, I have visited its official website http://nodejs.org/, but I didn't think the documentation they have is a good starting point.
Joneph O.
- 6,887
- 5
- 20
- 9
1259
votes
29 answers
Listing only directories using ls in Bash?
This command lists directories in the current path:
ls -d */
What exactly does the pattern */ do?
And how can we give the absolute path in the above command (e.g. ls -d /home/alice/Documents) for listing only directories in that path?
Sibi
- 47,472
- 16
- 95
- 163
1257
votes
27 answers
When should you use a class vs a struct in C++?
In what scenarios is it better to use a struct vs a class in C++?
Alan Hinchcliffe
- 12,862
- 3
- 18
- 11
1256
votes
22 answers
How to call shell commands from Ruby
How do I call shell commands from inside of a Ruby program? How do I then get output from these commands back into Ruby?
CodingWithoutComments
- 35,598
- 21
- 73
- 86
1256
votes
5 answers
How to mark a method as obsolete or deprecated?
How do I mark a method as obsolete or deprecated using C#?
Chris Ballance
- 33,810
- 26
- 104
- 151
1254
votes
16 answers
How to echo shell commands as they are executed
In a shell script, how do I echo all shell commands called and expand any variable names?
For example, given the following line:
ls $DIRNAME
I would like the script to run the command and display the following
ls /full/path/to/some/dir
The purpose…
Jack Nock
- 14,703
- 5
- 22
- 18
1251
votes
29 answers
Convert a string to an enum in C#
What's the best way to convert a string to an enumeration value in C#?
I have an HTML select tag containing the values of an enumeration. When the page is posted, I want to pick up the value (which will be in the form of a string) and convert it to…
Ben Mills
- 27,454
- 14
- 42
- 38
1250
votes
8 answers
How do servlets work? Instantiation, sessions, shared variables and multithreading
Suppose, I have a webserver which holds numerous servlets. For information passing among those servlets I am setting session and instance variables.
Now, if 2 or more users send request to this server then what happens to the session variables?
Will…
Ku Jon
- 12,503
- 3
- 16
- 4
1249
votes
13 answers
What does in XML mean?
I often find this strange CDATA tag in XML files:
I have observed that this CDATA tag always comes at the beginning, and then followed by some stuff.
But sometimes it is used, sometimes it is not. I assume it is to mark that…
dontWatchMyProfile
- 45,440
- 50
- 177
- 260
1248
votes
12 answers
Convert tabs to spaces in Notepad++
How do I convert tabs to spaces in Notepad++?
I found a webpage that suggests it's possible, but I couldn't find any information about how to do it.
I would like to be able to do that, because some web forms don't respect code with tabs in them.
Helephant
- 16,738
- 8
- 39
- 36
1247
votes
46 answers
Parsing JSON with Unix tools
I'm trying to parse JSON returned from a curl request, like so:
curl 'http://twitter.com/users/username.json' |
sed -e 's/[{}]/''/g' |
awk -v k="text" '{n=split($0,a,","); for (i=1; i<=n; i++) print a[i]}'
The above splits the JSON into…
auser
- 13,808
- 4
- 21
- 15
1247
votes
16 answers
git undo all uncommitted or unsaved changes
I'm trying to undo all changes since my last commit. I tried git reset --hard and git reset --hard HEAD after viewing this post. I responds with head is now at 18c3773... but when I look at my local source all the files are still there. What am I…
Antarr Byrd
- 24,863
- 33
- 100
- 188
1246
votes
40 answers
Is quitting an application frowned upon?
Moving on in my attempt to learn Android, I just read the following:
Question: Does the user have a choice to kill the application
unless we put a menu option in to kill it? If no such option exists,
how does the user terminate the…
Ted
- 19,727
- 35
- 96
- 154
1246
votes
31 answers
How can I tell if a DOM element is visible in the current viewport?
Is there an efficient way to tell if a DOM element (in an HTML document) is currently visible (appears in the viewport)?
(The question refers to Firefox.)
benzaita
- 12,869
- 3
- 20
- 22
1245
votes
43 answers
How to make Twitter Bootstrap menu dropdown on hover rather than click
I'd like to have my Bootstrap menu automatically drop down on hover, rather than having to click the menu title. I'd also like to lose the little arrows next to the menu titles.
falter
- 13,584
- 5
- 22
- 23