Friday, July 27, 2007

Tour de Farce

I have been into cycling since about 1995. I caught my first Tour on the T.V. around that time. I was captivated, awesome scenery coupled with the drama of the tour made for awesome T.V. I guess I was a little naive and really didn't know the dark under current that was perversive in the sport.

I watched year after year from then on. I loved Jan Ulrich's tour win taking the title of his team leader Barne Riis who was the defending champion. Richard Virenque winning 5 or 6 King of the Mountains in a row. Little Marco Pantani defying the odds with his awesome come back victory. Unfortunately, they were all caught cheating (well Ullrich "retired" before he could be found guilty but was implicated in a drug ring) the very sport they were supposed to love.

Then came Lance Armstrong and all was good with the world again. Even he, the most tested athlete in history, was tainted by the drugs. I firmly believe he was clean, but I'm an optimist. I want to believe.

After the on going fiasco with last years tour, it had to be squeaky clean this year. In every sense of the word. It was looking good. We had the drama of Vinokorov falling and then his heroic time trail victory and stage victory in the Pyrenees. Last year was almost forgotten. And then the bombshell. Vino and his team were thrown off the tour and he was found guilty of blood doping. Then today Rasmussen who was leading, was thrown off the tour for irregularities in off season dope testing. These two incidents are another slap in the face, in a long line of slaps in the face.

It's not the other riders, or the sponsors, or even the organizers of the tour that are hurt most. It's you and me, the cycling fan. The guys who will never make a bean from cycling, but race and train in the rain and the wind and the incessant attacks from Magpies in the Spring. All for the love of the sport. The drug cheats are killing it for everyone and have to be stopped.

What can we do?

We can hit the cheats were it hurts. In the pocket. We're the guys who buy the bikes and the wheels and the group sets and the team shirts, and show up to watch the pro's. There would be no pro cycling without us. So lets all make a stand. Let us agree, as cycling fans, to boycott the sponsors and teams of drug cheats. Lets not fuel the vicious circle any longer. We owe it to ourselves...

Sunday, July 22, 2007

Old Code

As I have posted previously, I am modifying some old Delphi code I maintain. It is usually a yearly thing. The client has some requests I procrastinate and do it at the 11th hour. I am not a procrastinator as a rule, but going back to Delphi from C# is very very painful, and something I don't like doing.

Looking through my old code is painful too. Most of the stuff I did between 5 and 7 years ago. I thought I was good in those days, but well I wasn't as good as I thought that is for sure. It seems looking back, that I didn't fully grasp OO. Also I seem to put code in utility type files - just source code files with procedures and functions that don't tie in together. I see now that most of the code should have been wrapped up in classes but for some reason I didn't.

Would have made my life a lot easier now that is for sure.

It's a worthwhile and humbling experience to go through some old code. It makes you realise that there is always room for improvement and learning. I bet in 5 years the code you did yesterday that you thought was awesome will look just as bad 5 year old code does today.

A little reminder that taking a step back from your code and thinking about what you are doing is always a good thing...

ModelMaker Explorer

Recently, I have been coding in Delphi again. I have to take some code (mine) and refactor. In standard Delphi it's not a pleasure. I am using D7 which is getting a little old now, but I prefer it over 2006 which I also own.

I purchased ModelMaker Explorer to help out. It comes highly recommended. I bought it for refactoring features, but it has a ton of other useful features too, such as live metrics. I haven't checked out all the features yet, but at 95Euro it is a bargain. I wish I had bought it years ago.

Wednesday, July 04, 2007

If apple designed everything

Link Here

It appears to be in Italian, but you get the idea.

Friday, June 22, 2007

QuickSilver

Hey Windows freaks. Beat this.

In all seriousness if someone did code this for Windows it would rock.

Would have to be in WPF to match the "cool" factor of OSX transitions and visual/animation effects, but it could be done.

Until then you can either be jealous or buy a Mac. Do the latter you won't regret it. Trust Me.

Tuesday, June 19, 2007

Sometimes normalising data is a pain

