Stack Overflow Weekly Newsletter
Stack Overflow Weekly Newsletter

Top new questions this week:

Large difference in speed of equivalent static and non static methods

In this code when I create an Object in the main method and then call that objects method: ff.twentyDivCount(i)(runs in 16010 ms) , it runs much faster than calling it using this annotation: ...

java performance object methods static  
asked by Stabbz 72 votes
answered by assylias 65 votes

Get a random number focused on center

Is it possible to get a random number between 1-100 and keep the results mainly within the 40-60 range? I mean, it will go out of that range rarely, but I want it to be mainly within that range.. Is ...

javascript random  
asked by Darryl 58 votes
answered by BlueRaja - Danny Pflughoeft 79 votes

Can Java class files use reserved keywords as names?

I'm aware that Java-the-compilable-programming-language is not one and the same as Java-the-bytecode-format-for-JVM-execution. There are examples of things that are valid in the .class format but not ...

java reflection jvm .class-file  
asked by Nayuki Minase 34 votes
answered by Antimony 7 votes

First random number is always smaller than rest

I happen to notice that in C++ the first random number being called with the std rand() method is most of the time significant smaller than the second one. Concerning the Qt implementation the first ...

c++ qt random  
asked by TheMindWithin 28 votes
answered by Rafael Monteiro 12 votes

How to segment a circle with different colors using CSS

I want to be able to draw a circle with a segment of it another colour, I would like the amount of a segment covered to be able to be increased in increments of 10% from 0% to 100%. Any examples on ...

html css css3 css-shapes  
asked by user2871826 27 votes
answered by Sergey Denisov 36 votes

List with many dictionaries VS dictionary with few lists?

1/ I'm doing some exercises with datasets. Should I structure them like users or users2? Are there performance differences? Is one more readable? Is there a standard? 2/ I usually convert these to ...

python pandas data  
asked by user2469211 26 votes
answered by Yann Vernier 18 votes

Can't use an "inline" array in c#?

Imagine you have this somewhere public static T AnyOne<T>(this T[] ra) where T:class { int k = ra.Length; int r = Random.Range(0,k); return ra[r]; } or even just this ...

asked by Joe Blow 25 votes
answered by adricadar 36 votes

Greatest hits from previous weeks:

Edit an incorrect commit message in Git

I wrote the wrong thing in a commit message. How can I change the message? The commit has not been pushed yet.

git git-commit git-rewrite-history amend  
asked by Laurie Young 7491 votes
answered by EfForEffort 8542 votes

Generating random integers in a range with Java

I am trying to generate a random integer with Java, but random in a specific range. For example, my range is 5-10, meaning that 5 is the smallest possible value the random number can take, and 10 is ...

java range random  
asked by user42155 1231 votes
answered by Greg Case 1425 votes

Can you answer these?

push --force-with-lease by default

I just learned about git push --force-with-lease. It's pretty awesome. But, of course, I don't use force that often, and so I'm worried that I might forget about this nifty feature the next time I ...

asked by Dan Fabulich 5 votes

Is there an automatic noexcept specifier?

I've heard that noexcept keyword is more like 'it should never throw an exception' rather than 'it doesn't'. I don't think it's good to use noexcept keyword if I'm not sure it throws an exception or ...

c++ c++11 c++14 noexcept  
asked by kukyakya 10 votes

Disposing of Child Classes inside Lists

I have a container class that represents a set of files. There are 10 different types of files, and 24 hourly files per type of file. I've created a child class per file type, and a list of 24 hourly ... dispose  
asked by JoeB 5 votes
Subscribe to more Stack Exchange newsletters

Unsubscribe from this newsletter or change your email preferences by visiting your subscriptions page on

Questions? Comments? Let us know on our feedback site. If you no longer want to receive mail from Stack Exchange, unsubscribe from all emails.

Stack Exchange, Inc. 110 William St, 28th Floor, NY NY 10038 <3