Andy Gibson

Code Monkey very simple man

Firefox 3 Download Day - It’s here!

Download Day 2008

Update: What I did forget to post was when the day will actually being, well I will let someone else show you: http://www.labnol.org/software/download/download-firefox-3-exact-time-world-map/3595/ (Digital Inspiration)

It doesn’t seem that long ago that I was all hyped about the new features that Firefox 2 brought to the internet, seeing how much of an improvement it was over Firefox 1.5 and now, here we are again with Firefox 3.

Well after 5 betas, 2 Release Candiates Firefox 3 is finally going live and this time the Mozilla team want to set a new Guiness World Record by having the most amount of downloads within a 24 hour period.

So, if you use firefox and want to see the new browser but didn’t want to get a pre-release copy, now is your chance, and what better way to do it than help break a world record!

Good look to the Mozilla guys for this one and thanks for making Firefox what it is!

Linq to SQL Object Referencing Gotcha

This may have just been a result of my PHP background trying to tell me how to do things and so it is quite possible that this post is common sense and obvious to others in the .NET / LINQ community.

I have been working on an ASP.NET MVC prototype application (Preview 3) and I ran into a very frustrating problem. Part of the system allows users who are logged in to vote a post up or down, a user can only vote once per post. There is a Posts table, a Users table and a Votes table and Votes contains a foreign key for both Posts and Users.

Now when a use submitted a vote the system created a new Vote object, passed in the PostID, the UserID of the current user and the result. LINQ then stuffed it in the data context and saved it back to the database. When a user came back to the post or a listing of posts, it didn’t display as having registered their vote although if they voted again the system blocked it which told me the data was there and LINQ could read it.

After quite a bit of head scratching and googling I came across Chris Rock’s post “LINQ TO SQL Caching Gotcha” which identified a similar problem and it did seem like mine was a caching issue. I tried his suggestion but to no avail so I ruled out caching.

So what was the solution? Well, let me do a before and after for you:

Before

After

The key is on lines 2 and 4. In the first snippet I am assigning the numerical IDs to the foriegn key fields PostID and UserID, in the second I am passing in actual objects; the Post object found using the id variable and the User object found by using the CurrentUser property.

LINQ does not seem to connect the Vote to the User or Post if you directly assign the ID values, evidently you need to pass the object which is being referenced in order to get LINQ to recognise the connection and perform the required updates, despite the DB knowing exactly what is going on.

As I said before, perhaps this is well documented and I am just being slow to catch on but that took the better part of a week to find and fix.

Developer Day Scotland - Tomorrow

Update: Some how I now have a twitter account, i’m saying nothing on how that happened.

First, sorry for the lack of updates and also the fact the blog had to be rolled back, there was a problem during an upgrade and the database decided to throw a wobbler so I had to restore from backup. I am also in the middle of my 3rd year degree examinations (3 down 1 to go) so time has been pretty scarce of late.

I start my position at NCR on the 19th and between now and then I seem to have been filling up a rather busy schedule between both work and social life. I guess I want to make the most of my last few days of “freedom” before my summer of corporate life begins.

Developer Day Scotland

Anyway, one of my lighter items is tomorrow. I will be attending Developer Day Scotland at Glasgow Caledonian University which has been very kindly organised by Colin Mackay. The event will see speakers from across Scotland talking on a variety of .NET and SQL Server related topics.

Barry Carr (a ex-colegue of mine) will be delivering his talk on Regular Expression (which I have actually yet to witness and I wonder if the Macbook will be aiding him this time) and another North East Scotland .NET founder Gary Short who will be presenting on The Web Client Software Factory. I will also be attending Tom Wardill’s talk on the ASP.NET MVC Framework which is of great interest to me since I have been doing quite a bit of work with the framework and I do like the features it brings to the ASP.NET dinner table.

So it’s late and I have some last minute things to catch up on before I rest, I just wanted to post this last minute item so that when I return and do a write up it wont be so out of the blue.

Anyone attending tomorrow I will possibly see there.

Power cuts and router failures

