Questions

What's the difference between a proxy server and a reverse proxy server?

What is the difference between a proxy server and a reverse proxy server?

How to duplicate a whole line in Vim?

How do I duplicate a whole line in in a similar way to + in IntelliJ IDEA/ Resharper or ++/ in ?

26 Apr at 10:6

What is the 'new' keyword in JavaScript?

The `new` keyword in JavaScript can be quite confusing when it is first encountered, as people tend to think that JavaScript is not an object-oriented programming language. - - -

25 Jul at 13:42

Loop inside React JSX

I'm trying to do something like the following in React JSX (where ObjectRow is a separate component): ``` <tbody> for (var i=0; i < numrows; i++) { <ObjectRow/> } </tbody> ``` I real...

14 Feb at 15:36

How to get just one file from another branch?

I have a `master` branch with a file called `app.js`. I made changes to this file on an `experiment` branch. I want to apply only the changes made to `app.js` from `experiment` onto the `master` branc...

25 Jul at 05:17

How do I split a string in Java?

I want to split the string `"004-034556"` into two strings by the delimiter `"-"`: ``` part1 = "004"; part2 = "034556"; ``` That means the first string will contain the characters before `'-'`, and t...

24 Jul at 23:41

What is TypeScript and why would I use it in place of JavaScript?

Can you please describe what the TypeScript language is? What can it do that JavaScript or available libraries cannot do, that would give me reason to consider it?

11 May at 13:36

What is the difference between Bower and npm?

What is the fundamental difference between `bower` and `npm`? Just want something plain and simple. I've seen some of my colleagues use `bower` and `npm` interchangeably in their projects.

AddTransient, AddScoped and AddSingleton Services Differences

I want to implement [dependency injection](https://en.wikipedia.org/wiki/Dependency_injection) (DI) in ASP.NET Core. So after adding this code to `ConfigureServices` method, both ways work. What is th...

8 Jun at 00:10

How to move an element into another element

I would like to move one DIV element inside another. For example, I want to move this (including all children): ``` <div id="source"> ... </div> ``` into this: ``` <div id="destination"> ... </di...

12 Nov at 05:3

How to redirect and append both standard output and standard error to a file with Bash

To redirect [standard output](https://en.wikipedia.org/wiki/Standard_streams#Standard_output_.28stdout.29) to a truncated file in Bash, I know to use: ``` cmd > file.txt ``` To redirect standard outp...

Why does this code using random strings print "hello world"?

The following print statement would print "hello world". Could anyone explain this? ``` System.out.println(randomString(-229985452) + " " + randomString(-147909649)); ``` And `randomString()` looks...

28 Aug at 16:12

How can I get a list of Git branches, ordered by most recent commit?

I want to get a list of all the branches in a Git repository with the "freshest" branches at the top, where the "freshest" branch is the one that's been committed to most recently (and is, therefore, ...

10 Dec at 19:42

Transitions on the CSS display property

I'm currently designing a CSS 'mega dropdown' menu - basically a regular CSS-only dropdown menu, but one that contains different types of content. At the moment, , i.e., you can't do any sort of tran...

26 Nov at 07:17

How to merge two arrays in JavaScript and de-duplicate items

I have two JavaScript arrays: ``` var array1 = ["Vijendra","Singh"]; var array2 = ["Singh", "Shakya"]; ``` I want the output to be: ``` var array3 = ["Vijendra","Singh","Shakya"]; ``` The output...

18 Oct at 06:29

Check existence of input argument in a Bash shell script

I need to check the existence of an input argument. I have the following script ``` if [ "$1" -gt "-1" ] then echo hi fi ``` I get ``` [: : integer expression expected ``` How do I check the i...

30 May at 11:25

What is a NullReferenceException, and how do I fix it?

I have some code and when it executes, it throws a `NullReferenceException`, saying: > Object reference not set to an instance of an object. What does this mean, and what can I do to fix this error?...

How can I view an old version of a file with Git?

Is there a command in Git to see (either dumped to stdout, or in `$PAGER` or `$EDITOR`) a particular version of a particular file?

16 Jul at 11:30

Meaning of @classmethod and @staticmethod for beginner

What do `@classmethod` and `@staticmethod` mean in Python, and how are they different? should I use them, should I use them, and should I use them? As far as I understand, `@classmethod` tells a cl...

Proper use of the IDisposable interface

I know from reading [Microsoft documentation](https://learn.microsoft.com/dotnet/api/system.idisposable) that the "primary" use of the `IDisposable` interface is to clean up unmanaged resources. To me...

How do I check if an object has a key in JavaScript?

Which is the right thing to do? ``` if (myObj['key'] == undefined) ``` or ``` if (myObj['key'] == null) ``` or ``` if (myObj['key']) ```

23 Jan at 15:46

Command to collapse all sections of code?

In Visual Studio, is there a command to collapse/expand all the sections of code in a file?

3 Jan at 06:36

Installing specific package version with pip

I am trying to install version 1.2.2 of `MySQL_python`, using a fresh virtualenv created with the `--no-site-packages` option. The current version shown in PyPi is [1.2.3](http://pypi.python.org/pypi/...

3 Apr at 19:58

How do we control web page caching, across all browsers?

Our investigations have shown us that not all browsers respect the HTTP cache directives in a uniform manner. For security reasons we do not want certain pages in our application to be cached, by th...

Vanilla JavaScript equivalent of jQuery's $.ready() - how to call a function when the page/DOM is ready for it

With jQuery, we all know the wonderful `.ready()` function: ``` $('document').ready(function(){}); ``` However, let's say I want to run a function that is written in standard JavaScript with no lib...

29 Jun at 20:23