Questions

How to convert list to string

How can I convert a list to a string using Python?

14 Sep at 19:41

What are the most common Python docstring formats?

I have seen a few different styles of writing docstrings in Python, what are the most popular styles?

How to force browsers to reload cached CSS and JS files?

I have noticed that some browsers (in particular, Firefox and [Opera](https://en.wikipedia.org/wiki/Opera_%28web_browser%29)) are very zealous in using cached copies of and files, even between brows...

LINQ query on a DataTable

I'm trying to perform a LINQ query on a DataTable object and bizarrely I am finding that performing such queries on DataTables is not straightforward. For example: ``` var results = from myRow in myD...

4 Jul at 20:44

How do I retrieve an HTML element's actual width and height?

Suppose that I have a `<div>` that I wish to center in the browser's display (viewport). To do so, I need to calculate the width and height of the `<div>` element. What should I use? Please include ...

19 Aug at 20:46

How to iterate over arguments in a Bash script

I have a complex command that I'd like to make a shell/bash script of. I can write it in terms of `$1` easily: ``` foo $1 args -o $1.ext ``` I want to be able to pass multiple input names to the s...

10 Jan at 02:16

Calculate distance between two latitude-longitude points? (Haversine formula)

How do I calculate the distance between two points specified by latitude and longitude? For clarification, I'd like the distance in kilometers; the points use the WGS84 system and I'd like to underst...

Return multiple values in JavaScript?

I am trying to return two values in . Is this possible? ``` var newCodes = function() { var dCodes = fg.codecsCodes.rs; var dCodes2 = fg.codecsCodes2.rs; return dCodes, dCodes2; }; ``...

List all environment variables from the command line

Is it possible to list environment variables from a Windows' command prompt? Something equivalent to PowerShell's `gci env:` (or `ls env:` or `dir env:`).

Show git diff on file in staging area

Is there a way I can see the changes that were made to a `file` after I have done `git add file`? That is, when I do: ``` git add file git diff file ``` no diff is shown. I guess there's a way to...

6 May at 00:28

Why use Redux over Facebook Flux?

I've read [this answer](https://stackoverflow.com/questions/32021763/what-could-be-the-downsides-of-using-redux-instead-of-flux), [reducing boilerplate](http://redux.js.org/docs/recipes/ReducingBoiler...

What is your most productive shortcut with Vim?

I've heard a lot about [Vim](http://www.vim.org/), both pros and cons. It really seems you should be (as a developer) faster with Vim than with any other editor. I'm using Vim to do some basic stuff a...

16 Aug at 10:58

How to convert UTF-8 byte[] to string

I have a `byte[]` array that is loaded from a file that I happen to known contains [UTF-8](http://en.wikipedia.org/wiki/UTF-8). In some debugging code, I need to convert it to a string. Is there a one...

6 Aug at 16:10

No 'Access-Control-Allow-Origin' header is present on the requested resource—when trying to get data from a REST API

I'm trying to fetch some data from the REST API of HP Alm. It works pretty well with a small curl script—I get my data. Now doing that with JavaScript, fetch and ES6 (more or less) seems to be a bigge...

14 Aug at 12:48

How do I use $scope.$watch and $scope.$apply in AngularJS?

I don't understand how to use `$scope.$watch` and `$scope.$apply`. The official documentation isn't helpful. What I don't understand specifically: - - - I tried [this tutorial](http://css.dzone.co...

7 Jan at 15:1

What is the difference between public, private, and protected?

When and why should I use `public`, `private`, and `protected` functions and variables inside a class? What is the difference between them? Examples: ``` // Public public $variable; public function ...

2 Jan at 00:16

What is the difference between ++i and i++?

In C, what is the difference between using `++i` and `i++`, and which should be used in the incrementation block of a `for` loop?

How can I make Bootstrap columns all the same height?

I'm using Bootstrap. How can I make three columns all the same height? Here is a screenshot of the problem. I would like the blue and red columns to be the same height as the yellow column. ![Three...

23 Jun at 21:36

How can I change the name of an iOS app in Xcode?

I began an iPhone project the other day with a silly development code name, and now I want to change the name of the project since it's nearly finished. How can I do this?

7 Feb at 19:47

What is the difference between g++ and gcc?

What is the difference between g++ and gcc? Which one of them should be used for general c++ development?

12 Dec at 14:4

What is the difference between String.slice and String.substring?

Does anyone know what the difference is between these two methods? ``` String.prototype.slice String.prototype.substring ```

17 Apr at 18:26

How do I get the current absolute URL in Ruby on Rails?

How can I get the current URL in my Ruby on Rails view? The `request.request_uri` only returns the URL.

29 Mar at 19:33

How do you auto format code in Visual Studio?

I know Visual Studio can auto format to make my methods and loops indented properly, but I cannot find the setting.

8 Oct at 14:9

Find the min/max element of an array in JavaScript

How can I easily obtain the min or max element of a JavaScript array? Example pseudocode: ``` let array = [100, 0, 50] array.min() //=> 0 array.max() //=> 100 ```

18 Feb at 11:40

What is the difference between old style and new style classes in Python?

What is the difference between old style and new style classes in Python? When should I use one or the other?