Sheen Space

Archive for the ‘Programming’ Category

Useful SQL Server tools in Visual Studio

leave a comment »

A less-known fact with Visual Studio is that, core SQL tool set is already included, but hidden, working behind the scenes.

This is convenient for developers because you no longer need to install a separate SQL Management Studio to access local/remote SQL server. For example, if you are developing Azure service using Visual Studio, it is easy-peasy to directly manipulate test data on the cloud through the VS GUI. Here is how to do it:

1. Use Ctrl-Q to search “SQL” or open menu item “New Query…”.


2. The connection dialog lists all available servers for you to choose: local / network/ Azure

2017-05-17 (1)

3. The opened new window tab resembles what you are used to in SQL Management Studio, Enjoy the query!



Written by Ying

17/05/2017 at 15:42

Posted in Programming

Tagged with

Link: 2012-June

leave a comment »

A brief note on object mortality

Joe Duffy

Author explains “premortem finalization” .Net uses and its disadvantages comparing to “postmortem finalization”. Although .Net doesn’t provide way to use postmortem finalization, things we can learn is that keep finalizable class simple.

Sayonara volatile

Joe Duffy

Volatile is evil

Anatomy of a Stack Smashing Attack and How GCC Prevents It

Oliver Mueller

Latest good article explaning how stack overflow attach works and modern C++ compilers’ detection mechanism.

Scope Regions in C++

Dan Saks

This is a very good and clear article about C++ scope and linkage for beginners. Sometimes it is not bad for experienced C++ programmers to go back and briefly review these concepts. The other parts of this series are posted here:
Linkage in C and C++
Storage class specifiers and storage duration

Written by Ying

23/06/2012 at 16:42

C++ Accelerated Massive Parallelism: Digest

leave a comment »

C++ AMP is coming with Visual Studio 2011. Here are information and good articles introducing it:

Herb Sutter: Heterogeneous Computing and C++ AMP

MSDN overview page

PDF: “C++ AMP : Language and Programming Model” – the specification

A list of articles:

Written by Ying

26/05/2012 at 22:46

Posted in C++, Programming, Technology

Tagged with

Start-up process of WPF application

leave a comment »

This is my WPF study note. I don’t guarantee it is error-free. Please kindly post comment when you think anything is wrong.

There is a top-level user-defined application class derived from System.Windows.Application. Let’s call it MyApp. After compilation, C# compiler generates two functions for MyApp class:

  • static void Main()
  • void  InitializeComponent()

Compiler prohibits you from defining the same functions.

MyApp.Main() calls MyApp.InitializeComponent(), and then calls System.Windows.Application.Run().

MyApp.InitializeComponent() has information of XAML file of main window of the application, and calls System.Windows.Application::set_StartupUri() with the XAML file path. It knows the XAML file path of main window because the file path is specified in <Application/StartupUri> in MyApp.xaml.

System.Windows.Application.Run() executes like normal WinForm code, initialising the main window and entering window message loop.

Written by Ying

23/05/2012 at 00:09

Posted in DotNet, Technology, Windows

Tagged with ,

Notes about improving your Visual C++ debugging skill

leave a comment »

Good Start Point

One useful link to start: PDB Files: What Every Developer Must Know

Summary from the blog article:

1) PDB files are as important as source code!

2) Every development shop must set up a Symbol Server.

Other useful things

Microsoft Windows Symbol Server is introduced here.

Source Server A tool to further facilitate debugging public build.

Symbol Proxy Advanced tool to give you centralised symbol store and performance boost on debugging. 


Written by Ying

05/12/2011 at 18:34

Posted in C++, Programming, Technology, Windows

Tagged with ,

Unnecessary relink caused by “/DYNAMICBASE” in Visual C++ 2008

leave a comment »

I am working on a big C++ solution which includes many DLL and EXE projects. It is created before Visual C++ 2008. Now we migrate to VC 2008, and I create new DLL projects in the solution.

I find that everytime there is change in my new DLL code, no matter how trivial it is, for example, only comment change in .cpp file, all dependent projects relink. It happens on my new projects, not those existing projects. So I spent some time comparing project settings, and found the cause:

/DYNAMICBASE (Use address space layout randomization)

By default, /DYNAMICBASE is on.

This option modifies the header of an executable to indicate whether the application should be randomly rebased at load time.

Address space layout randomization is supported on Windows Vista.

There is also another technical article from MSDN blog:

Address Space Layout Randomization in Windows Vista

This is a new program security enhancement setting introduced in VC 2008. It causes compiled binary to change everytime. Switching this setting off makes problem gone.

If your solution is big and you don’t need this level of security, switch it off for all your new projects.

Written by Ying

14/10/2011 at 10:33

Posted in C++, Programming, Technology

Tagged with , , ,

Sutter’s another great C++ talk

leave a comment »

“Writing modern C++ code: how C++ has evolved over the years”

Written by Ying

07/10/2011 at 22:08

Posted in C++, Programming, Technology

Tagged with