What is the difference between state and props in React?
I was watching a Pluralsight course on React and the instructor stated that props should not be changed. I'm now reading [an article (uberVU/react-guide)](https://github.com/uberVU/react-guide/blob/ma...
- Modified
- 5 Apr at 10:21
How do I get the current time in milliseconds in Python?
How do I get the current time in milliseconds in Python?
How to get first character of string?
I have a string, and I need to get its first character. ``` var x = 'somestring'; alert(x[0]); //in ie7 returns undefined ``` How can I fix my code?
- Modified
- 20 Mar at 07:12
What is the difference between localStorage, sessionStorage, session and cookies?
What are the technical pros and cons of `localStorage`, `sessionStorage`, session and `cookies`, and when would I use one over the other?
- Modified
- 6 Dec at 19:19
Understanding checked vs unchecked exceptions in Java
Joshua Bloch in "" said that > Use checked exceptions for recoverable conditions and runtime exceptions for programming errors (Item 58 in 2nd edition) Let's see if I understand this correctl...
- Modified
- 7 Oct at 14:18
Are (non-void) self-closing tags valid in HTML5?
The [W3C validator](https://validator.w3.org/) ([Wikipedia](http://en.wikipedia.org/wiki/W3C_Markup_Validation_Service)) doesn't like self-closing tags (those that end with “`/>`”) on [non-void](https...
- Modified
- 30 Nov at 19:14
What is an application binary interface (ABI)?
I never clearly understood what an ABI is. Please don't point me to a Wikipedia article. If I could understand it, I wouldn't be here posting such a lengthy post. This is my mindset about different i...
- Modified
- 1 Jan at 01:35
npm check and update package if needed
We need to integrate Karma test runner into TeamCity and for that I'd like to give sys-engineers small script (powershell or whatever) that would: 1. pick up desired version number from some config ...
- Modified
- 2 Jan at 15:56
Should I use Singular or Plural name convention for REST resources?
Some RESTful services use different resource URIs for update/get/delete and Create. Such as - - - I'm little bit confused about this URI naming convention. Should we use plural or singular for resour...
- Modified
- 28 Dec at 23:52
Git Push Error: insufficient permission for adding an object to repository database
When I try to push to a shared git remote, I get the following error: `insufficient permission for adding an object to repository database` Then I read about a fix here: [Fix](http://parizek.com/?p=1...
How do I wait for a pressed key?
How do I make my python script wait until the user presses any key?
- Modified
- 17 Jul at 06:41
Are HTTPS headers encrypted?
When sending data over HTTPS, I know the content is encrypted, however I hear mixed answers about whether the headers are encrypted, or how much of the header is encrypted. How much of HTTPS headers ...
- Modified
- 10 Jan at 20:55
denied: requested access to the resource is denied: docker
I am following [this link](https://docs.docker.com/engine/getstarted/step_four/) to create my first docker Image and it went successfully and now I am trying to push this Image into my docker reposito...
- Modified
- 22 Jun at 23:40
How do I test a single file using Jest?
I am able to test multiple files using Jest, but I cannot figure out how to test a single file. I have: - `npm install jest-cli --save-dev`- `package.json`- Running `npm test` works as expected (curr...
PHP | define() vs. const
In PHP, you can declare constants in two ways: 1. With define keyword define('FOO', 1); 2. Using const keyword const FOO = 1; --- - -
Using LINQ to remove elements from a List<T>
Say that I have LINQ query such as: ``` var authors = from x in authorsList where x.firstname == "Bob" select x; ``` Given that `authorsList` is of type `List<Author>`, ...
How to detect the OS from a Bash script?
I would like to keep my `.bashrc` and `.bash_login` files in version control so that I can use them between all the computers I use. The problem is I have some OS specific aliases so I was looking for...
- Modified
- 4 Mar at 17:32
Check if an element is present in an array
The function I am using now to check this is the following: ``` function inArray(needle,haystack) { var count=haystack.length; for(var i=0;i<count;i++) { if(haystack[i]===needle){r...
- Modified
- 21 Dec at 09:47
'IF' in 'SELECT' statement - choose output value based on column values
``` SELECT id, amount FROM report ``` I need `amount` to be `amount` if `report.type='P'` and `-amount` if `report.type='N'`. How do I add this to the above query?
Fastest way to duplicate an array in JavaScript - slice vs. 'for' loop
In order to duplicate an array in JavaScript: Which of the following is faster to use? ### Slice method ``` var dup_array = original_array.slice(); ``` ### For loop ``` for(var i = 0, len = ori...
- Modified
- 26 Jun at 05:6
Easiest way to convert a List to a Set in Java
What is the easiest way to convert a `List` to a `Set` in Java?
- Modified
- 26 May at 11:23
How do I do a case-insensitive string comparison?
How can I compare strings in a case insensitive way in Python? I would like to encapsulate comparison of a regular strings to a repository string, using simple and Pythonic code. I also would like to ...
- Modified
- 18 Jun at 22:29
What is the difference between a deep copy and a shallow copy?
What is the difference between a deep copy and a shallow copy?
- Modified
- 20 Feb at 22:45
Get statistics for each group (such as count, mean, etc) using pandas GroupBy?
I have a data frame `df` and I use several columns from it to `groupby`: ``` df['col1','col2','col3','col4'].groupby(['col1','col2']).mean() ``` In the above way I almost get the table (data frame)...
- Modified
- 28 Jun at 02:56