Questions

What is a mutex?

A mutex is a programming concept that is frequently used to solve multi-threading problems. My question to the community: What is a mutex and how do you use it?

29 Aug at 15:59

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder"

My application is to be deployed on both tcServer and WebSphere 6.1. This application uses ehCache and so requires slf4j as a dependency. As a result I've added the slf4j-api.jar (1.6) jar to my war f...

18 Dec at 16:9

How to check iOS version?

I want to check if the `iOS` version of the device is greater than `3.1.3` I tried things like: ``` [[UIDevice currentDevice].systemVersion floatValue] ``` but it does not work, I just want a: ```...

7 Aug at 13:42

Efficiency of Java "Double Brace Initialization"?

In [Hidden Features of Java](https://stackoverflow.com/questions/15496/hidden-features-of-java) the top answer mentions [Double Brace Initialization](http://www.c2.com/cgi/wiki?DoubleBraceInitializati...

What's the difference between SoftReference and WeakReference in Java?

What's the difference between [java.lang.ref.WeakReference](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/ref/WeakReference.html) and [java.lang.ref.SoftReference](https://doc...

Database, Table and Column Naming Conventions?

Whenever I design a database, I always wonder if there is a best way of naming an item in my database. Quite often I ask myself the following questions: 1. Should table names be plural? 2. Should co...

What are the various "Build action" settings in Visual Studio project properties and what do they do?

For the most part, you just take whatever Visual Studio sets it for you as a default... I'm referring to the [BuildAction](https://learn.microsoft.com/en-us/visualstudio/ide/build-actions?view=vs-2019...

Relation between CommonJS, AMD and RequireJS?

I'm still very confused about and , even after reading a lot. I know that (formerly ) is a group for defining some specifications (i.e. modules) when the language is used outside the browser. modu...

How to import the class within the same directory or sub directory?

I have a directory that stores all the files. ``` bin/ main.py user.py # where class User resides dir.py # where class Dir resides ``` I want to use classes from and in . How can I impo...

29 Apr at 20:9

URL encoding the space character: + or %20?

When is a space in a URL encoded to `+`, and when is it encoded to `%20`?

6 Jun at 16:51

How to move the cursor word by word in the OS X Terminal

I know the combination + to jump to the beginning of the current command, and + to jump to the end. But is there any way to jump word by word, like +/ in Cocoa applications does?

1 Jan at 07:57

In a Bash script, how can I exit the entire script if a certain condition occurs?

I'm writing a script in Bash to test some code. However, it seems silly to run the tests if compiling the code fails in the first place, in which case I'll just abort the tests. Is there a way I can ...

11 Apr at 23:42

How to make a new List in Java

We create a `Set` as: ``` Set myset = new HashSet() ``` How do we create a `List` in Java?

5 Oct at 09:57

How to create a new object instance from a Type

One may not always know the `Type` of an object at compile-time, but may need to create an instance of the `Type`. How do you get a new object instance from a `Type`?

19 Apr at 17:56

Making TextView scrollable on Android

I am displaying text in a TextView that appears to be too long to fit into one screen. I need to make my TextView scrollable. How can I do that? Here is the code: ``` final TextView tv = new TextView(...

How to identify which OS Python is running on?

What do I need to look at to see whether I'm on Windows or Unix, etc?

Entity Framework 5 Updating a Record

I have been exploring different methods of editing/updating a record within Entity Framework 5 in an ASP.NET MVC3 environment, but so far none of them tick all of the boxes I need. I'll explain why. ...

11 Mar at 10:36

Moment.js transform to date object

Using Moment.js I can't transform a correct moment object to a date object with timezones. I can't get the correct date. ``` var oldDate = new Date(), momentObj = moment(oldDate).tz("MST7MDT"),...

10 Sep at 02:2

How can I use Python to get the system hostname?

I'm writing a chat program for a local network. I would like be able to identify computers and get the user-set computer name with Python.

13 Sep at 16:0

How to pass all arguments passed to my Bash script to a function of mine?

Let's say I have a function `abc()` that will handle the logic related to analyzing the arguments passed to my script. How can I pass all arguments my Bash script has received to `abc()`? The number o...

17 Sep at 12:5

Call child method from parent

I have two components: 1. Parent component 2. Child component I was trying to call Child's method from Parent, I tried this way but couldn't get a result: ``` class Parent extends Component { ren...

17 Dec at 17:50

data.table vs dplyr: can one do something well the other can't or does poorly?

### Overview I'm relatively familiar with `data.table`, not so much with `dplyr`. I've read through some [dplyr vignettes](http://rpubs.com/hadley/dplyr-intro) and examples that have popped up on...

23 Jan at 18:57

How do I convert a string to a number in PHP?

I want to convert these types of values, `'3'`, `'2.34'`, `'0.234343'`, etc. to a number. In JavaScript we can use `Number()`, but is there any similar method available in PHP? ``` Input ...

24 Jun at 19:42

What is a daemon thread in Java?

Can anybody tell me what daemon threads are in Java?

26 Jul at 03:22

Function overloading in Javascript - Best practices

What is the best way(s) to fake function overloading in Javascript? I know it is not possible to overload functions in Javascript as in other languages. If I needed a function with two uses `foo(x)...

2 Jul at 07:47