Questions

What is the convention for word separator in Java package names?

How should one separate words in package names? Which of the following are correct? 1. com.stackoverflow.my_package (Snake Case using underscore) 2. com.stackoverflow.my-package (Kebab Case using hyp...

30 Dec at 13:7

.NET / C# - Convert char[] to string

What is the proper way to turn a `char[]` into a string? The `ToString()` method from an array of characters doesn't do the trick.

17 Jul at 15:39

How do I remove the file suffix and path portion from a path string in Bash?

Given a string file path such as `/foo/fizzbuzz.bar`, how would I use bash to extract just the `fizzbuzz` portion of said string?

24 Oct at 21:42

Most efficient way to increment a Map value in Java

I hope this question is not considered too basic for this forum, but we'll see. I'm wondering how to refactor some code for better performance that is getting run a bunch of times. Say I'm creating a...

20 Sep at 14:11

Redirecting to a certain route based on condition

I'm writing a small AngularJS app that has a login view and a main view, configured like so: ``` $routeProvider .when('/main' , {templateUrl: 'partials/main.html', controller: MainController}) .wh...

6 Sep at 22:58

Uninstall / remove a Homebrew package including all its dependencies

I have a formula that I wish to uninstall/remove along with all its dependencies, skipping packages whom other packages depend upon (a.k.a. [Cascading package removal](https://en.wikipedia.org/wiki/P...

25 Apr at 05:5

How to listen for a WebView finishing loading a URL?

I have a `WebView` that is loading a page from the Internet. I want to show a `ProgressBar` until the loading is complete. How do I listen for the completion of page loading of a [WebView](http://de...

3 Aug at 07:55

Handling file renames in Git

I'd read that when [renaming files in Git](https://bauermann.wordpress.com/2008/01/03/take-care-when-renaming-files-in-git/), you should commit any changes, perform your rename and then stage your ren...

13 Apr at 07:14

Calculating the difference between two Java date instances

I'm using Java's `java.util.Date` class in Scala and want to compare a `Date` object and the current time. I know I can calculate the delta by using getTime(): ``` (new java.util.Date()).getTime() - ...

Easy way to write contents of a Java InputStream to an OutputStream

I was surprised to find today that I couldn't track down any simple way to write the contents of an `InputStream` to an `OutputStream` in Java. Obviously, the byte buffer code isn't difficult to write...

21 Aug at 19:30

How to check if a variable is an integer in JavaScript?

How do I check if a variable is an integer in JavaScript, and throw an alert if it isn't? I tried this, but it doesn't work: ``` <html> <head> <script type="text/javascript"> ...

7 Sep at 14:36

How to compare two dates?

How would I compare two dates to see which is later, using Python? For example, I want to check if the current date is past the last date in this list I am creating, of holiday dates, so that it will...

3 Jun at 21:52

Specify an SSH key for git push for a given domain

I have the following use case: I would like to be able to push to `git@git.company.com:gitolite-admin` using the private key of user `gitolite-admin`, while I want to push to `git@git.company.com:some...

16 Nov at 13:13

Capturing Groups From a Grep RegEx

I've got this little script in `sh` (Mac OSX 10.6) to look through an array of files. Google has stopped being helpful at this point: ``` files="*.jpg" for f in $files do echo $f | grep -o...

29 Dec at 00:35

What is the JavaScript string newline character?

Is `\n` the universal newline character sequence in JavaScript for all platforms? If not, how do I determine the character for the current environment? I'm not asking about the HTML newline element (`...

5 Nov at 15:7

"Invalid signature file" when attempting to run a .jar

My java program is packaged in a jar file and makes use of an external jar library, [bouncy castle](http://www.bouncycastle.org/). My code compiles fine, but running the jar leads to the following err...

16 Jun at 03:49

What is the purpose of the vshost.exe file?

When I create and compile a "Hello, World!" application in C#, I get three files in the Debug folder apart from the main exe (e.g. HelloWorld.exe) 1. HelloWorld.vshost.exe 2. HelloWorld.pdb 3. Hello...

3 Jan at 12:20

Managing jQuery plugin dependency in webpack

I'm using Webpack in my application, in which I create two entry points - bundle.js for all my JavaScript files/codes, and vendors.js for all libraries like jQuery and React. What do I do in order to ...

12 Jun at 20:49

Apache2: 'AH01630: client denied by server configuration'

I get this error when trying to access localhost via a browser. ``` AH01630: client denied by server configuration ``` I checked my site folder permissions using: ``` sudo chmod 777 -R * ``` Her...

10 Nov at 22:42

How can I get my Twitter Bootstrap buttons to right align?

I have a simple demo here: ``` <ul> <li>One <input class="btn pull-right" value="test"></li> <li>Two <input class="btn pull-right" value="test2"></li> </ul> ``` I have an unordered list and f...

How to download image using requests

I'm trying to download and save an image from the web using python's `requests` module. Here is the (working) code I used: ``` img = urllib2.urlopen(settings.STATICMAP_URL.format(**data)) with open(...

30 Oct at 11:14

VS 2012: Scroll Solution Explorer to current file

VS2010 had the feature that viewing a file would automatically cause Solution Explorer to scroll to that file. With VS2012, viewing different files from within the IDE no longer scrolls and select th...

How do I find the MySQL my.cnf location

Is there a MySQL command to locate the `my.cnf` configuration file, similar to how PHP's `phpinfo()` locates its `php.ini`?

13 Mar at 16:3

How to urlencode data for curl command?

I am trying to write a bash script for testing that takes a parameter and sends it through curl to web site. I need to url encode the value to make sure that special characters are processed properly...

26 Jul at 14:6

How to insert text at beginning of a multi-line selection in vi/Vim

In [Vim](http://en.wikipedia.org/wiki/Vim_%28text_editor%29), how do I insert characters at the beginning of each line in a selection? For instance, I want to comment out a block of code by prepend...

24 Nov at 06:11