Courtasy of a couple of power cuts earlier in the week which affected most of the City Centre and as far out as the University Campus I had to replace my trustworthy Netgear DG834G router. At first it only appeared to be the power adapter which had gone however yesterday the modem inside of the router failed and forced me to replace it.

Now networking products are a point of contention for me, there are certain brands I just refuse to buy on principle, the worst being Linksys. Despite being owned by Cisco Systems, I just keep reading about how bad their equipment is and so despite being cheaper, I still avoid them. Belkin and D-Link are supposedly allright but  when it comes to routers and networking I work on the same principle I do with hard drives; If a brand hasn’t failed on it’s own within it’s reasonable lifespan then why change?

So sticking with the devil I know I bought another Netgear and effectively the same one, the DG834GT which has 108mb wireless instead of 54mb and came with a USB wireless dongle, that was the only difference. Thanks to the handy configuration backup and restore facility on both routers I could copy the settings across instantly so no need to re-write 30 or so port forwarding rules.

Everything is back online and working quite happily again.

VS.PHP Add-in problem (and how to resolve)

Even though I am using .NET as my primary platform I do still make use of PHP 5 and since I have come to like using Visual Studio so much, I use an add-in called VS.PHP from JCX Software.

Recently I tried out the newest version (2.4) which support Visual Studio 2008 and after the trial ran out I removed it however for whatever reason it interfered with my Visual Studio 2005 configuration and prevented the add-in from working at all.

The error I was receiving when trying to load a VS.PHP project was:

The application for project ‘<path to project>’ is not installed.
 Make sure the application for the project type (.phpproj) is installed. 

After about 40 minutes of head scratching and googling (as well as a re-install of VS.PHP) I encountered the following solution on the JCX Software Forums:

Run devenv /resetskippkgs

I did exactly that, I navigated a command prompt to:

C:\Program Files\Microsoft Visual Studio 8\Common7\IDE

And ran the command above.

I should explain that the reason I was receiving the error (well more why it wasn’t even loading VS.PHP) was because 2.4 conflicted with 2.3 and when I launched VS2005 again I got the VS error telling me an add-in failed to load and would I like to prevent it from loading on future launches of Visual Studio. I stupidly replied “Yes, please do”.

The command work, VS went back to normal and now I have VS refusing to store the window positions in upon application close in Vista. The two are unrelated but it doesn’t exactly help me any.

I have moved to XP for the time being until I have the time to fix the VS2005 install on Vista.

New phone - o2 XDA Stellar

Over 2 years ago I purchased a 12 month contract with O2 which contained an o2 XDA Mini S (Also known as the HTC Wizard), details can be found at XDA Developers Wiki. Now this has been a great little phone (ok, it looks like a brick but I don’t hold that against it), quad band, GPRS, Windows Mobile 5 (and currently 6) not to mention a QWERTY keyboard which is one of the features that drew me to it in the first place.

It has been very durable and survived many accidental drops on to hard surfaces, flash ROM upgrades and other such wear and tear and yet it still keeps on ticking. This is what I like in a phone, in fact this is what I like in electronics, something that can survive without fail and in this day and age such things are becoming fewer in number. Products just to not seem to be made to last any more, we have become a very “disposable” society.

HTC TyTn II

Anyway, I spotted on El Reg today that o2 has announced the newest addition to the XDA family, the O2 XDA Atmos (HTC S730) and so I started thinking about my loyal little Mini S. I compared the spec’s of the Atmos to the 2nd most recent XDA, the XDA Stellar (HTC Tytn II). They both sport the Qualcomm MSM7200 400MHz processor however the Stellar has the better memory (256mb ROM and 128mb SDRAM compared to 256mb ROM and 64mb SDRAM), The camera on the Atmos is only 2 megapixels compared to 3 megapixels on the Stellar. The list goes on, the Stellar is almost better than the Atmos is every way, about the only real upside for me that I could see what the fact it has a numeric pad on it with a slide out QWERTY keyboard.

So, comparison aside I have bought my new phone for the next 18 months, the XDA Stellar won out and will arrive some time this week. I got a good deal on the contract as well making the phone free for only £10 extra a month and double the minutes I currently recieve plus free unlimited landline calls thrown in. I feel quite proud of my purchase.

