Share data between AngularJS controllers
I'm trying to share data across controllers. Use-case is a multi-step form, data entered in one input is later used in multiple display locations outside the original controller. Code below and in [js...
- Modified
- 28 Jan at 00:33
How do I load a file from resource folder?
My project has the following structure: ``` /src/main/java/ /src/main/resources/ /src/test/java/ /src/test/resources/ ``` I have a file in `/src/test/resources/test.csv` and I want to load the file...
How can I limit Parallel.ForEach?
I have a Parallel.ForEach() async loop with which I download some webpages. My bandwidth is limited so I can download only x pages per time but Parallel.ForEach executes whole list of desired webpages...
- Modified
- 29 Aug at 21:26
Converting datetime.date to UTC timestamp in Python
I am dealing with dates in Python and I need to convert them to UTC timestamps to be used inside Javascript. The following code does not work: ``` >>> d = datetime.date(2011,01,01) >>> datetime.datet...
Get URL query string parameters
What is the "less code needed" way to get parameters from a URL query string which is formatted like the following? > www.mysite.com/category/subcategory?myqueryhash Output should be: `myqueryhash` ...
- Modified
- 21 Oct at 06:9
Omitting one Setter/Getter in Lombok
I want to use a data class in Lombok. Since it has about a dozen fields, I annotated it with `@Data` in order to generate all the setters and getter. However there is one special field for which I don...
How to pull remote branch from somebody else's repo
I've got a project hosted on GitHub which somebody has forked. On their fork, they've created a new branch "foo" and made some changes. How do I pull their "foo" into a new branch also named "foo" in...
- Modified
- 5 Feb at 09:10
When should one use a spinlock instead of mutex?
I think both are doing the same job,how do you decide which one to use for synchronization?
- Modified
- 3 May at 13:1
Align image in center and middle within div
I have following div ``` <div id="over" style="position:absolute; width:100%; height:100%> <img src="img.png"> </div> ``` How to align the image so as to be located in the middle and center of div...
What is JNDI? What is its basic use? When is it used?
- What is ?- What is its basic use?- When is it used?
- Modified
- 23 Apr at 12:31
Find mouse position relative to element
I want to make a little painting app using canvas. So I need to find the mouse's position on the canvas.
- Modified
- 13 Jul at 04:47
How do I skip an iteration of a `foreach` loop?
In Perl I can skip a foreach (or any loop) iteration with a `next;` command. Is there a way to skip over an iteration and jump to the next loop in C#? ``` foreach (int number in numbers) { if ...
ETag vs Header Expires
I've looked around but haven't been able to figure out if I should use both an ETag an Expires Header one or the other. What I'm trying to do is make sure that my flash files (and other images and ...
- Modified
- 24 Sep at 10:33
Setting the correct encoding when piping stdout in Python
When piping the output of a Python program, the Python interpreter gets confused about encoding and sets it to None. This means a program like this: ``` # -*- coding: utf-8 -*- print u"åäö" ``` wil...
- Modified
- 11 Nov at 18:28
Pass parameters in setInterval function
Please advise how to pass parameters into a function called using `setInterval`. My example `setInterval(funca(10,3), 500);` is incorrect.
- Modified
- 6 Sep at 14:34
Waiting for another flutter command to release the startup lock
When I run my flutter application it show > Waiting for another flutter command to release the startup lock this messages and not proceed further.
How do I make an attributed string using Swift?
I am trying to make a simple Coffee Calculator. I need to display the amount of coffee in grams. The "g" symbol for grams needs to be attached to my UILabel that I am using to display the amount. The ...
- Modified
- 10 Jul at 02:21
Code coverage with Mocha
I am using Mocha for testing my NodeJS application. I am not able to figure out how to use its code coverage feature. I tried googling it but did not find any proper tutorial. Please help.
- Modified
- 16 Apr at 18:42
Submit form on pressing Enter with AngularJS
In this particular case, what options do I have to make these inputs call a function when I press Enter? Html: ``` <form> <input type="text" ng-model="name" <!-- Press ENTER and call myFunc --> />...
- Modified
- 18 Aug at 17:18
Android get current Locale, not default
How do I get the user's current Locale in Android? I can get the default one, but this may not be the current one correct? Basically I want the two letter language code from the current locale. Not ...
Read and parse a Json File in C#
How does one read a very large JSON file into an array in c# to be split up for later processing? --- I have managed to get something working that will: - - This was done with the code below but i...
- Modified
- 2 Feb at 16:20
What is the difference between JVM, JDK, JRE & OpenJDK?
What is the difference between , , & ? I was programming in Java and I encountered these phrases, what are the differences among them?
- Modified
- 23 Mar at 08:54
C++ Structure Initialization
Is it possible to initialize structs in C++ as indicated below: ``` struct address { int street_no; char *street_name; char *city; char *prov; char *postal_code; }; address temp_a...
- Modified
- 9 Aug at 13:51
How to make an HTML back link?
What is the simplest way to create an `<a>` tag that links to the previous web page? Basically a simulated back button, but an actual hyperlink. Client-side technologies only, please. Looking for so...
- Modified
- 8 Apr at 15:46
Remove duplicate elements from array in Ruby
I have a Ruby array which contains duplicate elements. ``` array = [1,2,2,1,4,4,5,6,7,8,5,6] ``` How can I remove all the duplicate elements from this array while retaining all unique elements with...
- Modified
- 26 Sep at 18:13