Visualizing branch topology in Git
I'm playing with Git in isolation on my own machine, and I find it difficult to maintain a mental model of all my branches and commits. I know I can do a `git log` to see the commit history from where...
- Modified
- 5 Feb at 07:50
How to convert a std::string to const char* or char*
How can I convert an `std::string` to a `char*` or a `const char*`?
What does set -e mean in a bash script?
I'm studying the content of this file that the script executes before that package is unpacked from its Debian archive (.deb) file. The script has the following code: ``` #!/bin/bash set -e # Autom...
How do I rotate the Android emulator display?
How can I rotate the Android emulator display to see it in landscape mode?
- Modified
- 25 Sep at 09:0
How do I redirect with JavaScript?
How do you redirect to a page from another page with JavaScript?
- Modified
- 6 Feb at 12:29
not:first-child selector
I have a `div` tag containing several `ul` tags. I'm able to set CSS properties for the first `ul` tag only: ``` div ul:first-child { background-color: #900; } ``` However, my following attemp...
- Modified
- 28 Dec at 22:6
How can I specify a branch/tag when adding a Git submodule?
How does `git submodule add -b` work? After adding a submodule with a specific branch, a new cloned repository (after `git submodule update --init`) will be at a specific commit, not the branch itsel...
- Modified
- 6 Nov at 16:20
How can I do 'insert if not exists' in MySQL?
I started by googling and found the article [How to write INSERT if NOT EXISTS queries in standard SQL](http://www.xaprb.com/blog/2005/09/25/insert-if-not-exists-queries-in-mysql/) which talks about m...
- Modified
- 10 May at 10:11
How to find event listeners on a DOM node in JavaScript or in debugging?
I have a page where some event listeners are attached to input boxes and select boxes. Is there a way to find out which event listeners are observing a particular DOM node and for what event? Events ...
- Modified
- 11 Aug at 04:11
How to remove old and unused Docker images
When running Docker for a long time, there are a lot of images in system. How can I remove all unused Docker images at once safety to free up the storage? In addition, I also want to remove images pu...
- Modified
- 2 Aug at 08:28
How to detect Safari, Chrome, IE, Firefox and Opera browsers?
I have 5 addons/extensions for Firefox, Chrome, Internet Explorer(IE), Opera, and Safari. How can I correctly recognize the user browser and redirect (once an install button has been clicked) to downl...
- Modified
- 10 Jul at 22:22
What are C++ functors and their uses?
I keep hearing a lot about functors in C++. Can someone give me an overview as to what they are and in what cases they would be useful?
- Modified
- 29 Jun at 10:41
How to create RecyclerView with multiple view types
From [Create dynamic lists with RecyclerView](https://developer.android.com/preview/material/ui-widgets.html): When we create a `RecyclerView.Adapter` we have to specify `ViewHolder` that will bind wi...
- Modified
- 7 Jul at 17:55
Git: cannot checkout branch - error: pathspec '...' did not match any file(s) known to git
I'm not sure why I'm a branch that I had worked on earlier. See the commands below (note: `co` is an alias for `checkout`): ``` ramon@ramon-desktop:~/source/unstilted$ git branch -a * develop feat...
- Modified
- 23 May at 12:10
How can I change the color of an 'svg' element?
I want to [use this technique](http://css-tricks.com/svg-fallbacks/) and change the SVG color, but so far I haven't been able to do so. I use this in the CSS, but my image is always black, no matter w...
How to style a checkbox using CSS
I am trying to style a checkbox using the following: ``` <input type="checkbox" style="border:2px dotted #00f;display:block;background:#ff0000;" /> ``` But the style is not applied. The checkbox s...
How can I calculate the number of lines changed between two commits in Git?
Is there any easy way to calculate the number of lines changed between two commits in Git? I know I can do a `git diff`, and count the lines, but this seems tedious. I'd also like to know how I can do...
- Modified
- 3 Jan at 20:49
Understanding the Rails Authenticity Token
What is the Authenticity Token in Rails?
- Modified
- 28 Aug at 20:51
Constants in Objective-C
I'm developing a [Cocoa](http://en.wikipedia.org/wiki/Cocoa_%28API%29) application, and I'm using constant `NSString`s as ways to store key names for my preferences. I understand this is a good idea ...
- Modified
- 17 Apr at 14:21
How to validate phone numbers using regex
I'm trying to put together a comprehensive regex to validate phone numbers. Ideally it would handle international formats, but it must handle US formats, including the following: - `1-234-567-8901`- ...
- Modified
- 14 Feb at 19:35
Writing a pandas DataFrame to CSV file
I have a dataframe in pandas which I would like to write to a CSV file. I am doing this using: ``` df.to_csv('out.csv') ``` And getting the following error: ``` UnicodeEncodeError: 'ascii' codec can'...
Place cursor at the end of text in EditText
I am changing the value of an `EditText` on `keyListener`. But when I change the text the cursor is moving to the beginning of the `EditText`. I need the cursor to be at the end of the text. How to ...
- Modified
- 26 Jan at 19:52
How can I disable landscape mode in Android?
How can I disable landscape mode for some of the views in my Android app?
- Modified
- 2 Jun at 14:13
Why doesn't RecyclerView have onItemClickListener()?
I was exploring `RecyclerView` and I was surprised to see that `RecyclerView` does not have `onItemClickListener()`. I've two question. # Main Question I want to know why Google removed `onItemC...
- Modified
- 11 Dec at 14:47
Find all files in a directory with extension .txt in Python
How can I find all the files in a directory having the extension `.txt` in python?