Most Popular

1500 questions
2807
votes
36 answers

How can I save an activity state using the save instance state?

I've been working on the Android SDK platform, and it is a little unclear how to save an application's state. So given this minor re-tooling of the 'Hello, Android' example: package com.android.hello; import android.app.Activity; import…
Bernard
  • 44,632
  • 18
  • 53
  • 69
2799
votes
59 answers

How do I get the current date in JavaScript?

How do I get the current date in JavaScript?
Suresh
  • 36,587
  • 15
  • 58
  • 62
2794
votes
36 answers

How do I pass command line arguments to a Node.js program?

I have a web server written in Node.js and I would like to launch with a specific folder. I'm not sure how to access arguments in JavaScript. I'm running node like this: $ node server.js folder here server.js is my server code. Node.js help says…
milkplus
  • 30,869
  • 7
  • 28
  • 31
2786
votes
21 answers

Determine installed PowerShell version

How can I determine what version of PowerShell is installed on a computer, and indeed if it is installed at all?
Tangiest
  • 43,099
  • 24
  • 79
  • 110
2786
votes
90 answers

How do I detect a click outside an element?

I have some HTML menus, which I show completely when a user clicks on the head of these menus. I would like to hide these elements when the user clicks outside the menus' area. Is something like this possible with…
Sergio del Amo
  • 74,335
  • 67
  • 149
  • 178
2784
votes
13 answers

What are the correct version numbers for C#?

What are the correct version numbers for C#? What came out when? Why can't I find any answers about C# 3.5? This question is primarily to aid those who are searching for an answer using an incorrect version number, e.g. C# 3.5. The hope is that…
Jon Skeet
  • 1,335,956
  • 823
  • 8,931
  • 9,049
2782
votes
25 answers

Converting string into datetime

How do I convert the following string to a datetime object? "Jun 1 2005 1:33PM"
Oli
  • 228,145
  • 62
  • 212
  • 294
2777
votes
15 answers

How do I access environment variables in Python?

How do I get the value of an environment variable in Python?
Amit Yadav
  • 28,830
  • 6
  • 40
  • 52
2774
votes
14 answers

What is the --save option for npm install?

I saw some tutorial where the command was: npm install --save What does the --save option mean?
Dmitri
  • 32,142
  • 8
  • 35
  • 54
2773
votes
28 answers

How can I prevent SQL injection in PHP?

If user input is inserted without modification into an SQL query, then the application becomes vulnerable to SQL injection, like in the following example: $unsafe_variable = $_POST['user_input']; mysql_query("INSERT INTO `table` (`column`) VALUES…
Andrew G. Johnson
  • 26,163
  • 30
  • 87
  • 133
2773
votes
7 answers

Flash CS4 refuses to let go

I have a Flash project, and it has many source files. I have a fairly heavily-used class, call it Jenine. I recently (and, perhaps, callously) relocated Jenine from one namespace to another. I thought we were ready - I thought it was time. The new…
Ender
  • 26,873
  • 7
  • 27
  • 33
2773
votes
17 answers

I need an unordered list without any bullets

I have created an unordered list. I feel the bullets in the unordered list are bothersome, so I want to remove them. Is it possible to have a list without bullets?
praveenjayapal
  • 36,211
  • 29
  • 70
  • 72
2771
votes
7 answers

How does database indexing work?

Given that indexing is so important as your data set increases in size, can someone explain how indexing works at a database-agnostic level? For information on queries to index a field, check out How do I index a database column.
Xenph Yan
  • 80,783
  • 15
  • 46
  • 55
2761
votes
6 answers

How can I see the differences between two branches?

I have two branches: branch_1 and branch_2. How can I see the differences between them?
isuruanu
  • 27,675
  • 3
  • 13
  • 4
2761
votes
39 answers

How can I check if a program exists from a Bash script?

How would I validate that a program exists, in a way that will either return an error and exit, or continue with the script? It seems like it should be easy, but it's been stumping me.
gregh
  • 32,849
  • 8
  • 29
  • 27