Is there a format code shortcut for Visual Studio?

Visual Studio with C# key bindings To answer the specific question, in C# you are likely to be using the C# keyboard mapping scheme, which will use these hotkeys by default: Ctrl+E, Ctrl+D to format the entire document. Ctrl+E, Ctrl+F to format the selection. You can change these in menu Tools → Options → Environment … Read more

The type or namespace name could not be found [duplicate]

See this question. Turns out this was a client profiling issue. PrjForm was set to “.Net Framework 4 Client Profile” I changed it to “.Net Framework 4”, and now I have a successful build. Thanks everyone! I guess it figures that after all that time spent searching online, I find the solution minutes after posting, … Read more

Error ‘LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt’ after installing Visual Studio 2012 Release Preview

This MSDN thread explains how to fix it. To summarize: Either disable incremental linking, by going to Project Properties -> Configuration Properties -> Linker (General) -> Enable Incremental Linking -> “No (/INCREMENTAL:NO)” or install VS2010 SP1. Edits (@CraigRinger): Note that installing VS 2010 SP1 will remove the 64-bit compilers. You need to install the VS … Read more

What is “stdafx.h” used for in Visual Studio?

All C++ compilers have one serious performance problem to deal with. Compiling C++ code is a long, slow process. Compiling headers included on top of C++ files is a very long, slow process. Compiling the huge header structures that form part of Windows API and other large API libraries is a very, very long, slow … Read more

How do I run Visual Studio as an administrator by default?

Copied and pasted from here, the Using Advanced Properties section. This will allow you to always have the program run as an administrator when you open it. Right click on the shortcut of the program, then click on Properties. Click on the Shortcut tab for a program shortcut, then click on the Advanced button. Check … Read more

push_back vs emplace_back

In addition to what visitor said : The function void emplace_back(Type&& _Val) provided by MSCV10 is non conforming and redundant, because as you noted it is strictly equivalent to push_back(Type&& _Val). But the real C++0x form of emplace_back is really useful: void emplace_back(Args&&…); Instead of taking a value_type it takes a variadic list of arguments, … Read more

Why does changing 0.1f to 0 slow down performance by 10x?

Welcome to the world of denormalized floating-point! They can wreak havoc on performance!!! Denormal (or subnormal) numbers are kind of a hack to get some extra values very close to zero out of the floating point representation. Operations on denormalized floating-point can be tens to hundreds of times slower than on normalized floating-point. This is … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)