Most Popular

1500 questions
1105
votes
12 answers

INNER JOIN ON vs WHERE clause

For simplicity, assume all relevant fields are NOT NULL. You can do: SELECT table1.this, table2.that, table2.somethingelse FROM table1, table2 WHERE table1.foreignkey = table2.primarykey AND (some other conditions) Or else: SELECT …
JCCyC
  • 16,140
  • 11
  • 48
  • 75
1104
votes
9 answers

What's the difference between event.stopPropagation and event.preventDefault?

They seem to be doing the same thing... Is one modern and one old? Or are they supported by different browsers? When I handle events myself (without framework) I just always check for both and execute both if present. (I also return false, but I…
Rudie
  • 52,220
  • 42
  • 131
  • 173
1104
votes
21 answers

Is there a "theirs" version of "git merge -s ours"?

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". I am aware of git merge -s ours. But what I want is something like git merge -s theirs. Why doesn't it…
elmarco
  • 31,633
  • 21
  • 64
  • 68
1104
votes
20 answers

StringBuilder vs String concatenation in toString() in Java

Given the 2 toString() implementations below, which one is preferred: public String toString(){ return "{a:"+ a + ", b:" + b + ", c: " + c +"}"; } or public String toString(){ StringBuilder sb = new StringBuilder(100); return…
non sequitor
  • 18,296
  • 9
  • 45
  • 64
1104
votes
10 answers

What characters do I need to escape in XML documents?

What characters must be escaped in XML documents, or where could I find such a list?
Julius A
  • 38,062
  • 26
  • 74
  • 96
1103
votes
15 answers

How do I use sudo to redirect output to a location I don't have permission to write to?

I've been given sudo access on one of our development RedHat linux boxes, and I seem to find myself quite often needing to redirect output to a location I don't normally have write access to. The trouble is, this contrived example doesn't work: sudo…
Jonathan
  • 25,873
  • 13
  • 66
  • 85
1103
votes
10 answers

How can I write a `try`/`except` block that catches all exceptions?

How can I write a try/except block that catches all exceptions?
user469652
  • 48,855
  • 59
  • 128
  • 165
1102
votes
25 answers

Is Safari on iOS 6 caching $.ajax results?

Since the upgrade to iOS 6, we are seeing Safari's web view take the liberty of caching $.ajax calls. This is in the context of a PhoneGap application so it is using the Safari WebView. Our $.ajax calls are POST methods and we have cache set to…
user1684978
  • 8,569
  • 3
  • 13
  • 6
1101
votes
79 answers

HTML text input allow only numeric input

Is there a quick way to set an HTML text input () to only allow numeric keystrokes (plus '.')?
Julius A
  • 38,062
  • 26
  • 74
  • 96
1100
votes
14 answers

How to manage startActivityForResult on Android

In my activity, I'm calling a second activity from the main activity by startActivityForResult. In my second activity, there are some methods that finish this activity (maybe without a result), however, just one of them returns a result. For…
Hesam
  • 52,260
  • 74
  • 224
  • 365
1099
votes
2 answers

How to .gitignore all files/folder in a folder, but not the folder itself?

I want to check in a blank folder to my Git repository. Effectively, I need to ignore all of the files and folders within the folder, but not the folder itself. How can I do this? What should I put in my .gitignore file? For those wondering why I…
Aron Woost
  • 19,268
  • 13
  • 43
  • 51
1099
votes
8 answers

pip install from git repo branch

Trying to pip install a repo's specific branch. Google tells me to pip install https://github.com/user/repo.git@branch The branch's name is issue/34/oscar-0.6 so I did pip install…
goh
  • 27,631
  • 28
  • 89
  • 151
1099
votes
31 answers

How do I check in SQLite whether a table exists?

How do I, reliably, check in SQLite, whether a particular user table exists? I am not asking for unreliable ways like checking if a "select *" on the table returned an error or not (is this even a good idea?). The reason is like this: In my program,…
PoorLuzer
  • 24,466
  • 7
  • 31
  • 35
1098
votes
17 answers

How to list all commits that changed a specific file?

Is there a way to list all commits that changed a specific file?
Daniel
  • 11,315
  • 4
  • 19
  • 15
1098
votes
12 answers

Git: How do I list only local branches?

git branch -a shows both remote and local branches. git branch -r shows remote branches. Is there a way to list just the local branches?
munyengm
  • 15,029
  • 4
  • 24
  • 34
1 2 3
99
100