How do I return to an older version of our code in Subversion?
I'm working on a project with a friend and I want to return to an older version of our code and set it to be the current. How do I do it? I'm using "anksvn" on vs08. I have the version that I want o...
Base64 Java encode and decode a string
I want to encode a string into `base64` and transfer it through a socket and decode it back. But after decoding it gives different answer. Following is my code and result is "77+9x6s=" ``` import...
What are some examples of commonly used practices for naming git branches?
I've been using a local git repository interacting with my group's CVS repository for several months, now. I've made an almost neurotic number of branches, most of which have thankfully merged back i...
- Modified
- 18 Dec at 00:58
std::cin input with spaces?
``` #include <string> std::string input; std::cin >> input; ``` The user wants to enter "Hello World". But `cin` fails at the space between the two words. How can I make `cin` take in the whole of ...
- Modified
- 12 Jul at 23:52
Combination of async function + await + setTimeout
I am trying to use the new async features and I hope solving my problem will help others in the future. This is my code which is working: ``` async function asyncGenerator() { // other code w...
- Modified
- 11 Jul at 01:5
Why can't I change directories using "cd" in a script?
I'm trying to write a small script to change the current directory to my project directory: ``` #!/bin/bash cd /home/tree/projects/java ``` I saved this file as proj, added execute permission with ...
- Modified
- 5 Aug at 17:59
How can I do a recursive find/replace of a string with awk or sed?
How do I find and replace every occurrence of: ``` subdomainA.example.com ``` with ``` subdomainB.example.com ``` in every text file under the `/home/www/` directory tree recursively?
How can I find a specific element in a List<T>?
My application uses a list like this: `List<MyClass> list = new List<MyClass>();` Using the `Add` method, another instance of `MyClass` is added to the list. `MyClass` provides, among others, the f...
- Modified
- 20 Oct at 08:58
How to convert JSON data into a Python object?
I want to convert JSON data into a Python object. I receive JSON data objects from the Facebook API, which I want to store in my database. My current View in Django (Python) (`request.POST` contains t...
How do you launch the JavaScript debugger in Google Chrome?
When using Google Chrome, I want to debug some JavaScript code. How can I do that?
- Modified
- 20 Dec at 10:50
org.xml.sax.SAXParseException: Content is not allowed in prolog
I have a Java based web service client connected to Java web service (implemented on the Axis1 framework). I am getting following exception in my log file: ``` Caused by: org.xml.sax.SAXParseExcept...
How to create a video from images with FFmpeg?
``` ffmpeg -r 1/5 -start_number 2 -i img%03d.png -c:v libx264 -r 30 -pix_fmt yuv420p out.mp4 ``` This line worked fine but I want to create a video file from images in another folder. Image names in...
Insert picture into Excel cell
I'm tying to generate a report with pictures, but I cannot get the pictures into a single cell. I can get the pictures to "float" around my worksheet, but I need to put them into a cell. How can I do ...
- Modified
- 2 Feb at 14:29
Update all objects in a collection using LINQ
Is there a way to do the following using LINQ? ``` foreach (var c in collection) { c.PropertyToSet = value; } ``` To clarify, I want to iterate through each object in a collection and then upda...
Clearing localStorage in javascript?
Is there any way to reset/clear browser's localStorage in javascript?
- Modified
- 27 Dec at 13:36
Python Anaconda - How to Safely Uninstall
I installed Python Anaconda on Mac (OS Mavericks). I wanted to revert to the default version of Python on my Mac. What's the best way to do this? Should I delete the `~/anaconda` directory? Any other ...
How to iterate over a JavaScript object?
I have an object in JavaScript: ``` { abc: '...', bca: '...', zzz: '...', xxx: '...', ccc: '...', // ... } ``` I want to use a `for` loop to get its properties. And I want t...
- Modified
- 13 Sep at 19:56
ADB No Devices Found
I am attempting to install an [Android](http://en.wikipedia.org/wiki/Android_%28operating_system%29) app on my brand new [Nexus 10](https://en.wikipedia.org/wiki/Nexus_10). I have a .apk file. I have ...
How to execute Python code from within Visual Studio Code
[Visual Studio Code](https://code.visualstudio.com/) was recently released and I liked the look of it and the features it offered, so I figured I would give it a go. I downloaded the application from ...
- Modified
- 19 Nov at 02:37
Cannot simply use PostgreSQL table name ("relation does not exist")
I'm trying to run the following PHP script to do a simple database query: ``` $db_host = "localhost"; $db_name = "showfinder"; $username = "user"; $password = "password"; $dbconn = pg_connect("host=$...
- Modified
- 21 Feb at 06:56
Are double and single quotes interchangeable in JavaScript?
Consider the following two alternatives: - `console.log("double");`- `console.log('single');` The former uses double quotes around the string, whereas the latter uses single quotes around the string. ...
- Modified
- 27 Jan at 05:37
Strip all non-numeric characters from string in JavaScript
Consider a non-DOM scenario where you'd want to remove all non-numeric characters from a string using JavaScript/ECMAScript. Any characters that are in range `0 - 9` should be kept. ``` var myString ...
- Modified
- 24 Apr at 10:32
Best way to track onchange as-you-type in input type="text"?
In my experience, `input type="text"` `onchange` event usually occurs only after you leave (`blur`) the control. Is there a way to force browser to trigger `onchange` every time `textfield` content c...
- Modified
- 25 Nov at 15:39
How to format a DateTime in PowerShell
I can format the [Get-Date](https://technet.microsoft.com/en-us/library/hh849887.aspx) cmdlet no problem like this: ``` $date = Get-Date -format "yyyyMMdd" ``` But once I've got [a date](https://ms...
- Modified
- 14 Jan at 06:6
Get a substring of a char*
For example, I have this ``` char *buff = "this is a test string"; ``` and want to get `"test"`. How can I do that?