Questions

Install a Windows service using a Windows command prompt?

I want to install a Windows service using a Windows command prompt (not the Visual Studio command prompt). How do I do this?

1 Feb at 15:23

How can I escape a double quote inside double quotes?

How can I escape double quotes inside a double string in Bash? For example, in my shell script ``` #!/bin/bash dbload="load data local infile \"'gfpoint.csv'\" into table $dbtable FIELDS TERMINATED...

17 Jun at 00:19

How do I make a text input non-editable?

So I have a text input ``` <input type="text" value="3" class="field left"> ``` Here is my CSS for it ``` background:url("images/number-bg.png") no-repeat scroll 0 0 transparent; border:0 none; co...

29 Apr at 16:39

How to get the current URL within a Django template?

I was wondering how to get the current URL within a template. Say my current URL is: ``` .../user/profile/ ``` How do I return this to the template?

5 Apr at 19:13

Variable number of arguments in C++?

How can I write a function that accepts a variable number of arguments? Is this possible, how?

2 Apr at 17:25

Set transparent background of an imageview on Android

I am using a web view in which I am adding an image view. How can I set the background of this image view to transparent? I have tried this: ``` mImageview.setBackgroundResource(R.color.trans); ``` ...

28 Apr at 21:26

How can I add a class to a DOM element in JavaScript?

How do I add a class for the `div`? ``` var new_row = document.createElement('div'); ```

15 Dec at 04:52

Java Ordered Map

Is there an object in Java that acts like a Map for storing and accessing key/value pairs, but can return an ordered list of keys and an ordered list of values, such that the key and value lists are i...

7 Oct at 11:35

SQL Server - stop or break execution of a SQL script

Is there a way to immediately stop execution of a SQL script in SQL server, like a "break" or "exit" command? I have a script that does some validation and lookups before it starts doing inserts, and...

2 Dec at 14:52

What is the worst gotcha in C# or .NET?

I was recently working with a `DateTime` object, and wrote something like this: ``` DateTime dt = DateTime.Now; dt.AddDays(1); return dt; // still today's date! WTF? ``` The intellisense documentat...

13 Aug at 04:30

What is the difference between bool and Boolean types in C#

What is the difference between `bool` and `Boolean` types in C#?

17 Jun at 19:52

Git - remote: Repository not found

I have SourceTree with local working copy. And all operations work good, I can simple fetch, push, pull and etc via SourceTree. I just needed to make force push which does not exist in SourceTree. I ...

14 Jun at 13:31

What's the difference between returning value or Promise.resolve from then()

What is the difference between: ``` new Promise(function(res, rej) { res("aaa"); }) .then(function(result) { return "bbb"; // directly returning string }) .then(function(result) { ...

12 Sep at 13:15

appcompat-v7:21.0.0': No resource found that matches the given name: attr 'android:actionModeShareDrawable'

When attempting to use the latest appcompat-v7 support library in my project, I get the following error: ``` /Users/greg/dev/mobile/android_project/app/build/intermediates/exploded-aar/com.android.su...

Make xargs handle filenames that contain spaces

``` $ ls *mp3 | xargs mplayer Playing Lemon. File not found: 'Lemon' Playing Tree.mp3. File not found: 'Tree.mp3' Exiting... (End of file) ``` My command fails because the file "Lemon Tr...

2 Oct at 00:33

Twitter Bootstrap Tabs: Go to Specific Tab on Page Reload or Hyperlink

I'm developing a web page in which I'm using Twitter's Bootstrap Framework and their [Bootstrap Tabs JS](http://twitter.github.com/bootstrap/javascript.html#tabs). It works great except for a few mino...

MySQL with Node.js

I've just started getting into Node.js. I come from a PHP background, so I'm fairly used to using MySQL for all my database needs. How can I use MySQL with Node.js?

21 Nov at 12:49

Need a good hex editor for Linux

I need a good hex editor for Linux, and by good I mean: - - - - - What can you suggest?

5 Oct at 07:10

Android: install .apk programmatically

I made this with help from [Android download binary file problems](https://stackoverflow.com/questions/576513/android-download-binary-file-problems) and [Install Application programmatically on Andr...

24 Feb at 09:12

Force IE compatibility mode off using tags

I am doing work for a client who forces compatibility mode on all intranet sites. I was wondering if there is a tag I can put into my HTML that forces compatibility mode off.

6 Mar at 16:52

PDOException “could not find driver”

I have just installed Debian Lenny with Apache, MySQL, and PHP and I am receiving a PDOException `could not find driver`. This is the specific line of code it is referring to: `$dbh = new PDO('mysql...

10 Nov at 05:47

How do I assert my exception message with JUnit Test annotation?

I have written a few JUnit tests with `@Test` annotation. If my test method throws a checked exception and if I want to assert the message along with the exception, is there a way to do so with JUnit ...

Why do we need boxing and unboxing in C#?

Why do we need boxing and unboxing in C#? I know what boxing and unboxing is, but I can't comprehend the real use of it. Why and where should I use it? ``` short s = 25; object objshort = s; //Box...

28 Dec at 09:35

Easy way to dismiss keyboard?

I have quite a few controls scattered throughout many table cells in my table, and I was wondering if there's an easier way to dismiss the keyboard without having to loop through all my controls and r...

7 Aug at 13:48

How do I find the width & height of a terminal window?

As a simple example, I want to write a CLI script which can print `=` across the entire width of the terminal window. ``` #!/usr/bin/env php <?php echo str_repeat('=', ???); ``` or ``` #!/usr/bin/...

7 Sep at 17:22