We've all been there. Inherting some piece of crap Access app that was designed by someone who did a 5 minute polytech class. All the data is stored in one table or replicated in several tables. Above all else it's a nightmare to code against.

Of course databases like this could do with some normalisation. But sometimes, we can go a little too far. I am currently involved with a project to track data through a system and display eta's and other information on several display monitors around the physical location, to give workers a better idea of current state of play, allowing them to make better judgement calls. (can't go into specifics here).

At several locations along the route, there data is retrieved using some equipment. Each piece of equipment has a unique 6 character Id and posts information in real time to my app using tcp/ip sockets, with the 6 digit Id as the reference.

A process then filters this raw data and stores it in the database, with the primary key being the 6 digit char. Ok so far. At several points along the route decisions are made and data is manipulated and stored in another table for use by the seperate display process.

Against this spec, I start coding the system. I am lead developer on this system, but the overall lead (wrote the spec) is also designing the database. At some point he decided to normalise the data a little and move the 6 digit Id into a table of its own with an integer primary key.

This is fine, from a database point of view. It might be possible in the future that the Id field changes (6 digit char one) but not very likely. About as likely as Steve Jobs owning a Zune, likely.

So by normalising the data, my job as a developer has increased. A lot. First of all, my classes need to be rewritten to incorporate a int id field. ( I do this by hand - shoot me ), then my code needs to be rewritten to include joins to this new table . A simple change on the database creates a lot more work.

Some people at this point may argue that the design is at fault, or you shouldn't code against an incomplete db schema. This may be true. However in this system the int id field is meaningless, so I have to access two tables everytime, instead of just checking against the raw data. Ok, we may save a miniscule amount of space on the database server, but really, is it worth the extra effort, especially considering how cheap cycles and space are these days?

Normalisation, is good. But before you do it to the nth degree, it needs to weighed up against the system as a whole. Just because a DBA prefers fully normalised data, doesn't mean it should be done.

Wednesday, June 13, 2007

Safari Buzz (and fud)

There has been a lot reported about Safari 3.0 (beta) being available for Windows today. I have been running it all morning with few issues. However, if you're a Windows head, it seems to be the thing to do to bash Safari.

I think a lot of these people should remember ITS A FRICKEN BETA.

Also, if these people hate Apple so much, why are they so interested in this? I think thoust doth protest too much.

Tuesday, June 12, 2007

And now with Windows flavour

Just finished catching up with the WWDC Keynote address by Steve Jobs. Nothing earth shattering announced unfortunately. Leopard, OS X 10.5 looks very nice though. Makes Vista look a little tried. All features etc can be seen Here

The one interesting thing announced was that Apple have release a new version of Safari, that is also Windows compatible. According to (Apple) benchmarks it is the fastest browser available today. Download it here. If nothing else it makes it easier to test Websites on Windows. Until now the only way to test on all browsers was to have a mac and install Parallels or Boot Camp.

I guess it's a double edged sword. On one hand it makes it easier to make websites Safari compatible for Windows developers. On the other hand it takes away one excuse Windows developers can use for justifying a mac purchase. Not that one is needed, but Windows users are a little slow, lets face it....

Parallels for Mac 3.0 Review

I upgraded my version of Parallels to version 3 as soon it was released on Friday. The major draw card for me was 3D graphics support. I like to play the odd Windows game from time to time, so this is a major(ish) feature.

There are a slew of new features, including the ability to boot a Boot Camp partition within Parallels.

Install was fairly painless. I have a XP parallels image and a Vista boot camp drive. I tried both. I didn't notice any real world difference in my existing XP image to be honest. My Vista boot camp image loaded nicely within Parallels. It has to load some drivers to the OS first and requires a couple of reboots first, but it up and running within 10-15 minutes.

The Vista image running under Parallels had Aero turned off, and I couldn't get it running even with Direct3D support turned on. It run pretty sluggishly too. Quite a bit slower than native boot camp. This is understandable I guess but a little disappointing. I think it is down to memory issues with Vista (my version is Premium or Ultimate or wtf it's called) as much as anything else. My machine is a Macbook Pro @ 2.16Ghz and 2Gb Ram. The image had 1.5Gb ram allocated to it.

