Silverlight 3 released

by Bjørn Storkholm 10. July 2009 12:46

Yesterday Microsoft released Silverlight v3. Trying to install the new version I had a few sad findings. First of all, Silverlight v3 is not supported on Windows 7 with IE 8. I sure couldn't install it, and figured it might be because Win7 is still in Beta or the fact, that I'm running the 64 bit version of the OS. But check their system requirements:

While trying to figure out what was going on, I tried to see what would happen if I ran the 64 bit version of IE8, and discovered that silverlight does not support the 64 bit version at all. But ok... Adobe flash doesn't support the 64 bit version either.

I think, that it's weird.

LinQ and PocketOutlook

by Bjørn Storkholm 2. July 2009 13:22

I started writing a small application, which can handle objects in Pocket Outlook Object Model (POOM) items, aka Appointments, Contacts etc.

Writing a simple LinQ query to select my appointments, with a specific subject:

IEnumerable<Appointment> filteredAppointments = from appointment in appointments

                    where appointment.Subject == "Cornelius 2001"

                    select appointment;

 

 I was astonished to find, that this gives a compilation error, with a description saying “Could not find an implementation of the query pattern for source type”. Since I previously did a lot of work with POOM, I’m not that surprised with the fact, that there are always surprises.

Search Google for 5 minutes gave the solution. Explicitly specify the type of the object you want to select:

IEnumerable<Appointment> filteredAppointments = from Appointment appointment in appointments

                    where appointment.Subject == "Cornelius 2001"

                    select appointment;

Authentication failed after restoring database

by Bjørn Storkholm 29. June 2009 19:25

The last year or so, I’ve had a problem just about every time, I’ve restored a database that was backed up from another server.  After every restore, the applications I’ve been working with, throws an exception with authentications errors. The last project I worked on, we could solve this by deleting the user from the DB and add again.  A pretty weird solution, but it worked. But today I ran into the same problem, on another application, where I wasn’t able to delete the user for some reasons. So what to do? It would be nice to find the right solution to this topic, and not just the workaround I’ve been using previously.

The last few months I’ve had the pleasure of working with Erik Ejlskov, who knows a lot about MSSQL Server, so why not just ask him? As usual he was just about, to send a mail to everybody in the office with a solution to this.

If you get the failing authentication, after restoring a database, run the following sproc:

EXEC sp_change_users_login 'Update_One', '[username]', '[username]';

 I wonder what Update_One means, maybe Erik can give an answer to that tomorrow. Anyway it works, and I wish that I'd known this before, since it's really been bugging me.

Competition

by Bjørn Storkholm 28. June 2009 17:30

Who can show the worst code ? Recently I ran into something like this:

        public string[] GetSomeVeryStupidArray()
        {   
            Dictionary<string, string> customers = GetCustomers();
            string[] list = new string[customers.Count];
           
            list[0] = customers[Constants.FirstConstant];
            list[1] = customers[Constants.SecondConstant];
            list[2] = customers[Constants.ThirdConstant];
           
            return list;
        }

        private Dictionary<string, string> GetCustomers()
        {
            string[] customers = new string[]
            {
                Constants.FirstConstant,
                Constants.SecondConstant,
                Constants.ThirdConstant
            };

            Dictionary<string, string> values = new Dictionary<string, string>();
           
            foreach (string name in customers)
            {
                values.Add(name, name);
            }

            return values;
        }

        internal class Constants
        {
            internal const string FirstConstant = "FirstConstant";
            internal const string SecondConstant = "SecondConstant";
            internal const string ThirdConstant = "ThirdConstant";
        }

Obviously I rewrote this a bit, so I don't offend the person who accually wrote it, but what the f*** is going on ??? I found code similiar to this, in accual production code. The worst part is, that I saw, that some other developer has been copy pasting these methods into new areas of the application we're working on, without even thinking about, what it is he's pasting.... Only two days left...

Ubuntu

by Bjørn Storkholm 20. June 2009 14:46

About a year ago, I saw some quite awesome videos on youtube, demonstrating how cool Ubuntu is. Looks really really COOL.

I thought I ought to give it a shot, but apparently I'm not a very lucky man. Last year I tried to install Ubuntu 8 on my Lenovo T61P... damn display drivers not supported. Spent quite a while googling, and the only thing I found was, that others with the same laptop had the same issue.

