Tuesday, 28 August 2007

Del.icio.us Links For 28/08/2007

A page showing how good mash ups can be - 25 August, 2007

Hi there, so what is this about? Well, Bill Snitzer a BitGravity Techie is driving to LA form San Francisco. He's got a web cam streaming to the site and a GPS device updating the Google Map, crazy but cool
Link: http://bill.bitgravity.com/live/

Estimate Goat - 23 August, 2007

Been asked for another Estimate without much information?
Link: http://www.estimategoat.com/

Again with the Module Pattern - reveal something to the world - Wait till I come! - 22 August, 2007

Another way to do object oriented programming in Javascript
Link: http://www.wait-till-i.com/index.php?p=476

Last.fm Normaliser - 22 August, 2007

An awesome tool that ranks your favourite artists and albums by an estimation of how long you have spent listening to them. Well worth a go
Link: http://www.associativetrails.com/stuff/normalisefm/

Free SEO Marketing Tools - 21 August, 2007

Some good SEO marketting tools for help in making your site more SEO!
Link: http://www.mikes-marketing-tools.com/free-marketing-tools.html

ripper.rhetoric: activateActiveX - 2 August, 2007

a great way to fix the IE click to activate "feature".....
Link: http://therippa.blogspot.com/2006/03/activateactivex.html

Monday, 6 August 2007

For When Youve Had Enough of Vista Backup

Windows Vista came with a brand new backup tool to help save millions of people from loosing all there beloved data. But what happens when the user doesnt want ever file known to man backed up or the categorisation version misses out too much information? Well when it comes to the Vista backup tool your stuffed. Thats all it does, All, or next to nothing. Gutted I decided to bin off Vista Backup tool and find a worthy replacement, amazingly it didnt take too long. Presenting Microsoft Sync Toy v1.4 ;) Amazingly SyncToy does exactly what I want to. I used to use it many moons ago for syncing my uni files on my Laptop with my Desktop PC, but since I left uni and Hayley "inherited" , stole, my laptop I havnt used it. Until tonight that was, I decided to start it up again, create all my folder shares, development, databases, documents, music and photos and then schedule it to run every week. Now on a weekly basis all my files are backed up to a spare internal HDD and an external HDD. When it comes to sync options, SyncToy has every mode under the sun, I decided to set all mine to contribute, so new files, updates and names changes are copied to my backup, however deletions arent, in case I get all shift + del happy ;) And thats it, just simple backed up goodness. Now if you are a fan of having all your information in a backup format MS can see when your reinstalling from a backup etc, why not use SyncToy to get all the data you do want onto a HDD in a suitable format and then get Vista Backup to make its own backup image of that drive, that way all the files you want, none of the ones you dont and no hassle. If only other people thought like me....

More ASP.Net Antics - using the Site Navigation with SQL - An Update

Well it's been a while since I've had something decent to blog about, however I warn you what I'm about to blog about isn't really decent, its more of a side comment / observation. A while a go I posted about using ASP.NET 2's site navigation control with SQL, I have been playing with my modified of this for a while, and all seemed to be working fine in demo's and general development. However last week an interesting bug appeared. When the site's application is restarted, i.e cache cleared and the site navigation is rebuilt, the site would crash out the first two times the navigation tries to rebuild. The third time however results in the site loading perfectly fine. I have to say this behaviour baffled me. The first thing I did was to download the site's live database and run against a more debug friendly version of the site's code. Now the error message being thrown up was that the current node / page had an invalid parent. So of course I then checked the database only to find it did have a valid parent and all was ship shape data wise. I decided to deactive this page only to find another page casued the error, so I disabled the next suspect along with 2 others. Now this all seemed very odd, why would some pages error and others not? I couldn't figure it out, however I did realise one situation where this bug appeared for a genuine reason. I decided to add an "active" field next to each page so you could turn off pages until they were ready to go live. Now you can do this for a parent page, however all the child pages are left active. This would then oviously cause the script to chuck out errors as our SQL that returns all the pages for the navigation doesn't check to see if a pages parent is active. So how do you cater for this situation? Well I thought of a couple of ways, you could make your SQL, be it a stored procedure or plain T-SQL statement, join the parent Id's using an Inner Join and ensure the parents are active, this way any inactive parents are left off. However if you have a lot of pages in your database and the site has a steady flow of traffic, you could end up with a potential bottleneck. You could ensure that when a page is deactivated that all it's child pages and then their child pages are deactivaed, again this would be crazy as if you have lots of child pages which than have further child pages you would end up with unrelistic amount of update statements to perform. So what is the answer? Well i decided to do the required work at the business logic layer of my system. We have our SQLSiteMapProvider and it checks to see that the Parent ID of a node is valid. At present this churns out a nice provider exception error message so I decided to update this to handle things differently. I decided to go down the root of instead of causing a provider error if the parent id is invalid then simply return null instead of a sitemap node for the current page. Then where we call the check if parent is valid function, check if null is returned. If it isn't add the node to our sitemap, if not then don't worry carry on. This way any orphaned children are just ignored and the end user knows no difference. Now before anyone else comments, I know this isn't a grand solution and I'm sure that there will be pros and con's for a SQL solution and this solution or maybe even a better way, please comment if you have a better way, however for the hour I had to look at this I felt this was the best solution. It even masked the random page error that was occuring at the start, hopefully when I get chance to rebuild my main site using this code I will be able to take some time to relook at this provider and come up with a better solution. Until then if you want a copy of the SQLSiteMapProvider I am using then grab this zip file.