Stack Overflow Weekly Newsletter
Stack Overflow Weekly Newsletter

Top new questions this week:

What does P::************ mean in Boost assert.hpp file?

In boost/mpl/assert.hpp, I saw something like this: template<class Pred> struct eval_assert { typedef typename extract_assert_pred<Pred>::type P; typedef typename P::type p_type; ...

c++ pointers boost  
asked by stoneyan 67 votes
answered by sbabbi 81 votes

Is id = 1 - id atomic?

From page 291 of OCP Java SE 6 Programmer Practice Exams, question 25: public class Stone implements Runnable { static int id = 1; public void run() { id = 1 - id; if (id == ...

java multithreading atomic swap scjp  
asked by Adam Stelmaszczyk 53 votes
answered by Jon Skeet 61 votes

Why does the Java API use int instead of short or byte?

Why does the Java API use int if short or even byte would be sufficient? Example: The DAY_OF_WEEK field in Calendar uses int.

java types java-api  
asked by haywire 48 votes
answered by Marco13 58 votes

Compiler not detecting obviously uninitialized variable

All C compilers I've tried won't detect uninitialized variables in the code snippet below. Yet the case is obvious here. Don't bother about the functionality of this snippet. It's not real code, and ...

asked by Michael Walz 39 votes
answered by Brian Cain 55 votes

Arrays should not be statically initialized by an array initializer. Why?

This is one of the rules from Googles static analyser CodePro AnalytiX: Summary Arrays should not be statically initialized by an array initializer. Description This audit rule checks for array ...

java arrays static-analysis  
asked by Davor 30 votes
answered by Loïc Gammaitoni 13 votes

Why isn't this causing an infinite loop of events?

I have a simple application that reverses any text typed to it in another textbox. The catch is, you can modify either textbox and the changes will be (literally) reflected in the other. I wrote this ...

c# .net winforms events textchanged  
asked by Pietu1998 29 votes
answered by hvd 25 votes

C/C++: "inline" keyword vs "inlining" concept

I am asking this basic question to make the records straight. Have referred this question and its currently accepted answer, which is not convincing. However the second most voted answer gives better ...

c++ c inline language-lawyer inlining  
asked by iammilind 20 votes
answered by japreiss 35 votes

Greatest hits from previous weeks:

What and where are the stack and heap?

Programming language books explain that value types are created on the stack, and reference types are created on the heap, without explaining what these two things are. I haven't read a clear ...

memory-management stack heap  
asked by mattshane 3255 votes
answered by Jeff Hill 2294 votes

Remove specific element from an array?

I have an array of integers, which I'm using the .push() method to add to. Is there a simple way to remove a specific element from an array? The equivalent of something like array.remove(int); I ...

javascript arrays  
asked by Walker 1048 votes
answered by Tom Wadley 1822 votes

Can you answer these?

When does diamond syntax not work in Java 8?

As of Java 7, diamond syntax did not always work in method arguments, e.g. Why does the diamond operator not work for java.util.Collections methods in Java 7? . The answer to that question mentions ...

asked by Louis Wasserman 5 votes

Whatsapp API php code request

Following is my code to CodeRequest. $username = "91xxxxxxxxxx"; $identity = strtolower(urlencode(sha1($username, true))); $w = new WhatsProt($username, $identity, "test", true); $r = ...

php whatsapp  
asked by Gowri 6 votes

How to profile libraries?

Is there any hidden option that will put cost centres in libraries? Currently I have set up my profiling like this: cabal: ghc-prof-options: -O2 ...

haskell cabal  
asked by Florian 9 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