Most Popular
1500 questions
1619
votes
11 answers
Replacing a 32-bit loop counter with 64-bit introduces crazy performance deviations with _mm_popcnt_u64 on Intel CPUs
I was looking for the fastest way to popcount large arrays of data. I encountered a very weird effect: Changing the loop variable from unsigned to uint64_t made the performance drop by 50% on my PC.
The Benchmark
#include
#include…
gexicide
- 38,535
- 21
- 92
- 152
1619
votes
15 answers
How do I show my global Git configuration?
I'd like to show all configured Git sections.
I only found git config --get core.editor, and I'd like to output everything that's configured globally, not only the configured default editor.
wullxz
- 17,830
- 8
- 32
- 51
1618
votes
23 answers
Compiling an application for use in highly radioactive environments
We are compiling an embedded C++ application that is deployed in a shielded device in an environment bombarded with ionizing radiation. We are using GCC and cross-compiling for ARM. When deployed, our application generates some erroneous data and…
rook
- 66,304
- 38
- 162
- 239
1615
votes
34 answers
How do I migrate an SVN repository with history to a new Git repository?
I read the Git manual, FAQ, Git - SVN crash course, etc. and they all explain this and that, but nowhere can you find a simple instruction like:
SVN repository in: svn://myserver/path/to/svn/repos
Git repository in:…
Milan Babuškov
- 59,775
- 49
- 126
- 179
1613
votes
21 answers
How do I find out which DOM element has the focus?
I would like to find out, in JavaScript, which element currently has focus. I've been looking through the DOM and haven't found what I need, yet. Is there a way to do this, and how?
The reason I was looking for this:
I'm trying to make keys like the…
Tony Peterson
- 20,522
- 15
- 48
- 66
1612
votes
34 answers
Convert a Unix timestamp to time in JavaScript
I am storing time in a MySQL database as a Unix timestamp and that gets sent to some JavaScript code. How would I get just the time out of it?
For example, in HH/MM/SS format.
roflwaffle
- 29,590
- 21
- 71
- 94
1609
votes
11 answers
How can I generate a Git patch for a specific commit?
I need to write a script that creates patches for a list of SHA-1 commit numbers.
I tried using git format-patch , but that generated a patch for each commit since that SHA-1 value. After a few hundred patches were generated, I had to kill…
elle
- 16,125
- 3
- 15
- 4
1609
votes
39 answers
Determine Whether Two Date Ranges Overlap
Given two date ranges, what is the simplest or most efficient way to determine whether the two date ranges overlap?
As an example, suppose we have ranges denoted by DateTime variables StartDate1 to EndDate1 and StartDate2 to EndDate2.
Ian Nelson
- 57,123
- 20
- 76
- 103
1609
votes
29 answers
Using Auto Layout in UITableView for dynamic cell layouts & variable row heights
How do you use Auto Layout within UITableViewCells in a table view to let each cell's content and subviews determine the row height (itself/automatically), while maintaining smooth scrolling performance?
smileyborg
- 30,197
- 11
- 60
- 73
1609
votes
31 answers
Relative imports in Python 3
I want to import a function from another file in the same directory.
Usually, one of the following works:
from .mymodule import myfunction
from mymodule import myfunction
...but the other one gives me one of these errors:
ImportError: attempted…
John Smith Optional
- 22,259
- 12
- 43
- 61
1602
votes
22 answers
What exactly is Apache Camel?
I don't understand what exactly Camel does.
If you could give in 101 words an introduction to Camel:
What exactly is it?
How does it interact with an application written in Java?
Is it something that goes together with the server?
Is it an…
Myy
- 18,107
- 11
- 37
- 57
1602
votes
16 answers
How can I view a git log of just one user's commits?
When using git log, how can I filter by user so that I see only commits from that user?
markdorison
- 139,374
- 27
- 55
- 71
1602
votes
24 answers
How to Sort a List by a property in the object
I have a class called Order which has properties such as OrderId, OrderDate, Quantity, and Total. I have a list of this Order class:
List objListOrder = new List();
GetOrderList(objListOrder); // fill list of orders
I want to sort the…
Shyju
- 214,206
- 104
- 411
- 497
1601
votes
37 answers
Fastest way to determine if an integer's square root is an integer
I'm looking for the fastest way to determine if a long value is a perfect square (i.e. its square root is another integer):
I've done it the easy way, by using the built-in Math.sqrt()
function, but I'm wondering if there is a way to do it faster…
Kip
- 107,154
- 87
- 232
- 265
1600
votes
43 answers
How can I open a URL in Android's web browser from my application?
How to open an URL from code in the built-in web browser rather than within my application?
I tried this:
try {
Intent myIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(download_link));
startActivity(myIntent);
} catch…
Arutha
- 26,088
- 26
- 67
- 80