See what the Stackoverflow community is most excited about today.
Date: 2017-10-14
-
Best way to convert string to bytes in Python 3?
tags: python, string, character-encoding, python-3.x
291 votes, 6 answers and 386149 views
\r\n There appears to be two different ways to convert a string to bytes, as seen in the answers to TypeError: 'str' does not support the buffer interface\n\nWhich of these methods would be better or ...\r\n
-
How to tell if a Javascript function is defined
tags: javascript, reflection
229 votes, 18 answers and 122610 views
\r\n How do you tell if a function in JavaScript is defined? \n\nI want to do something like this\n\nfunction something_cool(text, callback) {\n alert(text);\n if( callback != null ) callback();\n}\r\nbut it ...\r\n
-
Getting the length of an array in Python
tags: python, arrays
523 votes, 9 answers and 1166307 views
\r\n In Python, is the following the only way to get the number of elements?\n\narr.len()\r\nIf so, why the strange syntax?\r\n
-
How to do associative array/hashing in JavaScript
tags: javascript, dictionary, hashtable
411 votes, 10 answers and 519691 views
\r\n I want to calculate/store some statistics information using JavaScript, the equivalent code in C# is below (features I need are -- key-value pair, string/int key value pair, manipulate values by keys, ...\r\n
-
SQL SELECT WHERE field contains words
tags: sql, select
234 votes, 11 answers and 839630 views
\r\n I need a select which would return results like this:\n\nSELECT * FROM MyTable WHERE Column1 CONTAINS 'word1 word2 word3'\r\nAnd I need all results, i.e. this includes strings with 'word2 word3 word1' or '...\r\n
-
Setting the default Java character encoding?
tags: java, utf-8, character-encoding
288 votes, 12 answers and 494077 views
\r\n How do I properly set the default character encoding used by the JVM (1.5.x) programmatically?\n\nI have read that -Dfile.encoding=whatever used to be the way to go for older JVMs... I don't have that ...\r\n
-
Is there a “theirs” version of “git merge -s ours”?
tags: git, git-merge
576 votes, 16 answers and 279617 views
\r\n When merging topic branch "B" into "A" using git merge, I get some conflicts. I know all the conflicts can be solved using the version in "B".\n\nI am aware of git merge -s ours. But what I want is ...\r\n
-
The application may be doing too much work on its main thread
tags: android, multithreading
214 votes, 13 answers and 222744 views
\r\n I am new to Android SDK/API environment. It's the first I am trying to draw a plot/chart. I tried running different kinds of sample codes the emulator using 3 different free libraries, nothing is ...\r\n
-
Make the current commit the only (initial) commit in a Git repository?
tags: git, github, git-commit
408 votes, 14 answers and 138257 views
\r\n I currently have a local Git repository, which I push to a Github repository.\n\nThe local repository has ~10 commits, and the Github repository is a synchronised duplicate of this.\n\nWhat I'd like to ...\r\n
-
tags: html, css
666 votes, 15 answers and 865988 views
\r\n Is there any way to disable a link using CSS?\n\nI have a class called current-page and want links with this class to be disabled so that no action occurs when they are clicked.\r\n