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.

Linux without Packages

I’m still mulling over the reasons behind the continued failure of the Linux desktop. I was thinking back recently about why I feel out with certain Linux distributions. Over years of developing for and writing about Linux I formed a good understanding of how the systems work but of course never really understood what needed to happen to improve it.

I never got on with Debian but I think it was because I came to it last – at the end of a path well worn via RPMs and tarballs and everything else. Debian is clever in how it deals with packages but it is certainly not foolproof and precisely because Linux users can change their installed packages it means that they probably will. All users at one time or other will want to get some extra software or update some existing software and this introduces changes which cannot be guaranteed to work. It’s not unreasonable to let users change their software but how can we guarantee it won’t leave our system unusable at the same time?

Answer is that you don’t actually want the user to have the ability to configure core packages. If Ubuntu wanted to do it right they would just send out a binary image which doesn’t have the ability to change the core components without going to a lot of hassle. Take away the mechanism by which it’s easy to download and install packages that are not designed for your system. Put your faith back in the hands of the packager and for anything else you install it with the assumption that it’s standalone or any shared components it overwrites you keep backups. Alternatively you make your system difficult to change at a system level.

A good example of how this was done right was when Asus created their EEE image – they used Xandros over a split file system and made sure that the booting filesystem wasn’t mounted after it had been loaded so that package changes wouldn’t spoil the bootability and core configuration of the system.

These days I only use Windows 7 desktop and I find it both a blessing and a relief for both day-to-day using and maintaining and also developing on. Packages are easily downloaded and installed – the same cannot be said for Linux which suffers under a wide variety of different schools of package management that appear at time to contradict both themselves and each other. When is someone going to wake up and be properly prescriptive about this? Perhaps then we’ll start to see a Linux that Just Works.

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.

Attention Seekers

Quite regularly now when I’m helping a colleague out or explaining something to them they take it as an opportunity to fiddle about with their mobile phone. Perhaps I’m boring, or taking it too fast, or taking it too slow or not making any sense but I’m taking the time to explain something to them because they’ve asked me to. One-on-one tuition is all about pacing and if you don’t get this right using quite a tight feedback loop (engagement) then you’re both wasting each other’s time. Also it’s just plain rude.

Now, presentations – well they can be a little different. They can go on for hours and are often impersonal, dull and deeply uninteresting. If the audience isn’t engaged then they are liable to drift off into smartphoneworld. I’m guilty of surfing or texting or Facebooking in presentations and to some extents this is taken as a bit of a joke but you’ve got to know how far to take this. It seems that the biggest abusers of this system who have the hardest time taking it when other people are doing it to them. As if to say “I can screw around in someone else’s presentation but obviously mine is really interesting and so you should pay attention”. Better to make an excuse and leave and get a cup of coffee rather than sitting there making it worse and also disrupting others.

There is a good article on Slashdot about how banks could be using mobile phone usage data to gain creditworthiness insights based on usage patterns. Similarly mobile phone data usage patterns could easily be farmed for engagement information in meetings, workgroups, seminars, expos etc. This even be used to work out who is actually working and who isn’t – and I’m sure within years with the current levels of privacy erosion it probably will be. Or it might even already be like that. You want a job? Sign up to our agreement on access to your usage data. Who knows?

For me it’s enough that you listen if we’re one on one and if we’re not you can daydream all you like.