Questions

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...

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...

8 Nov at 13:3

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...

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...

17 Jul at 09:13

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` ...

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...

3 Nov at 11:42

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...

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?

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...

19 Jul at 00:11

What is JNDI? What is its basic use? When is it used?

- What is ?- What is its basic use?- When is it used?

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.

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 ...

10 Apr at 09:51

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 ...

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...

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.

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.

25 Jun at 08:54

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 ...

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.

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 --> />...

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 ...

17 Jan at 22:31

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...

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?

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...

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...

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...

26 Sep at 18:13