Questions

Fastest way to convert string to integer in PHP

Using PHP, what's the fastest way to convert a string like this: `"123"` to an integer? Why is that particular method the fastest? What happens if it gets unexpected input, such as `"hello"` or an ar...

27 Oct at 05:21

How do I create a foreign key in SQL Server?

I have never "hand-coded" object creation code for SQL Server and foreign key decleration is seemingly different between SQL Server and Postgres. Here is my sql so far: ``` drop table exams; drop tab...

15 Oct at 07:56

create react app not picking up .env files?

I am using [create react app](https://github.com/facebookincubator/create-react-app) to bootstrap my app. I have added two `.env` files `.env.development` and `.env.production` in the root. My `.env...

22 Jan at 14:46

ModuleNotFoundError: What does it mean __main__ is not a package?

I am trying to run a module from the console. The structure of my directory is this: [](https://i.stack.imgur.com/naRKa.png) I am trying to run the module `p_03_using_bisection_search.py`, from the ...

How to update TypeScript to latest version with npm?

Currently I have TypeScript 1.0.3.0 version installed on my machine. I want to update it to latest one i.e. 2.0. How to do this with npm?

29 Aug at 14:51

docker - how do you disable auto-restart on a container?

I can enable auto-restart with `--restart=always`, but after I stop the container, how do I turn off that attribute? I normally run a webserver and typically map port 80: ``` docker run -d --restart...

2 Jun at 18:3

How do I install the ext-curl extension with PHP 7?

I've installed PHP 7 using [this repo](http://php7.zend.com/repo.php), but when I try to run `composer install`, it's giving this error: > - With PHP 5, you can easily install it by running the `yu...

27 Nov at 12:38

Concatenate a list of pandas dataframes together

I have a list of Pandas dataframes that I would like to combine into one Pandas dataframe. I am using Python 2.7.10 and Pandas 0.16.2 I created the list of dataframes from: ``` import pandas as pd ...

Execute action when back bar button of UINavigationController is pressed

I need to execute an action (emptying an array), when the back button of a `UINavigationController` is pressed, while the button still causes the previous `ViewController` on the stack to appear. How ...

IOException: The process cannot access the file 'file path' because it is being used by another process

I have some code and when it executes, it throws a `IOException`, saying that > The process cannot access the file 'filename' because it is being used by another process What does this mean, and...

29 Mar at 01:23

How to set ANDROID_HOME path in ubuntu?

How to set ANDROID_HOME path in ubuntu? Please provide the steps.

14 Oct at 09:1

Git credential helper - update password

I'm currently using GitHub over HTTPS and have the latest version of Git installed (1.9.0) along with the Git credential helper on Windows 7. On setting up my environment, I told git-credentials to p...

How to get the code coverage report using Jest?

Is there a way to have code coverage in the JavaScript Jest testing framework, which is built on top of Jasmine? The internal framework [does not](https://github.com/facebook/jest/blob/db003d5dc76b966...

18 Mar at 18:55

Python import csv to list

I have a CSV file with about 2000 records. Each record has a string, and a category to it: ``` This is the first line,Line1 This is the second line,Line2 This is the third line,Line3 ``` I need t...

15 Feb at 06:7

Difference between Destroy and Delete

What is the difference between `@model.destroy` and `@model.delete` For example: ``` Model.find_by(col: "foo").destroy_all //and Model.find_by(col: "foo").delete_all ``` Does it really matter i...

17 Jan at 09:13

Could not load file or assembly 'Newtonsoft.Json' or one of its dependencies. Manifest definition does not match the assembly reference

Things I've tried after searching: 1. in Web.Config put a binding on the old version: <dependentAssembly> <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neut...

12 Mar at 09:59

Exit single-user mode

Currently, my database is in Single User mode. When I try to expand me database, I get an error: > The database 'my_db' is not accessible.(ObjectExplorer) Also, when I try to delete the database, I ...

7 Apr at 13:18

AngularJS For Loop with Numbers & Ranges

Angular does provide some support for a for loop using numbers within its HTML directives: ``` <div data-ng-repeat="i in [1,2,3,4,5]"> do something </div> ``` But if your scope variable includes ...

5 Dec at 12:6

What are the differences and similarities between ffmpeg, libav, and avconv?

When I run `ffmpeg` on Ubuntu, it shows: ``` $ ffmpeg ffmpeg version v0.8, Copyright (c) 2000-2011 the Libav developers built on Feb 28 2012 13:27:36 with gcc 4.6.1 This program is not developed a...

1 Jan at 22:29

How to detect if browser window is scrolled to bottom?

I need to detect if a user is scrolled to the bottom of a page. If they are at the bottom of the page, when I add new content to the bottom, I will automatically scroll them to the new bottom. If they...

17 Nov at 15:28

Check if an element's content is overflowing?

What's the easiest way to detect if an element has been overflowed? My use case is, I want to limit a certain content box to have a height of 300px. If the inner content is taller than that, I cut it...

16 Oct at 17:1

How to communicate between iframe and the parent site?

The website in the iframe , but both are mine, and I would like to communicate between the `iframe` and the parent site. Is it possible?

10 Mar at 09:57

Send POST data on redirect with JavaScript/jQuery?

Basically what I want to do is send `POST` data when I change the `window.location`, as if a user has submitted a form and it went to a new page. I need to do it this way because I need to pass along ...

25 Oct at 20:53

/etc/apt/sources.list" E212: Can't open file for writing

I am trying to edit sources.list using vi editor but getting the following error while saving the file: ``` /etc/apt/sources.list" E212: Can't open file for writing ```

6 Dec at 01:17

How to remove from a map while iterating it?

How do I remove from a map while iterating it? like: ``` std::map<K, V> map; for(auto i : map) if(needs_removing(i)) // remove it from the map ``` If I use `map.erase` it will invalidat...

19 Dec at 13:41