PHP Is Evil
Okay maybe not evil, just braindead in this particular area but I’ve got a theme going this afternoon.
If you have multiple form elements with the same name in a HTML form, PHP discards all but the last of them unless the element’s names end with []. How’s idea was that? Didn’t anyone consider the fact that you might not have control over the form element’s names? Or that dealing with form elements with special characters in their names might just be difficult (the PHP manual has a number of useful tips on how to handle it).
IIS Is Evil
Here’s a tip, if you configure IIS to use a custom 404 error page (or any type of error I imagine) and use the “URL” type, IIS will return 200 OK by default instead of the appropriate error code. This breaks things in very unexpected and often difficult to track down ways.
You can work around it by making sure that the URL you use for the error page is a script of some kind that sets the return code to the appropriate error code again. The default however should really have been to preserve the error code. Sigh. Using “File” or “Default” for the error page works correctly.
Playing With Skype
I thought I’d take another look at Skype – we used it at work for a while and eventually gave up on it as it was just too much of a hassle compared to a normal phone call even if a phone call was more expensive.
Anyway, my username is ajsutton so feel free to give me a call so I can test it out.
Forget the message, respect the attitude
I have to say, I am really impressed by Robert Scoble’s attitude. Someone rips into him and unsubscribes from his feed in a highly public and critical fashion and he takes it on the chin and points out how good it is that people can do that to him (and in fact to anyone brave enough to publish their thoughts on a blog).
As someone who has ripped into Robert’s comments before (and knowing me, most likely I took the odd cheap shot at him as well in the process) and being someone that disagrees with most of what he has to say, this is why I keep reading “Scobilizer”. He can take criticism well and actually learns from that feedback. Sure he mightn’t go so far as coming to his senses and agreeing with me
Why This Site Won’t Use application/xhtml+xml
Byron and I seem to be heading for another round of make it standard or make it work discussion. In this case, Byron pointed out that pages on this site are served as text/html instead of application/xhtml+xml. After some brief investigation, here’s why I’ll be sticking with text/html:
It works. application/xhtml+xml doesn’t.
Firstly, apparently IE 6 doesn’t support application/xhtml+xml, at least according to http://www.xml.com/pub/a/2003/03/19/dive-into-xml.html so I’d have to dynamically detect the browser and change the mime type anyway. I really must start up my PC and check how the entire site looks on IE for Windows for myself - I haven’t bothered as yet.
New Site
If you’re seeing this post, you’ve made it through the maze of redirects to the new home of my blog. If you normally read via a planet or RSS feed, now would be a good time to head on over to the actual site to check out the new design (featuring the Brisbane skyline courtesy of Iain Robertson).
Apologies if previous entries show up as new, the RDF feed has dates in it so hopefully it won’t cause any problems but changes to blogs almost always seem to cause some problems.
How To Fix NetNewsWire “Domain: POSIX Type: error code: 32” Errors
If you are finding that NetNewsWire doesn’t update your feeds like it should be and when you open /Applications/Utilities/Console you see a bunch of lines like:
2005-02-24 15:54:24.679 NetNewsWire Lite[371] HTTP download error -- Domain: POSIX Type: error code: 32 -- URL: http://feedster.com/links.php?url=http://www.intencha.com/adrian/&type=rss
and you’re using Privoxy try changing the proxy settings from using localhost to using 127.0.0.1. Doing so will also fix a problem where Internet Exploreron OS X can’t connect to any sites despite the fact that Safari can connect successfully.
On Smart Tags And Producer Rights
Iain Robertson and Robert Scoble have commented on Google’s new smart tags feature and while I agree with most of what they said I have to disagree on their views of producers rights.
Iain said:
Admittedly, the main people complaining will be those whose content has been altered, i.e. the producer of a given piece of work, who might find that some people are tracing new and interesting links away from their site. Fair enough that they complain, too — I know the idea of J. Random Company “hijacking” content in my site irritates me somewhat. To that end, I’d hope that Google would use the MSSmartTagsPreventParsing meta-tag, and/or a common tag standard can be agreed upon to allow content creators to opt out of the “service.”
Evangelists and Koolaid
A fair while back I commented on a job opening at Microsoft, noting that my blog would probably work against me in that particular case due to it being so critical of Microsoft. Robert Scoble noted that Microsoft don’t want to hire evangelists that just drink the company Kool-aid and have no credibility. He’s right of course but slightly missed my original reasoning. It’s not so much that I’ve made some negative comments about Microsoft – more that I pretty much have never said anything positive about Microsoft on my blog. I was supportive in my “Missing The Point” entry about Microsoft’s new interoperability initiative and did defend beta releases which were relevant to Microsoft at the time, but that’s about it. See for yourself.
How To Simulate Key Events In Swing JUnit Tests
Gianugo Rabellino has been playing with unit testing in Swing – an area that I’ve spent a lot of time complaining about in the past. In his particular case he’s trying to send key events to Swing components programmatically so that his JUnit tests can run automatically. As Gianugo discovered you can’t just create a KeyEvent and send it to Component.dispatchEvent() because it gets rerouted to the focus manager.
Gianugo’s solution was to display the component on screen in a JFrame and make sure it has focus. However, we can go one better – we can simulate the component having focus.
Book List
I’ve set up a blog to keep track of the books I want to read. This year I want to do a lot more reading, particularly on technical subjects but also just stuff in general. The most recent entries are syndicated into this blog over on the right hand side of the main page and RSS junkies can grab the feed.
Allowing Tests To Fail
The basic idea of unit tests is that you write them once and run them a lot – you don’t check in your changes unless all the unit tests pass. This is a great idea.
There is one problem with it – it prevents unit tests from being used as a specification of work to be done later. I don’t mean it prevents test driven development where the tests are written then the code is to make them pass is added and then the tests and code are checked in. I mean where a particularly complex piece of functionality is going to be added and the best way to ensure that all the use cases are covered is to write unit tests for them all and let them act as the specification (note: this doesn’t work well if you have a non-technical client, but if you are working on off the shelf software it can be very useful). You need to plan the set of features to include in a release ahead of time so you wind up with a whole heap of new unit tests which are acting as this specification that at some point in the future you will make pass. At the moment though, those tests are okay to fail.