Most Popular
1500 questions
1501
votes
39 answers
Where can I find documentation on formatting a date in JavaScript?
I noticed that JavaScript's new Date() function is very smart in accepting dates in several formats.
Xmas95 = new Date("25 Dec, 1995 23:15:00")
Xmas95 = new Date("2009 06 12,12:52:39")
Xmas95 = new Date("20 09 2006,12:52:39")
I could not find…
Naga Kiran
- 8,585
- 5
- 43
- 53
1496
votes
44 answers
Passing data between view controllers
I'm new to iOS and Objective-C and the whole MVC paradigm and I'm stuck with the following:
I have a view that acts as a data entry form and I want to give the user the option to select multiple products. The products are listed on another view with…
Matt Price
- 34,499
- 6
- 24
- 33
1496
votes
12 answers
Vertical rulers in Visual Studio Code
Rendering More than One Ruler in VS Code
VS Code's default configuration for a ruler is demonstrated below.
"editor.ruler": 80
The issue I am having with the default VS Code configuration (as shown above) is that it only renders a single ruler.…
nalply
- 26,770
- 15
- 78
- 101
1491
votes
3 answers
Using group by on multiple columns
I understand the point of GROUP BY x.
But how does GROUP BY x, y work, and what does it mean?
Alex Gordon
- 57,446
- 287
- 670
- 1,062
1489
votes
37 answers
What is the best way to add options to a select from a JavaScript object with jQuery?
What is the best method for adding options to a
Darryl Hein
- 142,451
- 95
- 218
- 261
1488
votes
34 answers
UnicodeEncodeError: 'ascii' codec can't encode character u'\xa0' in position 20: ordinal not in range(128)
I'm having problems dealing with unicode characters from text fetched from different web pages (on different sites). I am using BeautifulSoup.
The problem is that the error is not always reproducible; it sometimes works with some pages, and…
Homunculus Reticulli
- 65,167
- 81
- 216
- 341
1488
votes
42 answers
Path.Combine for URLs?
Path.Combine is handy, but is there a similar function in the .NET framework for URLs?
I'm looking for syntax like this:
Url.Combine("http://MyUrl.com/", "/Images/Image.jpg")
which would return:
"http://MyUrl.com/Images/Image.jpg"
Brian MacKay
- 31,133
- 17
- 86
- 125
1486
votes
28 answers
Safely turning a JSON string into an object
Given a string of JSON data, how can I safely turn that string into a JavaScript object?
Obviously I can do this unsafely with something like:
var obj = eval("(" + json + ')');
but that leaves me vulnerable to the JSON string containing other code,…
Matt Sheppard
- 116,545
- 46
- 111
- 131
1486
votes
18 answers
Check synchronously if file/directory exists in Node.js
How can I synchronously check, using node.js, if a file or directory exists?
user196106
1485
votes
24 answers
How do I use threading in Python?
I would like a clear example showing tasks being divided across multiple threads.
albruno
- 14,955
- 3
- 18
- 6
1485
votes
39 answers
How to fix npm throwing error without sudo
I just installed node and npm through the package on nodejs.org, and whenever I try to search or install something with npm, it throws the following error unless I sudo the command. I have a feeling this is a permissions issue? I am already the…
Chad
- 18,076
- 8
- 31
- 41
1484
votes
27 answers
Turning off auto indent when pasting text into vim
I am making the effort to learn Vim.
When I paste code into my document from the clipboard, I get extra spaces at the start of each new line:
line
line
line
I know you can turn off auto indent but I can't get it to work because I have some…
Rimian
- 36,864
- 16
- 117
- 117
1483
votes
22 answers
How does the "this" keyword work, and when should it be used?
I am looking to find a clear explanation of what the "this" keyword does, and how to use it correctly.
It seems to behave strangely, and I don't fully understand why.
How does this work and when should it be used?
Maxim Gershkovich
- 45,951
- 44
- 147
- 243
1483
votes
19 answers
Sort (order) data frame rows by multiple columns
I want to sort a data frame by multiple columns. For example, with the data frame below I would like to sort by column 'z' (descending) then by column 'b' (ascending):
dd <- data.frame(b = factor(c("Hi", "Med", "Hi", "Low"),
levels = c("Low",…
Christopher DuBois
- 42,350
- 23
- 71
- 93
1483
votes
17 answers
Memcached vs. Redis?
We're using a Ruby web-app with Redis server for caching. Is there a point to test Memcached instead?
What will give us better performance? Any pros or cons between Redis and Memcached?
Points to consider:
Read/write speed.
Memory usage.
Disk I/O…
Sagiv Ofek
- 25,190
- 8
- 60
- 55