My advice would be unless you absolutely need it don't run Vista in Parallels.

XP runs as fast as native under Parallels, in fact, running in full screen it would be impossible to tell it wasn't running native, using real world / seat of pants benchmarking.

3D Gaming
The marketing blurb on the website says, "New! 3D Graphics lets you run today’s most popular PC games on a Mac". This is a little misleading.

I downloaded a demo of Star Wars Lego II and it crashed on the menu screen. There is a list of games on the website, one of which is Quake 4. I downloaded the demo - I also downloaded the native Mac version, but haven't benchmarked yet.

Quake worked fine, but in game fps was hovering around 14-18 on average. I had medium detail turned on, with shadows but no AA, running @ 1082 x 768.

I will benchmark against native Mac version be commenting. I would have thought however that 14-18fps would be quite low however.

Overall, Parallels is great and I recommend it to anyone. Word on the street suggests that something similar may be built into Leopard. Time will tell on that front.

I would hold off on buying or upgrading, until after the WWDC which starts today (11/06/2007) as this info will become more clear then. Also, if you are looking to run the latest PC games, I still think dual booting with Boot Camp is the best way forward.

Friday, May 25, 2007

Life changing gadgets

On the back of Nics blog post about a Scott Hanselman blog post I thought I'd add my 2c, sorry 2p worth.

In no particular order:

  • Macbook Pro

  • I'm a born again Apple addict (as I keep telling anyone who will listen). I was getting thoroughly sick of wasting my time rebuilding Windows PC's after 6 months because of slow down, and generally getting sick of Windows. After 3 months with a Mac, my passion and excitment for computers is back. Every geek should have at least one Mac.

  • Sky+

  • Ok it's hardly bleeding edge and I should get around to getting a "proper" DVR, but being able to record two Sky channels at once, live record, and season link is brilliant.

  • iPod Video

  • Watching webcasts and listening to podcasts while commuting to work is a god send here in Britain. I didn't really understand how great these things were until I got here. I do think people use them to hide behind, so they don't have to talk to strangers on public transport but I guess that's a good thing for those people. They say copying is the greatest form of flatery, then take a look at most other MP3 players and Apple should feel very very flattered indeed.

  • Wireless Internet


  • Not really a gadget but hey it's my list. Life before Wireless broadband sucked. Surfing in a dark, dingy, cold computer room. Now I can surf infront of the box and talk to the missus! Actually the Internet in general is IMHO the single greatest invention in the history of the world. Don't agree? Ok think about your life now. Now take the internet away. Sucks doesn't it. Communication, Information and Entertainment has been changed forever because of the Internet. I was a programmer before the Internet, but can't remember too much about those days. Man it must have been hard getting information. These days a quick Google finds the solution to most issues. Huge productivity gains there I think!

  • Amstrad CPC 464


  • This little machine started it all for me. I got an interest in computers and programming because of that little 8 bit machine. Who knows what I would have been if I hadn't met the Amstrad, but I can genuinely say that my life would be completely different. So the Amstrad must rate as number 1 on my list of life changing gadgets.

Thursday, May 24, 2007

Wednesday, May 23, 2007

Notice to Microsoft - Stop. Stop now.

Silverlight, Linq, Astoria, even .NET 3.0 are all either out or on the horizon.

I want to learn all of them, but with the need to: work, commute, eat, sleep and spend time with the family - there just isn't enough time in the day. So I say to Microsoft, stop now. Let me catch up ;-)

As a born again Mac fan boy I am pretty buzzed about Silverlight 1.1 and all it entails. Hopefully it will give all those devs out there that are bi curious (Mac and PC) an excuse to buy a Mac - testing silverlight apps on Mac!

Technologies like Silverlight and to a lesser extent WPF are creating a paradigm shift in the world of software development. It won't be long before you need a designer and/or user experience person on your team. Hopefully it will mean a richer experience for the user and nicer web sites and apps to use.

