Author: francis

Back to JDeveloper – loading config files from the classpath

Eclipse V3 didn’t do a lot. Could not be bothered wasting a day configuring it, double click on a file and it started up NetBeans because that was the default editor for files with a java extension. Back to JDev 10g. It just works. A downside is that it doesn’t run the 1.4 JDK native but for 99% of us who cares? Unless you are totally obsessed with writing inner classes it probably doesn’t matter.

I also like the feature where you can select a block of code that you know needs a try/catch block, right click and select surround with try/catch and it knows which exceptions are being thrown so it creates all of the catch’s for you (not a punctuation error, think about it). Also, type sop<ctrl-Enter> and it will expand to System.out.println() and drop your cursor in the middle of the (). You can also define your own shortcuts and browse the predefined ones. Another thing it supports is dragging (move) and ctrl-dragging (copy) of selected text, which netbeans didn’t get.

I really like the JSP editing and integration into the runnable OC4J container, which is a mouse click away.

The only issue with JDeveloper is that you should pay for it if you are using it in a team: the technet licence is for single-use, single download, so maybe you’d be better using Eclipse. If you are and Oracle shop doing Java in the database it’s a no brainer.

Wracking my brain to remember how to load resources independent of absolute paths etc. Found http://www.javaworld.com/javaworld/javaqa/2003-08/01-qa-0808-property.html, which explains it very well. You need ClassLoader.getResourceAsStream. If you arle using your class inside a JSP beware that you need to get the class loader that loaded the same class. JSP’s have a different SystemClassLoader so they can be reloaded on demand.

I have managed to get rid of the JDev clutter. Dock everything to the centre of the left and it creates a nice tabbed group for everything so you haven’t got millions of tiny unreadable windows.

Imported Comments:

autoversicherung

last few days our group held a similar talk about this topic and you point out something we haven’t covered yet, appreciate that.

– Kris

NetBeans cost me a day

Twice this useless IDE didn’t save the file I was working on, even though I pressed ^S and exited it. Nor did it warn me I had unsaved changes.

Switching to Eclipse.

Still using Oracel JDeveloper for Oracle-specific things, particularly Java in the database, but I don’t like all of the clutter.

Oracle Repository

Spent the day evaluating Oracle Repository. I quite like it, as far as it goes. I’m busy preparing a powerpoint so I can share my conclusions with the rest if the company.

It isn’t as good as some products (but is better than PVCS) but to be honest, if you’re an Oracle partner or have a site licence, you should consider it .

I used dimensions (made by merant) and it had a kind of workflow in it that sort of made sense. But the Oracle one just allows you to do version control and create folders which are themselves subject to version control, which I quite like.

The only annoying thing is that you have to turn version control on and then grant it to yourself which is really annoying; but then you only have to do it once.

One irritating thing is that it doesn’t have the ability to embed version numbers into files out of the box. In its current form you have to buy an Oracle Consulting Option to add this facility, which is a pain.

Friendly Fire

Think about it:

All your life you’ve let other people’s envy and stupidity hold you back because you let yourself believe them.

You are the victim of friendly fire – you are constantly firing on yourself.

I had a whole song about this going through my head this morning and didn’t write it down – bah!

Ignant and shit: Brain software: XML to HTML: Goals

Ignant

This is the title of a Screamin’ Jay Hawkins song on Black Music for White People (it’s the one with Heart Attack and Vine used in the jeans ad). I was standing talking to someone and another person (the one from the club whom we fell out with over capsizing our daughter) pushed in and started talking about something over the top of me. I left the ignorant bastard to it: you can tell from the way his kids behave that he has no manners and all this did was prove it. He loiks to play the country bumpkin, being from Somerset, but I think it’s just ignant and shit. Rosie says that we shouldn’t let him define what we do, and she’s right, but I nearly lost it with him.

To be fair it’s not his fault I’m in such a foul mood. Things have been getting me down and I’ve been having trouble sleeping, plus some old petty addictions (chocolate is the most benign) have been bugging me. An addiction is like a wave breaking, you don’t have to swim in it but it can feel very good. I need to think some more about how to deal with it.

Brain Software

