How to see docker image contents
I did a docker pull and can list the image that's downloaded. I want to see the contents of this image. Did a search on the net but no straight answer.
- Modified
- 2 Oct at 10:39
How can bcrypt have built-in salts?
Coda Hale's article ["How To Safely Store a Password"](http://codahale.com/how-to-safely-store-a-password/) claims that: > bcrypt has salts built-in to prevent rainbow table attacks. He cites [this pa...
Split string with multiple delimiters in Python
I found some answers online, but I have no experience with regular expressions, which I believe is what is needed here. I have a string that needs to be split by either a ';' or ', ' That is, it has ...
Dynamic LINQ OrderBy on IEnumerable<T> / IQueryable<T>
I found an example in the [VS2008 Examples](http://msdn2.microsoft.com/en-us/bb330936.aspx) for Dynamic LINQ that allows you to use a SQL-like string (e.g. `OrderBy("Name, Age DESC"))` for ordering. U...
- Modified
- 15 Oct at 14:45
How to display request headers with command line curl
Command line curl can display response header by using `-D` option, but I want to see what request header it is sending. How can I do that?
- Modified
- 10 Feb at 20:52
How do I get my program to sleep for 50 milliseconds?
How do I get my Python program to sleep for 50 milliseconds?
How to "pretty" format JSON output in Ruby on Rails
I would like my JSON output in Ruby on Rails to be "pretty" or nicely formatted. Right now, I call `to_json` and my JSON is all on one line. At times this can be difficult to see if there is a prob...
- Modified
- 2 Mar at 03:16
Asking the user for input until they give a valid response
I am writing a program that accepts user input. ``` #note: Python 2.7 users should use `raw_input`, the equivalent of 3.X's `input` age = int(input("Please enter your age: ")) if age >= 18: print...
- Modified
- 22 May at 19:18
*.h or *.hpp for your class definitions
I've always used a `*.h` file for my class definitions, but after reading some boost library code, I realised they all use `*.hpp`. I've always had an aversion to that file extension, I think mainly b...
How to use Regular Expressions (Regex) in Microsoft Excel both in-cell and loops
How can I use regular expressions in Excel and take advantage of Excel's powerful grid-like setup for data manipulation? - - - - --- I understand Regex is not ideal for many situations ([To use...
Can I add jars to Maven 2 build classpath without installing them?
Maven 2 is driving me crazy during the experimentation / quick and dirty mock-up phase of development. I have a `pom.xml` file that defines the dependencies for the web-app framework I want to use, an...
Difference between object and class in Scala
I'm just going over some Scala tutorials on the Internet and have noticed in some examples an object is declared at the start of the example. What is the difference between `class` and `object` in Sc...
How do I prepend to a short python list?
`list.append()` appends to the end of a list. [This explains](http://mail.python.org/pipermail/tutor/2005-March/036803.html) that `list.prepend()` does not exist due to performance concerns for large...
How to find if an array contains a specific string in JavaScript/jQuery?
Can someone tell me how to detect if `"specialword"` appears in an array? Example: ``` categories: [ "specialword" "word1" "word2" ] ```
- Modified
- 8 Nov at 15:36
How can I clear or empty a StringBuilder?
I'm using a [StringBuilder](http://download.oracle.com/javase/1.5.0/docs/api/java/lang/StringBuilder.html) in a loop and every x iterations I want to empty it and start with an empty `StringBuilder`, ...
- Modified
- 8 Feb at 01:15
Find duplicate records in MySQL
I want to pull out duplicate records in a MySQL Database. This can be done with: ``` SELECT address, count(id) as cnt FROM list GROUP BY address HAVING cnt > 1 ``` Which results in: ``` 100 MAIN ...
- Modified
- 12 May at 18:24
How to determine CPU and memory consumption from inside a process
I once had the task of determining the following performance parameters from inside a running application: - - - --- - - - --- - - The code had to run on Windows and Linux. Even though this seems...
Writing to output window of Visual Studio
I am trying to write a message to the output window for debugging purposes. I searched for a function like Java's `system.out.println("")`. I tried `Debug.Write`, `Console.Write`, and `Trace.Write`. I...
- Modified
- 21 Jul at 22:33
What is an idiomatic way of representing enums in Go?
I'm trying to represent a simplified chromosome, which consists of N bases, each of which can only be one of `{A, C, T, G}`. I'd like to formalize the constraints with an enum, but I'm wondering what...
Show a number to two decimal places
What's the correct way to round a PHP string to two decimal places? ``` $number = "520"; // It's a string from a database $formatted_number = round_to_2dp($number); echo $formatted_number; ``` Th...
- Modified
- 7 Sep at 20:16
How do I append one string to another in Python?
How do I efficiently append one string to another? Are there any faster alternatives to: ``` var1 = "foo" var2 = "bar" var3 = var1 + var2 ``` --- [How to concatenate (join) items in a list to a si...
How to append to a file in Node?
I am trying to a string to a log file. However writeFile will erase the content each time before writing the string. ``` fs.writeFile('log.txt', 'Hello Node', function (err) { if (err) throw err; ...
- Modified
- 8 Jul at 18:6
Updating address bar with new URL without hash or reloading the page
I either dreamt about chrome (dev channel) implementing a way to update the address bar via javascript (the path, not domain) without reloading the page or they really have done this. However, I can'...
- Modified
- 23 May at 12:26
Why is Java Vector (and Stack) class considered obsolete or deprecated?
Why is Java Vector considered a legacy class, obsolete or deprecated? Isn't its use valid when working with concurrency? And if I don't want to manually synchronize objects and just want to use a th...
- Modified
- 16 May at 00:28