Skip to main content

Stack Overflow Weekly Newsletter - Tuesday, March 29, 2016

Stack Overflow Weekly Newsletter

Top new questions this week:

Why does BufferedInputStream copy a field to a local variable rather than use the field directly

When I read the source code from java.io.BufferedInputStream.getInIfOpen(), I am confused about why it wrote code like this: /** * Check to make sure that underlying input stream has not been * ...

java  
asked by Saint 45 votes
answered by Stephen C 48 votes

Why cube is faster than square

I wrote this: var max = 0xffffff * 4; var step = 1 / max; function cube() { var result = 0.; for (var x = 0.; x < 1; x += step) { result += x * x * x; } return result; ...

javascript performance  
asked by shal 27 votes
answered by Siderite Zackwehdex 0 votes

Query the alignment of a specific variable

C++11 introduced the alignas specifier to specify the alignment of a variable, and the alignof operator to query the default alignment of a type. However, I don't see any way to get the alignment of a ...

c++ c++11 memory-alignment  
asked by Morwenn 25 votes
answered by manlio 6 votes

What is the logic behind this result?

def foo(_, _='override') _ end p foo("bye bye") p foo("hello", "world") Output: "override" "hello" I could understand if the result was: "override" "world" or even: "bye bye" "hello" But ...

ruby  
asked by Gerry 21 votes
answered by Mike 2 votes

How to prevent implicit conversion from int to unsigned int?

Suppose you have this: struct Foo { Foo(unsigned int x) : x(x) {} unsigned int x; }; int main() { Foo f = Foo(-1); // how to get a compiler error here? std::cout << f.x ...

c++ implicit-conversion unsigned-integer  
asked by tobi303 19 votes
answered by skypjack 16 votes

What's the right way to fix this template resolution ambiguity?

Suppose I've written: template <typename T, typename = std::enable_if_t<std::is_integral<T>::value>> void foo() { std::cout << "T is integral." << std::endl; } template ...

c++ c++11 c++14 sfinae enable-if  
asked by einpoklum 19 votes
answered by Barry 10 votes

C++ array sizes without constant expressions

I'm reading Stroustrup's A Tour of C++. On page 9, he states: "The size of an array must be a constant expression." Yet later, on pg. 16, he uses the following code sample: void vector ...

c++ arrays  
asked by George 19 votes
answered by Barry 28 votes

Greatest hits from previous weeks:

How can I know which radio button is selected via jQuery?

I have two radio buttons and want to post the value of the selected one. How can I get the value with jQuery? I can get all of them like this: $("form :radio") How do I know which one is selected? ...

javascript jquery jquery-selectors radio-button  
asked by juanformoso 1463 votes
answered by Peter J 2520 votes

Difference between INNER and OUTER joins

What is the difference between INNER JOIN and OUTER JOIN? How do LEFT JOIN, RIGHT JOIN, and FULL JOIN fit in?

sql join inner-join outer-join difference  
asked by cdv 2650 votes
answered by Mark Harrison 3828 votes

Can you answer these?

How to merge adjacent polygons

I'm using a Javascript implementation of Fortune's algorithm to compute voronoi cells (https://github.com/gorhill/Javascript-Voronoi). My sites to compute are points on a map (so (lat,lng)). I first ...

javascript geometry leaflet voronoi turfjs  
asked by kwn 5 votes

Bootstrap navbar "flashing" when clicking outside of menu to close it

I'm having an issue with the navbar where a "flash" appears when you click outside the menu to close the menu. The flash persists if the mouse is held down when clicking out of the menu as shown here: ...

html css angularjs twitter-bootstrap  
asked by Left 6 votes

Phaser Custom Sprite Trapezoidal Shape

I want to create something like this using Phaser Javascript Framework here is a sample of a reference on creating a trapezoidal image transformation using canvas Trapezoid - JSFiddle and here is a ...

javascript html html5 canvas phaser-framework  
asked by Oli Soproni B. 6 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 ...