Questions

error: passing xxx as 'this' argument of xxx discards qualifiers

``` #include <iostream> #include <set> using namespace std; class StudentT { public: int id; string name; public: StudentT(int _id, string _name) : id(_id), name(_name) { } int ...

20 Jun at 09:12

jQuery deferreds and promises - .then() vs .done()

I've been reading about jQuery deferreds and promises and I can't see the difference between using `.then()` & `.done()` for successful callbacks. I know [Eric Hynds](http://www.erichynds.com/jquery/u...

3 Feb at 17:14

How is the default max Java heap size determined?

If I omit the `-Xmxn` option from the Java command line then a default value will be used. According to [Java documentation](http://download.oracle.com/javase/6/docs/technotes/tools/windows/java.html)...

10 Aug at 14:17

Why are there no ++ and --​ operators in Python?

Why are there no `++` and `--` operators in Python?

9 Dec at 13:36

What's the difference between "git reset" and "git checkout"?

I've always thought of `git reset` and `git checkout` as the same, in the sense that both bring the project back to a specific commit. However, I feel they can't be exactly the same, as that would be ...

8 Apr at 20:10

What is the purpose of a self executing function in javascript?

In javascript, when would you want to use this: ``` (function(){ //Bunch of code... })(); ``` over this: ``` //Bunch of code... ```

No module named MySQLdb

I am using Python version 2.5.4 and install MySQL version 5.0 and Django. Django is working fine with Python, but not MySQL. I am using it in Windows Vista.

19 Feb at 11:15

How to add item to the beginning of List<T>?

I want to add a "Select One" option to a drop down list bound to a `List<T>`. Once I query for the `List<T>`, how do I add my initial `Item`, not part of the data source, as the FIRST element in tha...

21 May at 11:49

How to unit test abstract classes: extend with stubs?

I was wondering how to unit test abstract classes, and classes that extend abstract classes. Should I test the abstract class by extending it, stubbing out the abstract methods, and then test all the...

Generator expressions vs. list comprehensions

When should you use generator expressions and when should you use list comprehensions in Python? ``` # Generator expression (x*2 for x in range(256)) # List comprehension [x*2 for x in range(256)] `...

How to manually include external aar package using Gradle for Android

I've been experimenting with the new android build system and I've run into a small issue. I've compiled my own aar package of ActionBarSherlock which I've called 'actionbarsherlock.aar'. What I'm t...

How to parse float with two decimal places in javascript?

I have the following code. I would like to have it such that if price_result equals an integer, let's say 10, then I would like to add two decimal places. So 10 would be 10.00. Or if it equals 10.6 wo...

6 Jun at 06:39

How do I change the text of a span element using JavaScript?

If I have a , say: ``` <span id="myspan"> hereismytext </span> ``` How do I use JavaScript to change "hereismytext" to "newtext"?

14 Aug at 14:7

ps command doesn't work in docker container

I want to do a ps command in a docker container derived from Debian official Docker hub repository: ``` $ docker run -ti debian:wheezy /bin/bash root@51afd6b09af8:/# ps bash: ps: command not found ``...

16 Apr at 04:33

How can I change property names when serializing with Json.net?

I have some data in a C# DataSet object. I can serialize it right now using a Json.net converter like this ``` DataSet data = new DataSet(); // do some work here to populate 'data' string output = Js...

22 Jun at 12:8

Restore a postgres backup file using the command line?

Locally, I use pgadmin3. On the remote server, however, I have no such luxury. I've already created the backup of the database and copied it over, but is there a way to restore a backup from the comm...

favicon.png vs favicon.ico - why should I use PNG instead of ICO?

Other than the fact that PNG is a more common image format, is there any technical reason to favor favicon.png vs. favicon.ico? I'm supporting modern browsers which all support PNG favorite icons.

29 Aug at 08:1

How do I modify a MySQL column to allow NULL?

MySQL 5.0.45 What is the syntax to alter a table to allow a column to be null, alternately what's wrong with this: ``` ALTER mytable MODIFY mycolumn varchar(255) null; ``` I interpreted the manual...

8 Feb at 21:23

Room - Schema export directory is not provided to the annotation processor so we cannot export the schema

I am using Android Database Component Room I've configured everything, but when I compile, Android Studio gives me this warning: > Schema export directory is not provided to the annotation processor...

2 Jan at 06:34

Node.js heap out of memory

Today I ran my script for filesystem indexing to refresh RAID files index and after 4h it crashed with following error: ``` [md5:] 241613/241627 97.5% [md5:] 241614/241627 97.5% [md5:] 241625/...

How to change the Jupyter start-up folder

I tried following the instructions given on the [Jupyter Notebook documentation](http://jupyter-notebook-beginner-guide.readthedocs.org/en/latest/execute.html#change-jupyter-notebook-startup-folder-wi...

Could not load file or assembly ... An attempt was made to load a program with an incorrect format (System.BadImageFormatException)

I have two projects, `ProjectA` and `ProjectB`. `ProjectB` is a console application, which depends on `ProjectA`. Yesterday, everything was working fine, but suddenly today when I run `ProjectB` I g...

How can I remove a character from a string using JavaScript?

I am so close to getting this, but it just isn't right. All I would like to do is remove the character `r` from a string. The problem is, there is more than one instance of `r` in the string. However,...

11 Dec at 07:58

ViewPager and fragments — what's the right way to store fragment's state?

Fragments seem to be very nice for separation of UI logic into some modules. But along with `ViewPager` its lifecycle is still misty to me. So Guru thoughts are badly needed! ### Edit See dumb s...

UIDevice uniqueIdentifier deprecated - What to do now?

It has just come to light that [the UIDevice uniqueIdentifier property is deprecated](https://web.archive.org/web/20140703160701/https://developer.apple.com/library/ios/documentation/UIKit/Reference/U...

21 Nov at 03:51