Sunday, July 23, 2006

Debian port for IBM's Cell Simulator

Well, today I've made available a Cell Simulator for Debian through this link

Friday, July 21, 2006

Removing or disabling ImageJ toolbar

So, I've been playing around with ImageJ and faced the problem to remove the default toolbar. I mean, as I needed specific user interaction, I had to get rid of the useful default toolbar.
It is a nice trick. Thanks for TurboReg being open source I've got some useful ideas.
Firstly, you'll need to add some imports:

import ij.ImagePlus;
import ij.gui.ImageCanvas;
import ij.gui.ImageWindow;
import ij.gui.Toolbar;

Now, your setup method should look something like:

public int setup(String arg, ImagePlus imp) {
this.img = imp;
return DONE;
}

Now remove the old MouseListeners and the old Toolbar in your run method:

public void run(ImageProcessor ip) {
ImageWindow win = img.getWindow();
canvas = win.getCanvas();
for(int i=0;i
canvas.removeMouseListener(canvas.getMouseListeners()[i]);
}
//Here, you'll add your MouseEvent handler...
//if this class handles MouseEvents implementing MouseListener, you may
// directly add 'this'
canvas.addMouseListener(this);

/**
* This part will remove the old toolbar
*/
Toolbar oldToolbar = Toolbar.getInstance();
Container container = oldToolbar.getParent();
Component[] components = container.getComponents();
for(int i=0; i<>
if(components[i] == oldToolbar){
container.remove(i);
//TODO add new toolbar here
//container.add(newToolbar)
break;
}
}

It is a good idea to keep a copy of the old toolbar to restore it after your application finishes.
Now, enjoy your freedom, hhehe

Wednesday, July 19, 2006

Oxygen - Soul Asylum lyrics

Well, this music has been in my mind for the last days. It's from Soul Asylum, one of my favorite bands. It brings me back memories from "Veil of Tears" era. I have gotten these lyrics by ear (and mixing up with some I found in internet). I hope this version is correct (and that there's no problem making it available in Internet). So, here the lyrics go:

Oxygen - Soul Asylum


Wishing upon a mattress
Falling off the axis
Slipping in stillnes
Flipping the pearl(?)
I walk you when you're wasted
I can almost taste it
All this oxygen's for your

But it's a couple more volts of shock treatment for you
When a couple more votes of confidence will do
I walk you when you are wasted
I can almost taste it

And it's a couple more volts of shock treatment for you
When a couple more votes of confidence will do

All is there to remind you
Before and behind you
Follows you everywhere you go
Make me say you're crazy
It don't even phase me
Cause you're the sanest one I know

Just a couple more breaths of oxygen will do
They may say you're crazy
But she's so amazying

But it's couple volts of shock treatment for you
(A couple volts of shock treatment for you)
When a couple more votes of confidence will do
(Lonelyness, Lonelyness again)

Just a couple more breaths of oxygen will do
But it's a couple more pills and a couple more pills
And a couple more "What do you do those things you do?"
(Shock treatment for you)
Just a couple more volts of shock treatment for you
(Shock treatment for you)
Just a couple more breaths of oxygen will do
(Shock treatment for you)
Treatment, treatment for your
(Shock treatment for you)
That will do
That will do
That will do
That will do
That will do

Starting up!

Well, I'm just trying to see how it works