Archive for the ‘Uncategorized’ Category

Hello world!

Posted: October 15, 2010 in Uncategorized

Welcome to This is your first post. Edit or delete it and start blogging!


blog from xperia

Posted: June 19, 2009 in Uncategorized
a little test blog from my mobile.

the ui leaves room for imptovement..

When did I create you?

Posted: February 17, 2009 in Uncategorized

I thought I would add some file aging capabilities to a logger class as an lower bound guarantee. I thought it would be nice to use the creation time of a file to keep track, bad idea, this is why.

It had to be platform agnostic so I set about trying to implement it in Windows first. I wrote all the code and ran the unit test. To my amazement sometimes the unit test failed some times it worked. Actually most of the time it failed. I started debugging it and found to my surprise that the creation date of the file somehow carried forward when a fast delete/create of a file at the same location with the same name was done. I swiftly turned to the MSDN doc and read it more closely for CreateFile and what would you know, it is a documented feature. A small line among a few hundred, not very precise either.

“If you rename or delete a file and then restore it shortly afterward, the system searches the cache for file information to restore. Cached information includes its short/long name pair and creation time.”

How odd? Who came up with that idea. Well that someone even came up with a name is called File System Tunneling

Once again the reason is backward compatibility, to MS-DOS!

“The idea is to mimic the behavior MS-DOS programs expect when they use the safe save method. They copy the modified data to a temporary file, delete the original and rename the temporary to the original. This should seem to be the original file when complete. Windows performs tunneling on both FAT and NTFS file systems to ensure long/short file names are retained when 16-bit applications perform this safe save operation”

All you people complaining that Vista breaks things, you should instead rejoice and be happy that we are finally getting rid of more and more legacy idiocies such as this (although this is still in Vista and Windows 7).

Either way, I ended up setting the creation time upon creation of a file. Finally done I thought.

Well things get even worse in unix. Unix file systems generally don’t track creation times. You could fake it through the i-node time stamp (through fsdb) however if a new i-node is created for whatever reason the time stamp will be updated. Not very reliable. FreeBSD apparently tracks it as birth time, all in all, as so very often in the unix land, it is a mess and no real set standard.

I played around in a few different distros to try to figure out a solution, but found none. So.. if anyone happen to read this and know what to do feel free to share.

For now I will have to resort to the very tacky thing of reading the date from the first log row in the file and cache that… Not really a performance problem as this is part of a syslog service that is running all the time, so generally it will only be needed upon restart.

Since I mentioned tine Windows 7 engineering blog in my last post I want to continue on that topic just a little bit longer. For those really interested in what happens inside many of the Microsoft’s products have a look at Channel 9

Especially hot right now for developer is this

Also the entire PDC can be viewed here:

A Microsoft not many have seen

Posted: February 6, 2009 in Uncategorized

The other day spotify blessed this world and today I witnessed a “new” Microsoft. A Microsoft that finally gets into the fray and combats the blogosphere, handling feedback and giving facts.

It all started a few months ago when the Windows 7 engineering blog was started. I was very excited about that announcement and what it promised to deliver. An inside view (at least as close as you can get) on the engineering process and thoughts behind the design decisions in Windows 7. It has been a very good read so far and I wish a lot more people would read it. Especially many out there in the blogosphere in the hopes that it would get many debates back to talking about facts and being constructive instead of religious bickering.

In the last few days a heated discussion started to form about, a weakness if you will, in the UAC system in windows 7. People realized that it was possible to change the UAC level without being elevated. A lot of people pointed this out and Microsoft response was somewhat peculiar as it took a defensive position, a high horse approach, this is not a bug. That was what it felt like and everyone was thinking, they are missing the point (again). Today all of us were proven wrong

I know not one man changes the face of a company, but Steven Sinofsky is doing an excellent job in the communication department I hope this is what we can expect from Microsoft for all products in the future. We technical people need all the help we can get to communicate clearly, I know for sure I do =)

Let’s hope they don’t get hubris (like a few years ago) and instead stays true to this new open path.

Spotify – a better world!

Posted: January 26, 2009 in Uncategorized

Sometimes the world surprises you, sometimes it is one of those moments when the world takes a slight step forward towards a better place. Today was such a day when I was introduced to Spotify (not to mention the iTunes drops DRM!)

An online music service with an already vast directory of online music(even if the service is just months old), with many of the worlds’ artists. Some notable artists have decided to opt out of this unfortunately, but I am sure they will come around when they realize the potential this has.

The basic service is free and commercialized. A subscription costs a mere 99kr per month. That’s less than one CD a month! But it is also a good trick to get me to buy at least 8 CDs a year. More than I do now (not by much but still) which is wherein the trick lies, many small expenses are an evil way to increase people’s spending as it creeps in, but in this case I applaud it!

On the upside I get to chose exactly what to listen to and find new genres to appreciate. Now if they would only add the ability to donate to the artists right from the app too!

Hopefully this will be a start of the end of DRM which sucks valuable money (not counting the valuable processor cycles on my computer..) out of the hands of the ones that should get them. The performers.

What would you know, it was founded in Sweden too!

Now if it would only come to the mobile as well. Will help Ericsson too =) as the capacity increase needed might explode finally and perhaps also push prices of roaming mobile broadband across Europe to a more acceptable level. Oh well one can dream!

Vista unidentified network

Posted: July 10, 2008 in Uncategorized


Anyone that has tried to install a loopback adapter of any sort in Vista have probably hit the firewall profile annoyance. It will set your firewall profile to "Public" whenever it cannot identify a network. That has bugged me for quite awhile (especially if you install the loopback remotely connected to work thus losing your connection because RDP only was open on the domain profile..) but I never got around to be annoyed enough to fix it, I simply turned off the loopback as I wasn’t using it any longer. However today I decided to install VMWare again on my dev box, VMWare have the same problem as it install 2 networks for your benefit, unfortunately it sets your firewall profile to "Public".

Last time I tried to solve this I simply set the default gateway to point to the adapter itself. But I found this to be a poor solution as it adds default routes to my routing table that I don’t want there (especially since I have a multi homed setup at home, so I need those routes and metrics static!), so I ended up disabling the VMNet as I didn’t use it at the time, but now I want to use it so simulate an entire system locally in VMWare, so today I finally dug in a bit and found the gem!

In Ndis you can change the device type to become an end point device. This basically means that the adapter isn’t a connection to a reachable network, Vista will thus not try to discover and manage it.

Add the DWORD key "*NdisDeviceType" with value 1 to

So there you have it! A happy route table and an even happier firewall!