Friday, June 24, 2005

Weather terrible, glad I am here...

Occasionally I am reminded about my place in the world, and why I choose to occupy it. I am sitting here watching The Zutons playing at Glastonbury on BBC 3, and I know that much as I love them I would not like to be there. I am definitely not a festival person. Last year my friends and I gave up on a camping trip to Wales after two nights of storms. I would never have been able to take the weather this morning at Glastonbury. But I am happy to enjoy it through the mediums of television, radio and the Internet.

Luckily I have had the perfect opportunity to do just that as I had to work from home today. The underground stopped dead this morning, well at least the line that I should have been using did. Of course I am most glad that I was not one of the unlucky people stuck in a tunnel in soaring temperatures. So back to the flat I came, fired up the laptop and here I've been for most of the day. I ventured out briefly to the local pub for lunch, first time in three years that I have done that. It was full of old men, who ignored each other until they left. At which point the goodbyes were so involved and heartfelt you would think that they had been debating life, the universe and everything for the last hour instead of sitting in silence reading papers and eating soggy ham sandwiches.

This has been a glimpse into the world of people who work from home, and it scares me. For so long I have really wanted to be in a position to do this some day, but now I realise that you need to gear up to it. You need your lifelines, so that you don't go a little nuts. Today my lifeline was MSN Messenger to people in the office, most of whom had not even noticed I wasn't there. You also need to structure your day and ensure that you leave the flat at some point. I didn't have any problem knuckling down and doing the work, it was making myself take breaks that was the problem. In the office I can go to the kitchen to get a coffee, and that can turn into a 15 minute break, what with putting a new pot on and talking to a colleague who is also waiting for something to boil, steam or ping. Lunch today was about 30 minutes, because I went out, ate and came back. Heading out with the team from the office is rarely less than a full hour.

I don't know many people who work from home, but I think I am going to seek them out and find out the true secrets. I still like the idea, but it's 6:30pm and I need to get out for bit because those pesky walls are sneaking in on me again...

Monday, June 20, 2005

Money is there to be spent, right?...

So I went and did it again, I blew a load of money on a new toy. I spent most of last week fighting a battle of wills with the Apple store on Regent Street, here in sunny (for a change) London. It kept on calling to me from clear across the city, and the things in there were all so pretty. When I did cave, I would like to point out, it was limited to a minimum specification iBook.

To be honest with you I had decided that I was going to make the move to Apple, with my next computer, some time ago. I haven't mentioned it till now, partly because I really wasn't planning on getting one so soon. However I also wanted to get that last article out of the way before you all found out that I have switched camps again.

Before I am flamed by Linux advocates everywhere, please understand that I am not turning my back on Linux at all, my other machines will still continue to run Suse. The reason that I moved to Apple is simple, and it is simplicity.

I am a geek and a nerd, everyone who has every met me will testify to that, including my family and my extremely understanding girlfriend. It would be easy to assume that I would be happy to monkey around with Linux, especially being a developer and one who spends most of his time working on an open source project. It is true, but not all the time. There are other things that I want to do. For those things, Linux on the desktop is not quite there. It is there for most standard desktop tasks, it is there for the general office tasks (except Project Management where integration with MS Project really is a must have). But it is not there for video editing or some of the other associated and slightly more esoteric tasks.

By moving to Apple some people will see that as me making a statement of some kind, and I suppose it may well be whether I want it to or not. But really it was all about the right tools for the job, and that job is not what I thought it was going to be when I went down the Linux root. Again I tell you that I am not turning my back on Linux, far from it, nor on open source. One think I am definitely not doing is turning back to Microsoft, they have lost me for a good long while, if not for ever, and for those that know me well, that is a big thing...

Friday, June 17, 2005

Wintel, Lintel now Mactel(?) ... are we in the Post OS era?...

Strangely I haven't yet heard anyone put forward an offering for this, I think Mactel sounds better than Apptel personally. Although we could go a bit all out for something different and use Intac...Perhaps not. Of course I am referring to the worst kept secret in the IT world, which Steve Jobs finally let out of the bag at the Apple Developers conference the other week, that from June 2007 every single computer sold by Apple would be built around Intel chips.

