Month: August 2003

Investigating struts, discovering Velocity

Looking at the website I think I want to use struts for my project. There’s also a template-based technology, which is new to me, called Velocity, which looks good too. My ideal is to start from a description of the data model, with some tags for actions, in my XML document and then generate out the data entry subsystem complete. In order to do this I think I need to take a typical entity and then build the whole thing by hand.

So next tasks:

Generate DM and run script in Postgres (ironing the bugs out on the way).

Take an entity and “do” it, tagging subsystem, lookups and all.

Turn this into a template.

Write some code to take the XML and apply (via script or somesuch) the template across the whole DM.

It dosen’t matter if it’s rough around the edges, just as long as I don’t have to repeat code myself. Remember a good programmer is lazy. If you are doing something repetetive and can’t get the machine to do it then start again. I will spend a lot of time on editor macros because then you can repeat the boring shit over and over once you’ve done it once. That’s why I like bash and awk.

Still haven’t decided about EJB’s tho’, but they are a marketable skill.

Dev environements, XML, Postgres etc.

Postgres worked straight away with the JDBC driver you get off the net. In no time at all I was browsing my schema in JDeveloper.

I have been reading the docs for postgres and I like it. I like being able to define domains (whereas in Oracle you can define them in Designer but not in the DB, except as types (which maybe Designer supports now?), which aren’t quite the same conceptually). I also like the way the documentation clearly gives the differences between the implementation and the SQL standard, which is not something I have ever seen in the Oracle documentation (although Oracle is in fact a standard of sorts because of the wide use). I don’t like having so many scalar types (like int4 and int8), but I think I was spoiled by Oracle’s Number type (42 digits of precision, but it did encourage messy thinking, where columns where just declared Number). I like the way that the variable character type is just called varchar, rumour has it that Oracle’s original implementation was messed up so they tried again and put a 2 on the end. Something that has always annoyed me, although I believe that the two have been synonymous in Oracle for a long time now but habit stops you changing. And types in Postgres are proper types with operations on them with a reasonably clean syntax for conversion etc. Never had to play with types in Oracle so I’m probably not being fair. I like postgres date/interval/timestamp thing because you had to do a lot of odd stuff with Dates in Oracle to get these things which are there already.

I have decided to save the description of the schema into an xml document and then use this to generate scripts. I haven’t used SAX, only the DOM, and so I thought it time to learn it. To be honest, SAX is much easier and the amount of code I had to write is minimal. Of course, I’m only parsing well-formed documents with no schema but it was easy. If I was going to go the whole hog I suppose I’d write an XSL sheet, but that would only slow me up.

Thanks to Stefan Ram http://userpage.fu-berlin.de/~ram/pub/pub_detics8/java_sax_parser_en, although the bit that opens the XML source file isn’t quite correct and I changed it to      

reader.parse( new org.xml.sax.InputSource( new FileReader(“public_html\data-model.xml” )));

The API docs say that if you give a string it is some kind of system ID, so I changed it to use the FileReader as shown. Note the MS file name if you are a Linux kid.

So the plan is:

  1. Define schema in XML
  2. Tag main entities in XML so that I can generate out some generic data entry screens.
  3. Write parser to create schema script
  4. Write parser to create data entry engine
  5. Bag the whole thing up and give it to Source Forge as a project.

I’ve already done 1, 2 and 3 in less than a day (with some shortcuts in the XML). I need to think about 4, and have a look at what struts can give me, whether I want to use beans etc. etc. etc. Will probably move back to doing my marketing screens while I investigate.

All I need to do now is find a job! Interestingly I discovered through the grapevine that the top developer in NZ (who I disagreed with but had a lot of respect for) has left. Tee hee. The price of everything and the value of nothing. Good luck Steve, I learned a lot from you.

(Note : Stefan moved his URL so I have changed it to the new one : 17-Oct-03)

Grindstones beckon

Tryweryn

Spent a day at the Tryweryn trying to master the Elbow Wave. Very fast and off course you get blown down the river if you screw up too badly. Managed to stay on it for more than a few seconds and try some turns. Still a way to go but maybe my experience on the Tees will help next time (see later).

Oasis

Just spent a week at Oasis in Penrith. Already paid for so what the hell? Very good chill-out time, but we did fall out with Jon a bit because he likes to be awkward some times. The days consisted of doing an activity and then chilling out at the sub-tropical pool for the rest of the time. We also went to see Jonny English which was OK, kind of Carry on up the Secret Service. Jon watched a lot of Fox kids and it is absolute crap, wall to wall low-quality cartoons and power rangers reruns, you can tell it’s owned by tabloid kings preparing the rest of us for a life of consuming their predigested bollocks.

Slalom in Fairnilee (nr. Selkirk)

Competed in a Div 4 slalom at Fairnilee on a bit of the river Tweed. Quite an interesting course, the first time I had ever competed at slalom. Much harder than it looks and on day 2 they had made the course more difficult and I managed to miss a gate (well more crash into one side of it and not get head and shoulders through). The kids from the club did well, Hannah got promoted to Div 2 and we think that Gareth may have done (needs confirmation). Hannah is now trying to amass enough points to get to Div 1 before the season ends. Going to the event at Marple in a couple of weeks. I’d like to get to Div 3 just for the hell of it but there’s not a lot of the season left and my slalom boat sucks.