Recently Ubuntu 9 was released, and I thought to give it another shot. This time I'd install it on my MacBook Air.... IO device error on reboot after installation.... that sucks!

Installing Windows7 on it again, since I know it works!

Update 20090622:  Somebody at the office asked me, if I really do waste time on stuff like this. The answer is yes, I waste a lot of time, on a lot of ridiculous things. The youtube video, that really kicked of my curiosity on ubuntu can be found here: Vista vs. Ubuntu

Reinstalling windows mobile

by Bjørn Storkholm 9. May 2009 12:21

Since I got my first windows mobile device, I've been hating the license rules for the OS. Some years ago, I bought a danish QTek S200. Since I live in Denmark, it came with a danish OS.... I always hated danish operating systems.

I want to get the OS in english and install that (I'd even pay for it). Now that appeared to be a struggle. The danish OS had a higher version number than the english. The installer refused to do a "downgrade" to a lower version number. This appeared to me to be a way for HTC (QTEK), to prevent doing changes they wouldn't allow.

Those learnings is about 4 or 5 devices ago, and is still an issue to me. Whenever I get a new device, I prefer to buy a Danish one, since we have the special danish characters on the hardware keyboard (my current device is Touch Pro), but I don't want that crappy danish OS.

Beeing a little bit of a stubborn geek of nature, I needed to find out something about this. The keyword is Hard SPL. If you need to flash a device, with an OS that the vendor doesn't like, start googling for Hard SPL.

Windows 7 RC

by Bjørn Storkholm 9. May 2009 10:29

Just reinstalled my primary laptop with Windows 7 RC. To try out something new I decided to install the 64 bit version. The installation worked pretty smooth. About an hour after I started the install, I had a running laptop. No drivers needed or any stuff like that.

So far I only discovered two issues running the Windows 7 64 bit version. Cisco discontinued developing ther VPN client for 64 bit operating systems. Apparently they build a new client called "Cisco AnyConnect". The only bitch about this is, that you have to be a registered user to download the software. I never understood that thing with Cisco - a little bit of googling and you have the client.

Daemon tools cannot be installed yet, I hope Daemon up them selves for RTM - they seem really ignorant saying "we don't support beta os's" (Bastards). This especially annoys me, because all of the downloads from MSDN is provided as an iso. At least they can be unpacked with winrar, wich basically wants me to forget that Daemon tools exists.

The conclusion of my freshly installed RC as a primary machine is: Cool. The more I start using Windows 7, the more impressed I get. Microsoft has really done a great job on this one.

Installing windows 7 rc1 on a MacBook Air

by Bjørn Storkholm 2. May 2009 14:19

A couble of days ago, Windows 7 RC1 was released on MSDN. Since I was pretty amazed by Build 7000, I couldn't wait installing the RC1. Since I'm pretty much depending on my laptop being functional these days, I can't reinstall on the primary just yet. So I decided to try an upgrade from Build 7000. This does not seem to be possible, during the install it claims not to be able to upgrade the current operating system.

Since I really want to checkout the RC1, I decided to try to install it on my MacBook Air. I did not expect this to be without problems, but accually it went quite smooth, but with a few issues.

I have not yet found the golden solution to the issues, but I did a few workarounds, to accually beeing able to use the computer.

First thing I did after installing, was as usual to enroll the macbook into my domain. After a reboot I couldn't login. This is a funny thing about the MacBook Air. Apple got some idea on this machine, to spare away a few buttons. One of them is the delete button. One way to hit delete is to hit fn + backspace. This doesn't work with my new windows 7 installation. On the logon screen you can choose "Ease of access". One thing is to have an onscreen keyboard, wich gives you the delete button. What an irritating thing, but at least I can logon now.

When I got pass the logon screen I noticed, that the keyboard is accually very much fucked up. Buttons doesn't give you the expected keystrokes, when using some special characters. For example "$" is replaced with "<", "\" is hit byt "alt" + $ ... this is quite annoying, but I find it as a result of running a Microsoft operating system on a Mac. It wasn't that gr8 under XP either.  Maybe I'll find a solution for this some day.

When I first got my MacBook Air, it took me tons of time, to figure out, that right mouse click is two fingers on the touch pad, this doesn't work anymore. I hope that the issues regarding the keyboard and touchpad is, because Bootcamp isn't updated to support win7 yet.

Next finding was, that the sound doesn't work. Googling a bit I found the drivers for the soundcard. I can't provide a link for the drivers, but if you google for "Vista_R221.zip" you can find drivers for the realtek sound card, that works.

Daemon tools still doesn't work, but that's because they ignore the fact, that windows 7 is way further than an early beta.

Conclusion of this installation is, that Windows 7 RC1 seems even better than build 7000, but if you run it on a macbook air, you asked for trouble.... can't wait till next week-end, where I hopefully will have the time to install it on my Lenovo.

Update 20090715: Hahaha... the solution to my keyboard issues was so simple, that i totally looked in the wrong place. When trying to install Bootcamp under windows 7, I got some unkown error. This made me look towards googling, and was trying all kinda suff with Bootcamp update for Vista and blablabla.... Since I don't use the MacBook Air very much, I left it with these small issues, and decided to live with them for now.

But since it's vacation time, I got some spare time to deal, with these small things that bugs me. I realised, that the real issue was, that I couldn't install Bootcamp at all. Trying to run an update for Vista showed quite useless, since it is an update, and the initial Bootcamp never got in.

On the OsX disc 1 there's a library with bootcamp -> drivers -> apple. Run the AppleKeyboardInstaller.exe and AppleMultiTouchTrackPadInstaller.exe, and everything is solved. No issues left at all, just a smooth MacBook Air running Windows 7 RC without any problems.

Strange TFS requirements

by Bjørn Storkholm 27. April 2009 18:37

What the f....Sometimes I receive some strange error messages from TFS. This error occurs once in a while, I wonder why TFS requires Messenger to be runnning? I'll connect to TFS anyway, after clicking OK.

Tags:

TFS | Weird stuff

Tracking code changes with TFS

by Bjørn Storkholm 21. April 2009 12:19

Working at Microsoft we had a checkin policy, that you can't checkin without associating the changeset with a work item. Never really occured to me, why we had to do this, but it seemed like a good practice.

 On the last two projects I worked on, that involved Team Foundation Server as version control, the customer has been using other software for bug tracking. Because of that, we haven't used workitems, and it seems like there's no point in associating changesets to workitems.

That was a wrong assumption. After I completed the first task on the project I'm currently working on I discovered, that it is a requirement that we create a document, describing every change that's been done to the code. The document is meant for code review, so it's a fairly good idea. But - when I had to track down every change done in the repository for 14 days of work, and 20 other developers made checkins, it showed to be a bit of a task to track down my changes (and boring as well).

On the next task, we decided to create a workitem. Not that it'll be used by anybody else. But we decided to create it, and agreed to associate every checkin with the workitem, so that it'll be a piece of cake to list the changesets regarding this task.

Now this seems like a pretty good solution to me. This way we can always track down every change done, regarding this task. But is it without problems? I don't think so. First of all, it requires some discipline from the developers to do the association. I've seen too many developers who doesn't even bother to write a comment, when they checkin. Another problem on the current project is, that there hasn't been awareness of the details in the code review document, until everybody completed a task which typically lasted 2-4 weeks. So what can you do, when it's too late ?

The best solution I found so far, to track down your own changes is to install the "Team Foundation Server Power Tools" which can be found here: TFS powertools .

You'll get lots of small extra stuff in you're team explorer. One thing is, that you'll get a node in the treeview displaying your team members. On the team members node you can get a list of every changeset that's been done by a specific developer, hence help you do the code review.

Big brother? Maybe, but very helpfull.

Update 20090424: Erik Ejlskov told me about a tool for doing extended searches in the repository called "Team Foundation Sidekicks". Pretty cool 3rd party tool, can be downloaded here: Team Foundation Sidekicks

Tags:

dotNet | Microsoft | TFS

Powered by McDonalds

About Bjørn

Bjørn StorkholmBjørn Storkholm has been working in the IT industry since the mid 90es, with a primary focus on Microsoft technologies. Started developing on the dotNet platform in 2001, when it was in it's early beta stages.

About the blog

This is a place where I can discover my own findings, after they have slipped my memory. But maybe others can find some usefull stuff here as well.

The blog is powered by BlogEngine