What is the (function() { } )() construct in JavaScript?
I would like to know what this means: ``` (function () { })(); ``` Is this basically saying `document.onload`?
- Modified
- 4 Jul at 12:8
Jackson with JSON: Unrecognized field, not marked as ignorable
I need to convert a certain JSON string to a Java object. I am using Jackson for JSON handling. I have no control over the input JSON (I read from a web service). This is my input JSON: ``` {"wrapper...
- Modified
- 16 Aug at 07:22
How do I do a not equal in Django queryset filtering?
In Django model QuerySets, I see that there is a `__gt` and `__lt` for comparative values, but is there a `__ne` or `!=` ()? I want to filter out using a not equals. For example, for ``` Model: bo...
- Modified
- 12 Nov at 06:47
How do I detect whether a variable is a function?
I have a variable, `x`, and I want to know whether it is pointing to a function or not. I had hoped I could do something like: ``` >>> isinstance(x, function) ``` But that gives me: ``` Traceback (mo...
- Modified
- 29 Nov at 00:12
"INSERT IGNORE" vs "INSERT ... ON DUPLICATE KEY UPDATE"
While executing an `INSERT` statement with many rows, I want to skip duplicate entries that would otherwise cause failure. After some research, my options appear to be the use of either: - `ON DUPLICA...
How to change node.js's console font color?
I had to change the console background color to white because of eye problems, but the font is gray colored and it makes the messages unreadable. How can I change it?
How to convert a char to a String?
I have a `char` and I need a `String`. How do I convert from one to the other?
- Modified
- 27 Feb at 18:45
How do I convert struct System.Byte byte[] to a System.IO.Stream object in C#?
How do I convert struct `System.Byte` `byte[]` to a `System.IO.Stream` object in ?
What is the difference between the GNU Makefile variable assignments =, ?=, := and +=?
Can anybody give a clear explanation of how variable assignment really works in Makefiles. What is the difference between : ``` VARIABLE = value VARIABLE ?= value VARIABLE := value VARIABLE += v...
What are the special dollar sign shell variables?
In Bash, there appear to be several variables which hold special, consistently-meaning values. For instance, ``` ./myprogram &; echo $! ``` will return the [PID](https://en.wikipedia.org/wiki/Process...
- Modified
- 19 Dec at 19:51
Remove empty strings from a list of strings
I want to remove all empty strings from a list of strings in python. My idea looks like this: ``` while '' in str_list: str_list.remove('') ``` Is there any more pythonic way to do this?
When to use .First and when to use .FirstOrDefault with LINQ?
I've searched around and haven't really found a clear answer as to when you'd want to use `.First` and when you'd want to use `.FirstOrDefault` with LINQ. - When would you want to use `.First`? Only ...
How do you sort a dictionary by value?
I often have to sort a dictionary (consisting of keys & values) by value. For example, I have a hash of words and respective frequencies that I want to order by frequency. There is a `SortedList` whic...
- Modified
- 20 Feb at 04:27
Is it possible to add dynamically named properties to JavaScript object?
In JavaScript, I've created an object like so: ``` var data = { 'PropertyA': 1, 'PropertyB': 2, 'PropertyC': 3 }; ``` Is it possible to add further properties to this object after its i...
- Modified
- 7 Jun at 16:24
Is there a way to get the git root directory in one command?
Mercurial has a way of printing the root directory (that contains .hg) via ``` hg root ``` Is there something equivalent in git to get the directory that contains the .git directory?
- Modified
- 9 Apr at 18:10
Does C# have extension properties?
Does C# have extension properties? For example, can I add an extension property to `DateTimeFormatInfo` called `ShortDateLongTimeFormat` which would return `ShortDatePattern + " " + LongTimePattern`?...
- Modified
- 26 Feb at 12:47
What's the difference between faking, mocking, and stubbing?
I know how I use these terms, but I'm wondering if there are accepted definitions for , , and for unit tests? How do you define these for your tests? Describe situations where you might use each. ...
- Modified
- 12 Jan at 07:25
How to send an object from one Android Activity to another using Intents?
> How can I pass an object of a custom type from one [Activity](https://developer.android.com/reference/android/app/Activity.html) to another using the `putExtra()` method of the class [Intent](https:...
- Modified
- 17 Apr at 18:1
List comprehension vs map
Is there a reason to prefer using [map()](https://docs.python.org/3.8/library/functions.html#map) over list comprehension or vice versa? Is either of them generally more efficient or considered gener...
- Modified
- 16 Jan at 00:21
What is the difference between React Native and React?
I have started to learn out of curiosity and wanted to know the difference between React and React Native - though could not find a satisfactory answer using Google. React and React Native seems to h...
- Modified
- 21 Jan at 12:36
How to change the remote a branch is tracking?
The `central` repository had to be set up on a new server, so I created a new remote on my local repo, and pushed to that. But now when I do `git pull`, it claims I am up to date. It's wrong—it's tel...
- Modified
- 23 Jun at 17:28
Removing input background colour for Chrome autocomplete?
On a form I'm working on, Chrome is auto-filling the email and password fields. This is fine, however, Chrome changes the background colour to a pale yellow colour. The design I'm working on is using...
- Modified
- 6 May at 13:36
Link to the issue number on GitHub within a commit message
Is it somehow possible to have a link to GitHub issue number in the `git commit` message?
- Modified
- 3 Apr at 00:1
Convert date to datetime in Python
Is there a built-in method for converting a `date` to a `datetime` in Python, for example getting the `datetime` for the midnight of the given date? The opposite conversion is easy: `datetime` has a `...
Download old version of package with NuGet
Is there a way to download a previous version of a package with , not the latest one?
- Modified
- 19 Apr at 17:17