About: Jobs

About Jobs

Projects in Visual C++ 2010 – Part 3: Precompiled Headers

In this part of the “Projects in Visual C++ 2010″ mini series another important aspect of C++ programming is explain: precompiled headers. Precompiled headers (or precompiled header files) in many cases significantly reduce the time needed to compile a project.

Here at work I have a C++ project with about 50 .cpp files in it. The project uses the Qt library and all files only include the absolute minimum of header files required. Without precompiled headers, compiling the project takes about 56 seconds. With precompiled headers, the compile time goes down to about 7 seconds. That’s eight times faster.

Related Articles:

Projects in Visual C++ 2010 – Part 2: Project Dependencies

This article is the second part of the subprojects mini series. The first part was about creating a DLL project. This part will show how to use a DLL library project in another project.

Referencing a library in C++ (or, more specific, with Visual C++) is somewhat cumbersome – or should I say, used to be somewhat cumbersome. Fortunately, with the release of Visual C++ 2010 this has been greatly simplified. This article first shows the old way and then describes the new (simple) way.

Related Articles:

Projects in Visual C++ 2010 – Part 1: Creating a DLL project

When you write software, you often/sometimes divide your project into several subprojects. This mini series describes how to do this with Visual C++ 2010 (but this first part also applies to earlier versions). We start with creating a library project in form of a DLL.

Related articles:

3.November 2011

Muhaha

iPad 2 Karton
31.Oktober 2011

Exploits of a mom

Exploits of a Mom
12.Oktober 2011

X11

X11-Zufriedensheitsgraph

(via xkcd.com)

11.Oktober 2011

Bundestrojaner 4 Mac


Nach intensiven Protesten durch verärgerte Apple-Nutzer ist der Bundestrojaner ab demnächst endlich auch für Mac-Computer verfügbar. Der Bundestrojanerbeauftragte beteuerte, die App bereits zur Prüfung an den Appstore übermittelt zu haben. Dort werde überprüft, ob ggf. Urheberrechte verletzt würden oder unzulässige Worte wie “Fuck”, “Bitch” oder “Android” im Quelltext der Anwendung vorkämen.

Sehr lustig. Hier der vollständige Text.

28.September 2011

Das coolste iPhone-Dock

Haha :D

Das coolste iPhone-Dock

(via ApfelBlog)

5.September 2011

WordPress vs. Drupal vs. Joomla

2011 05 Sep

Nicht unbedingt 100% representativ, aber dennoch mal interessant.

WordPress vs. Drupal vs. Joomla Comparsion Chart

(via)

2.September 2011

500 x I will not throw paper airplanes in class

I will not throw paper airplane in class written 500 times by C

(via FoxTrot)

29.August 2011

The future accordings to films

Here’s how the future definitely will look like. ;)

future-accordings-to-films.jpg

Thanks to Tremulant Design for this.

9.August 2011

Steve Ballmer in “The Matrix”

Einfach nur herrlich :D

YouTube Preview Image

Triggering a build when file changed in Visual Studio

In Visual Studio when a source code file is changed, the project it belongs to will be built when the whole solution is being built. So far, so good. But what happens if you want some other files (read: non source code files) to have the same behavior?

In my case, I had some translation files (XML files), and a custom build event that converted them into a binary representation. So when one of translation files changed, I wanted this change to trigger a build for the project the translation files were contained in, so that they could be converted into binary form (ie. so that the build event was executed).

Visual Studio (at least version 2010) provides an easy but hidden way to achieve exactly this. After you’ve added the file(s) to your project, right-click them and choose Properties (Alt+Return).

The Properties menu item

Note: You need to open the properties for the files you want to trigger the build – don’t open the project’s properties. Also, you need to open the “Properties” dialog. You can’t do this from the “Properties” panel (which usually opens up when hitting F4).

Note 2: You can have selected multiple files to make them all triggering a build when changed in one step.

In the “Properties” dialog under Configuration Properties –> General –> Item Type you select Custom Build Tool. Then you hit “OK”. And that’s it.

Selecting "Custom Build Tool" as "Item Type".

Changing the file(s) should now trigger a build when you build the solution (via menu Build –> Build Solution).

8.August 2011

Removing “Bookmarks” button from Firefox bookmarks toolbar

Ever since I updated from Firefox 3.6 to 4.0 (and now 5.0) I had an additional item called “Bookmarks” in my Bookmarks toolbar. For me, it was (and is) unnecessary because I have all my bookmarks on my toolbar (and none of them in the actual Bookmarks menu). So, I was looking for a way to get rid of this button. I did some searching on the Internet but found nothing. So, I just tried to ignore this button.

Bookmarks button on the bookmarks toolbar in Firefox

Today, however, I stumbled over a way to remove this button. Just right-click on an empty space on the toolbar containing the address bar (not on the bookmarks toolbar). A menu will pop up and there you choose Customize.

Customizing Firefox' toolbar

This will allow you to add and/or remove toolbar buttons to Firefox’ main toolbar. Strangely, a new “Bookmarks” button will appear – usually on the right side.

Bookmarks button appeared in Firefox' main toolbar

This is the “Bookmarks” button that is displayed in your Bookmarks toolbar. Remove it (drag it away from the toolbar), close the “Customize” dialog, and the “Bookmarks” button will be gone.

Note: There are actually two bookmark buttons available in Firefox. One with a pulldown arrow to its right and one without. Only the one with the pulldown arrow will be moved to the bookmarks toolbar.