Mobile earthquake screensaver for your Sony-Ericsson

June 2nd, 2008

Inspired by the recent earthquake on Iceland measuring 6.1 on Richters Scale (and possibly the 7.9′er in Kina) I decided to create my own earthquake screensaver for my Sony Ericsson 810i.

For those of you interessted in seismic activity in and around Norway feel free to download the source or binaries here.



- Petter

Sodoko, sodoku, suduko, sudoku!

May 1st, 2008

Like any other serious website now has its own Sudoku! Wee! Just click a ’square’ and enter a number.
Read the rest of this entry »

Protected: Schnapps & Schnee 2009

April 27th, 2008

This post is password protected. To view it please enter your password below:

Avoid those unnecessary for-loops…

April 4th, 2008

One thing that makes my - and others - code look ugly are all those for-loops repeatedly embedded into the code.

A typical example ias converting a string of comma seperated numbers into an array of integers. Here’s how to do it in one statement, without any loop:

Dim str As String = "1,2,3,4,5"
Dim ints As Integer() = Array.ConvertAll(Of String, Integer)(str.Split(","), _
    AddressOf Convert.ToInt32)
- petter

How can I access a protected member from a derived class?

April 1st, 2008

First I encountered the error message:

Compiler Error CS1540: Cannot access protected member 'member' via a qualifier
of type 'type1'; the qualifier must be of type 'type2' (or derived from it).

Then I encountered Eric Lipperts explanation of Why Can’t I Access A Protected Member From A Derived Class?

Then I got angry. Read the rest of this entry »

Canine anti-piracy… anti-bug unit…

March 4th, 2008

If they can find pirated DVDs, then it’s just a matter of time before they can sniff up buggy, copy&paste code…

- petter

Software development

March 1st, 2008

Here’s a beatuful illustration of how software development works. It may seem like a joke, but it’s actually quite accurate.


- petter

A Generic C# 3.0 Collection Initialization Adapter

February 29th, 2008

C# 3.0 comes with this new language feature called Collection Initializaton. It’s more or less syntactical sugar that simplifies the way you initialize collections.

Where you pre 3.0 would initialize a list of integers like this:

List<int> list = new List<int>();

You now can do this:

List<int> list = new List<int>() {1, 2, 3};

Now, this is somewhat beautified, but it does exactly the same as in the first example. The compiler parses the code and calls the Add method, implemented by List<int>, once for every integer in the initialization list.

Now, wouldn’t this be nice to do on your own proprietary collections? Read the rest of this entry »

in·con·sis·tent IIII

February 29th, 2008

When it comes to Visual Studio installation folders, why is it that Microsoft don’t just settle for one naming convention?

Here it seems that thy’re not sure what their product is named. Sometimes is .NET, sometimes not. Sometimes by year, sometimes by version (with or without the decimal):

Microsoft Visual Studio .NET 2003
Microsoft Visual Studio 8
Microsoft Visual Studio 9.0

At times they find capitalized words totally unnecessary:

microsoft frontpage

And sometimes a space, sometimes not:

Microsoft ASP.NET

- petter

Powered by WordPress. Entries (RSS) and Comments (RSS).