Skip to main content

Stack Overflow Weekly Newsletter - Tuesday, March 31, 2015

Stack Overflow Weekly Newsletter

Top new questions this week:

Why is 0[0] syntactically valid?

Why is this line valid in javascript ? var a = 0[0]; After that, a is undefined.

javascript  
asked by Michael 55 votes
answered by jfriend00 73 votes

Why does this Java 8 lambda fail to compile?

The following Java code fails to compile: @FunctionalInterface private interface BiConsumer<A, B> { void accept(A a, B b); } private static void takeBiConsumer(BiConsumer<String, ...

java lambda compiler-errors java-8 void  
asked by Brian Gordon 41 votes
answered by assylias 51 votes

Is it more efficient to perform a range check by casting to uint instead of checking for negative values?

I stumbled upon this piece of code in .NET's List source code: // Following trick can reduce the range check by one if ((uint) index >= (uint)_size) { ...

c# performance micro-optimization numeric-conversion range-checking  
asked by enzi 30 votes
answered by Damien_The_Unbeliever 27 votes

Why does toString fail to produce the correct value on an immutable BigDecimal?

import java.math.BigDecimal; import java.math.RoundingMode; public class BigDecimalTest { public static void main (String[] args) { // 4.88...e+888 (1817 digits) BigDecimal x = new ...

java bigdecimal  
asked by MikeM 29 votes
answered by Marco13 17 votes

Confusing sizeof(char) by ISO/IEC in different character set encoding like UTF-16

Assuming that a program is running on a system with UTF-16 encoding character set. So according to The C++ Programming Language - 4th, page 150: A char can hold a character of the machine's ...

c++ sizeof utf-16  
asked by kembedded 22 votes
answered by paxdiablo 25 votes

Python class scoping rules

EDIT: Looks like this is a very old "bug" or, actually, feature. See, e.g., this mail I am trying to understand the Python scoping rules. More precisely, I thought that I understand them but then I ...

python scoping  
asked by ivanl 22 votes
answered by Antti Haapala 6 votes

Java synchronisation: atomically moving money across account pairs?

How to make moving money from one account to another atomic? For: public class Account { public Account(BigDecimal initialAmount) {...} public BigDecimal getAmount() {...} public void ...

java multithreading  
asked by gavenkoa 22 votes
answered by Petr 20 votes

Greatest hits from previous weeks:

Force Git to overwrite local files on pull

How do I force an overwrite of local files on a Git pull? The scenario is following: A team member is modifying the templates for a website we are working on He is adding some images to the images ...

git version-control git-pull git-fetch  
asked by Jakub Troszok 1751 votes
answered by Jakub Troszok 79 votes

Get selected value in dropdown list using JavaScript?

How do I get the selected value from a dropdown list using JavaScript? I tried the methods below but they all return the selected index instead of the value: var as = document.form1.ddlViewBy.value; ...

javascript html-select  
asked by Danferd Lan 532 votes
answered by Paolo Bergantino 1033 votes

Can you answer these?

A list whose "Nil" carries a value?

Does some standard Haskell library define a data type like this data ListWithEnd e a = Cons a (ListWithEnd e a) | End e That is a list whose terminating element carries a value ...

list haskell data-structures  
asked by Petr Pudlák 8 votes

WinDbg loses connection debugging over network, and target machine freeze

I'm trying to get WinDbg debugging over the network to work, but it always loses connections after I break into the debugger (Debug->Break), and then try to start it again (Debug->Go). However, if I ...

debugging windbg kernel-mode  
asked by tchau.dev 6 votes

How can I pass RTS options to runghc?

For ghci, I can limit the memory ghci can use by $ ghci +RTS -M10m -RTS When I compile the whole program, I can $ ghc -rtsopts a.hs then $ ./a +RTS -M10m How can I do this for runghc a.hs? ...

haskell ghc  
asked by Yosh 7 votes
Subscribe to more Stack Exchange newsletters


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

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

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

Comments

Popular posts from this blog

Drupal Answers Weekly Newsletter - Wednesday, December 31, 2014

Top new questions this week: Can I delete old hook_update_N functions? Suppose you have a custom module, and you have hook_update_N() implementations in your .install file. If you have old update functions, and all updates have run in all sites that the module is ... node-update hook-update-n   asked by AyeshK ...

[New post] 8th Class Result 2014 PEC Hafizabad Board

Muhammad Waqas posted: "PEC Hafizabad Board 8th Class Result 2014 expected date is 28th March, 2014 by PEC. Punjab Examination Commission (PEC) will announce 8th class result for Hafizabad Board soon and all the students of Hafizabad Board who are extremely waiting for the resul" New post on Jobs in Pakistan 8th Class Result 2014 PEC Hafizabad Board by Muhammad Waqas ...

[New post] 1st Year (11th Class) Result 2014 BISE Rawalpindi Board

Xaib Aslam posted: "BISERWP board Inter part 1 result expected on 10th October 2014 according our source. students of Rawalpindi board desperately waiting for 11th class result. 1st they upload the 12th class result and after some time they ready for showing the 1st year fin" New post on Jobs in Pakistan 1st Year (11th Class) Result 2014 BISE Rawalpindi Board by Xaib Aslam ...