Subscribe to
Posts
Comments

Wifi Speed

Home WiFi has been playing up a bit recently with poor performance. After some manual tweaking of the channel based on the results of iStumbler (or NetStumbler for you PC folk) with no achievement, I found this discussion of channel selection.

Deserialising to IList

Having upgraded the website I work on to .net 2.0, one of our console apps failed whilst talking to a webservice on the site. We’d not changed anything on either the console app, or the website other than upgrading the website to 2.0.

The error message was “global:System.Collections.IList cannot be deserialized because it does not have a default public constructor”. This makes a lot of sense and it turns out that the class being serialised contains a public IList property. Changing this to a concrete type solved the problem.

So the question is… what was the deserialiser in 1.1 doing? how did it know which concrete type to deserialise to?

Sign of the times

TV updatingI just got home and the TV told me it had found a software update so I took a picture with my phone. I’m slightly perplexed as to where it downloaded the update from though…!

Horizontal Partitioning

We’ve got a moderately large database here - 80gb, 5 tables and 500m rows - and we had problems updating it. Following a bout of Horizontal Partitioning we’ve now got 130 tables and those rows distributed evenly across them. However when a check constraint was updated today SQL Server 2000 wouldn’t allow data to import and we got the error message:

UNION ALL view ‘Classifier_z’ is not updatable because a partitioning column was not found.

In the back of my mind i’d remembered about trusted and untrusted check constraints and after a bit of Googling (I did use Google so I can use it as a verb ;)) I found this page which displays all the currently untrusted constraints in your table, and further allows you to set them to trusted. Here’s the code too, just in case that target page disappears.

To display untrusted constraints:
[sql]
SELECT ctu.TABLE_SCHEMA, ctu.TABLE_NAME, cc.CONSTRAINT_NAME, cc.CHECK_CLAUSE
FROM INFORMATION_SCHEMA.CHECK_CONSTRAINTS AS cc
JOIN INFORMATION_SCHEMA.CONSTRAINT_TABLE_USAGE AS ctu
ON ctu.CONSTRAINT_NAME = cc.CONSTRAINT_NAME
WHERE objectproperty( object_id(quotename(cc.CONSTRAINT_NAME)), ‘CnstIsNotTrusted’ ) = 1
[/sql]

To make all constraints trusted:
[sql]
DECLARE @tablename nvarchar(300), @constraint nvarchar(300)
DECLARE @constraints cursor
SET @constraints = cursor fast_forward FOR
SELECT quotename(ctu.TABLE_SCHEMA) + N’.’ + quotename(ctu.TABLE_NAME), quotename(cc.CONSTRAINT_NAME)
FROM INFORMATION_SCHEMA.CHECK_CONSTRAINTS AS cc
JOIN INFORMATION_SCHEMA.CONSTRAINT_TABLE_USAGE AS ctu
ON ctu.CONSTRAINT_NAME = cc.CONSTRAINT_NAME
WHERE objectproperty( object_id(quotename(cc.CONSTRAINT_NAME)), ‘CnstIsNotTrusted’ ) = 1
OPEN @constraints
WHILE (1=1)
BEGIN
FETCH @constraints INTO @tablename, @constraint
IF @@fetch_status < 0 BREAK
EXEC(’ALTER TABLE ‘ + @tablename + ‘ WITH CHECK CHECK constraint ‘ + @constraint)
END
[/sql]

I’ve written a script to parse the London Underground real-time tube status page and convert it into an Xml feed. It caches the output from TfL for 1 minute. If their page structure changes i’ll endeavour to update my parser.

