It's that time of the year again when I have to submit my list for the Deadpool game. If you're one of the celebrities on this list, don't panic. I haven't come close to winning in the several years it's been running. I always keep the same list except for any additions, a strategy that has been spectacularly unsuccessful.
Saturday, December 30, 2006
Deadpool 2007
Saturday, December 23, 2006
Monday, December 18, 2006
Displaying a tick mark in HTML
This afternoon's challenge was to get a tick mark to appear in a HTML file. Not too taxing I thought. I'd already done it, using the HTML entity ✓. But this didn't properly in all browsers. I initially thought the problem was some kind of encoding problem but it seems that unfortunately it's one of those HTML things that works in 'modern' browsers but doesn't seem to work in IE6 (this ✓ should be a tick mark, if you're one of the lucky ones). Given that most people are still using IE6, it's not really an ideal solution.
So what to do? I thought I'd search for a fairy common font that had a tick mark available. WingDings does and although it's a Windows font, I thought it would be available on enough computers to suit my needs. Unfortunately, as this page shows, FireFox doesn't display WingDings fonts at all, even when they are installed on the computer. Most odd, although it seems that this is how browsers should work...
You may be asking why I didn't plump for the simplest solution, displaying an image? Unfortunately I'm generating a web page on the fly on the user's PC and I don't want to be generating extra images if I can avoid it. Life could get very complicated if they already have a file with the same name on their PC. I guess they wouldn't appreciate me overwriting it.
So my not very neat solution was to use a standard checkbox, <input type="checkbox" disabled checked>, . This wouldn't be too bad if I could apply some styling to it to make it look less like a checkbox, but CSS for a checkbox is ignored so I'm not very happy with the resulting output. If anybody knows of a better solution, let me know.
Addendum - Since quite a few people are finding this page, you might be interested in the follow-up posts, which have a potentially better soluton to this problem
Sunday, December 17, 2006
Another way to get more hits to your site
I guess like most sites the Random Pub Finder gets most of its hit through Google searches. But a drunken chat with a friend led to another way to drive more traffic to the site. I've uploaded all the pub images to Flickr and added links to the reviews on the site. So far results have not been spectacular but it means we have deep links into some of our pages so their PageRank should improve. And who knows, it might work for you.
Thursday, December 14, 2006
Setting a display from: address using CDONTS
Since it took me so long to find the answer to this problem I thought I'd post it here (and also so I don't need to look it up again). Not sure if this applicable to other ways of programmatically sending email but I guess it probably is. To show a friendly display name when setting the From: address of an email using CDONTS just use the following syntax -
(Test address)<test@test.com>
Wednesday, December 13, 2006
Testing, testing
Just testing out Windows Live Writer with the new version of Blogger... And it works, hurrah!
Tuesday, December 12, 2006
Reading embedded resources in C#
Reading embedded resources in .NET isn't particularly hard but since I always forget how to do it, I thought I'd write it down for my own benefit.
First thing to do is set the Build Action property of the file you want to embed to 'Embedded Resource'. Next download my Resource Explorer from
http://www.doogal.co.uk/ResourceExplorer.php
After building the assembly, inspect it with this little utility to find out the name of the resource. If you're clever you can probably work out the resource name for yourself but I'm lazy and/or stupid (depends which day it is).
Finally, the code to read it is something like this.
Assembly assem = GetType().Assembly; using (Stream stream = assem.GetManifestResourceStream("resource name")) { stream.Position = 0; // read data from stream
Thursday, December 07, 2006
Visual Studio 2003 on Vista
OK, I should have known better. I'd read about the lack of support for Visual Studio 2003 on Vista, but then I read another article claiming all I needed to do was turn off UAC. I was planning on doing that anyway, since UAC seems like the biggest PITA of all time (and I seem to avoid any kind of virus/malware without it). So I went ahead and installed Vista. And Visual Studio 2003 falls over all the fecking time... I can't edit any of the code-behind files in one of my websites.
Fingers crossed Microsoft will release a version of VS2003 that actually works on Vista. If it means turning off UAC, I'm cool with that. Their excuse is that they want to use their scant(!) resources on the next version of Visual Studio. Even if I believe they haven't got the resources to get VS2003 to run on Vista, can't they slow down a bit? .NET 1.1 does most of the things I want to do pretty well, .NET 2.0 adds a few nice things, but nothing mind blowing, I don't even care about .NET 3.0 yet, so I care even less about the next version. The thing is I have a job to do and that job is to get working stuff to clients, they don't care what version of .NET I'm using and certainly don't want to be paying for me to upgrade to the latest and greatest version every other day...
Currently listening to 'Nothing' by 'No-one' from the album 'My soundcard doesn't work on Vista'
Monday, December 04, 2006
Reflector insanity
I spent a couple of days at a conference last week, which was fun. What did I learn? A few things, but the weirdest thing I learned was about Reflector's crazy behaviour. Often when Reflector starts up it informs you there is a new update available. Generally I'll let it do its thing and download the update. But it turns out if you don't download the update when you exit Reflector it deletes itself from your hard disk...
Wednesday, November 29, 2006
Liking Vista, mostly
I've got no sound, Visual Studio 2003 is a bit unsure of its new environment, it took me an hour to fix up my source control installation due to Vista clobbering file permissions, UAC is crap (I have turned it off and turned off the warning telling me to turn it back on) and SonicWall VPN Client doesn't work but... Vista is actually pretty good. Search works quickly for the first time ever in Windows (and searches emails as well!), the new UI is actually quite beautiful (something that could never be said about the XP Fisher-Price look), IIS 7 is a damn fine upgrade (although it took a while to get my ASP.NET 1.1 apps up and running) and performance seems to be pretty much the same as XP, which is quite remarkable given all the visual additions and extra services that have been added.
No doubt the Mac did it better two years ago but the Mac doesn't have any apps I need. My Mac OSX box sits unloved in the corner with nothing to do...
Sunday, November 26, 2006
Vista headaches
I'm a bit of a fool when it comes to new software, if I can get a copy of something cool for free I'll probably install it. So, since the company I work for now has an MSDN license I thought I'd give Vista a spin.
So I pretty much ignored the warnings the installer gave me about the problems I might have and went ahead and installed it. And the warnings were pretty much spot on. I now have no sound and I can't play videos. I have no idea why but I guess it's a driver problem. Hopefully Dell will fix the problem PDQ because sound is kind of important for me since I use Skype all the time...
Other than that Vista seems to work fine. I'm not sure at this point whether the upgrade was worth it, nothing has jumped out at me as an aboslutely must have feature.
Saturday, November 18, 2006
FireFox and IE differences
Often when I'm reading up on support for particular HTML or CSS features, I'll see something along the lines of "Most modern browsers support this feature, Internet Explorer doesn't". A loose translation of this could be "if you use this feature it won't work for 80% of your users".
I do most of my testing in IE then go over to FireFox to make sure it looks OK and probably because of this it always seems to be the other way round, FireFox doesn't support a lot of stuff that IE does.
FireFox doesn't have a way to render text vertically. OK, there's no official way to do this, so IE has come up with it's own CSS attribute, but I'm kind of surprised that FireFox hasn't come up with some way of doing it, it seems like quite a common thing to want to do.
Another problem is hiding and showing rows in a table. FireFox kind of supports using 'display:block' but the row gets taller and taller with each hide and show. So I have to use 'display:table-row', which doesn't work in IE. Not sure which is standards-compliant but 'display:block' seems like the more consistent approach.
Friday, November 17, 2006
XSLT not completely insane
I've played with XSLT before and never quite got to grips with it, but over the last few days I've finally got a basic understanding of what it's all about. It still seems like it was designed by somebody who was an XML/HTML addict and could only think in terms of tags when developing a programming language. Like the old saying goes, when the only tool you have is a hammer, every job looks like a nail. But the thing is if you have an XML document and you want to transform it to some other flavour of XML or HTML then XSLT is a fine choice. I'm still not sure if my XSLT is any good or not, I've not seen any coding standards for it anywhere. Should I be splitting things out into multiple templates? Should I be doing anything in particular to make my XSLT more maintainable? Dunnow. But I've got 1000 lines of it and it produces quite a nice HTML document so that's good enough for me at the moment.
Currently listening to Love Less by New Order from the album Technique
Wednesday, November 15, 2006
Well done Ken
Chelsea Tractors are going to be hit by another tax soon, as the London Congestion Charge will be increased to £25 for band G vehicles. Well done Ken!
Tuesday, November 14, 2006
Breaking news: No-one buys Borland's IDE tools
However they try to spin it, it's fairly obvious that Borland were unable to find a buyer for their IDE business. So my prediction was right. Is it good or bad news for Delphi and their other tools? It doesn't look great but at least they can hopefully stand on their own two feet and won't have their income sucked away to finance the ALM business.
Currently listening to The Only One by Billy Bragg from the album Workers Playtime
Crude awakening - Peak Oil
Found a couple of interesting videos about peak oil and some of the possible solutions
Saturday, November 04, 2006
IE7 take-up
IE7 hasn't been released as part of Windows Update yet, but its usage is up to 6% of all IE users on the Random Pub Finder. Saying that, FireFox 2 is being used by 38% of all FireFox users. I reckon that is down to the techy nature of most FireFox users. Funnily enough 20% of our visitors are now using FireFox, which is pretty astounding. I'd guess we've had quite a few techy people visit recently due to the coverage we've had.
Thursday, November 02, 2006
Build it and they will come
After five years, the Random Pub Finder has finally become an overnight success. Google seems to have started re-indexing pages, although there's still a random nature to its indexing. We were up to 300 pages indexed, now we're back down to about 150. But the main reason for the sudden surge in traffic has been appearing at Programmable Web. Thanks to that, we've been covered on a couple of other sites. We've never had so many hits.
Now I'm actually getting traffic here as well, thanks to this post. Seems I'm one of the top results on Google if you search for directmailchat. Clearly I'm not the only one suffering from this spam.
Tuesday, October 31, 2006
I am a sex god
I've been getting a lot of emails like this recently
Hi,
Hope I am not writing to wrong address. I am naice, pretty looaking girl. I am planning on visiting your town this month. Can we meet each other in person? Message me back at qzyv@directmailchat.info
Today was different, it came from somebody called Johnathan...
Makes you wonder how successful these kind of spams are, with a To: list of several people, a From: address that doesn't match the address they've asked me to reply to, a load of spelling mistakes and apparently coming from a girl with a boy's name.
Monday, October 30, 2006
Hurrah for Richmond Council
Richmond Council are introducing increased parking charges for high-polluting vehicles. This brought all the usual rubbish from the 4x4 drivers. Lets go through the points one by one.
4x4s are efficient
If your 4x4 is efficient then it won't be charged very highly. The charge is based on CO2 emissions, not car size.
I need a big car, I've got 4 kids
Presumably it was your decision to have 4 kids. Having kids is expensive, you have to feed and clothe them, house them. You wouldn't expect these to be subsidised would you? It's not like we have a shortage of kids on the planet.
Climate change is just a theory
Even though the vast majority of scientists agree that temperatures are rising and we are at least partly to blame, this line still gets trotted out. Can someone explain why I've still got bees flying round my garden at the end of October? This isn't normal. But let's assume climate change isn't in fact happening. Cars produce pollution at a local level, are noisy and generally reduce quality of life, particularly in cities like London where there isn't enough space to accomodate them. Not only that, but fossil fuels will run out, some time. So it seems like a good idea to reduce our dependence on them.
It's undemocratic
The motoring dinosaur Jeremy Clarkson claimed the whole thing is undemocratic. How's that then? The council were voted for by the people of Richmond. If the residents don't like it, they can vote them out again.
What I like about this scheme is that it shows we can do something about climate change at the local level, we don't have to wait for the government or, even worse, the international community to do something. Since we live in the neighbouring borough and our council is also run by the Lib-Dems, I'm going to be lobbying them to introduce the same scheme.
Currently listening to Have A Day / Celebratory by The Polyphonic Spree from the album The Beginning Stages Of... [UK]
Friday, October 27, 2006
iTunes and Windows Live Writer love-in
For the past few months I've been using my Toshiba Gigabeat to listen to music in my office, but something has been bugging me about it for a while. The random play functionality is completely whacked out. It seems to be random based on the artist, so if you've got one track by an artist, that artist will get as much coverage as an artist with 100 tracks.
So I decided to move my MP3 collection on to my new PC and use iTunes instead. That in itself was a bit of a pain. The Gigabeat converts MP3s into a file with a SAT extension so you can't just copy them back across, since nothing but the Gigabeat knows what a SAT file is. But if you plug it in right, Windows recognises it as a media player and knows what to do with the files and does the conversion on the fly. All seems a bit odd really, but I could now listen to my MP3s through iTunes.
And now I've found a very nice plugin (well two actually) that lets you insert the track you're currently listening to into your blog post. Perhaps it should be called 'Completely Pointless Vanity Plug-In' but I like it.
Couple of things to note. The Apple website doesn't seem to be correct when it tells you where to put plug-ins for iTunes to pick up, it says they should go under 'My Documents' somewhere but I had to put it in C:\Program Files\iTunes\Plug-ins.
The Live Writer plug-in goes in C:\Program Files\Windows Live Writer\Plugins but by default the plug-in will insert 'Nothing playing', you need to update the HTML template to something like <P>Currently listening to %t% by %a% from the album %al%</P> to get it to work.
Currently listening to Carrion by British Sea Power from the album The Decline of British Sea Power
Tuesday, October 24, 2006
Disabling the Dell malware
When I purchased my new PC it came with a whole host of crapware that I didn't want. Most of this could be removed but one piece of software remained, an extension for IE that brought up a Dell search page whenever a website failed to load. I've never tried to get rid of this because it's never caused too much harm but today it began interfering with my work so it was time to get rid of it. IE7 makes it pretty easy to disable pointless or dodgy add-ins. If you have the same problem as me, go to Tools/Manage Add-ons/Enable or Disable Add-ons and disable CBrowserHelperObject object. No more 'helpful' Dell search page, yippee!
Sunday, October 22, 2006
Google Sitemaps improvements
Saturday, October 21, 2006
So how quickly will IE7 be adopted?
Thursday, October 19, 2006
Somebody listened
OK, probably not to me, but the silly error message no longer appears in the final released version of IE 7
Wednesday, October 18, 2006
IE7 Stupidity
Internet Explorer 7 is mostly a good experience. Yeh, it's ripped off some of Firefox's features, but that's what Microsoft do well.
But what on earth is this dialog box about? I tried to paste into a field in Google Maps and it popped up. I understand that Microsoft is getting a little paranoid about security these days, but of course I want to allow the webpage to access my clipboard, I just hit CTRL-V! Oddly enough this doesn't happen on all websites, so perhaps Google Maps is doing some odd scripting when I do a paste. Who knows, but please someone fix it!
Exciting new website
In their ongoing attempts at SEO, BetterDeal have got a new site (New Car Showroom) and they want some inbound links. Where better to get them than from here, with my huge number of visitors and massive PageRank?
Monday, October 09, 2006
Hello World for ZX Spectrum lovers
When I was a young lad, there was nothing I liked more than going down to my local Dixons after school and typing my very own Hello World application into the nearest ZX Spectrum. But the Hello World apps I see today just don't match up to the beauty and elegance of that original version, so I've written one for C#
using System; namespace HelloWorld { class App { [STAThread] static void Main(string[] args) { line10: Console.WriteLine("Doogal is cool!"); line20: goto line10; } } }
Who says goto is evil? I think I might adopt this style for all my applications...
Sunday, October 08, 2006
Bid on my birthday present
My brother has given everybody the opportunity to bid on my birthday present. Looks like he'll send it to me, even if somebody else outbids me, but any proceeds go to charity, so get bidding!
Thursday, October 05, 2006
Google have cocked up again
It looks like Google has cocked up its data update again. The PageRank updates it started a few days ago look like they are being rolled back, so the Random Pub Finder is back to PR 0. More worryingly, if I do a site: search, all URLs bar three are now shown as supplemental. But If I do a search for particular keywords, other pages on the site are returned and aren't marked as supplemental. Go figure.
Wednesday, October 04, 2006
How to have a reasonably successful website
I can't pretend to know a lot about making a website a huge success, none of the sites I've been involved with have been massively successful, but I've kind of worked out how to get a reasonable number of visitors to a site without any kind of massive outlay. Here are a few of my thoughts.
Don't spend a lot of cash
Websites are pretty cheap to run. Even if your website is your business, you can probably keep it running with no visitors and no income for a pretty long time. Blowing any money you do have on advertising before you're even sure your site is up to scratch is a sure fire recipe for disaster. Better to get just a few visitors in who'll give you a good idea if you're heading in the rifgr direction and you can fix any problems you have before too many people spot them.
I think advertising in the old media is pretty much a waste, it's very expensive and it's hard to see if it's been a success. You can advertise using AdWords for next to nothing, giving you the chance to see if it works at all and also trying out different advertising approaches.
Don't ignore SEO
Google is fond of saying that you should optimise for the end user, not the search engine. I can understand where they are coming from but essentially this is pretty much untrue. If end users can't find your site, whether the site has been optimised for users or not is pretty much irrelevant, they'll never see it. Chances are search engines will be the biggest source of traffic to your site, so of course you need to optimise for them. I managed to triple the number of visitors to the Random Pub Finder just by applying some simple SEO, all completely above board and not impacting on the end user at all. I found this free download a very useful read.
Design isn't too important
There are many examples of butt ugly sites being pretty damn successful (craigslist being the most obvious example) and plenty of examples of beautiful sites that have crashed and burned (boo.com comes immediately to mind). The fact is if the idea behind your site is appealling, people will come back. If the idea doesn't appeal, it doesn't matter how good looking it is, people will go elsewhere.
One company I worked for redesigned their site about 4 times in one year, in an attempt to get more conversions. I've no idea how much they spent in total but the effect on conversions was pretty minimal, so it was pretty much wasted cash. Every redesign brought a host of new problems that needed fixing, along with pages stored in search engines that no longer existed. Not only that but time spent on those redesigns could have been spent refining and improving what was already there.
Keep focussed
I've never really stuck to this advice (this site covers whatever I can be arsed to write about) but if you want to get people coming back to your site it sure helps if your site covers a single topic, or a few related topics.
Iterate and watch
I come from a software development background and I've always practised a kind of iterative development technique. And I use the same approach when developing websites. Make a small change, see if it works, move on. Unlike software development, when developing websites the 'see if it works' stage doesn't just mean 'make sure it runs OK'. it also requires looking to see how it has affected traffic, so the iterative cycle can be somewhat longer. and to see if it works, you need to have some data. The cheapest tools (i.e free) for this job are Google Analytics and Google Sitemaps, which tell you how many visitors you're getting and what keywords are driving them there, along with heaps of other information.
Take advantage of free advertising
There are plenty of opportunities to get more hits on your site that cost nothing. When I post to a forum and I'm given the opportunity to provide a URL I always do. Of course, posting randomly to forums just to get a link to your site is generally considered as spam and will likely cause more harm than good. Sites like Technorati and digg can drag in more readers and directories related to your site can help pull in yet more eyeballs.
Wait, and wait some more
I have no knowledge of the search engine algorithms but I'm pretty sure, all other things being equal, a site that has been around for 5 years will rank higher than one that's been around for 1 month. So if you just hang around doing nothing, your site should start to get some more hits. I've never really done anything to get hits to doogal.co.uk, but I now get about 200 visitors a week.
Monday, October 02, 2006
PageRank update
I've just noticed that Google seems to have updated PageRanks across my various sites. And finally The Random Pub Finder has got some PageRank! It's been PR0 for about a year, now we are up to PR3. My home page and this blog are both up, wahey!
Wednesday, September 27, 2006
The Great Australian Survey are spammers
I signed up with the Great Australian Survey (www<dot>aussiesurveys<dot>com<dot>au) to see where BetterDeal were mentioned and I started getting the usual crappy offers from them. Kind of expected that, but the emails had an unsubscribe link at the bottom. I've clicked on that twice now and ticked the relevant boxes on their site but I'm still getting the emails. Either they are completely incompetent (why on earth are they sending emails to a .co.uk address anyway?) or they are spammers.
Thursday, September 21, 2006
Working from home is different
Wednesday, September 20, 2006
The changing face of spam
The Random Pub Finder has been getting a lot of spam reviews recently. This isn't a big deal, the reviews go straight to my inbox and don't appear on the site until I put them there, but the weird thing is the content of these spams. Many of them are bacon-related. Here's an example
"a rasher ( and reland), or a slice ( orth merica). raditionally the skin is left on the cut and is known as bacon rind. indless bacon, however, is quite common. n the"
I just can't work out what on earth they are trying to achieve.
On the other hand, email spam seems to be getting more sophisticated. I'm now getting quite a lot of spam emails that contain a single image offering whatever penny stocks I really need to buy, followed by some text that isn't related and is obviously being added to get through the spam filters. How can we ever defeat that kind of spam?
Sunday, September 17, 2006
Metastorm e-Work Forums
My employer has set up forums for Metastorm e-Work in the last couple of days. They are already pretty successful and can be found here.
Saturday, September 16, 2006
Dell vs HP
I've got a new computer from Dell and now my HP DeskJet 5550 doesn't work. Funnily enough the reason I've got the printer is because my de-facto mother-in-law bought a Dell computer and the printer wouldn't work for her either. Who's to blame for this I wonder? I've been fiddling around with it for most of the day and can't get it to work. I can print out the HP test page but any other page refuses to do very much except throw out a blank sheet of paper. Based on my experiences with the new computer that have been mostly positive (except for the shitload of rubbish software it came installed with) I'm going to blame Hewlett Packard.
Do you ever need to do a complete rewrite?
Joel Spolsky's article about rewriting software has always struck me as a very well reasoned argument for never rewriting software from scratch. He mainly talks about Netscape's attempt to rewrite their browser from scratch. You might claim this was a reasonable success in some respects since it led to FireFox, which now has a pretty decent share of the browser market (about 10% I guess). But compared to the market share Navigator had before they started their rewrite it is still pretty miniscule. Of course they may well have lost a lot of that market share anyway, since MS was installing their browser on every new machine that was sold. But MS stopped developing Internet Explorer after they achieved almost complete ownership of the browser market, which gave FireFox a chance to gain ground. So basically we'll never know what would have happened if Netscape had continued with their old codebase.
So I was somewhat disturbed to find out one of my previous employers had decided to rewrite one part of the software product they sell. I could say who it is but I don't really want to have them getting their legal dogs onto me. I worked on this part of the system for over six years and it is pretty large (with third party code it's over 500,000 lines of code) and pretty central to the whole product. It is written in Delphi and the rewrite will be in C#. As a developer, you always want to work on the latest cool technology and always think the legacy code you're working on is a complete mess, so I'm sure they are happy to be involved on a green field project like this but I'd hope the people in charge would have a very good reason for wanting a complete rewrite, but frankly I can only think of one. It's probably getting increasingly difficult to get hold of good Delphi developers. The market is shrinking and from what I can see the good Delphi developers are moving onto other things, like C#.
I've heard they have a team of five people working on this and it is planned to be done in a year. OK, here's my guess on how long it will take. Whilst I worked there, there were probably on average about 2 developers working on this bit of the system. I'm guessing it continued with the same level of manpower after I left. When I started they already had a working product, if a little rough round the edges, so say that took 2 man years. I started in '98, 8 years ago, so we have another 16 man years of work, 18 in total. Divide that by 5 people and we have about 3.5 years to write a piece of software that has the same functionality as what they currently have... Lets hope they have five really good developers...
As an aside, it has to be pointed out you'd need to have very good reasons to want to get to C# anyway, whether through a rewrite or a migration. Whatever people say, Delphi is still a fine choice for Win32 desktop applications. OK, it is missing some of the nicer features of .NET like reflection and the availability of 3rd party controls is drying up but it still produces small, quick native apps. And if you have a stack of Delphi code, throwing it away is a very expensive thing to do.
But is there any other way? I thought about this when I worked at the company. Like any developer I wanted to move onto new technology so I had a long hard think about how to get from the Delphi codebase we had to C#. One choice was Delphi for .NET, but this looked like a pretty painful route, especially with the number of 3rd party controls (many no longer supported) we were using. My though in the end was the best route to take would be to componentise what we had using COM. OK, this wouldn't really be a step forward, more a step sideways, but once you've got those components in place you could start to replace each bit piece by piece.
But I hear you saying, that would take even longer, since you still need to rewrite each bit and you have the overhead of separating them into COM components in the first place. And you'd have to use that horrible COM Interop stuff as well. All true, but the major advantage of this approach is that you will always have an application in a state that is ready to ship, or very close at least. A complete rewrite means there will be a very long period of time when you can't ship anything at all, unless you want to add new features to the old codebase at the same time as adding them to the new codebase, which will be even more expensive and painful.
So I wish them good luck with their development. I really do hope it works out, because my livelihood now depends on their software...
Wednesday, September 13, 2006
ASP.NET State Service crashes on shutdown
Am I the only person to suffer from this? Can't find anything on the web but whenever I shut down my machine the ASP.NET State Service crashes. I thought it was caused by my old machine but my new machine has exactly the same problem. No big issue since the machine still shuts down but odd that nobody else seems to be suffering with it.
Tuesday, September 05, 2006
We are all doomed
There are still people who claim climate change is only a theory, just like there are people who think that evolution may not be correct or the Holocaust never happened, but there seems to be pretty much total consensus amongst scientists that it is happening and we are to blame. But even if climate change isn't happening, there is another problem awaiting us, which certainly can't be ignored. Fossil fuels will run out and, more importantly, we will pass the maximum level of production, possibly quite soon. And once that happens, if demand continues to increase, the price will rise pretty quickly. And oil is fairly fundamental to our economy, due to the amount used to produce and transport goods. I was pretty stunned when I noticed some apples in our local supermarket were being imported from New Zealand...
But running out of oil was bound to happen at some point in the future but unfortunately we have completely failed to address the issue, so we head into an uncertain future where "the Thames estuary is the most vulnerable place in northern Europe to major storm surges", which could affect me fairly directly.
I'd always thought that computers would help out here. I'm doing my part by working from home but unfortunately it turns out that growth of the Internet is actually sucking even more power from the grid, so perhaps that isn't part of the solution either. So, as the post title says, we are all doomed.
Monday, September 04, 2006
100th Post
So somehow I have managed to reach 100 posts on this blog. I was presuming that by the time I reached this point I would be a major web celebrity with millions of readers and I'd be rich beyond my wildest dreams through the adverts on-site. But it hasn't quite panned out that way and I have to say I'm disappointed in you all. Where are you and why are you choosing to read some boring old shite rather than the riveting stuff here? I feel like this kid...
Friday, September 01, 2006
The Apostrophe Protection Society
Some people seem to have a real problem understanding where apostrophes should and shouldn't be placed so I was pleased to find the Apostrophe Protection Society, who were set up "with the specific aim of preserving the correct use of this currently much abused punctuation mark in all forms of text written in the English language". Their site explains all the rules which are generally pretty easy to understand, except for the occasional edge case.
Thursday, August 31, 2006
Metastorm e-Work 7 and DEP
I've already written about Metastorm e-Work 7, so I was quite excited when I got hold of the CD and immediately started to install it on a test machine. That is until I read the Installation Guide which said "Before attempting to install Metastorm BPM ensure the Data Execution Prevention (DEP) feature is disabled.". Er, excuse me? I read on and was dumbfounded to see that I had to turn off DEP for the whole machine before I could install version 7. I ignored the advice and tried to install anyway but the Installation guide was telling the truth. I couldn't install because DEP was enabled.
What is DEP and why should you worry? Applications on your computer have a code section and a data section. Executable code is contained within the code section and any other data required by the application is within the data section. Most applications will only ever execute code from the code section but until recently nothing stopped you from writing an application that ran code from the data section. This could be potentially useful if you need to write self-modifying code, but there is a very small minority of applications that would ever need to do this. In fact the overwhelming number of applications that do execute code in the data section are viruses, trojans and other malware. So Microsoft have recently introduced DEP that will stop applications executing code in the data section. There are two flavours of DEP, software and hardware. The hardware version only runs on the most recent processors but other than that I'm not sure of the differences. But one thing is for sure, DEP is a good thing! It is just one line of protection for your PC but an important one. Disabling it is asking for trouble.
So why does e-Work 7 require me to disable DEP? To be blunt, the software has a bug. Clearly Metastorm thought disabling DEP was an easier option than fixing the bug. What I do find odd is the fact that it is possible to disable DEP on a per-application basis, so I don't understand why they didn't go down this route. I would certainly consider installing the software if this was how it was set up. As it is, e-Work 7 will be remaining on my shelf. If I was Metastorm I'd be somewhat concerned about the possibilities of a lawsuit caused by a server being compromised due to DEP being disabled...
Wednesday, August 30, 2006
Delphi the best tool for .NET? Er, no
Nick Hodges is doing a fine job of evangelizing Delphi which makes me think Delphi may have some kind of future but in his latest post, he suggests that Delphi is the best choice for .NET development. Delphi is certainly still a great choice for native Win32 application development but it just can't compete in the .NET world. There still isn't a version that supports .NET 2 so Delphi developers don't get to play with all the new features. Delphi is always likely to be playing catch-up in this respect. Also, almost all .NET code examples on the web are in C# or VB.NET which would make life more difficult for anyone developing in Delphi for .NET.
There are situations where using Delphi in a .NET environment makes sense. If you have a large Delphi code base that you want to get to .NET, rewriting in C# or VB.NET isn't likely to be the most cost-effective solution. If for some reason you need to target Win32 and .NET, Delphi would also be a good solution, in fact probably the only solution.
Finally, looking round at new applications coming out, we are now starting to see .NET managed desktop apps appearing. How many of them are written in Delphi? I don't know of one. In the world of ASP.NET I guess it's harder to know what language is being used for the development but I'd guess the vast majority of them are in C# or VB.NET. Compare this to the world of Win32 development where there are quite a few high quality apps being actively developed in Delphi and it's clear that .NET developers also don't think Delphi is the best tool for the job.
Sunday, August 27, 2006
Getting into MySql with PHP
Our host for the Random Pub Finder has been providing MySql integration for a while. I've been holding off using it for a while because I was thinking of converting the RPF to ASP.NET. But I eventually decided that was going to be too much like hard work and would break any links in. OK, I could probably do some URL rewriting to get round that but again it seemed like a lot of bother and PHP does pretty much everything we need.
Anyway, I signed up for the MySql integration and I've been pleasantly surprised with how good the phpMyAdmin web interface is. RPF has been running off several text files for the last five years so I had to make quite a few changes to our code but getting the data in to MySql was pretty straightforward (phpMyAdmin will suck in any kind of delimited text file). Setting up phpMyAdmin on my local machine was pretty straightforward. OK, it's not MS easy, but then this is a free bit of software developed by people in their spare time. So I had to tweak a few text config files to get it working and I couldn't get it to play with PHP 5 but PHP 4 is fine for our needs. And now it's working I'm presuming I won't need to touch it again.
Updating the RPF live site is now much simpler, I just insert a new row in a table and a new pub appears on the site. Previously I had to update one of our text files and email it to myself, run to my other half's laptop, download the email and FTP it to our host via a phone modem, because they won't let me connect to the FTP site via our broadband connection. I guess that's because their business model is based on getting revenue from phone calls...
So, in conclusion, a thumbs up for PHP, MySql and phpMyAdmin. Perhaps I'll stop being an MS fanboy and become a open-source zealot. Time to grow a beard...
Programmable Web
Just found this site, which looks like a useful resource for knocking together Web 2.0 (God I hate that term) mashups (God I hate that term)
Thursday, August 24, 2006
What is the point of Second Life?
Apparently it's very popular with the young uns but I'm failing to understand why. I've been wandering around for a while and there just doesn't seem a great deal to do, except check out some butt ugly buildings. If I want to live in a fantasy world I want to be able to do some fantastic things, like wield big guns and blow up things, not just socialise...
Worst of all, I seem to have to download a new version every time I log in.
Wednesday, August 23, 2006
Google Maps and the Random Pub Finder
OK, I got bored waiting for a response to my queries about ripping off people's code so the Random Pub Finder London Map has gone live. Trying not to be too big headed, I think it's superb. None of it would have been possible without phpcoord and overplot. If programming is an art form then the old adage 'good artists borrow, but great artists steal' must be true...
Solving the Google Maps performance problem
Google Maps has a nice API to create your own map interfaces on a website. Unfortunately it has some serious performances problems when you add a large number of markers. In my case, I have about 500 markers and both IE and Firefox grind to a halt on my page. I've seen various suggested solutions, the most common being to reduce the number of markers by only showing one marker when there are several clustered together when zoomed out. I'm sure that would work but I wasn't too keen on the idea because it just sounded like too much work. Fortunately somebody has come up with a nice solution that works well for me. thanks to the wonderful open source nature of the web, I can happily rip off his code. Just need to get approval from him before I show off my new page to the world...
Sunday, August 20, 2006
Pompous rock star is hypocrite shocker
Thursday, August 17, 2006
More Windows Live Writer
A comment to my previous post from Spike Washburn (of the Windows Live Writer team no less!) suggests image uploading won't be supported until Blogger improve their API, which is a shame. So Blogger, get your finger out! And apologies if it appeared that I was suggesting Windows Live Writer deliberately wasn't supporting image uploads to Blogger.
A couple of other points about Writer. First, I'm very pleased to see it is a managed application. Great to see MS dogfooding the .NET Framework and proving it's possible to produce professional apps using WinForms.
Second, it's great to see developers from MS responding to blog posts from little old me. Fact is I'm a Z-list blogger that no-one reads but I've had two lots of feedback from MS people. That kind of communication will really help build a good feeling towards MS in the IT community.
And yes, I'm using Writer to write this post.
Windows Live Writer
Just playing around with Windows Live Writer and it's mostly pretty cool. The first problem I've encountered is the lack of image support on Blogger, which is pretty much a showstopper. Odd really, because Blogger does support images, but I guess this is a beta...
More fun with <noscript> tags
The guys at BetterDeal wanted to know why their website didn't rank as highly as some of their competitors. Short answer is inbound links, which seems to be the prime ranking decider used by Google. To illustrate I did a link:www<dot>carbroker<dot>com<dot>au search (replace the <dot> with ., don't want them getting anymore inbound links), which is one of their competitors. The odd thing was that one of their inbound links came from a penis enlargement site. Penis enlargement doesn't have a lot to do with new cars, other than the obvious psychological enlargement for men who buy big red Ferraris. Looking at the source of the penis site (purely for research of course) showed up the reason. The link was hidden away in a <noscript> tag. Car Broker are also the guys who have <noscript>betterdeal</noscript> hidden away in one of their pages slagging off reverse auctions, which is why they rank pretty highly for a search on "BetterDeal reverse auction". Although Google know about this, they haven't done anything about it and their algorithm still doesn't seem to handle <noscript> tags too well...
Tuesday, August 08, 2006
Borland goes Turbo
Monday, August 07, 2006
Land Rover's misplaced marketing
Sunday, August 06, 2006
Richmond Park
Thursday, August 03, 2006
DesignerSerializationVisibility attribute
Use the tool, tool part 8
Use the tool, tool part 7
Use the tool, tool part 6
Use the tool, tool part 5
Use the tool, tool part 4
Use the tool, tool part 3
Use the tool, tool part 2
Use the tool, tool part 1
Wednesday, August 02, 2006
BPM software comparison
Monday, July 31, 2006
House price crash? I hope so
Friday, July 28, 2006
Windows Live Local vs Google Maps part 2
Wednesday, July 26, 2006
Windows Live Local vs Google Maps
Cunts are still running the world
Tuesday, July 18, 2006
An unobjective review of Metastorm BPM 7
Friday, July 14, 2006
MMC RIP?
Friday, July 07, 2006
How to choose colours for a website
Wednesday, July 05, 2006
Ajax.NET Professional
Sunday, July 02, 2006
England suffer completely predictable World cup exit
Friday, June 30, 2006
How to rescue a Delphi project
Tuesday, June 20, 2006
What is System.RuntimeType?
"RuntimeType is the basic Type object representing classes as found in the system. This type is never creatable by users, only by the system itself. The internal structure is known about by the runtime. __RuntimeXXX classes are created only once per object in the system and support == comparisions."
But this still wasn't much help. So I thought I'd have a hack around. The reason it isn't documented and doesn't show in many searches is because it's an internal class, which makes it a bit surprising I'm seeing at all. But it does have a useful property called UnderlyingSystemType that returns the type I'm interested in. Of course because it's internal I can't access that property. The way round this is via the best thing since sliced bread, reflection. So here is the litle snippet of code I came up with to do just that.object val = reader.GetFieldType(index); Type runtimeType = val.GetType(); PropertyInfo propInfo = runtimeType.GetProperty("UnderlyingSystemType"); Type type = (Type)propInfo.GetValue(val, null);
Update - As mentioned in the comments (only took me three years to respond!), this code is actually pointless. The thing I hadn't noticed is that RuntimeType inherits from Type, so although it isn't possible to deal with an instance of RuntimeType directly, you can just treat it as an instance of Type instead.
Sunday, June 18, 2006
The construction of a disco shed
Thursday, June 15, 2006
The story of an SL-1210
Saturday, June 10, 2006
HTTPS and stupid error messages
Wednesday, June 07, 2006
Server-side view state
Monday, June 05, 2006
Handling errors in ASP.NET
public static void LogError(string errorMessage) { // log error to database using (SqlConnection connection = new SqlConnection()) { connection.ConnectionString = ConfigurationSettings.AppSettings["connectionString"]; connection.Open(); using (SqlCommand command = connection.CreateCommand()) { command.CommandText = "INSERT INTO Log VALUES (GETDATE(), @Error)"; command.Parameters.Add("@Error", errorMessage); command.ExecuteNonQuery(); } } // send email SmtpMail.Send("webserver@initech.com", "doogal@doogal.co.uk", "IniTech web server information", errorMessage); } protected void Application_Error(Object sender, EventArgs e) { // log exceptions Exception ex = Server.GetLastError().GetBaseException(); StringBuilder errorMessage = new StringBuilder(); errorMessage.AppendFormat("An unexpected error occurred{0}", Environment.NewLine); errorMessage.AppendFormat("Type: {0}{1}", ex.GetType().ToString(), Environment.NewLine); errorMessage.AppendFormat("Source: {0}{1}", Request.Url.AbsoluteUri, Environment.NewLine); errorMessage.AppendFormat("Message: {0}{1}", ex.Message, Environment.NewLine); errorMessage.AppendFormat("Browser: {0}{1}", Request.UserAgent, Environment.NewLine); errorMessage.AppendFormat("Stack trace: {0}{1}{2}", Environment.NewLine, ex.StackTrace, Environment.NewLine); errorMessage.AppendFormat("Session data: {0}", Environment.NewLine); foreach (string key in Session) { string val = string.Empty; if (Session[key] != null) val = Session[key].ToString(); errorMessage.AppendFormat(" {0}: {1}{2}", key, val, Environment.NewLine); } LogError(errorMessage.ToString()); }
Friday, June 02, 2006
Skype rocks
Tuesday, May 30, 2006
DCOM from .NET
Type type = Type.GetTypeFromProgID(progId, serverName); if (type == null) throw new Exception("Unable to find the object, ensure the type library is registered"); Object objTest = Activator.CreateInstance(type); ComObject comObject = (ComObject)objTest;