gist JS

Wednesday, September 27, 2006

Hibernate cannot dereference scalar collection element

You're getting this because nobody told you about the secret little hibernate 'elements' and 'indices' functions. Yes I know there's 1001 tutorials/books/etc on how to creating a mapping file with lists or sets or maps. But no, no of course it wouldn't be usefull to put in said tutorials a small hint as to how one actually queries these collections.

from the hib docs:
from Player p where 3 > all elements(p.scores)
from Show show where 'fizard' in indices(show.acts)

Monday, September 25, 2006

Old office. New office.

First the old office. A study in comparative cultures and attitudes towards ourselves. Notice the wall of failed build CD's. Notice how being haunted by past failures in this environment seems to make sense.

Notice the smiley face mug near my hand. Notice the soothing stress balls. Notice the paper behind my head, Keller's recipe for the best roast chicken ever. A priceless document scavenged from the bowels of the Internet and the only real treasure one can expect to find in cubicle-ville.

Notice the shirt that says DREAM contrasted with the general lack of dreams..

Ok, enough of that.

Now the new office.

Mark, you'll notice that even without stepping out the door there is much fall goodness to be had here. But your reminder does not go unheeded and is well appreciated. I won't forget to go find the real mountains too.

This is the conference room. Still 1-man show so we don't have to worry about OSHA regulations for cliff-side offices.

Leisure room. Sadly no dart board. You can't have everything.

Saturday, September 09, 2006

Plea to the CSS Gods

oh css gods why have you forsaken me!

So css is the one true path. fine. I don't much care, but fine. I'll go with your standard.

Great, DIV's. I can make little boxes wherever I want coolio. Let's try to little 2 little red boxes, ten pixel on the side, touching corners. Easy right?

<div style="background-color: red; position: absolute; left: 200px; top: 200px; width: 10px; height: 10px; padding: 0px; padding-right: 0px;"/>
<div style="background-color: red; position: absolute; left: 210px; top: 210px; width: 10px; height: 10px; padding: 0px; padding-right: 0px;"/>

Whoa! Those corners aren't even close!
(At (200,200) on your screen there's a little red box. At (410,410) there's another)

hmm.. let me bash my head into a wall for 20 minutes. ok, that's better. how about:

<div style="background-color: black; position: absolute; left: 250px; top: 250px; width: 10px; height: 10px; padding: 0px; padding-right: 0px;"></div>
<div style="background-color: black; position: absolute; left: 260px; top: 260px; width: 10px; height: 10px; padding: 0px; padding-right: 0px;"></div>

ahhh... yes. I see. Closing the tag with another tag is the One True Path(tm) Shame on you who would assume that the way in which you close your tag should be completely friggin irrelevant to how it's layed out on the screen.

can anybody explain this to me?

Friday, September 01, 2006

GWT NestingCallbacks

Spent some time playing around with creating GWT callback "nests". Basically the idea was to have something where you could add a bunch of AsyncCallbacks into a queue, then have them fire each other off.

Basically, I wanted a blocking async call, but after reading some very good posts about this found that it's just not possible due to some javascript thread things. Moreover, it really avoids the whole point of async GUIs. (Granted, I'd planned to have a cache, so that it was unlikely to need the nested calls to be truly asynchronous, blah blah...)

Anyway I solved my problem another way, but I may play around with these nested callbacks some more. I liked the idea of big asynchronous monsters rolling around in my code.

Man I'm enjoying GWT.

public class NestingCallbacks {

List nest = new ArrayList();

* add it to the beginning
* @param nestable
public void addToNest(NestedStdAsyncCallback nestable){
nest.add(0, nestable);

public void doIt(){

NestedStdAsyncCallback cur = (NestedStdAsyncCallback) nest.get(0);



public class NestedStdAsyncCallback {

private AsyncCallback callback;

public NestedStdAsyncCallback(AsyncCallback callback) {
this.callback = callback;

public void run(List nest) {

System.out.println("run ");


if(nest.size() > 0){
System.out.println("nest size now "+nest.size());
NestedStdAsyncCallback next = (NestedStdAsyncCallback) nest.get(0);
System.out.println("end of the line");