This is truly big news, for many people. Best of all it was delivered in Jobs' perfected nudge, nudge, wink, wink style of delivery. I cannot recommend enough that you watch the whole thing (in QuickTime of course) here. It is a masterpiece of unveiling, starting with the typical catch up on how well Apple has been doing over the last year, then moving into the wonderfulness of Mac OS X 10.4. Jobs focuses a lot on the new Dashboard features, not missing an opportunity to have a dig at Microsoft along the way by showing off the count down calendar, entering 2009 and labeling it Longhorn.

After about half of the presentation he moves to the big build up, talking about the major changes in Apple's history, moving from the 68000 to the PowerPC and then Os9 to OSX and then he simply puts up a slide saying "It's true", the dropped 'e' matching perfectly to the Intel logo. The master stroke though is proving the doubters wrong about how good Mac OS X will be on Intel by revealing that the machine he had been demoing on for the last 40 minutes was in fact an Intel machine...he shoots, he scores and the crowd go wild...

So we come into the new world with three different *tel platforms, what does this mean? Well for a start it will, as many are saying, hurt Apple sales in the short term. This is the reason that they waited and presented a complete and finished solution to the world, and most importantly the developers. So much emphasis was place on the idea of the "Universal Binary" that Jobs was all but screaming "please keep buying the PowerPC machines!!!". The first machines will be on sale by June 2006 and the whole line (by which I presume he means XServe, Mini and laptop machines) will be Intel by June 2007. After that Apple will be in a great position. Not only will they benefit from the greater range of chips that Intel can give them, therefore more powerful laptops which are what people have been crying out for from Apple, but also, and perhaps more importantly, they are no longer tied into a single vendor.

A few people have commented that it is strange that Apple would go for a link up with Intel when many see AMD as having much more momentum. They trumped Intel to the 64bit revolution (Apple and PowerPCs of course having trumped them both), and AMD are seen as being more innovative. Intel must be extremely happy, although perhaps not so much when they are being forced, as part of the launch of this new venture, to describe Apple as the best PC manufacturer and potentially pissing off their many other clients. Anyway, I am digressing from my point, which is that while they have linked up with Intel for the launch there will be nothing stopping Apple from moving away to the AMD camp in the future, or even running multiple lines with different chips.

I find the situation we will be in extremely strange. After all this time and development we are now in a world where there is one single unified consumer computer architecture, and it is the one that we started out on so many years ago. The humble x86 architecture is still in their somewhere and now it will be powering Mac OS X as well as Windows and Linux and Unix. Apple have clearly stated that they will lock OS X so that it will only run on their machines, and not other Intel based machines (presumably using the Trusted Computing Platform architecture). I wonder if that will last. Less than a week after the announcement there was an Intel version of OS X floating around on the net. Sometime soon are we going to be in the position where it really doesn't matter which OS we use, it will become irrelevant. Your choice of OS will simply be personal choice, probably more of a fashion statement (Apple must like the idea of that right now) and incur no technical or functional penalty.

We have been heading this way for years now in the development world. As a Java developer I almost never have to think about the platform(s) that the software will be deployed onto. Now with Mono even Microsoft's own runtime is available on all platforms. Looking at the server market, one which Apple has been storming over the last couple of years with XServe, OS X Server and XSAN. All of the *tel operating systems can claim to be in the running for super computer status, this is in fact the one area where Microsoft is behind. The recent push towards Service Oriented Architectures sitting on top of Web Services and the XML revolution moves us further away from OS lock in. Strangely Microsoft is moving XML Web Services down into the core of Windows with the Indigo project.

Development and the server markets always lead from the front but the consumer market is becoming less and less OS dependent. Microsoft shocked the world when they announced that their holiest of holys, Office, would move towards standards based document formats. We are only a short time away from 100% interoperability between Office and other suites such as OpenOffice. Look also at the resurgence of Web based applications as promoted through Google's efforts with GMail and Google Maps, even more importantly look at the world of blogs which we inhabit, there are people whose whole careers are now dependent on their blog software which they can access from any OS anywhere in the world anytime.

