BahnCard 25 besser als BahnCard 50

Bin heute mal wieder über den Fakt gestolpert, dass die BahnCard 25 besser ist als die BahnCard 50 – wenn es um Sparpreise bei der Bahn geht.

Beispiel: Einfache Fahrt von Stuttgart nach Magdeburg mit BahnCard 50: 59,00€

Sparpreis für einfach Fahrt mit BahnCard 50

Gleiche Fahrt mit BahnCard 25: 44,25€

Sparpreis mit BahnCard 25

Das sind immerhin 14,75€ Ersparnis.

Noch krasser wird es, wenn man die Kosten pro Jahr vergleicht (2. Klasse; basierend auf dem Preis von oben):

6 Fahrten/Jahr 8 Fahrten/Jahr 12 Fahrten/Jahr
BC50 (62€/Jahr) 609€ 727€ 963€
BC25 (255€/Jahr) 327,50€ 416€ 593€
Ersparnis 281,50€ (~ 46%) 311€ (~ 43%) 370€ (~ 38%)

Ich denke, diese Zahlen sprechen für sich.

Spaß mit C

Was macht diese Codezeile (sz ist ein TCHAR*)?

_tcsrchr(sz, '\\')[1] = '\0';

C ist einfach toll

Dann begannen Dennis und Brian an einer wirklich verzerrten Version von Pascal zu arbeiten, genannt ‘A’. Als wir merkten, daß andere tatsächlich vorhatten, Programme mit ‘A’ zu entwerfen, fügten wir rasch zusätzliche kryptische Eigenschaften hinzu, und entwickelten daraufhin B, BCPL und schließlich C. Wir hörten auf, als es uns gelang, den Ausdruck

for(;P("\\n"),R--;P("|"))for(e=C;e--;P("_"+(*u++/8)%2))P("| "+(*u/4)%2);

fehlerfrei zu kompilieren.


Switch Azure Development Storage to SQL Server Express – Step by Step


While developing for Windows Azure, I recently got lots of StorageExceptions reading “(500) Internal Server Error.”.

After some googling I found an article that says I should switch to SQL Server Express. So far, so good. But how do I do this?

  1. Download SQL Server Express. (If you’re using Visual Studio, chances are that you’ve already installed SQL Server Express.) You may also want to down SQL Server Management Studio (same download link).
  2. Make sure SQL Server is running. Go to All Programs -> Microsoft SQL Server 2012 -> Configuration Tools -> SQL Server Configuration Manager. Under SQL Server Services make sure SQL Server (SQLEXPRESS) is running. (Otherwise start it by right-clicking on it and clicking on Start.)
  3. (Optional) Open SQL Server Management Studio.

    • In Connect to Server under Server Name click on the dropdown button and choose <Browse for more...>. You can then select your local SQL server instance. It should by named like COMPUTERNAME\SQLEXPRESS. (For Authentication keep Windows Authentication.)
    • Under Databases later something like DevelopmentStorageDb22 will appear, once we switched the development storage to SQL Sever.
  4. Open All Programs -> Windows Azure SDK, right-click on Windows Azure Storage command line and choose Run as administrator.

That’s it.

Update: The Azure Development Table Storage’s size seems to be limited to 4 GB (even though since SQL Server Express 2012 it should be 10 GB). You can see the size of your database (or of the PRIMARY file group, to be more precise) in the database properties in SQL Server Configuration Manager:


As you can see in the image, my database is already full. (Initially the size is about 3 MB.) Once you get there, you’ll see error messages like these in your Development Storage logs:

Could not allocate space for object ‘dbo.TableRow’.’PK_dbo.TableRow’ in database ‘DevelopmentStorageDb22′ because the ‘PRIMARY’ filegroup is full. Create disk space by deleting unneeded files, dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.

To “fix” this problem, you can only delete the database or delete Table Storage tables to decrease the database’s size.

Switching OpenID providers through delegation


Back in the days, when I decided to join StackOverflow, I was forced to create an OpenID – because this is the way to login on StackOverflow.

I decided to use an independent OpenID provider, called myOpenID. I also set up OpenID delegation. This way I could use my own domain name as my OpenID. (OpenID uses URLs as user names, like

Now, myOpenID is shutting down on Feburary 1, 2014. Thus, I had to switch my OpenID provider.

Fortunately, OpenID delegation makes this easy – you just replace the two delegation <link> tags and you’re done.

Unfortunately, not all OpenID providers seem to support this. I tried Google (which should work according to this), but StackOverflow always wanted to create a new account for me. (May also be StackOverflow’s fault, I don’t know.)

Fortunately, StackOverflow provides its own OpenID service:

So I created a new OpenID there, replaced the <link> tags (details), done. Works like a charm.

Windows Performance Counter Types


There are several types of performance counters in Windows. However, I had a hard time of understanding all these types just from their documentation. So I decided to compile some examples for each counter type.

I also wrote some C# code to demonstrate how to use performance counters. You’ll find it at the end of this article.

Read more →