Hello world!

Posted: October 15, 2010 in Uncategorized

Welcome to WordPress.com. 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!

Non booting windows

Posted: December 14, 2008 in Computer and Internet


If you happen to have to restore a windows machine that isn’t booting any longer (god forbid!) these tools can come in handy



As well if you are managing a center of public computers this might be useful


Have fun restoring!

IE8 accelerators

Posted: October 5, 2008 in Computer and Internet


So IE8 has been out for awhile up to beta 2. Working quite nicely, still a bit sluggish at times, but at other times on par with for instance opera. I am happy to see that more and more pages render properly in the default mode in IE8 (which is standard sort of compliant). This will be a great benefit to all web page contributors out there that IE finally follows standards.

Anyhow I thought I would spread the word about accelerator in IE8, they are pretty cool and their use seems unlimited. It is an “open” standard such as that the XSD definition is open and IE8 allows you to plug in custom accelerators easily. It is all very simple, all you have to do is fill out the OpenService Accelerator Schema, more information can be found here Accelerators Development Guide.

I decided to put this to use as I have always wanted a quick way to search our internal wiki for keywords

   1: <?xml version="1.0" encoding="UTF-8"?>
   2: <os:openServiceDescription
   3:     xmlns:os="http://www.microsoft.com/schemas/openservicedescription/1.0">
   4:     <os:homepageUrl>http://merlin:8080/</os:homepageUrl>
   5:     <os:display>
   6:         <os:name>Search Consat Wiki</os:name>
   7:         <os:description>Search the Consat Confluence Wiki.</os:description>
   8:     </os:display>
   9:     <os:activity category="Consat">
  10:         <os:activityAction context="selection">
  11:           <os:preview action="http://merlin:8080/confluence/dosearchsite.action?where=conf_all&amp;queryString={selection}" />
  12:           <os:execute method="get"
  13:             action="http://merlin:8080/confluence/dosearchsite.action?where=conf_all&amp;queryString={selection}" />
  14:         </os:activityAction>
  15:     </os:activity>
  16: </os:openServiceDescription>

The only problem I had was that my IE8 just didn’t want to have anything to do with a & in the “action”, so beware you need to encode it as &amp;, perhaps obvious, but the error message I had was not obvious to me at the moment it happened.

Then all you have to do is host this XML file somewhere and give the user a possibility to install it easily, like so:

   1: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
   2: <html>
   3:     <head>
   4:         <title>Confluence IE8 Accelerator</title>
   5:         <script>
   6:             window.onload = function() {
   7:                 if (window.external.IsServiceInstalled('http://merlin/apps/wikisearch/confluence_accelerator.xml','Consat')) {
   8:                     document.getElementById('myButton').disabled = true;
   9:                 }
  10:             }
  11:     </script>
  12:     </head>
  13:     <body>
  14:        <button id="myButton" onclick="window.external.AddService('http://merlin/apps/wikisearch/confluence_accelerator.xml')">
  15:           Add IE8 Confluence accelerator
  16:        </button>
  17:     </body>
  18: </html>

You can now easily search for Göteborgs bussar


Now I just have to figure out how to get confluence to send back a better formatted preview page!

Amazingly easy and very cool

Google Chrome Web Browser

Posted: September 3, 2008 in Computer and Internet

I have been using it for a few hours now and it runs smoothly, although IE8 Beta 2 is running equally smoothly I must say. Chrome has "stolen" the IE8 interface where they try to make it as sleek as possible. I think they have done a better job as the search is integrated into the address bar nicely.

I had plentiful problems to get Visual Studio 2005 to work with the new Windows 2008 Server SDK that is needed to build the chromium browser, but I finally got that sorted out and it is now plunching away building occupying all my 4 cores as I type this.

The source code weighs in at a hefty 430MB with the SVN folders and encompasses 17000 folders with 110k files. SVN does a really decent job of updating the source tree as a fully sync take just about 30s on my machine and internet connection.

To read about how to get hacking on chrome take a look here

Now my friend Mattias Bergander managed to crash the entire browser not just a tab when browsing google analytics. My goal is to reproduce this and find the bug!


Had plentiful of problem to get the new SDK to integrate with Visual Studio 2008 SP1 and Visual Studio 2005 SP1. Apprently there is a bug in the 2008 SP1 that "corrupts" a few registry keys with version numbers the Windows SDK configuration tool cannot handle. Read about it here

After fixing those keys the tools still crashes on me, so I found this thread where they introduce an undocumented option like so:

WindowsSdkVer.exe  -version:v6.1 -legacy

And finally it integrates automatically without me having to do it manually, although I think it would have been faster for me to just do that as this took a good 30min.. Use your Windows update for some good please. if this has been discovered fix it or handle me the sources to the WindowsSdkVer programs so I can figure out why it is crashing!