Get querystring from URL using jQuery
I have the following URL: ``` http://www.mysite.co.uk/?location=mylocation1 ``` I need to get the value of `location` from the URL into a variable and then use it in jQuery code: ``` var thequerystri...
- Modified
- 25 Jul at 01:57
Detect click outside React component
I'm looking for a way to detect if a click event happened outside of a component, as described in this [article](https://css-tricks.com/dangers-stopping-event-propagation/). jQuery closest() is used t...
- Modified
- 21 Aug at 23:36
How to delete a column from a table in MySQL
Given the table created using: ``` CREATE TABLE tbl_Country ( CountryId INT NOT NULL AUTO_INCREMENT, IsDeleted bit, PRIMARY KEY (CountryId) ) ``` How can I delete the column `IsDeleted`?
- Modified
- 15 Sep at 11:58
Two divs side by side - Fluid display
I am trying to place two divs side by side and using the following CSS for it. ``` #left { float: left; width: 65%; overflow: hidden; } #right { overflow: hidden; } ``` The HTML is simple,...
- Modified
- 3 Oct at 09:41
How to add multiple classes to a ReactJS Component?
I am new to ReactJS and JSX and I am having a little problem with the code below. I am trying to add multiple classes to the `className` attribute on each `li`: ``` <li key={index} className={activ...
- Modified
- 21 Jun at 18:16
How do I assign a port mapping to an existing Docker container?
I'm not sure if I've misunderstood something here, but it seems like it's only possible to set port mappings by creating a new container from an image. Is there a way to assign a port mapping to an ex...
- Modified
- 12 Mar at 13:28
How to convert an int to a hex string?
I want to take an integer (that will be <= 255), to a hex string representation e.g.: I want to pass in `65` and get out `'\x41'`, or `255` and get `'\xff'`. I've tried doing this with the `struct.p...
How to get the last character of a string?
How to get the last character of the string: ``` "linto.yahoo.com." ``` The last character of this string is `"."` How can I find this?
- Modified
- 10 Jan at 12:27
Java SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'") gives timezone as IST
I have SimpleDateFormat constructor as ``` SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'") ``` and I am parsing string `"2013-09-29T18:46:19Z".` I have read that here Z represents the `GMT/UTC` tim...
- Modified
- 1 Oct at 09:19
Enum String Name from Value
I have an enum construct like this: ``` public enum EnumDisplayStatus { None = 1, Visible = 2, Hidden = 3, MarkedForDeletion = 4 } ``` In my database, the enumerations are refer...
Relative paths in Python
I'm building a simple helper script for work that will copy a couple of template files in our code base to the current directory. I don't, however, have the absolute path to the directory where the te...
- Modified
- 27 May at 21:43
How to concatenate a std::string and an int
I thought this would be really simple, but it's presenting some difficulties. If I have ``` std::string name = "John"; int age = 21; ``` How do I combine them to get a single string `"John21"`?
- Modified
- 17 May at 14:39
convert a char* to std::string
I need to use an `std::string` to store data retrieved by `fgets()`. To do this I need to convert the `char*` return value from `fgets()` into an `std::string` to store in an array. How can this be do...
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
How can I change div content with JavaScript?
I have simple HTML code with some JavaScript. It looks like: ``` <html> <head> <script type="text/javascript"> function changeDivContent() { // ... }; </script> </head> <body> <input ...
- Modified
- 25 Jan at 14:12
Which is the preferred way to concatenate a string in Python?
Since Python's `string` can't be changed, I was wondering how to concatenate a string more efficiently? I can write like it: ``` s += stringfromelsewhere ``` or like this: ``` s = [] s.append(somest...
- Modified
- 28 Aug at 17:50
How can I remove a substring from a given String?
Is there an easy way to remove substring from a given `String` in Java? Example: `"Hello World!"`, removing `"o"` → `"Hell Wrld!"`
How do I convert a PIL Image into a NumPy array?
How do I convert a PIL `Image` back and forth to a NumPy array so that I can do faster pixel-wise transformations than PIL's `PixelAccess` allows? I can convert it to a NumPy array via: ``` pic = Imag...
- Modified
- 30 Jul at 06:21
Safest way to convert float to integer in python?
Python's math module contain handy functions like `floor` & `ceil`. These functions take a floating point number and return the nearest integer below or above it. However these functions return the an...
- Modified
- 5 Aug at 18:21
Must declare the scalar variable
`@RowFrom int` `@RowTo int` are both Global Input Params for the Stored Procedure, and since I am compiling the SQL query inside the Stored Procedure with T-SQL then using `Exec(@sqlstatement)` at t...
- Modified
- 10 Sep at 16:41
Using Node.js require vs. ES6 import/export
In a project I am collaborating on, we have two choices on which module system we can use: 1. Importing modules using require, and exporting using module.exports and exports.foo. 2. Importing modules...
- Modified
- 26 Jan at 00:48
Select statement to find duplicates on certain fields
Can you help me with SQL statements to find duplicates on multiple fields? For example, in pseudo code: ``` select count(field1,field2,field3) from table where the combination of field1, field2, f...
- Modified
- 3 Sep at 09:40
Java Does Not Equal (!=) Not Working?
Here is my code snippet: ``` public void joinRoom(String room) throws MulticasterJoinException { String statusCheck = this.transmit("room", "join", room + "," + this.groupMax + "," + this.uniqueID)...
- Modified
- 25 Apr at 00:3
How to tell Jackson to ignore a field during serialization if its value is null?
How can Jackson be configured to ignore a field value during serialization if that field's value is null. For example: ``` public class SomeClass { // what jackson annotation causes jackson to s...
How to submit form on change of dropdown list?
I am creating a page in JSP where I have a dropdown list and once the user selects a value he has to click on the go button and then the value is sent to the Servlet. ``` </select> <input...