I now have Windows, Linux and Mac based systems at home and it really doesn't bother me which I use for most of the work that I want to do, this is surely a sign of things to come, and I haven't even begun to talk about the impact of portable devices....we truly are approaching Post OS era...long may it reign.

Tuesday, June 14, 2005

It's been a 5 year stretch so far...

This week I am celebrating(?) five years with Simulacra, and it is causing some serious strolling down memory lane. I joined the company fresh out of university, so fresh that I still had to find out my results and had to specifically request time off during my three month probation to attend graduation.

Five years is a long time to be with your first company, especially in this industry. I remember my father being concerned about my choice of such a traditionally nomadic profession, understandable from his vocational teaching perspective. Yet here I am, wondering if five years really is a long time.

It is not like I've been doing the same job here all that time. I've progressed from being the new coffee boy to heading an amazing team of developers. I have had the chance to work and learn from some really talented people (special mention here for Mark and Mike, you know who you are). The projects, both internal and external have continuously been interesting and challenging. Those five years have flown by, yet I think I am quite a different person to the one who started here.

As part of my nostalgia I have been looking back over old documents from my final year of university. From the comedy acknowledgements of my final year project;

"I would like to thank the following:

Rob Kinmond and Euan Wilson, for putting the fear of God into me once a week, and because they said I'd fail if I didn't thank them.

Katherine Hall and John Large, for their hard work proof reading and the subtle way they asked whether English was, in fact, my first language.

Andrew Hodgetts, for being a shining example of how not to manage a final year project.

My family, for not worrying about me when I was screaming at a monitor at four o'clock in the morning.

The owners and staff of The Star Inn, Copmere, for turning a blind eye to my turning up for shifts on only two hours sleep.

This project was powered by junk food and a vast and regular intake of caffeine."


to my cringe worthy CV;

"I am a problem-solver with the flexibility and awareness to see inter-connections and routes to solutions."

That's going to haunt me for a while.

So with five years down I look to the future, I wonder where I might be five years from now. I am fast approaching 30, which is something scary when you see it written down like that. For some people it carries with it thoughts of pensions and houses, and I won't deny that I have had such thoughts. However foremost in my mind for some time now has been the concept of "career".

It is easy when asked about your career to simply state your job, but is that the truth of the matter. Some people I know who work full time do not consider that they have careers or that the career they foresee for themselves is nothing to do with their current occupation, both valid choices. Five years ago I was almost certain I was about to embark on a career in network administration, yet I dodged that bullet and became a devoted coder. Over those five years I have slowly, and consciously, moved into a more managerial role to where I am today. I have no problem with all the form filling and meetings if they are leading the company to better things. It is fantastic that I have the opportunity to talk to clients so much. One of the major benefits of being in a small company is the number of different hats you can wear should you want to. But as we established earlier, your job isn't really your career.

So we come to the crux of my current preoccupation, what really is my career and how should I be going about it? I don't have the answer, hell I don't really have all the questions yet, but with two years to 30 I guess I had better start working it all out. I'll let you know...

p.s. She-ra, that was one for you :)

Monday, May 23, 2005

Google's fusion initiative...

So Google have finally announced what we've all known for sometime, that they are attempting to pull together all their disparate "products" under one roof in what they are describing as the "fusion initiative". A fancy name for what is basically making Google into a portal.

I suppose that it is good they are taking their time over this, but so far I am not impressed with the results. My problem is partly caused by their tactic of placing all new features into overly long Betas. I now have a GMail account, which I monitor through the Windows notifier and the Firefox plugin, depending on where I am. I can now also monitor this through their new "fusion" homepage, but only if I remember to go there. It doesn't help that I cannot seem to reset the Google Homepage button in the Google IE Toolbar to point to anything except the Google.com homepage.

When setting up my personlised Google homepage it didn't pick up any of my settings from my personlised Google News page that I set up the other week, very annoying. Finally, if I try to load my personlised Google homepage from the google.co.uk domain I get re-routed to the google.com domain. All very patchy.

In each case Google has launched something that I find incredibly useful, but I have to remember how to access each of these things. Perform the special mouse gesture while standing on one leg....okay, not quite that bad, but you get the idea.

I think the "fusion initiative" is fantastic and long overdue, and completely predictable. But they have their work cut out for them to pull back together all the different initiatives launched to date into one cohesive whole. I wish them luck.

