How do I reference a local image in React?
How can I load image from local directory and include it in `reactjs img src` tag? I have an image called `one.jpeg` inside the same folder as my component and I tried both `<img src="one.jpeg" />` a...
- Modified
- 4 Jul at 15:58
Convert Promise to Observable
I am trying to wrap my head around observables. I love the way observables solve development and readability issues. As I read, benefits are immense. Observables on HTTP and collections seem to be s...
- Modified
- 8 Aug at 19:38
How to find what code is run by a button or element in Chrome using Developer Tools
I'm using Chrome and my own website. ### What I know from the inside: ) I have a form where people sign up by clicking this orange image-button: ![enter image description here](https://i.stack.imgu...
- Modified
- 20 Jun at 09:12
Replace multiple characters in one replace call
I need to replace every instance of '_' with a space, and every instance of '#' with nothing/empty. ``` var string = '#Please send_an_information_pack_to_the_following_address:'; ``` I've tried this:...
- Modified
- 18 Feb at 19:49
What are the lengths of Location Coordinates, latitude and longitude?
How many digits can latitude and longitude have, before the decimal, and after the decimal? Here is an example I am getting from the location sent by a Windows Phone device: ``` Latitude=-635723752901...
- Modified
- 30 Jan at 21:1
How to crop an image in OpenCV using Python
How can I crop images, like I've done before in PIL, using OpenCV. Working example on PIL ``` im = Image.open('0.png').convert('L') im = im.crop((1, 1, 98, 33)) im.save('_0.png') ``` But how I ca...
TypeScript function overloading
Section 6.3 of the TypeScript language spec talks about function overloading and gives concrete examples on how to implement this. However if I try something like this: ``` export class LayerFactory...
- Modified
- 3 Nov at 19:22
Get protocol, domain, and port from URL
I need to extract the full protocol, domain, and port from a given URL. For example: ``` https://localhost:8181/ContactUs-1.0/contact?lang=it&report_type=consumer >>> https://localhost:8181 ```
- Modified
- 16 Feb at 05:57
How to do URL decoding in Java?
``` https%3A%2F%2Fmywebsite%2Fdocs%2Fenglish%2Fsite%2Fmybook.do%3Frequest_type ``` ``` https://mywebsite/docs/english/site/mybook.do&request_type ``` ``` class StringUTF { public static...
- Modified
- 9 Apr at 00:28
How to add number of days to today's date?
I need to be able to add 1, 2 , 5 or 10 days to today's date using jQuery.
- Modified
- 21 Dec at 05:7
How to make a vertical line in HTML
How do you make a vertical line using HTML?
Rails migration for change column
We have `script/generate migration add_fieldname_to_tablename fieldname:datatype` syntax for adding new columns to a model. On the same line, do we have a script/generate for changing the datatype of...
- Modified
- 28 Oct at 06:26
LinearLayout not expanding inside a ScrollView
I have a `LinearLayout` inside a `ScrollView` that has `android:layout_height="fill_parent"`, but it doesn't expand to the full height of the `ScrollView`. My layout looks something like: ``` level ...
- Modified
- 9 Apr at 09:53
What does LINQ return when the results are empty
I have a question about LINQ query. Normally a query returns a `IEnumerable<T>` type. If the return is empty, not sure if it is null or not. I am not sure if the following `ToList()` will throw an exc...
XmlSerializer giving FileNotFoundException at constructor
An application I've been working with is failing when I try to serialize types. A statement like ``` XmlSerializer lizer = new XmlSerializer(typeof(MyType)); ``` produces: ``` System.IO.FileNotFo...
- Modified
- 13 Nov at 18:16
How to compare only Date without Time in DateTime types in Linq to SQL with Entity Framework?
Is there a way to compare two `DateTime` variables in `Linq2Sql` but to disregard the Time part. The app stores items in the DB and adds a published date. I want to keep the exact time but still be a...
- Modified
- 22 Oct at 20:3
Response Content type as CSV
I need to send a CSV file in HTTP response. How can I set the output response as CSV format? This is not working: ``` Response.ContentType = "application/CSV"; ```
Could not find default endpoint element
I've added a proxy to a webservice to a VS2008/.NET 3.5 solution. When constructing the client .NET throws this error: > Could not find default endpoint element that references contract 'IMySOAPWebSe...
- Modified
- 8 Mar at 19:21
How do I set environment variables from Java?
How do I set environment variables from Java? I see that I can do this for subprocesses using [ProcessBuilder](http://docs.oracle.com/javase/7/docs/api/java/lang/ProcessBuilder.html). I have several ...
- Modified
- 27 Dec at 17:37
Correct way to initialize empty slice
To declare an empty slice, with a non-fixed size, is it better to do: ``` mySlice1 := make([]int, 0) ``` or: ``` mySlice2 := []int{} ``` Just wondering which one is the correct way.
"date(): It is not safe to rely on the system's timezone settings..."
I got this error when I requested to update the [PHP](http://en.wikipedia.org/wiki/PHP) version from 5.2.17 to PHP 5.3.21 on the server. ``` <div style="border:1px solid #990000;padding-left:20px;mar...
UnicodeDecodeError: 'utf8' codec can't decode byte 0x9c
I have a socket server that is supposed to receive UTF-8 valid characters from clients. The problem is some clients (mainly hackers) are sending all the wrong kind of data over it. I can easily distin...
- Modified
- 6 Jul at 19:4
multiprocessing.Pool: When to use apply, apply_async or map?
I have not seen clear examples with use-cases for [Pool.apply](https://docs.python.org/2/library/multiprocessing.html#multiprocessing.pool.multiprocessing.Pool.apply), [Pool.apply_async](https://docs....
- Modified
- 19 Oct at 17:1
Git error when trying to push -- pre-receive hook declined
When I try and push a change I've commited, I get the following error ... ``` git.exe push -v --progress "origin" iteration1:iteration1 remote: *****************************************************...
- Modified
- 16 Nov at 10:59
What is the difference between children and childNodes in JavaScript?
I have found myself using JavaScript and I ran across `childNodes` and `children` properties. I am wondering what the difference between them is. Also is one preferred to the other?
- Modified
- 28 Oct at 22:55