Category Archives: Life

Things I always forget in Application Express (Apex) from Oracle v4.0.X

Firstly – How do You Copy a Page?

I always forget that you can copy a page really simply but it’s hidden away in some obscure place:

- Click on the page you want to Copy

- Click on Create -> Page as a new Copy

Oh so simple but you’d be amazed how much time I’ve wasted trying to remember this.

Secondly – Page Templates. You can’t seem to change them once they are set. At this time I can’t even remember how you assign them without doing a Page->Copy (see above).

Thirdly – How to create an Updateable Report? Again another one that’s so well hidden you think they did it deliberately. You can spend as much time clicking as you like but you have to remember this one or look it up every time:

- Create Region

- Form

- Tabular Form

Then you get the option of Update, Insert, Delete et voila you have an Updateable SQL Report.

Bottom line with Apex is this – there’s always a way of doing it but it’s so well hidden that you need to dig dig dig to find it. Also sometimes even the simplest stuff is hard to remember.

Unit Test

Today I’ve been finding out about this automated unit testing/JUnit thing that people do. Does it actually improve quality? Testing as a concept (to me, working in the industry) just seems like this sickness that is crept in for writing code twice or three times when you only want it once. Is the testing trade off worth the effort for non critical systems? I mean even with critical code there is a question of why we’re spending as much on testing as we are on development?

It of course depends on what code you’re writing and who is going to see it or its interfaces. I don’t think I’ve ever written a single interface that some other alien code will use – in that I always see both sides of the coin. If I were writing a public interface (anything web oriented) I’d be sure as dammit it worked to all tests and if it were to be maintained by other people I would put effort into constructing automated unit testing for it. However for most code I write I can see there is no point as it’s probably not going anywhere.

When you look at testing frameworks and dependency injection it is almost like test metadata is driving coding style. I think that an approach where dependencies are specified in constructors is a good way to code but this is after all only a coding approach. We will always find lots more problems passing structures into pre-existing objects rather than constructing them with those objects in the first place c.f. copy constructors being notoriously difficult to get right or say switching documents inside applications. And if you think logically about design then it follows that your objects should always be able to stand on their own with the minimum amount of dependency. Those highly coupled areas are always going to be the ones where problems exist anyway.

Isolating areas for test makes for progress and then refactoring (newish word which of course means redesigning) code to expose bugs and to fit better with the changed conceptual model ensures that things stay fixed and also code is easier to understand. So I’d argue that perhaps unit tests are just lazy ways of saying ‘need more work here’? And it’s all well and good to say ‘refactor’ but we don’t always have the time.

It’s very interesting learning about this – I can absolutely see the drive but again I just wonder why these languages are so complicated that we are forced to use complex frameworks to reverse park ourselves into good coding practices.

Gardeners

I’ve been joining in with the seasonal Dutch tradition of pollarding. Trees form an important part of Dutch landscape seeing as there are few hills and boggy soil interspersed with water – tall trees with healthy root systems are a necessity for farmers, dyke maintainers and town planners.

My problem is slightly smaller but nonetheless important for us, to whit a lack of light into our garden and house from the neighbours sprawling cherry tree. I spoke with the gentleman who owns it a couple of weeks ago and he was more than happy for me to cut off as much as I liked. And on the weekend I did so, balanced precariously in branches reaching higher with a borrower halberd type thing to cutting off upper branches.
All was going well and I wanted just one more top one when the wife rushes out (backed sheepishly by her husband) to beg me not to take off any more.

A perfect example of the difference between male and female gardeners in my experience.

Still, we now have some sky back and I have a garden full of sticks to clear up. Cherry wood though – must be something I can do with that lot…

Vital Statistics

While doing a little research on the Elfstedentocht (which requires 15 centimetres of ice to run) I discovered this nice little feature in Google Translate for Dutch -> English.

Hopefully no-one is using it to do any tricky calculations.

Should I be IPTV’ng?

I spent a couple of hours on Sunday taking up the edging on the laminate flooring to run a TV cable from our bedroom to the spare bedroom/office. It’s seems all a bit old-hat doesn’t it? Taking up flooring. Running cables. Surely it should be all wireless for this kind of thing? Well I tried those TV senders before and the last time I did they had a nasty habit of stamping all over your wifi signal plus you still need somewhere to store the digibox and inevitably it’ll crash occasionally so you’re switching rooms and debugging another invisible network as well as all the plethora of things that can go wrong in between.

So this time I wanted to do it the old fashioned way and have the STB next to the telly (well monitor innit these days?) and so I duly spend hours on my knees prising and pushing and wedging and even soldering to get it sorted and allow me to watch a bit of snooker by myself sat on a beanbag in the spare room. So yes now it works just fine with my UPC digibox.

But, I hear myself ask, shouldn’t I be taking notice of those extra icons on my PS3 and all these services helpfully pointed out by The Register? Shouldn’t I just rely on my horribly heterogeneous 10n/10g/10b network to carry all my favourite TV programmes about? Well for me it’s almost down to the same argument – that scary invisible network that runs throughout my house which works fine for email, browsing and occasionally downloading stuff but seems to chug to a halt every so often for no reason. Even the plug in network extenders seem to flicker into the red for some reason occasionally – I dunno is it oxidation on the contacts or what I mutter to myself as I unplug/replug/reboot the router and everything works again. Even not taking into account the fact I’d need to pay for a VPN address in the UK to allow me to receive the UK channels it’s just another potential way in which the system could fail. Another flakey link in the chain. There is something to be said for doing it with cables and dedicated hardware when software and invisible networks come into play.