Saturday, May 21, 2005

Space geekery...

I am a geek in many ways, I am a computer geek, a Sci-Fi geek, a film geek. I have been this way for many years, but longer than all of these I have been a space geek. The thought of everything that is out there, how much we don't know, how much we do and how we found it out always amazes me.

One of the best things about being a space geek is that it sits quite happily with my other geek obsessions. Space exploration is a very technical endeavor and the Internet has been a boon to us space geeks for getting all the latest information, even seeing space exploration as it happens.

People in my office know that if there is a big space event happening during working hours they will probably be able to stand behind me and watch it. We all saw SpaceShipOne's historic flights into space, all three of them. We sat around and watched as the Genesis probe crashed into the desert.

Such visual images of space exploration, whether good or bad, still captivate me, they always have. I remember the first time I saw Viking images from the surface of Mars, especially the ones where you could see Martian frost! I doubt many people could forget the pictures of Earth rise from the surface of the moon. These images still manage to give me butterflies.

The most recent one is perhaps the most geeky one to date. Few people that I have shown this too get quite why it makes me geek out, and it is hard to explain. But I figured that the people who read this blog would instinctively get it. Over the last few months Nasa seems to have been on a Mars hardware hunt. Spotting various Mars landers from orbit, they think they have spotted the doomed Mars Polar Lander.

Cool though those images are, it is another one that amazed me. It is the first clear(ish) picture of a man made probe in orbit of another planet. It is a picture of the Mars Odyssey probe taken from the Mars Global Surveyor. It's not a great image, but damn does it put a big smile on my face.

Enjoy....

Monday, May 16, 2005

I am seeing our code through new eyes...

...in fact they are the eyes of our new developer who started today. I had forgotten how educational it is to listen to someone completely new talk about your code. Someone who has no emotional attachment to it. Someone who has not put blood, sweat and tears into it (honestly each of those at least once over the last 5 years). Someone who obviously doesn't care as much as me....sorry getting carried away there.

But it is true that if you spend as long as we have creating something you do begin to get attached to it. I was in an all day meeting with clients last week, we took them out for lunch. On the walk to Franco's (wonderful pasta place near here) she apologised to me, saying that she knew she could be "picky and awkward". After a moments reflection on this I apologised back to her about being too defensive, remarking that the system she had been commenting on was something that I often though of as my "baby" for want of a better term.

Since starting here in mid 2000 I have seen the code grow from a mere 8 classes to the behemoth that it is now. I lived through the delivery pains of the "Mango" version. The joys of seeing the "Papaya" version in all its' refactored glory. The long nights coaxing the first Swing management console "Guava" out of the door and the horror of starting again from scratch for the "Tangerine" version.

It is often said that most software is no good till at least the third version. Depending on how you count we are there now, and looking back I am amazed and very happy at where we are with the software. I could sit back and bask in the shining light of Open Harmonise.....thank God we have a new developer to point out its' problems and where it could be better.

Wednesday, May 11, 2005

Lessons Learned #5: Cross-browser Javascript and CSS

Unlike previous "Lessons Learned" articles this one will describe my current project and list some of the little annoyances that I have had to solve. I mentioned in my last post that this project was to build a web based administration system for Open Harmonise that mirrored the Java Swing version as closely as possible. Obviously the Java Swing version was pretty dynamic in nature so this project was going to require a lot of Javascript and funky CSS which would have to work in both of our target browsers (Internet Explorer and Mozilla/Firefox).

I have to admit, that when starting out I really did not think the project would be successful. The Java Swing version of the client includes many custom components to allow the management of complex information. The layout includes Outlook style tabs, a highly customised table view and a tabbed form that is built on the fly from data definitions. These form elements are not simple either, for example a text field is made up of the following components;

  • text of the field name.
  • button to open a help text window.
  • valid/invalid icon (updated in real time, also impacting a similar icon on the tab).
  • the text entry field itself.
  • a counter which counts down how many characters you have left based on the data definition. This counter turns amber when you get close to the maximum length and red when you go over it.