The Tees

Paddled for 2 days at the Tees whitewater centre. Finally mastered the Happy Eater wave, was getting spins just throwing weight and lifting my legs. It’s taken me years to learn this because I had to unlearn the old way of doing things first. At last I seem to be making progress with playboating.

Saw one of the GB juniors training at slalom. It was like watching ballet as he whipped round the gates at speed without touching them, he’d just come back from training on the big water in Europe. Luckily his mum can afford to take him round but she’s saying that they will need some sponsorship soon. Interestingly they get his kayaks made in Bratislava (I think) and then pay the import duty because it’s cheaper than ordering them from Double Dutch in the UK.

(Hmmm big water in Europe … must save up and take summer off paddling – maybe see if I can get job as pursuit kayak … hmmm).

Job Search

Nothing doing at the moment, about to make a couple of calls to an agency for some jobs I saw on Skillsite http://www.skillsite.co.uk.

Adis

Received a letter minuting the meeting I had with der managemint a couple of weeks ago which of course missed out the bit that said if they employ a temp to cover for the work I used to do I will sue them. Not sure if I can be bothered replying to this dross. They were unable to put my street name and number on the letter and the Post Office had to wait for another letter for me to match the name up with the post code, this didn’t actually affect my impression of their competence one whit, I have to say, but I was impressed with the Post Office’s persistence. Need to get my P45 so that I can sort out my mortgage insurance and sign on (yada).

Bye bye, Lucy

The poor cat was so ill she couldn’t even walk five paces to get herself a drink, so I carried her around the house to her bowl. Rosie spoke to the vet and it was too hard, she was dying. We got the vet to put her out of her misery. I cried, I’ve known her longer than almost everybody else I know. Feeling very down. Kids don’t seem that bothered, a less sentimental breed than I by far.

Open Office

Just getting to know open office http://www.openoffice.org , wasn’t going to spring for Office XP (Rosie’s employer has a site licence anyway for all staff, but she isn’t back in work until September). Seems OK for what I need. Maybe the drawing package will do for creating my images as well.

Buying stuff

Went to Brookbank canoes (http://www.brookbankcanoes.co.uk) and got a full plate footrest for the MI 380, because we are going to use it for div 4 slalom and the dragon’s teeth footrests were totally uncomfortable. Went to Cheshire Oaks and bought more bits for the kids and our holiday. So much for reigning in while I find another job.

Sendmail

Didn’t need to do a reconfig after all, smoothie had just shut down the VPN link, so I restarted it.

Back in the land of the living

Well, no job yet, some contracts on the go but I’m due to go off for my fortnight’s hols on Friday so not a lot of point getting too wigged about things, really until September starts.

Bought a PC from http://savacentre.co.uk. Good spec, reasonably cheap, made a tit of myself because I thought the keyboard wasn’t working. It turns out I was trying to type in the bar code instead of the XP activation code and the XP installer helpfully disables all of the keys you don’t need to type it in. After 40 minutes on the phone (and a weekend in the middle) I finally got through to one of their tech support people who was mystified by the number I was trying to type in – oh, well, it’s working now.

Ideas

I’ve started work on a site of my own that might start to bring some cash in eventually but don’t want to discuss it here because it’s too public a forum. Been playing with Dreamweaver and so on to get the marketing message right. I’ve begun to realise that fireworks sucks for everything but creating silly buttons with text on them. I want to draw an image, maybe I’ll have another look at gimp (but it’s even more horrible).

I’m having an inner conflict about the dev platform, whether to J2EE or use PHP, PHP seems to be faster turnaround by all accounts but I’d have to learn it so maybe it wouldn’t be faster at all. Roger recommended I use postgres for my DB, but I can’t find an easy NT install without running cygwin (which is OK but looking fiddly). MySql just works on NT (OK XP Pro but you know what I mean).

Went for lunch with my former colleagues. It was nice to see them all, who knows when I’ll see them again. The best bunch I’ve worked with in a long time (well, the people at Oracle were mostly good too, but you’d only see them for the duration of a project and that’d be that). Nobody can understand who the hell is going to do the work now I’m gone. Including the time I was working for Oracle pre-head hunt, I’ve been there four years.

Annoyances

I can’t send mail because I’m running a local LAN and the external mail servers say that they won’t relay. Roger got this going using his sendmail server but I have to keep resetting the VPN because the GPL version of smoothwall doesn’t like IP’s changing.

Sadnesses

My poor cat is dying after 16 years. Her kidneys are packing in and her liver function isn’t far behind. We’ve decided collectively not to prolong her suffering. I need to work out how to do things the buddhist way and try to help her to a more favourable rebirth (mystic stuff, but I believe it).

Good stuff

I love having ADSL. It’s just like being at work without the journey (but what work, compadres?). Got JDeveloper and the 1.4 JDK downloaded no probs. Wireless network working fine but I need to make it secure.

Onward and upward.