November 29, 2005

jUse

Posted in Software at 20:32 by graham

I’ve written a small Python program I’m calling jUse which I’m placing here in the hope that someone might find it useful. It analyses a Java project and shows the dependencies of a particular package. I use it to check that my model code doesn’t depend on my controllers, for example.

In the tar.gz (linked at the end) there are two python files: jUse.py and model.py. To run jUse type:

python jUse.py -r /root/of/my/javaProject

The path given should be where your package starts – i.e. there should be a ‘com’, ‘org’, etc directory directly underneath that one. It will analyse the java files in all subdirectories and write a ‘jUse.cache’ file in the current directory.

To Query the dependencies of the ‘net.darkcoding.myproject.model’ package run:

python jUse.py -q net.darkcoding.myproject.model

This will print all the dependencies, including the ‘java’ packages. To Narrow to only the dependencies in your current project use:

python jUse.py -q net.darkcoding.myproject.model -n net.darkcoding.myproject

That’s it. I hope you find it useful. It’s licensed under the GPL. If you do anything cool with it let me know.

Download jUse

November 13, 2005

Creativity

Posted in Behaviour at 11:55 by graham

From New Scientist, 29th October 2005:

bq. Merge two previously separate concepts that are in conflict with one another. For example, combinations such as ‘friendly enemy’ and ‘healthful illness’. The more discrepant the concepts, the more likely they are to result in novel properties.
??Tom Ward, senior research fellow in the Center for Creative Media at the University of Alabama, Tuscaloosa, and editor of the Journal of Creative Behaviour.??

bq. Get a really good part-time job, preferably to do something you like. For example, if you like reading, work in a book shop and do lots of evening classes.
??Tracey Emin, artist, London.??

bq. Creativity demands that you leave your comfort zone, that you continually challenge yourself and be prepared to confront conventional wisdom. When you become an expert, move on. Especially, engage in that for which you have not been schooled.
??Allan Synder, director of Centre for the Mind, Australian National University, Canberra, and University of Sydney.??

bq. Creativity is fostered by a particular, if poorly understood, brain state. It often seems to be induced when you feel under pressure to perform and at the same time free to let your mind wander. Some authors go to the mountains or the seashore, others take a walk in a park. But this might be easiest to do by simply going to bed. As our brain cycles through REM and non-REM sleep, it appears to go in and out of this state.
??Robert Stickgold, associate professor of psychiatry, Harvard Medical School.??

bq. I have a great big cupboard stuffed with ideas, and when I want one I open the door and take the first one that falls out. Alternatively, if you want and idea, do the following. Close your eyes, put your left hand on the ground, raise our right hand into the air. You are now a conductor.The ideas will pass through you. Sooner or later one will pass through your brain. It never fails, though the waiting times vary and sometimes lunch intervenes.
??Margaret Atwood, novelist, Toronto.??

bq. Hold the intention or the question. Trust it and will it to happen. Leave a space – daydream, relax, doze… you’ll be amazed because you are not doing it.
??F. David Peat, author and physicist, director of the Pari Centre for New Learning near Siena, Italy.??

bq. The main ingredients in science are intensive immersion in a problem, fanatical desire to solve it (big problems are rarely solved by accident), familiarity with previous attempts leading to an original critique of where they went wrong, reckless disregard for what other experts think, and the courage to overcome your own doubts and hesitations, which are much scarier than anything anyone else can say because you know best how vulnerable your new idea is.
??Lee Smolin, theoretical physicist at the Perimeter Institute for Theoretical Physics in Waterloo, Ontario.??

bq. Think about the big problems while working on the small ones and vice versa. A larger perspective can be the best guide when approaching a detailed problem. On the other hand, details can reveal profound insights about larger questions. Listen carefully and pay close attention. You might learn more than people, or the objects you’re studying, superficially reveal.
??Lisa Randall, professor of physics at Harvard University.??

bq. Creativity is enhanced by having a prepared mind, and then being stuck on a problem. I also need a space of silence and calm, where I am free from distractions.
??Alan Lightman, novelist and physicist at the Massachusetts Institute of Technology.??

bq. Know your stuff: creativity requires expertise; but don’t know it too well: overspecialisation puts blinders on. Imagine the impossible: many breakthrough ideas at first seem outright crazy; but you have to be able to impose your idea: crazy ideas remain crazy if they cannot survive critical evaluation. Finally, be persistent: big problems are seldom solved on the first try, or the second, or the third; but remember to take a break: you may be barking up the wrong tree, so incubate a bit to get a fresh start.
??Dean Simonton, professor of psychology at the University of California, Davis.??

November 9, 2005

Free credit cards

Posted in Credit card at 20:09 by graham

As you can probably tell from some of the comments in the credit card section, some people don’t seem to understand that the generator just makes numbers that look like credit cards, but are IN NO WAY actual credit card numbers.

So, in the hope of preventing any further requests for a card (I delete about 10 a day), here is the ultimate guide to getting your own free credit card

Many thanks to R from Aus for posting this on the previous incarnation of this site

HEY who wants a free **VALID** cc number with all info? Do you NeEd a cc number with the CVV2 code and ADDrESS?!?!? I did it and NOW I got a VALiD number & I bought PS2, XBOX and a NEW WicKeD GAMING PC 3 GHz P4!! AlL Uz wanting cc NUMBER with INFOS, I tell U ONE TIME, This is HOW u GET vAlId CC numberzzz!! Guaranteed!!1!!

1. Goez in2 ur BANK! Sayz 2 the GIrL at the window: \”Hello, I would like 2 apply 4 A CREDIT CARD\”!!!! Try to look innocent! IMPORTANT! >>Don\’t< < TELL her YET that U want the CVV2 CODE!!! or she WiLL LooK aT u FUnnY & you might give the game away!!

2. She will give u a FOrM. Take the FOrM and fill it in and GIVE it back 2 da GIrL.

3. Go home & get a piece of paper. This bit is IMPORTANT: Write UR NAME & addREsS on it. Then, WAIT a cpl DAYS. Think about that new PS2, XBOX and NEW WicKeD GAMING PC 3 GHz P4 u r GoNNa BUY!!

4. U will get a ENVELOPE from ur BAnK. In it will bE a small rectangular piece of plastic with ur NAmE ON IT. turn it over and there Written on da BACK is a long number, n guess WHAT, this is a ***VALID**** cc number AND a ***VALID*** CVV2 CODE!!!!! Write this shit on da piece of paper under ur NAME & addREsS!!!

5. Now read out whats ON the piece of paper…. u gots a VALID NAME and ADDRESS of someone wif a card, u GOTS their CC NUMBER and the **VALID*** CVV2 CODE!! u will be AMAZED how easy it was!

6. now you got ***VALID** number with all the INFOS u can help eVeRyone here who is asKIN for a valid CC NUMBER, just like youd like to be helped! I helped U, so help THEM, type in everythink off the piece of paper and post it here!

7. NOW, U cn go to a website & buy present for UR MUM or pay ur SCHOOL FEES !!!! or fix car so U dont hav 2 take train wif ppl wot looks @ u

** THIS WORKS!! *** TrUsT me!!!

OK I\’m sick of writing this now

R

November 7, 2005

JavaWorld unit testing article

Posted in Software at 12:01 by graham

JavaWorld have published my third article. It’s called ‘Don’t sweat unit tests’, is about unit testing and moose, and can be found here:

http://www.javaworld.com/javaworld/jw-11-2005/jw-1107-testing.html

I hope you like it.