And it will allow developers to get back to what they are good at - developing. To often websites are either designed by developers or developed by designers. The end result can be disastrous. I mean you wouldn't get your dentist to remove your appendix?!

New Zealands greatest export

The pilot episode from the FOTC new US TV show is up. Funny.

http://www.hbo.com/conchords/

not sure how it will go down in the States with the dry humour but hope it goes really well.

Wednesday, May 09, 2007

My first play with Oracle

On the current project I am working on, I have been introduced to Oracle. I have never come across it before - usually use SQL Server in various guises.

The installation process was a little harder than SQL Server, as the server we had been supplied had Java locked down on it. Basically the installer wouldn't run as it's a Java app. A boffin managed to find a work around and got it installed.

I guess being multi platform is a good thing - but to me the Java interface looks dated and is a lot slower than a native Windows app. The actual interface itself is a little clunky also. I don't believe it's as intuitive as SQL Server 2005 for example, although I am a lot more familiar with SQL Server.

Once you get up and running though, it's not too dissimilar than SQL Server. I did read an article talking about update-read locking and how Oracle allows users to read data on pending updates. I guess the thought process is that the update may never happen so why lock a process from reading. I guess it's a good feature to have that option. SQL Server just locks the read in that scenario.

From a front-end point of view the two are the same - I use the new .NET 2.0 data factory pattern (System.Data.Common) when connecting to databases anyway, so from that point of view nothing in my code is different for use with Oracle or SQL Server (or mySQL or any other db for that matter).

Anyway, so far no real issues with Oracle. I much prefer SQL Server, but I guess that is more to do with familiarity than any negative aspects of Oracle.

Friday, April 13, 2007

I.T. Interviews

As some of you may know we packed up and left NZ and moved to England about a month ago. I decided to go contracting as it allows greater freedom and more money! There are downsides too of course (discussed on my other Other Blog

Anyway, as such I have been to a few (3) interviews and 2 phone interviews over the last few weeks and thought I would post my views.

The Process
Interviews suck, lets face it, but some suck more than others. It is common these days to vete applicants with an initial phone interview first. This to me is fine and makes sense. I have no problem with phone interviews.

Then it seems it is becoming more and more popular to do an online "skills" test. I think these are a complete waste of time. I (and others) consider myself to be an above average developers, and I have over 10 years experience, in several languages, platforms and more importantly, business areas.

Quite frankly the stupid online tests can hope to test me on my experience. The ones I have done are a multi choice question and answer type thing. All this tests in my opinion is how well you remember semantics outside the IDE. I have pretty much been developing since Intellisense, and have (I admit) become lazy. It doesn't mean I am a bad developer, in fact in my opinon the opposite. I let the tools do the donkey work, while I am concentrating a creating a solution.

I once interviewed for a job at HP. They had the best test I have ever seen. It was a real world scenario to finish an application. It gave the testee the opportunity to really show what they were capable of, and let the testers see some code and see how the person thinks. (I didn't get the job, but was the only person to ever finish the test. Didn't get the job for other reasons than soft dev ability BTW)

I think the HP style test is the only way to go. Test people by all means, but don't make them do stupid little multi choice Q+A tests. They really are wasting everybodys time.

Tips
If you make it to the face to face interview, make sure you have are prepared. Do some research on the internet about the company, and have some questions in your mind to ask them.

I find if you ask questions along the way, it makes you :
a) seem more intested in the company
b) look intuitive and knowledgable
c) seem well prepared

Also, run through in your head some questions they may ask you, and have some answers sorted out. It helps relieve the tension.

Don't put anything on your C.V. you can defend/explain in an Interview. You may have played with Javascript before but don't make it look like yuo are an expert. It will come back to haunt you as most interviewers will ask questions based on you C.V.

Above all enjoy it.

Back

I've been a bit busy of late - move to the UK and was looking for work so haven't been inspired to blog about software development.

I have been busy on my other blog - it includes tips on those looking to move to the UK.