I’ve been using some software called the Brain (http://www.thebrain.com/default.htm?thoughtid=49). It sits on the side of the screen and allows you to organise the relationships between thoughts, dragging documents and folders and breaking the windows hierachy. The only problem I have had is that I used to use the Enterprise Edition of Mind Manager(http://www.mindjet.com/) it would let me plan documents as mind maps, exporting maps to HTML or word documents. The brain has horizontal relationships across hierachies and is better at focusing on the thing you are thinking about and I prefer its interface, but all it has is a utility to turn a selected Brain document into an XML document.

XML to HTML

You guessed it: I’m writing a utility to change this exported XML into something I can usefully paste into a word document.

It is work related in that I have put a lot of the notes into it and need an easy way to get them out with the structure preserved. Of course, once I have done this I could write my own system, which as long as I don’t sell it might mean I could use it. Thing is, I could write this but I don’t want to steal their IP. They have a good product and deserve success. I think it more honest to give them the HTML dump as a thank you.

GOALS!

Reading a book with this title. The chapters end with lists of things to think of. The most scary is saying the words I am responsible, and not allowing yourself to pretend to be a victim. Very hard but very worthwhile. Will post more later.

Stuff from the Register

Quoting from this site:

It’s wrong to wish on space hardware

Esther’s true purpose amongst us is revealed later in the interview, where she boasts that “I’ve never met a government that could pick winners” and advises regulators to get right out of town. Of course you don’t need to be a genius to see that government makes a lousy businessman, which is why governments don’t even try to anymore. But government can fund technology projects that are both hugely useful (TGV) and aesthetically beautiful (Concorde). Japan, Germany and now the People’s Republic of China have proved that judiciously directed public investment provides a welcome alternative to the bulimic US model of private investment: huge splurges followed by copious vomiting. And only a churl would point out that of the last three technology upturns in Esther’s old launch pad of Silicon Valley, two (the 1980s and the current modest revival) have been stoked by government defense spending, and the one in between was the result of exploiting a publically funded defense project: the Internet.

ANSI 92 in Oracle 9i

This may be some use to you. Most of this stuff has been in SQL Server for a long time because they came late to the party and built to ANSI 92.

Left, Right and Full joins

This is the industry standard syntax which is now supported by Oracle (just in case you ever wondered)

select dname, ename
from emp
right outer join dept
on emp.deptno = dept.deptno
order by dname, ename

See <http://www.oreillynet.com/pub/a/network/2002/04/23/fulljoin.html> and http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_103a.htm#2107297.  Ansi can outer join more tables (so it says).

You can also do inner joins, which are your straightforward join. I think the left and right say which table is outer joined to in the statement, as in left in this case would be emp. A full outer join outer joins in both directions, meaning you no longer have to union left and right together.

If someone wants to rustle up an example of outer joining to two tables go right ahead.

Some other useful things from ANSI 92 in 9i are replacing DECODE with CASE, NULLIF and COALESCE

CASE:

SELECT cust_last_name
, CASE credit_limit
WHEN 100 THEN ‘Low’
WHEN 5000 THEN ‘High’
ELSE ‘Medium’ END
FROM customers;
(see http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/expressions5a.htm#1033394)

COALESCE

COALESCE (expr1, expr2)

is equivalent to:
CASE WHEN expr1 IS NOT NULL THEN expr1 ELSE expr2 END
Similarly,
COALESCE (expr1, expr2, …, exprn), for >=3
is equivalent to:
CASE WHEN expr1 IS NOT NULL THEN expr1 
   ELSE COALESCE (expr2, …, exprn) END

NULLIF:

NULLIF compares expr1 and expr2. If they are equal, then the function returns null. If they are not equal, then the function returns expr1. You cannot specify the literal NULL for expr1.
The NULLIF function is logically equivalent to the following CASE expression:
CASE WHEN expr1 = expr 2 THEN NULL ELSE expr1 END

(see http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/functions85a.htm#1001199)

Dukkha

Christ, I dunno

One of those things. Loads going on but not space to sit back and think about it. The printing press of life continues to weave some kind of bloody narrative. Bones and guts and living. Things falling apart, not satisfactory. Pushing like crazy and the door opens on another door.

Spent last week at the Canoe Camping Club meet at Mordiford (Hereford, about 10 miles out) paddling up and down the river Wye. Did some training and 2*assesment. The main thing that happened was me realising what Buddha meant when he talked about things being unsatisfactory, even if you have a good life, there is always dukkha, which is translated as being unsatisfactory. Just think about it, you get settled with your book or cup of tea or whatever and even if nothing happens either the thing you are enjoying ends or you need to attend to some biological thing.

Unsatisfactory doesn’t cut it, really, its a very deep malaise. If you can’t live in the moment and treat everything that happens as empty, and not having any particular form that forces you to act, even in some minor way, you’re fucked.

Getting on top of my new job. There’s a lot to do and I’m worried about having the authority to make things happen, but what can I do other than push and try to make sure people start talking and understanding each other’s point of view?

Reading a great book called The Leader’s Digest by Jim Clemmer, which gives a lot on how to help people to grow, I say help because people will do nothing if you try and make them. It’s all in short digestible lumps. The only problem is that it runs together.

Had a good BBS last Sunday. One of the speakers was talking about the wellness industry (food supplements and so on) vs. the sickness industry (keep your chronic conditions while we charge you for treating the symptoms). Apparently most modern vegetables only contain about 10% of the goodness they used to. When I can find it I will post the URL’s he gave here for others to read.

Time for sleep. Very tired but didn’t want to go to bed because it only involves waking up again, Dukkha, what can I say? If I could only stop time and rest properly. Time is an illusion brought on by things moving about, but how can you stop them when the processes appear to be outside of you. Think about it. If there is no barrier between subject and object then what is moving? (getting a bit Zen there, I need to go to my bed)

Will post a longer report about the Rivers Access Rally in Chester when it’s happened on Sunday.

Have fun

Mistakes

If you learn from your mistakes then all is well and good. On the other hand, if you carry on doing the same old thing forever you are in deep shit. Yesterday we relaunched our business with a meeting that Joanna was kind enough to help us with. After a frenzy of contacting people we managed to get only three to come and see the business offering. That said one of them was very interested in it.

The second session was not a success because I hadn’t checked back with the people coming and qualified them properly. A lesson learned. I was very embarassed because Joanna had travelled so far, but she seemed quite relaxed about it. There is an adage in the business: only about 15% of your time will be directly productive but that 15% will make you rich beyond the dreams of avarice.

Worth doing? I think so.

So. the next thing to master is qualifying people better and then the follow up.