That is just one of the simple types of form field, we also support number (with or without floating point), date (with or without time) and boolean. Then there are the complex types including vocabulary lookups, relationships to other resources in the CMS and finally compound properties (nested fields like address). Each field in the form can have a min and max number of occurrences and therefore needs to have plus and minus buttons for adding and removing extra fields.

I have ranted on a bit, but you can see why I was a little worried about building this and supporting it in html's request response model. But this was my task so I forged on. Overall it has been nice to discover that building these types of web application is a lot easier now than in days gone by. The latest versions of IE and Firefox interoperate quite well, but there have been many points where I have had to stop and scratch my head for a while. The following are my experiences and solutions, if for any of these you know that I am just being stupid and that there are much easier ways of doing these then please leave a comment.

1) Dynamically adding dynamic content.

Problem;

There are several approaches to adding content to a html page, the easiest of these is to append to the "innerHTML" attribute of an element. In Internet Explorer this doesn't work for forms as any information people have already input to form elements will be lost. Instead you must construct your new elements as html DOM objects and use the "appendChild" method. While this works fine for simple things life becomes complex in Internet Explorer with some special (for want of another word) attributes. These attributes include;

  • name on form elements
  • value on form elements
  • class
  • name on iframes
  • all Javascript event handlers such as onchange and onclick
The problem with these is that Internet Explorer treats them as plain DOM attributes and does not do the special processing that each requires. The worst offender for these is the Javascript event handlers, they are not parsed by the Javascript engine so they are not actually set as listeners to the events.

Solution;

For most of these it is a simple mater of using the relevant Javascript attribute for the object, such as doing;

element.name='NAME' ;

instead of;

element.setAttribute('name', 'NAME');

However things get a little more complex where the Javascript event handlers are concerned. For these you must again set the relevant Javascript attribute for the object, but you must set it to the method pointer rather than a string. E.g.

inputElement.onchange = elementChangeMethod;

instead of;

inputElement.setAttribute('onchange', 'elementChangeMethod(PARAM1, PARAM2)');

One thing that should be obvious from this is that when having to use the method pointer you cannot provide any parameters to the method. When mocking the interface up in static HTML I was mostly passing "this" into these methods, which is still accessible, but not as a parameter, from a method called using the method pointer. So the rule is to remember that if you are going have to insert a new version of some html that has Javascript event attributes on it, ensure that those methods only deal with the "this" context object and use no other parameters.

2) & in links and window.location

Problem;

Because this is a very dynamic html web application there are many points where I use Javascript to either load a page into a frame/main window or insert an IFRAME in the page. Something that foxed me for quite a while was the fact that "window.location.replace" was working in IE but not in Firefox (and that Firefox was not showing any errors), I would just get a blank page.

Solution;

The solution was embarrassingly simple, but not obvious at all. IE allows you to put "& amp" into the URL for "window.location.replace" and Firefox does not. Mostly this is hard to spot as Firefox doesn't complain, it just shows a blank page.

3) Submitting a form and using window.location

Problem;

I replicated the Java Swing toolbar as a series of buttons in a frame across the top of the page. These submit various forms in other frames to accomplish their tasks. These forms may be visible to the user, for example the "Save Resource" button submits the main visible data entry form. Some are not, the "New Resource" button submits a hidden form. To keep life simple, these forms submit to a page that performs the action and then I redirect the frame back to the previous page which is now in a new state because of the action. However the changes were not happening.

Solution;

After quite a while of fiddling it appeared that the "window.location.replace" was happening before the "form.submit" commands in the Javascript, even though they were in the other order in the source. The evil hacky solution was to put the "window.location.replace" into a delay of a second to allow the "form.submit" to happen, truly horrible but it does work.

4) Comparing the value of a html DOM attribute to a string

Problem;

In many places I am allowing the user to move values from a list into a "select" field. The field has the "multiple" attribute set to "true" so that it appears as a list instead of a drop down, but I want everything in it to be submitted. So I wrote a small Javascript function to find all the elements with a tag name of "SELECT" and a "multiple" attribute with a value of "true". This is a very simple DOM navigating script, so imagine my surprise when it found the elements with the right name but would never match on the attribute value.

Solution;

