Does the ‘mutable’ keyword have any purpose other than allowing a data member to be modified by a const member function?

It allows the differentiation of bitwise const and logical const. Logical const is when an object doesn’t change in a way that is visible through the public interface, like your locking example. Another example would be a class that computes a value the first time it is requested, and caches the result. Since c++11 mutable … Read more

Is there a goto statement in Java?

James Gosling created the original JVM with support of goto statements, but then he removed this feature as needless. The main reason goto is unnecessary is that usually it can be replaced with more readable statements (like break/continue) or by extracting a piece of code into a method. Source: James Gosling, Q&A session

How to get VS 2010 to recognize certain CUDA functions

You could create a dummy #include file of the following form: #pragma once #ifdef __INTELLISENSE__ void __syncthreads(); … #endif This should hide the fake prototypes from the CUDA and Visual C++ compilers, but still make them visible to IntelliSense. Source for __INTELLISENSE__ macro: http://blogs.msdn.com/b/vcblog/archive/2011/03/29/10146895.aspx

SQL Server equivalent to MySQL’s EXPLAIN

The MySql EXPLAIN statement can be used either as a synonym for DESCRIBE or as a way to obtain information about how MySQL executes a SELECT statement. The closest equivalent statement for SQL Server is: SET SHOWPLAN_ALL (Transact-SQL) or SET SHOWPLAN_XML (Transact-SQL) From a SQL Server Management Studio query window, you could run SET SHOWPLAN_ALL … Read more

C# : ‘is’ keyword and checking for Not

if(!(child is IContainer)) is the only operator to go (there’s no IsNot operator). You can build an extension method that does it: public static bool IsA<T>(this object obj) { return obj is T; } and then use it to: if (!child.IsA<IContainer>()) And you could follow on your theme: public static bool IsNotAFreaking<T>(this object obj) { … Read more