Link Here

Anyway, I will post soon about my thoughts on the interview process...

Wednesday, February 28, 2007

Sometimes technology is fantastic

I am writing this on my new Macbook Pro, using an HTC Apache EVDO phone connected via Bluetooth as the internet connection.

The Apache is a great data device / PDA - not so good as a phone - bit big. The fact you can use it as a modem is good. The fact that you can use it via Bluetooth as a modem is great. The fact that it all works with the Mac is fricken brilliant. I was a bit worried about switching to OSX that things like this wouldn't work (I have been tainted by bad experiences with Linux) but so far so good. OSX has just about every app I use on Windows or an equivalent.

It's a little mind boggling really if you think about how far the technology sector has evolved. The computer industry has been really only around since the mid/late 70's. How many other industries have moved so far in so little time. If the automotive industry for example moved at the same pace, just imagine what sort of vehicles we would have today - certainly wouldn't be tied to fossill fuels for one.

Anyway for today anyway, mark one up for technology actually working and being useful!

Friday, February 23, 2007

New tools from CodeGear

Codegear the new name for the development arm of Borland have announced a couple of new tools:

Delphi 2007
Delphi for PHP

The D2007 release is, from what I can tell, a release of Delphi to that includes Vista support and some refactoring of the Database connection components. I don't do much Delphi anymore, so not terribly interested, but will check it out.

The other one, Delphi for PHP, is a little more interesting to me. I don't currently do PHP - I do ASP.NET, but am always keen to see how other technologies work.

All in all, I think a positive couple of announcements from CodeGear. It seems to me they are concentrating on areas they can actually compete. Their Java toolset has been moved over to Eclipse which is a good thing, and they appear to be concentrating on Win32 for Delphi.

I think this is a good move. In all reality they can't hope to compete with Microsoft when it comes to .NET. They are just too far behind the 8 ball, always a release behind. For example the latest Borland Development Studio 2006 uses .NET 1.1. Concentrating on Win32 which a lot of people are still keen to develop for, and looking at new areas - Delphi for PHP, I think they just might be able to create a good niche for themselves.

Wednesday, February 14, 2007

Design Patterns in C#. Part 1 Singleton Pattern

Design Patterns are a useful part of software development reuse. Design Patterns introduce a common problem and common solution to said problem. DP's are usually broken into 3 categories:

Creation Patterns:
As the name suggests, deals with the Creation of Objects
Structural Patterns:
Ease design by identifying a simple way to realize relationships between entities
Behavioral Patterns:
Identify common communication patterns between objects

Design Patterns are bigger in the Java world than they are in the .NET world. It's only in the last couple of years that I come across design patterns and their usefulness.

The most common design pattern, and the easiest to understand is the Singleton Pattern.

The definition of the Singleton Pattern is, "Ensure a class has only one instance and provide a global point of access to it."

Which means that the class will only allow one instance of itself to exist. We do this by hiding the constructor of the object and publishing a public method to instantiate the object.

Example:

namespace Singleton
{
  class Program
  {
    static void Main(string[] args)
    {
      ClassicSingleton s1 = ClassicSingleton.CreateInstance();
      ClassicSingleton s2 = ClassicSingleton.CreateInstance();
      //if new classes were being created, values should both be 1
      Console.WriteLine(s1.CountValue());
      //if singleton works then should output 2
      Console.WriteLine(s2.CountValue());

      Console.Read();

    }
  }


  public class ClassicSingleton
  {
    private ClassicSingleton(){}

    private static ClassicSingleton instance;
    public static ClassicSingleton CreateInstance()
    {
      //if instance doesn't exist create new instance
      if (instance == null)
      {
        instance = new ClassicSingleton();
      }
      return instance;
    }

    //small method to prove only one instance gets initiated
    private int counter = 0;

    public string CountValue()
    {
      return (counter += 1).ToString();
    }
  }
}

The above example is using the classic singleton approach. As you can see it is fairly straight forward and easy to understand.

