Bell EndBell Endquite amusing and drastically geeky at the same time Articles
Buy Nothing Day
2007-11-24 22:39:00 Today was Buy Nothing Day, which I think is a top idea. I've been aware of this for a few years, but today I only heard about it after I'd popped out to buy some batteries. They are rechargeable so I don't feel too bad about it.
What is click fraud?
2007-11-23 23:09:00 There are plenty of examples of obvious click fraud, people setting up dubious websites with advertising then using nefarious means to get clicks on those ads, companies clicking on their competitors ads to drive up their competitors' costs. And these kind of examples of fraud are quite possibly detectable by the companies who run the ads. But there seems to be a whole other bunch of other stuff that may also be considered fraudulent, or at the very least not valid clicks. For instance, my daughter can now use Google to search for stuff on the internet but she has no idea of what the difference is between a sponsored ad and a normal search result and since she can't read everything, she just clicks on whatever she feels like. And, until she works out how to use my credit card, she won't be buying any Charlie and Lola gear from one of the sites she visits. Or what about me when I see an ad for some dubious debt company or some get rich quick scheme and I click on the link purely ... More About: Fraud , Click
Posting errors to a website
2007-11-20 22:23:00 The exception logger I've written is one of the most popular pages on my proper website but I've never been completely happy with it. I've always wanted to be able to get the details of an unhandled exception from the user of my software to me easily. I added support for sending an email some time ago, but that's never felt like a good solution since the user must configure their SMTP connection before sending off the email. Then I read a website posting suggesting a much better solution, post the error to a website, then email the error to the relevant address from the web server. That way, email only needs to be configured in one place, on the web server. Admittedly if the user isn't hooked up to the internet it won't work, but sending an email via SMTP will also generally fail in that scenario. The exception logger code shows how to do the client-side code, but here it is anyway. private void LogToWebsite (string error) { Uri uri = new Uri("http://www.yourwebsite... More About: Errors
Developing custom state activities
2007-11-19 23:10:00 I've banged on before about how extensible Windows Workflow is (assuming you can work out how to extend it), but there is at least one place where it isn't quite as extensible as one would like, state activities. I was trying to create a custom state activity that contained a state initialization activity and an event driven activity and various other activities within those. The first problem I encountered was when I inherited from State Activity. Trying to add any activities at design-time failed. This seems to be down to the state activity designer. One solution would have been to write my own designer class, but this is complicated by the fact that the standard state designer is internal so can't be inherited from. I guess I could have decompiled the code using Reflector and made the required mods in my own code, but that seemed too much like hard work. So I decided to construct the activity in code instead. Then I bumped into the second problem. Adding activities in code is... More About: Activities , Custom
Sharepoint create task workflow error - Not supported exception
2007-11-15 23:41:00 If you've tried to create tasks in workflows hosted in Sharepoint using the Create Task activity you may have come across this error in the Sharepoint logs. System.NotSupportedException : Specified method is not supported. at Microsoft.SharePoint.Workflow .SPWorkflowT ask.SetWorkflowData(SPListItem task, Hashtable newValues, Boolean ignoreReadOnly) at Microsoft.SharePoint.Workflow.SPWinOETask Service.UpdateTaskInternal(Guid taskId, SPWorkflowTaskProperties properties, Boolean fSetWorkflowFinalize, Boolean fCreating, HybridDictionary specialPermissions) &nbs p; at Microsoft.SharePoint.Workflow.SPWinOETask Service.CreateTaskWithContentTypeInternal (Guid taskId, SPWorkflowTaskProperties properties, Boolean useDefaultContentType, SPContentTypeId ctid, HybridDictionary specialPermissions) &nbs p; at Microsoft.SharePoint.Workflow.SPWinOETask Service.... Although saying that, my own searches on the Internet didn... More About: Error
Pies and Prejudice
2007-11-11 13:29:00 One of the sure signs of getting older is listening to Radio 2, not in some kind of ironic post-modern way but because, of all the options available, it seems like the best one. And if you listen to Radio 2 then it's pretty much required to like Stuart Maconie, since it seems like half their output involves him. Fortunately I fall into that category. The man's funny and it's always good to hear a Northern accent on the radio (even if it has been softened, presumably from too many years living in the South). So when I saw his book 'Pies and Prejudice - In Search of the North' I was interested. When I read the back cover 'A northerner in exile, stateless and confused' I thought yep that's me and promptly bought it (OK I put it on my Amazon wish list and somebody bought it for me several months later). And it's a great read. He writes like he talks, so if you like his shows you'll like the book. Any Northerner reading it will no doubt be disappointed by his lack of coverage ...
Using Sharepoint activities in a workflow designer
2007-10-30 22:02:00 If you're hosting the Windows Workflow designer control in your own application (this shows you how to host the control) and you want to use the Sharepoint activities, these are the files you'll need (these are for Sharepoint Services, I think there are more activities for MOSS 2007). Microsoft.SharePoint.dll Microsoft.SharePoint.Security.dll microsoft.sharepoint.WorkflowActions.dll microsoft.sharepoint.WorkflowActions.intl .dll microsoft.SharePoint.workflowactions.intl .resources.dll I'm not sure of the rules regarding redistribution of these files since I'm only using it for my own personal use. If you're having trouble getting any of these files out of the GAC then read this post which explains how to get them out. More About: Activities , Designer
MSDN forums not very useful
2007-10-29 22:11:00 How hard can it be to write some code for a web forum? After all it's a problem that has been solved thousands of times before. Well apparently it's too hard for Microsoft. I've been trying to post to their MSDN forums for the last week and whenever I try to create a new thread or reply to a thread I get the following error message. I've tried clearing out all the crud from IE, with no joy. So I'm forced to kick off a Virtual PC session to post, not very handy. Not only that, when I get an email alert telling me about a reply to my post, the link starts with 'h ttp://forums.micro' so it doesn't fecking work. More About: Forums
A no-op activity
2007-10-29 21:55:00 I'm in the process (no pun intended) of converting one business process XML language to XOML via some XSLT. I'm not really sure how some of the source activities will map to Windows Workflow activities so I'd like a no-op activity for the time being, just so I get the correct layout of the process, without having to nail down all the details. The solution is actually very simple, just use the base Activity class whose Execute method does nothing, simply returning ActivityExecutionStatus.Closed. Although it's not available in the Visual Studio toolbox, Visual Studio copes quite happily with a XOML file that contains an Activity activity.
Web applications aren't the solution to every problem
2007-10-28 22:40:00 I've been working on an ASP.NET website for a while now. For the admin side of things, I've added a few pages for updating the database and such like. There have always been problems with updating the data, which is read in from some text files and then dumped in the database. First there were problems with the size of the data in the files, which was solved initially via the maxRequestLength attribute in web.config. Then the file upload to the web server was still taking a long time so I started to require the data to be uploaded via Remote Desktop or FTP. Then I had problems with the SQL update timing out. This was solved by increasing the value of the executionTimeout attribute in web.config. But after a while even this didn't work and the update failed when the request timed out. I could probably increase the timeout some more or I could use some other technique to get it working, but I eventually came to the conclusion that this just isn't what I should be doing. ... More About: Applications , Problem , Solution
The problem with LINQ
2007-10-26 00:30:00 In principle it sounds like a great idea. Rather than having to learn SQL, XPath and whatever other query language you care to mention, just learn LINQ and use it to access any data source you like. That's great and all, if I'm using .NET 3.5 for every single project I work on. And until I am (which I'm guessing will be, er, never), LINQ is actually yet another thing to learn. So now I need to know SQL, XPath and LINQ. Or perhaps not, perhaps best to just forget LINQ and stick to the old stuff, since it works and is available on most platforms. When LINQ is available everywhere, then I'll start to think about learning it. More About: Problem
MySQL error messages = crap
2007-10-23 22:01:00 OK, it's an old version of MySQL (4.0.25 to be precise) but the error messages are completely useless. Almost any kind of SQL syntax error shows this helpful message. #1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT PubID FROM Pubs ) LIMIT 0, 30' at line 1 Of course the problem is that MySQL 4 doesn't support subqueries (!), apparently MySQL 5 does and perhaps my ISP will upgrade one day... More About: Crap , Messages , Mysql , Error , Mess
SonicWall VPN client for Vista released
2007-10-23 00:29:00 My post about the SonicWall Vista client beta is one of the most popular things on here, lord knows why. Anyway, the final version has been released and it is working perfectly for me. I've not had any problems with Vista complaining about two computers with the same IP address being connected to the network. I realise I'm really tempting fate writing that... More About: Released , Client
Licensing
2007-10-19 22:28:00 Somebody emailed me asking what the licensing terms were for some code he'd found. I was surprised somebody would bother asking since I tend to assume any code I find on the web is public domain (although I wouldn't dream of stealing somebody's prose - odd how I think of code differently to the written word). But of course this isn't necessarily the case. In fact I believe if no licensing terms are explicitly stated, the code is by default copyright of the author. So to clarify the licensing for anything on this site, any code samples are public domain. Do what the hell you want with them. I do however claim the copyright for the English on here, not because I think it's particularly valuable but because I don't want spammers stealing it for their own sites. Not that a little copyright theft is likely to stop them of course, but I don't want to make it perfectly legal for them either. Whether any of this is legally binding, who knows, but I'm definitely n... More About: Licensing
Improved Excel-like select all in a DataGrid
2007-10-19 22:15:00 My first attempt at this worked mostly but if the user clicked anywhere in the grid that wasn't a cell, the whole grid would be selected, which wasn't what I was after. So here's an improved version which will only select all when the user clicks in the top left cell. public void Select All() { BindingManagerBase bm = BindingContext[DataSource]; for (int i = 0; i < bm.Count; i++) { Select(i); } } protected override void OnClick (EventArgs e) { base.OnClick(e); Point client = PointToClient(Cursor.Position); HitTestInfo hitInfo = HitTest(client); if ((hitInfo.Column == -1) && (hitInfo.Row == -1)) { if (client.X < TableStyles[0].GridColumnStyles[0].Width) if (client.Y < TableStyles[0].PreferredRowHeight) SelectAll(); } } More About: Excel , Prove
Radiohead's pay as much you like strategy
2007-10-12 22:40:00 I had every intention of buying the new Radiohead album from their website. After all, they've done exactly what I've asked for. It's DRM-free and the price is reasonable (since it's whatever I consider to be reasonable*). But I had some problems. First the site constantly timed out when I tried to connect yesterday (which I guess is a good sign since it suggests they are getting a good number of hits). When I did manage to connect and I registered, I was asked for my mobile number, which was a required field. Er, I don't have a mobile. And if I did, why do I need to give the number to you? Unsurprisingly, the album is pretty easy to find from illegitimate sources and there are no hoops to jump through to get it from those sources. So if I wasn't fussed about a bit of copyright infringement, that's what I'd probably do. It's clear the music industry and Radiohead are still missing the point about downloading music. Price isn't the k... More About: Strategy , Adio
Words that annoy me
2007-10-10 22:56:00 Spelunking - This word comes from the caving community, the weird guys who like to go down small wet holes at the weekend (fnar, fnar). They may be weird, but their sport is kind of dangerous and possibly exciting. Now the geek community have appropriated the word to describe, er, groping around in new technology or source code. It seems to be a desperate attempt to make IT sound much more interesting than it really is. Look, computing is not cool, get over it. Grok - What is wrong with 'understand'? It's been in the English language for quite some time and everybody (including normal, non-geek people) knows what it means. Also see above. Regards - Email and the web have always seemed pretty informal to me. There was a time in about 1990 when I ended emails with some kind of sign off, but now I find my name is plenty to mark the end of a message. So when I see 'regards' (or worse 'kind regards'), I think that the person sending that message has some kind of problem.... More About: Words , Anno
Excel-like select all in a DataGrid
2007-10-02 22:20:00 Clicking on the top-left cell in Excel selects the whole worksheet, which always seemed like a good use of an otherwise useless cell. So I've done the same with the DataGird-derived control I've been using in one of my apps. It's pretty damn simple to implement, but for the lazy amongst you, here's some code. public void Select All() { BindingManagerBase bm = BindingContext[DataSource]; for (int i = 0; i < bm.Count; i++) { Select(i); } } protected override void OnClick (EventArgs e) { base.OnClick(e); HitTestInfo hitInfo = HitTest(PointToClient(Cursor.Position)); if ((hitInfo.Column == -1) && (hitInfo.Row == -1)) { SelectAll(); } } More About: Agri
A simple 'Check for updates'
2007-09-25 21:25:00 My brother asks when I'll post something interesting on here, but it hasn't happened yet so I doubt it will anytime soon... Anyway it seems the most boring posts are the most popular so I'll keep on posting crap. Back to the point of this post. Lots of applications these days will check for an update when they start or when you press a 'Check for updates' button or menu item. Some really annoying applications have some little helper process that runs continuously and checks on a regular basis then throws up a big dialog telling you that there's an update (that's you Apple). Not wanting to be left out, I thought I'd do the same. But being incredibly lazy, I couldn't be bothered to implement it completely. So this little bit of code will read a text file stored on the web server and tell the user that an update is available. It won't do anything fancy like download it for them or install it but I might add that at some point. Usage is simple, set the... More About: Updates , Simple
Getting directions using Google Maps
2007-09-20 22:17:00 I'm not sure when this feature was added but Google Maps now lets you drag your route around, if you want to go via a particular place. I'm not sure how useful this will be for me, but it's certainly cool to play with. Saying that I have asked for a web app to create Google Maps routes previously, and this is certainly heading in the right direction. It's possible to embed the map in a web page via an IFrame pretty easily, but I can't add markers and images, so not quite there yet. I was going to embed the route of my bike ride today but of course it doesn't understand about going off road or, erm, going through pedestrianised areas so I didn't have any luck with that. Another great new feature is the information about bus departures, although weirdly I'm only seeing these in my local area, Kingston. It seems to be getting its information from Transport Dire ct, a website I've never seen before, but that looks like it goes some way to fulfilling my r... More About: Directions
Buy a people carrier
2007-09-19 22:45:00 It got us to Spain and back in one piece with not a hiccup, but now it's time to pass our trusty vehicle on to someone else. If you're interested then check it out. All reasonable offers will be considered. More About: People , Carrie
More reliable wireless
2007-09-17 22:49:00 When I set up our wireless router, I initially set it up as an unsecured network and restricted access to certain MAC addresses. This worked fine but when we had visitors who wanted to use our wireless connection, it was a bit of a pain to allow access to their laptop. So I changed the router's configuration so it used WPA security and it all seemed to be working fine. But then a couple of things happened which I didn't realise were related to this seemingly simple change I'd made. First, the wireless connection would stop working every few hours. This affected any computer connected to the network and would typically last a few minutes and then everything would be fine again. This was particularly annoying when I was connected to somebody's VPN and would have to re-establish a connection. The second problem was my Vista PC started to lock up completely. This was less frequent, about once a day. I put the first problem down to the number of wireless networks in cl... More About: Wireless
Are we in a fast moving industry?
2007-09-16 23:20:00 It's virtually taken for granted that we work in a fast moving industry and the facts would appear to back up this theory. Just look at the new programming tools coming out of Microsoft (I'm just going to talk about them since I don't really even try and keep up with technology coming out of other companies). In no particular order, some of them are: WPF, WCF, WF, Silverlight, Linq, CardSpace, Virtual Earth, ASP.NET AJAX, Vista... But hang on a second, who is using this stuff and how much of it will be relevant in five years time? Myself, the only new technology I'm looking at is Windows Workflow, since it may well be useful in my job. The rest may become relevant at some point and if and when it does I'll start looking at it then. And I'm a geek who likes to fiddle around with new technology. What about the normal people out there who aren't obsessed with software? Well, it doesn't look so good there either. Take IE7, which has been out for almost a year. Usage ... More About: Industry , Moving , Fast
Handling 404 errors in PHP
2007-09-11 21:00:00 If you're running a PHP site on your own server, you can find out what 404 errors have occurred by viewing the log files. If, like me, you're running your PHP site on a cheap and cheerful host, you're probably not going to have access to the log files. But you can probably still do something to find out about them. The first thing to do is ensure your users see a useful error message, rather than the default provided by your host, which will probably be some page advertising their services. This can be achieved via the .htaccess file, if your site is running on Apache. IIS has similar features, available through its admin tool (although I can't believe there are many people using PHP on IIS). Add something like the following to the .htaccess file to tell Apache to show your custom error page. ErrorDocument 404 /error.phpThe next thing to do is to make sure you get notified if somebody ends up on a non-existent page on your site, so just add the following code to ... More About: Errors
Yet more tick mark fun
2007-09-07 21:56:00 I've written about this three times now. Read my previous posts here Displaying a tick mark in HTML More on tick marks in HTML Even more on tick marks in HTML But it turns out it's not as simple as the browser somebody is using. The other day I noticed that my tick marks weren't displaying on a computer that had IE7 installed. After more fiddling around I realised the fonts installed on that particular PC must be different to the ones installed on other PCs I'd tested and IE7 was unable to find the tick mark. I'm not sure whether IE7 only uses the current font or if it tries other fonts in an attempt to find the correct symbol but in any case it just displayed a square block. Because of this I'm thinking perhaps the only 100% reliable solution is to either use an image or to display a checkbox in all situations, not just for IE6. In a desperate attempt to avoid either of those solutions, I've started using the 'Arial Unicode MS... More About: Mark , Tick
Road trip map
2007-09-02 23:02:00 After some fiddling around with Google Maps I've managed to come up with a little map of our journey through France and Spain. It would be way cool if somebody came up with a web app that could be used by normal people to do this kind of thing... More About: Trip , Road Trip , Road
A disconcerting sign
2007-08-28 21:11:00 Seen on the ferry over to France... More About: Sign , Cert
Increment by increment
2007-08-27 22:25:00 Popular music lyrics don't often use the word "increment" so I was pleased to hear British Sea Power use it on their first album. In fact they use quite a few unusual words and phrases. But "increment" has stuck in my head because it's such an important word to me. Take programming for instance. Joel Spolsky calls development "The Game of Inches", but personally I prefer to think of it as a game of millimetres. It's probably partly due to my metric background but also inches suggests you might spot you've made progress after a day, whereas often I'll only recognise some progress has been made on a development project after weeks or months. Perhaps I'm just a slower programmer... The fact is you can't make a lot of headway in a day. Which is probably why agile development has become popular. I'm not sure about parts of agile development but the idea of taking baby steps to get to where you want to be seems like a pretty damn good idea and I've... More About: Creme
What I learnt on the road trip
2007-08-24 00:39:00 Take as few tents as possible - Campsites in Europe generally charge per person, per vehicle and per tent. Since you can't do much about the first two, the only way to save money is to bring a single tent that's big enough for everybody to fit into. The downside of this is the possibility that your big tent won't fit in the plot, but most sites seem to provide a pretty big space for you. Take some kind of mattress - I've always slept directly on the ground in the past without problem, but the campsites in Europe can have much harder ground than the sites in blighty, with little or no grass, leading to some not very restful nights. Spanish people stay up very late and have exceedingly loud TVs - I guess I already knew they stay up late, but hadn't considered the potential problems when staying in a camp site. Most of Spain takes the whole of August off and some of them head off to camp for a month, along with their tellies. They are then involved in an arms war in an a... More About: Trip , Road Trip , Road , On The Road , The Road
Road trip
More articles from this author:2007-08-08 01:01:00 It all started when my brother read Trek by Paul Stewart. The book describes the story of four people attempting to cross Africa (including the Sahara) in a Morris Minor during the 50s. Unfortunately it all ended in tragedy. Oddly enough, due to this story, we head out on Thursday on a road trip of our own. Not quite as dangerous as crossing the Sahara (although by all accounts, thanks to GPS, even that journey is much less risky than in the past), we're heading off to Spain to see my dad. The original plan was to go in a Rover P4, but the demands of teenagers mean we have to go in an air-conditioned people carrier. From a personal perspective, I also see this as part of the slow travel movement. I haven't worked out the figures but I'm hoping this will be better for the environment than flying (although staying at home would be even better of course) and will be much more fun than being crammed on an EasyJet plane. So move along, there won't be anything to s... More About: Trip , Road Trip , Road 1, 2, 3, 4 |