The html DOM method "getAttribute('ATT_NAME')" returns a "DOMString" object not a "String" object, therefore you cannot do a simple comparison. In the end I did the following;

var attrubuteValue = element.getAttribute('ATT_NAME');
var sValue = '' + attrubuteValue;
if(sValue == 'STRING_TO_COMPARE') {
...
}

I am guessing that I could have compared against the DOMString's "toString()" method, but I was a bit fecked off by the time I thought of that and so haven't gone back in to fix it. But you get the idea. Again, no warnings or errors to be seen.

5) Dynamically inserted IFrame not findable by name

Problem;

Inserting an "IFRAME" element using Javascript works fine, until you come to try and find it by its' name in the "frames[]" array. The name doesn't appear to be available.

Solution;

Another bit of a hack, I found it by comparing the location instead.

Conclusion

So those were the most annoying issues, and the ones that I can remember while writing this. Although these did cause me major headaches, again I must say that the process of building this site has not been anywhere near as bad as I thought it would be. There is a resurgence in the art of building web "applications" instead of websites. Most of this has been the interest surrounding Google's efforts in this area and the fantastic results that can be gained from using asynchronous calls with XMLHttpRequest objects. Of course I would have loved to build this site in that way, but it was a bit too much of a risk given the time and budget allowed. Still I did create the layout structure to allow us to begin replacing various parts in this way over time.

Finally, please to do let me know if I am wrong in anything I have said here. I really do want to find the best way of fixing these issues, and I must thank the Mozilla/Firefox teams for supporting all the non-standard IE ways of doing things so that I could build truly cross-browser Javascript.

Friday, April 22, 2005

So I'm back...at last...

Wow, it has been a long since I last posted. There are many reasons for this. I've been pulling overtime, along with the rest of the team, as we are still a man down. More interviews next week so here's hoping. Also I have a friend staying in my flat at the moment so there isn't much room. Can't really get to my computer late at night, so blogging has been out because of that.

So I guess you might be interested in what I've been doing since the 28th Feb. Well I managed to finish and deliver the project I was working on since early December last year. This was the project that was trying to produce a paper based system. It ended up managing the application of several controlled vocabularies (about 3,600 terms plus other user entered metadata) to almost 18,000 resources. It was truely dissappointing when this resulted in the export of just 5Mb of Zthes exports.

Since then I've been working on producing a web based version of our administration system. The brief was to make it as much like our Swing based version as possible. This scared the crap out of me at first but has eneded being a really nice project. I will be posting some thoughts on the current state of web based applications soon, along with some invaluable hints and tips on cross-browser Javascript/CSS/DHTML.

Finally I wanted to share this most amusing of geek in jokes that I came across the other day on the OASIS site. They are producing a specification of another part of the Web Services stack , this one dealing with asynchronous calls to long running services, i.e. something where time for response is an issue. It's called Asynchronous Service Access Protocol or ASAP for short!! :)

Well it made me laugh anyway.

Oh, before I go I should shout out to my best friend Brada8. He also hasn't heard from me much over the last couple of months. Sorry dude. Promise I'll make that chess move any day now....just considering my winning strategy.

Monday, February 28, 2005

Great XSLT article and update on stuff...

First off, if you ever have to write XSLT, or more importantly teach someone how to write good XSLT, then you should bookmark this article. I especially liked the part where part of his solution to the XSLT problem was to restructure the XML he was transforming. While not always an option it's something I've done many times and it really can help.

You have probably noticed that I've not been posting much of late. Lots going on with the new boss and ongoing recruitment. Over the last few days at work I've had much fun writing some useful code. Of course, as one of my collegues pointed out all of our code is useful, but my point is that over the last three months I've mostly been writing one off Java and XSLT transformation code, probably a couple of thousand lines of XSLT alone.

The last few days I have been re-writing our database creation and default seeding code. Previously we've been using SQLServer specific scripts but it was finally time to bite the bullet and make all of this database independant. Not as big a job as you might think. We have the DataStoreInterface api which should abstracts the SQL into objects. So all I had to do was some up with some XML grammer to represent the table definitions and then to describe the default data to go in them. The only slightly hard part is managing and resolving all the cross-references because of foreign keys. Well it's been a nice diversion from the other work.