Skip to main content

Stack Overflow Weekly Newsletter - Tuesday, September 30, 2014

Stack Overflow Weekly Newsletter

Top new questions this week:

What is this JavaScript pattern called and why is it used?

I'm studying THREE.js and noticed a pattern where functions are defined like so: var foo = ( function () { var tmpObject = new Bar(); return function ( ) { //actual logic using …

javascript closures iife  
asked by Patrick Klug 45 votes
answered by MD. Sahib Bin Mahboob 39 votes

Is the behavior behind the Shell Shock vulnerability in Bash documented or at all intentional?

A recent vulnerability, CVE-2014-6271, in how bash interprets environment variables was disclosed. The exploit relies on bash parsing some environment variable declarations as function definitions, …

bash function security environment-variables shellshock-bash-bug  
asked by kojiro 33 votes
answered by Barmar 34 votes

what does Haskell's <|> operator do?

Going through haskell's documentation is always a bit of a pain for me, because all the information you get about a function is often nothing more than just: f a -> f [a] which could mean any …

haskell applicative  
asked by Electric Coffee 30 votes
answered by J. Abrahamson 26 votes

Why does GCC implement isnan() more efficiently for C++ <cmath> than C <math.h>?

Here's my code: int f(double x) { return isnan(x); } If I #include <cmath> I get this assembly: xorl %eax, %eax ucomisd %xmm0, %xmm0 setp %al This is reasonably clever: ucomisd …

c++ c optimization nan constantfolding  
asked by John Zwinck 28 votes
answered by Rapptz 7 votes

Why does adding 0.1 multiple times remain lossless?

I know the 0.1 decimal number cannot be represented exactly with a finite binary number (explanation), so double n = 0.1 will lose some precision and will not be exactly 0.1. On the other hand 0.5 can …

java floating-point floating-point-precision  
asked by icza 27 votes
answered by Peter Lawrey 28 votes

Why is this function call ambiguous?

I'm reading the standard and trying to figure out why this code won't be resolved without a cast. void foo(char c) { } // Way bigger than char void foo(unsigned long int) { } int main() { …

c++ integer implicit-conversion unsigned-integer integer-promotion  
asked by user4073503 25 votes
answered by AndreyT 44 votes

Why are std::fstreams so slow?

I was working on a simple parser and when profiling I observed the bottleneck is in... file read! I extracted very simple test to compare the performance of fstreams and FILE* when reading a big blob …

c++ performance  
asked by Felics 24 votes
answered by Mats Petersson 11 votes

Greatest hits from previous weeks:

Edit an incorrect commit message in Git

I wrote the wrong thing in a commit message. How do I change the message? I have not yet pushed the commit to anyone.

git git-commit git-rewrite-history  
asked by Laurie Young 5851 votes
answered by EfForEffort 6546 votes

How to horizontally center a div in a div?

How do I horizontally center a div in a div with CSS (if it's possible at all)? The outer div has 100%: <div id="outer" style="width:100%"> <div id="inner">Foo foo</div> …

html css  
asked by Lukas 1317 votes
answered by Justin Poliey 1501 votes

Can you answer these?

Is it possible to login automatically in google drive or Dropbox with static credentials, without login popup?

I have a requirement in my project like this . Client will place a images in his google drive account/dropbox.I need to display those images in my application from drive/dropbox.I need to give …

ios objective-c iphone google-drive-sdk  
asked by sunil 4 votes

Escape "[]" characters in a semicolon-separated list in CMake

I found "[" and "]" might have special meanings in a semicolon-separated list in CMake. When I try this code in CMakeLists.txt: set(XX "a" "b" "[" "]") message("${XX}") foreach(x ${XX}) …

cmake  
asked by Cheng Li 5 votes

How can I establish a secure connection to a websocket on localhost?

We have an application which we run on a POS terminal, that should receive data from an application running on the same machine, while displaying content from a remote site which is loaded over HTTPS. …

javascript google-chrome https websocket  
asked by Oliver Salzburg 5 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 ...