You can get the feed as Xml or HTML. I’ve also started the ball rolling with a Mac OS X Widget (15kb) (download, unzip and install), and a Google Gadget (add http://www.socialanimal.com/tube/status.php?format=google as a custom URL in iGoogle.

Enjoy and let me know if you find any problems with the feed.

UPDATE 13/May/08: TfL are now offering a selection of iGoogle gadgets. At the moment I can’t find an Xml feed, and the XHTML gadget just states ‘loading’ though which is a shame.

UPDATE 8/June/08: I’ve released the source code for this under GPL license so you can use it in your programs. Please read the GPL license to ensure your usage complies. I didn’t write the output caching files i’ve included and I can’t find the original author to check licensing terms.

I’ve had a few occasions to print out a website exactly as the browser is displaying it. Usually it involves a screen grab, scroll down, screen grab, scroll down etc. and then stitching the images back together. I’ve now found a much simpler solution - ScreenGrab:

Screengrab! is an extension for Firefox that makes it easy to save a web-page as an image. With it, you can save anything that you can see in a browser window - from a small selection, to a complete page.

Feedburner

I’m jumping on the bandwagon of Ben and Mark regarding feed statistics. If you’re subscribed to the feed, why not make my day and update your feed to the URL below.

http://feeds.feedburner.com/alpriest

Retro video tableRemember those video games tables pubs had back in the 70s and 80s? Well they’ve evolved in the guise of Microsoft Surfaces - check out the website ‘magic’ demonstration. There are some great ways to interact photos with it - similar to the multitouch feature of the forthcoming iPhone.

It’ll be pretty neat to sync your mobile device so that your manipulated content can be taken with you.Microsoft Surface

Back in February a mate who was buying a flat in Athens asked if I fancied driving a car loaded up with furniture once the sale had completed. I’ve just got back, wiser for two pieces of knowledge - 1) Athens is a long way by car which you don’t appreciate in the 3.5hr flight, and 2) Pubs are bad places to make major decisions.

Anyway, having agreed to the trip, my mate bought a car off Ebay and on last Thursday night we set off for Dover at 8pm following a hard day at work. Traffic jams on the A13, the closed M25/M20 junction, and the closed A20 all tried to prevent us getting there, but at 21:50 with 83 miles on the clock we got to the ferry port. We took the map on board to plan the route during the hour long journey.

I took over driving then at around midnight, and took us through France to Reims, and then towards Metz. At 03:45 and 336 miles on the clock we swapped drivers. At this point the car was beginning to make a very odd noise and was losing power. I think either the exhaust had blown or it was misfiring. Either way, we were en route to Athens and we didn’t want to resort to the AA backup plan quite yet.

At 06:45 and 515 miles my mate completed his driving stint to Strasbourg. The French appear to have invested a considerable sum in their motorway stops and they put the UK ones to shame with their cleanliness and general lack of tat.

A quick sprint further down the A35 and at 07:50/555mi we were in the traffic queue approach to Switzerland. There had been an unfortunate turn of events back in London which had meant my mate had left his bag of important documentation (driving license, insurance docs, proof of car ownership etc) so we swapped drivers because at least I had a valid driving license. We had agreed in advance that we’d tell them were driving to Milan so as to not provoke too much investigation from them. This worked a treat and with just a €30 motorway tax we went on into Switzerland.

At 10:00/683mi Friday morning we were in the Gotthard Tunnel which is the second longest road tunnel in the world. Not stopping to admire the workmanship we pressed on to Milan arriving there at 13:00/780mi. As we’d been munching on just Snickers[sic], energy bars, Red Bull and pork pies we decided to stop for pizza. The weather was being very British to us and pouring down but we resisted buying umbrellas and instead will all be buying new shoes. Arse. Still, we saw the Doumo which was covered in scaffolding (again!).

We left Milano at 15:20/780mi and pushed on towards Bologna. I was awoken in the back seat by a loud banging noise from the car and quickly persuaded my mate to pull over. It turned out a bit of plastic under the engine which prevents stones hitting the engine was hanging off. We fixed it with an arm strap from a laptop bag and continued. Traffic increased and by 17:25/891mi we were stuck in heavy traffic at the A13/A14 junction. Another driver change and we drove on to Ancona where at 21:00 and with 1,053 miles under our belts we found a hotel and crashed out for the night.

04:20 we departed, and headed down through Pescora and Lesina. There’s some very beautiful scenery down that way, or at least there was until someone built a 4 lane motorway straight through it. We didn’t dwell on this point for long and by 10:45/1,405mi we were in Brindisi buying tickets for the ferry to Greece. The 7.5hr ferry overran it’s schedule a little and got us into Igoumenitsa, Greece at 21:00 where we had our second proper meal of the journey. I had Spag Bol as i’d forgotten to do that in Italy.

More Red Bull and Snickers and we set off for Petra. By this time all the lorries had disembarked the ferry and the 3 hour journey ended up a real-life scene from The Duel. Crossing their new bridge, although illuminated by fancy lighting for €10,90 was a bit steep.

Leaving Petra at 03:30/1571mi we drove the remaining section of the journey to Athens, arriving there at 06:00/1,702mi.

1,702 miles, 57 hours, 2 drivers, 2 meals, 1 hotel stop. Any volunteers to help bring the car back in September?


Pictures here.

« Prev - Next »