Questions

Add Bootstrap Glyphicon to Input Box

How can I add a glyphicon to a text type input box? For example I want to have 'icon-user' in a username input, something like this: ![enter image description here](https://i.stack.imgur.com/ijhXz.pn...

16 Sep at 23:23

Understanding Fragment's setRetainInstance(boolean)

Starting with the documentation: > public void setRetainInstance (boolean retain)Control whether a fragment instance is retained across Activity re-creation (such as from a configuration change). This...

20 Jun at 09:12

HttpClient.GetAsync(...) never returns when using await/async

[This question](https://stackoverflow.com/questions/9895048/async-call-with-await-in-httpclient-never-returns) looks like it might be the same problem, but has no responses... In test case 5 the ta...

using statement with multiple variables

Is it possible to make this code a little more compact by somehow declaring the 2 variable inside the same using block? ``` using (var sr = new StringReader(content)) { using (var xtr = new XmlTe...

26 Mar at 20:24

How to set commands output as a variable in a batch file

Is it possible to set a statement's output of a batch file to a variable, for example: ``` findstr testing > %VARIABLE% echo %VARIABLE% ```

2 Feb at 09:12

Opposite of %in%: exclude rows with values specified in a vector

A categorical variable V1 in a data frame D1 can have values represented by the letters from A to Z. I want to create a subset D2, which excludes some values, say, B, N and T. Basically, I want a comm...

23 Mar at 20:47

How do I 'overwrite', rather than 'merge', a branch on another branch in Git?

I have two branches, `email` and `staging`. `staging` is the latest one and I no longer need the old changes in `email` branch, yet I don't want to delete them. So I just want to dump all the content...

20 Mar at 00:29

How to check if a variable is not null?

I know that below are the two ways in JavaScript to check whether a variable is not `null`, but I’m confused which is the best practice to use. Should I do: ``` if (myVar) {...} ``` or ``` if (my...

18 Apr at 13:40

Rails: How to run `rails generate scaffold` when the model already exists?

I'm new to Rails so my current project is in a weird state. One of the first things I generated was a "Movie" model. I then started defining it in more detail, added a few methods, etc. I now reali...

8 Dec at 05:38

Key existence check in HashMap

Is checking for key existence in HashMap always necessary? I have a HashMap with say a 1000 entries and I am looking at improving the efficiency. If the HashMap is being accessed very frequently, the...

2 Sep at 11:53

What is WebKit and how is it related to CSS?

More recently, I have been seeing questions with the tag "webkit". Such questions usually tend to be web-based questions relating to CSS, jQuery, layouts, cross-browers compatibility issues, etc... S...

JavaScript: Passing parameters to a callback function

I'm trying to pass some parameter to a function used as `callback`, how can I do that? This is my try: ``` function tryMe(param1, param2) { alert(param1 + " and " + param2); } function callbackTest...

Getting the thread ID from a thread

In C# when debugging threads for example, you can see each thread's ID. I couldn't find a way to get that same thread, programmatically. I could not even get the ID of the current thread (in the prop...

27 Sep at 12:40

Store boolean value in SQLite

What is the type for a BOOL value in SQLite? I want to store in my table TRUE/FALSE values. I could create a column of INTEGER and store in it values 0 or 1, but it won't be the best way to implement ...

22 Jan at 07:10

How can I divide two integers to get a double?

How do I divide two integers to get a double?

20 Jul at 01:14

What is meant by the term "hook" in programming?

I recently heard the term "hook" while talking to some people about a program I was writing. I'm unsure exactly what this term implies although I inferred from the conversation that a hook is a type ...

21 Jan at 23:52

Best way to define private methods for a class in Objective-C

I just started programming Objective-C and, having a background in Java, wonder how people writing Objective-C programs deal with private methods. I understand there may be several conventions and ha...

3 Mar at 19:30

Why was the name 'let' chosen for block-scoped variable declarations in JavaScript?

I understand why `var` takes that name - it is variable, `const` - it is a constant, but what is the meaning behind the name for `let`, which scopes to the current block? Let it be?

10 Jan at 03:48

Logging with Retrofit 2

I'm trying to get the exact JSON that is being sent in the request. Here is my code: ``` OkHttpClient client = new OkHttpClient(); client.interceptors().add(new Interceptor(){ @Override public com...

26 Feb at 08:16

@ variables in Ruby on Rails

What's the difference between `@title` and `title`? Since both of them can be variable names. Also, how do I decide which kind of variable I should use? With `@` or not?

19 Feb at 02:33

What is the apply function in Scala?

I never understood it from the contrived unmarshalling and verbing nouns ( an `AddTwo` class has an `apply` that adds two!) examples. I understand that it's syntactic sugar, so (I deduced from contex...

16 Mar at 12:36

Why use the params keyword?

I know this is a basic question, but I couldn't find an answer. Why use it? if you write a function or a method that's using it, when you remove it the code will still work perfectly, 100% as without...

Which characters need to be escaped in HTML?

Are they the same as XML, perhaps plus the space one (` `)? I've found some huge lists of HTML escape characters but I don't think they be escaped. I want to know what to be escaped.

What is the javascript filename naming convention?

Should files be named something-with-hyphens.js, camelCased.js, or something else? I didn't find the answer to this question [here](https://stackoverflow.com/questions/921133/javascript-naming-conven...

23 May at 11:54

Git for Windows: .bashrc or equivalent configuration files for Git Bash shell

I've just installed Git for Windows and am delighted to see that it installs Bash. I want to customise the shell in the same way I can under Linux (e.g. set up aliases like `ll` for `ls -l`), but I c...

23 Nov at 18:12