Questions

Mipmap drawables for icons

Since Android 4.3 (Jelly Bean) we can now make use of the `res/mipmap` folders to store "mipmap" images. For example, stores its icons in these folders instead of the more normal `res/drawable` fold...

21 Jan at 06:58

How do I detect if I am in release or debug mode?

How can I detect in my code that I am in Release mode or Debug mode?

30 Oct at 20:16

JsonMappingException: No suitable constructor found for type [simple type, class ]: can not instantiate from JSON object

I am getting the following error when trying to get a JSON request and process it: > org.codehaus.jackson.map.JsonMappingException: No suitable constructor found for type [simple type, class com.mywe...

22 Oct at 19:15

Epoch vs Iteration when training neural networks

What is the difference between and when training a multi-layer perceptron?

Internal vs. Private Access Modifiers

What is the difference between the `internal` and `private` access modifiers in C#?

How to get C# Enum description from value?

I have an enum with Description attributes like this: ``` public enum MyEnum { Name1 = 1, [Description("Here is another")] HereIsAnother = 2, [Description("Last one")] LastOne = 3...

20 Jun at 11:47

Is it better to return null or empty collection?

That's kind of a general question (but I'm using C#), what's the best way (best practice), do you return null or empty collection for a method that has a collection as a return type ?

28 Jun at 11:20

Tell Ruby Program to Wait some amount of time

How do you tell a Ruby program to wait an arbitrary amount of time before moving on to the next line of code?

25 May at 00:58

Why does Math.Round(2.5) return 2 instead of 3?

In C#, the result of `Math.Round(2.5)` is 2. It is supposed to be 3, isn't it? Why is it 2 instead in C#?

18 May at 06:3

Windows equivalent to UNIX pwd

How do I find the local path on Windows in a command prompt?

22 Oct at 16:54

A generic list of anonymous class

In C# 3.0 you can create anonymous class with the following syntax ``` var o = new { Id = 1, Name = "Foo" }; ``` Is there a way to add these anonymous class to a generic list? Example: ``` var o ...

6 Sep at 20:39

Convert from MySQL datetime to another format with PHP

I have a `datetime` column in MySQL. How can I convert it to the display as using PHP?

5 Jan at 12:53

Python dictionary from an object's fields

Do you know if there is a built-in function to build a dictionary from an arbitrary object? I'd like to do something like this: ``` >>> class Foo: ... bar = 'hello' ... baz = 'world' ... >>> ...

Docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock

I am new to docker. I just tried to use docker in my local machine(Ubuntu 16.04) with Jenkins. I configured a new job with below pipeline script. ``` node { stage('Build') { docker.image('ma...

15 Sep at 19:25

Angular exception: Can't bind to 'ngForIn' since it isn't a known native property

What am I doing wrong? ``` import {bootstrap, Component} from 'angular2/angular2' @Component({ selector: 'conf-talks', template: `<div *ngFor="let talk in talks"> {{talk.title}} by {{talk.s...

17 Dec at 08:33

How to print to console in pytest?

I'm trying to use TDD (test-driven development) with `pytest`. `pytest` will not `print` to the console when I use `print`. I am using `pytest my_tests.py` to run it. The `documentation` seems to sa...

How to abort a stash pop?

I popped a stash and there was a merge conflict. Unlike the question that is listed as a duplicate, I already had some uncommitted changes in the directory which I wanted to keep. I don't just want to...

29 Apr at 13:34

JavaScript object: access variable property by name as string

If I have a javascript object that looks like below ``` var columns = { left: true, center : false, right : false } ``` and I have a function that is passed both the object, and a property na...

25 Feb at 21:58

How do you convert epoch time in C#?

How do you convert Unix [epoch time](http://en.wikipedia.org/wiki/Unix_time) into real time in C#? (Epoch beginning 1/1/1970)

8 Mar at 08:43

Find nearest value in numpy array

How do I find the in a numpy array? Example: ``` np.find_nearest(array, value) ```

20 Jun at 03:12

What is a classpath and how do I set it?

I was just reading this line: > The first thing the format() method does is load a Velocity template from the classpath named output.vm Please explain what was meant by classpath in this context, an...

2 Jun at 07:44

How to find a min/max with Ruby

I want to use `min(5,10)`, or `Math.max(4,7)`. Are there functions to this effect in Ruby?

26 Feb at 08:56

Peak memory usage of a linux/unix process

Is there a tool that will run a command-line and report the peak RAM usage total? I'm imagining something analogous to /usr/bin/time

Make xargs execute the command once for each line of input

How can I make xargs execute the command exactly once for each line of input given? It's default behavior is to chunk the lines and execute the command once, passing multiple lines to each instance. ...

13 Oct at 23:43

What does the "static" modifier after "import" mean?

When used like this: ``` import static com.showboy.Myclass; public class Anotherclass{} ``` what's the difference between `import static com.showboy.Myclass` and `import com.showboy.Myclass`?

19 May at 11:21