Regular expression to limit number of characters to 10
I am trying to write a [regular expression](http://en.wikipedia.org/wiki/Regular_expression) that will only allow lowercase letters and up to 10 characters. What I have so far looks like this: ``` pa...
- Modified
- 24 Nov at 14:41
Axios handling errors
I'm trying to understand javascript promises better with Axios. What I pretend is to handle all errors in Request.js and only call the request function from anywhere without having to use `catch()`. ...
- Modified
- 22 Apr at 15:45
Use dynamic variable names in JavaScript
In PHP you can do amazing/horrendous things like this: ``` $a = 1; $b = 2; $c = 3; $name = 'a'; echo $$name; // prints 1 ``` Is there any way of doing something like this with Javascript? E.g. if ...
- Modified
- 2 Mar at 12:19
How to check if two arrays are equal with JavaScript?
``` var a = [1, 2, 3]; var b = [3, 2, 1]; var c = new Array(1, 2, 3); alert(a == b + "|" + b == c); ``` [demo](http://jsfiddle.net/YrMyc/3/) How can I check these array for equality and get a meth...
- Modified
- 7 Apr at 21:13
Button that refreshes the page on click
I need a button that will refresh the page on the user's click. I tried this: ``` <input type="button" value="Reload Page" onClick="reload"> ``` or ``` <input type="button" value="Refresh Page" o...
- Modified
- 27 Jun at 18:18
How to get the IP address of the docker host from inside a docker container
As the title says, I need to be able to retrieve the IP address the docker hosts and the portmaps from the host to the container, and doing that inside of the container.
What is the syntax for an inner join in LINQ to SQL?
I'm writing a LINQ to SQL statement, and I'm after the standard syntax for a normal inner join with an `ON` clause in C#. How do you represent the following in LINQ to SQL: ``` select DealerContact....
- Modified
- 21 Aug at 10:31
onclick="location.href='link.html'" does not load page in Safari
I cannot get `onclick="location.href='link.html'"` to load a new page in Safari (5.0.4). I am building a drop-down navigation menu using the `<select>` and `<option>` HTML tags. I am using the `oncli...
- Modified
- 13 Apr at 15:52
How can I view live MySQL queries?
How can I trace MySQL queries on my Linux server as they happen? For example I'd love to set up some sort of listener, then request a web page and view all of the queries the engine executed, or just...
- Modified
- 20 Feb at 00:5
What is the difference between char, nchar, varchar, and nvarchar in SQL Server?
What is meant by `nvarchar`? What is the difference between `char`, `nchar`, `varchar`, and `nvarchar` in SQL Server?
- Modified
- 27 Jun at 05:43
How to add element to C++ array?
I want to add an int into an array, but the problem is that I don't know what the index is now. ``` int[] arr = new int[15]; arr[0] = 1; arr[1] = 2; arr[2] = 3; arr[3] = 4; arr[4] = 5; ``` That cod...
Database, Table and Column Naming Conventions?
Whenever I design a database, I always wonder if there is a best way of naming an item in my database. Quite often I ask myself the following questions: 1. Should table names be plural? 2. Should co...
- Modified
- 29 Sep at 14:40
How to get the previous URL in JavaScript?
Is there any way to get the previous URL in JavaScript? Something like this: ``` alert("previous url is: " + window.history.previous.href); ``` Is there something like that? Or should I just stor...
- Modified
- 13 Nov at 12:25
How do you use the ? : (conditional) operator in JavaScript?
What is the `?:` (question mark and colon operator aka. conditional or "ternary") operator and how can I use it?
- Modified
- 27 Jan at 16:15
Docker Error bind: address already in use
When I run `docker-compose up` in my Docker project it fails with the following message: > Error starting userland proxy: listen tcp 0.0.0.0:3000: bind: address already in use ``` netstat -pna | grep ...
- Modified
- 1 Jul at 17:24
Synchronizing a local Git repository with a remote one
I want to synchronize my local repository with a remote one so that my local repository becomes a 100% copy of the remote one - meaning that if certain files differ in these repositories, we override ...
- Modified
- 17 Feb at 23:56
Get div height with plain JavaScript
Any ideas on how to get a div's height without using jQuery? I was searching Stack Overflow for this question and it seems like every answer is pointing to jQuery's `.height()`. I tried something like...
- Modified
- 30 Dec at 20:43
How to print a specific row of a pandas DataFrame?
I have a massive DataFrame, and I'm getting the error: ``` TypeError: ("Empty 'DataFrame': no numeric data to plot", 'occurred at index 159220') ``` I've already dropped nulls, and checked dtypes for...
- Modified
- 23 Jan at 06: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 to select date from datetime column?
I have a column of type "datetime" with values like 2009-10-20 10:00:00 I would like to extract date from datetime and write a query like: ``` SELECT * FROM data WHERE datetime = '2009-10-20' ORD...
Cannot run Eclipse; JVM terminated. Exit code=13
![enter image description here](https://i.stack.imgur.com/qi9fH.jpg) I just append -vm C:\Program Files\Java\jre6\bin\javaw.exe in eclipse.ini then I try to start eclipse again and got this error. ...
How can I combine two strings together in PHP?
I don't actually know how to describe what I wanted, but I'll show you: For example: ``` $data1 = "the color is"; $data2 = "red"; ``` What should I do (or process) so $result is the combination of `$...
- Modified
- 16 May at 09:9
How can I clear or empty a StringBuilder?
I'm using a [StringBuilder](http://download.oracle.com/javase/1.5.0/docs/api/java/lang/StringBuilder.html) in a loop and every x iterations I want to empty it and start with an empty `StringBuilder`, ...
- Modified
- 8 Feb at 01:15
Can't perform a React state update on an unmounted component
## Problem I am writing an application in React and was unable to avoid a super common pitfall, which is calling `setState(...)` after `componentWillUnmount(...)`. I looked very carefully at my c...
- Modified
- 28 Dec at 01:11
JavaScriptSerializer - JSON serialization of enum as string
I have a class that contains an `enum` property, and upon serializing the object using `JavaScriptSerializer`, my json result contains the integer value of the enumeration rather than its `string` "na...
- Modified
- 14 Nov at 00:30