This example is fine in a single threaded case, but in a multi-threaded application it is possible for an instance to exist on separate threads. To eliminate this issue we change the CreateInstance method to include a lock and another check:

public static ClassicSingleton CreateInstance()
{
  //if instance doesn't exist create new instance
  if (instance == null)
  {
    lock (typeof(ClassicSingleton)) ;
    if (instance == null)
    {
      instance = new ClassicSingleton();
    }
  }
  return instance;
}

These two above examples are using fairly standard approaches to creating a Singleton Pattern and is how you would probably expect to see things in the Java world. C# creators (and VB.NET too) new about Design Patterns when they were creating the language, and added a few nice features that makes it easier to do things such as this. The below is a Singleton Pattern creation the .NET way:

sealed class DotNetSingleton
{
  private DotNetSingleton() { }

  public static readonly DotNetSingleton CreateInstance = new DotNetSingleton();

  //small method to prove only one instance gets initiated
  private int counter = 0;

  public string CountValue()
  {
    return (counter += 1).ToString();
  }
}

As you can see from above the .NET version is much simpler. We create a static readonly property of type DotNetSingleton. Because it is marked static readonly it can only ever have one instance of DotNetSingleton. Note the class is now a sealed class, meaning it can't be inherited.

I am hoping to introduce several Design Patterns in the next few posts, but there are also several great resources on the net.

Do Factory is probably a good place to start, but as usual Google is your friend!

Next time, the Factory Pattern.

Wednesday, February 07, 2007

Macbook Pro First Impressions

Well, it finally arrived. Was it worth the wait. F**K YES!

I have owned PC's in various guises since my first 386SX-20Mhz in 1991. Since then I have owned and used literally hundreds of PC's. I got my first laptop in 1999, it was an IBM Thinkpad and I thought it was Christmas. I have used every version of Windows since 3.0, and Dos 3.3 before that. I am a professional programmer who makes a living off using Microsoft products, and developing for Microsoft OS's.

So in summation, I am not some blatant Apple fan boy. I know the ins and outs of PC's better than most. The reason I am relaying this information is because I think from here on in, this post could get a little Pro Mac.

First Impressions:


The packaging is first class. Every little thing is thought of. The styrafoam packaging is classy, and laid out well. There is nothing in the box that doesn't need to be there. The power cables and adapter are a nice designer white. All in all the packaging is brilliant.

You turn the laptop on, and OSX comes up straight away. That is nice. Usually with a PC laptop, there is still some final installation that is required. Once the obligatory sign on stuff is dealt to, you are away.

Nice touches

It's the little things that make the difference. The power connector is magnetic so it doesn't rip the side of the laptop off, if someone trips over it. It also has a little LED on it that is red when charging and green when finished.
The Apple logo on the back glows, as does the keyboard when it gets dark. This is so you can use it in the dark and still see the keys.

Oh and the other cool feature I noticed right away - you push the off switch and it realises you want to shut down and brings up the shutdown/restart menu. Nice.

The touchpad understands gestures too. For example you can push down with one finger and scroll up and down with another, and it acts like a scroll wheel. Again just a little thing but nice feature non the less.

OSX
I haven't played enough yet to give a full appraisal, but so far I like it. Again it's the little things I like. The fact you don't need to click "OK/Cancel/Apply" when you change something in the System Panel. It realises that if you changed it, you meant it and you don't want to be bothered again.

The integration between OSX and things like iTunes and PDF documents is much better than Windows. I guess this shouldn't be a shock. The great thing about the MBP, is that it comes with a remote, that you can use when using iTunes, or playing a DVD, or showing a photo slide show. It swaps seemlessly between the fullscreen applet and normal OSX. It is instantaneous. I have seen a few other PC makers try this. My work Dell for example has a Media Centre, but it is slow and switching between Media Centre and Windows takes several seconds.

Annoyances
The single mouse button is taking a little to get used to, as is the command key. Also the touch pad seems to freeze when switching applications from time to time.

That's it so far!

Conclusion
It just works. That is the overwhelming feeling I am getting so far. It just works.