As for my wee Mini S here, well I know one of my ex co-workers had his eye on it, if he doesn’t want it then I guess I have a spare PDA to play with.

Recent find

While cleaning up my flat a little I came across a small A5 sheet of paper that belonged to my father. Before he died he worked for Rank Xerox and was a team leader, the following passage was something he found and printed out to hand to the various teams he worked with.

If you think you are beaten, you are,
If you think that you dare not, you don’t,
If you’d like to win, but think you can’t,
It’s almost certain you wont.

If you think you’ll lose, you’ve lost,
For out in the world you’ll find,
Success begins with a fellow’s will,
It’s all in the state of mind.

If you think you are outclassed, you are,
You’ve got to think high to rise,
You’ve got to be sure of yourself before
You can ever win a prize.

Life’s battles don’t always go
To the stronger or faster man,
But soon or late the man who wins
Is the man who thinks he can.

It has sentimental value but I felt it was a nice thing to have posted on my blog as well.

Blog restored

Well it would appear that the database on the server fell over and reset my password hence why the blog has been offline. All fixed now and provisions have been made to prevent it happening again.

Apologies for the downtime.

AC32002, Looking back

Today saw the end of one of the largest pieces of on-going coursework we have done at university thus far. 6 people working together in a group for 6 weeks using a methodology that only 1 of them had any solid knowledge of at the beginning.  So, how did it go?

Putting aside the differences in experience and ability, pretty well. I find it hard at times to accept that I have an advantage over many of my peers in that I have more experience in development and methodologies. I read the articles and the books, I play with the tools and I learn very quickly.

It took time but the group really began to work closely together and especially in the 2nd sprint were able to work around tasks and keep things moving along. Communication became more free flowing and a bond formed that made working together much easier.

I think everyone has benefited from this project and has taken away something valuable from it. To get hands-on experience of both Agile and Waterfall approaches to software development before entering the industry is not something I would say is common and I think it has been a great opportunity for everyone.

I am not a fan of rigid designs and reports, they have their place but often they stifle productivity and creativity. Agile is growing and I am quite sure that at least once in their professional careers the other students will work in a team that uses an agile approach. By having this experience they will be more prepared for it.

I want to say well done to the team for this amazing effort, you all did well and hopefully you enjoyed it as much as I have.

I would like to say thank you to our Customer (although I doubt he will ever read this, doesn’t hurt to be courteous), Colin from Live and Lets Dive for presenting us with this challenge and for supporting the students.

And finally I would like to thank Janet for the hard work and effort she has put into this module in order to make this as enjoyable and as entertaining as it has been. Thanks Janet.

And so the end, well only of this project. The blog continues, university continues and my never diminishing quest for knowledge continues. If anyone outside of Dundee University has been reading this, I do hope it hasn’t bored you senseless or left you wondering “what on Earth?”.

Oh, and can I haz ur blocks?

Friday - Sprint Review for Sprint 2

Ahh, vast improvement on last sprint!

We met Janet (the Customer) and not only did we impress by asking if she would like coffee, we had refined our approach, presented what we had done and explained it clearly. Despite not having that much completed it actually look far more impressive than I thought it would.

As a team a lot of hours and work went into this second sprint and it was great to see that it had paid off and that most of the points that hurt us last time round had been resolved. We could have been more organised on what would be done in the theoretical third sprint but that really slipped our minds.

I am glad I threw in the little launcher application at the last possible minute, otherwise we would have needed a recompile mid demonstration, that would have been about as bad as showing raw XML or opening the sprint backlog spreadsheet (despite the fact I am quite proud of how I got that looking in the end, and thanks to Alan I learnt how you can restrict the values of a cell).

We did need to go back after the review and just tidy up a few loose ends for our coursework. Rory and Stacey made a really cool white box testing diagram, Alan and Paul finished up the black box testing and I sat and frantically collated all of our code, tests, backlog, etc.

I really enjoy the feeling of a team working together like that, even better against a deadline as it makes me work that bit harder.

So, as far as the review goes, amazing improvement and I really do hope everyone else feels the same.

Note to Janet:

This post and the one after it were written on Friday however I could not post them till Sunday evening.

Next Page »