Mar 11

A Negative Code Day

Tech 3 Comments »

Isn’t it great when you get in the zone when coding? Now and then you come to the end of the day and think:

Man I wrote a lot of code today

but, it is always nicer to think:

Man, I wrote some elegant code today

I was really excited as I had one of those days. Due to a major refactoring I was able to write negative code.

The LOC of my functionality went down by ~60%. Now, I am left with an infinitely cleaner API for myself, and others, to use…. and the innards are readable and grokable.

Gotta love nuking some code! Less to maintain!

Mar 11

iToast Shuffle

Apple 2 Comments »

If you are in a rush in the morning, just grab the iToast Shuffle and run!

I guess if you have to live with SPAM, we may as well make some fun with it :/

Mar 11

AspectWerkz 2.0 final, on the way to AspectJ 5

AOP, Java, Tech 328 Comments »

The AspectWerkz team has released AspectWerkz 2.0 final.

AspectWerkz 2.0 final comes with bug fixes.

  • option -keepjp renamed in -genjp (generate jit join points) (affects offline mode)
  • perJVM mixin deployment-model restablished
  • after returning advice was not handled properly in some cases
  • issue with around advice and set() pointcut could happen with long/double fields
  • issue with serialization and advised classes not implementing directly java.io.Serializable
  • issue could happen when using hot re-deployment of advised J2EE applications

Read more and download

What’s new in 2.0

Mar 11

Late night TiVo aware showings

Personal, TV / Movie, TiVo 1 Comment »

I know that this sometimes happens, but I wish more shows were repeated in the wee hours, just to please my TiVo. It is frustrating when several shows that I want to record overlap (and I don’t have DirecTiVo with multiple tuners).

If the network put on the new show at 4am, then TiVo could be a good boy and grab it for me. Then I wouldn’t miss the show! This has probably stopped me from getting into new shows that I miss for old favorites.

Maybe the networks don’t care as they also know we skip commercials? :)

Mar 10

RE: Ivy is everything Maven should be

Builds, Tech 198 Comments »

Colin Sampaleanu claims that Ivy is everything Maven should have/could have been 2.5 years ago.

While I understand where he is coming from, and I think Ivy is a nice piece of software, I have to stand up for Maven again.

Even though, I know that I will get bashed for it.

Handling dependencies is a very nice thing. And, having transitive closures on those dependencies is going to be great to have in m2.

However, this isn’t the only part of a build, nor of Maven. Maven is my build container. It takes care of so much that I don’t have to worry about, and I haven’t had to get deep into Jelly code, like others have expressed.

m2 is not going to come rushing out there, and you can’t blame the authors! They are going to learn from their mistakes, and my guess is that when m2 finally does rear its head, we will be impressed.

Also, in related news, Vincent Massol is writing a Maven book for O’Reilly.

disclaimer: just because I have had a good experience with Maven does not mean that I am trying to ram it down YOUR throats, and I understand if you don’t chose to use it :)

Mar 10

Debugging Web Services. Grr.

Tech 6 Comments »

Let me walk through a fun time we have had, working with third party integration. The party that we were integrating with has a Web services API that we can talk too, to get what we need done.

Working with Generated Proxies

We were handed a set of pregenerated proxies, in Java code, that we could use to talk to their system. Man, these pregenerated beasts are ugly! You end up working with a Foo, FooImpl, FooResult, Foo_Stub, Foo_KitchenSink, and a million other classes.

So, you quickly try to get a facade in place to make it bearable for any other poor sod behind you.

Lovely error messages

Some of the functionality was working nicely, and then suddenly some of it stopped working. ERROR. Time to look through and see what the problem is… but there was no error information. Not even SOAP Faults that had any information. Nothing. null.

After floundering through the documentation (which is never up to date, or informative), and trying out a bunch of solutions (trial and error… what a great approach), you end up punting to the third party vendor.

The Wrong Proxy

At this point, we find out that a new version of the service is deployed, and we had the wrong proxies. We are then given a new set of Axis proxies. Unfortunately, noone knows which version of Axis. So, you sit there with maven, changing the line with the various version.

Oops, says “no field RPC” guess it isn’t this version. Next!

Finally the right version magic is found between the jars. Some are so special they aren’t on ibiblio, so you need to put them up in your own Maven repository. I know, I know. If you are an ant guy you would just throw it in lib/ and laugh at the poor people that go through the same pain as you.

foo.setBar(null)

Now you are cooking with gas. You have the right libs in place, and you are able to get real results back from the Web service. Then it starts to go wrong again, and the null errors come back.

Bizarrely, you find out that by doing some set methods, even to null, it fixes things. What black magic!

You also learn to CLONE objects when you use them.

So, instead of:

Foo f = Foo.createWithBar(x, y);

e1 = f;
e2 = f;

you:

Foo f = Foo.createWithBar(x, y);

e1 = f.clone();
e2 = f.clone();

Now it all works again.

Using WSDL

You could, of course, try to just go off of the WSDL, but there were problems with that too. This is why the service company hands you proxies to use instead. They have seen too many interop problems.

Message Versioning and RPC

Doesn’t this smell a lot of RPC which is very coupled? In some ways it is more painful, as not only are you coupled to the proxy jars, but you are hoping that the runtime keeps working!

Ted would cry at this, as it isn’t message oriented at all. In fact, with the service ‘upgrade’ they didn’t even do so in a way to keep backwards compatibility!

Ah, the pleasure of Web services. But now we have a SOA so that is good ;)

Mar 10

@EventDrivenArchitecture

AOP, Java, Tech 7 Comments »

I was sitting in a session next to Adrian Colyer, and he showed me what he had literally just hacked up.

It is a nice proof of concept showing a DSL for event driven code.

It allows you to simply specify a publisher:

class Producer {
public Producer() {}

@RaisesEvent("price-update") private int price;

@RaisesEvent("calculation-complete")
public int calculate(int x, int y) {
return x*y;
}

public void setPrice(int price) {
this.price = price;
}
}

and a subscriber:

@EventSubscriber static class Recipient {

// exposed public fields for testing
public int calculationResult = 0;
public int price = 0;

@OnEvent("calculation-complete")
void onCalculationCompletion(MethodBasedEvent event) {
System.out.println("calculation-complete, result = "
+ event.getResult());
calculationResult = (Integer)event.getResult();
}

@OnEvent("price-update")
void onPriceUpdate(FieldBasedEvent event){
System.out.println("price-update, new price = "
+ event.getValue());
price = (Integer) event.getValue();
}
}

I hope that this could be firmed up, and maybe at some point make it into the ajlib project! :)

Mar 10

Shoe Enlarger

TV / Movie 1 Comment »

Ok, I know it is a little trite to put entries in like this. But, I was up in the wee hours last night, and one of the silly infomercials was for a Shoe Enlarger.

It is a device that lets you put shapes in various places on it, and then you shove it in your shoe. It stretches it this way and that.

I guess I could maybe understand this if you have broken a toe or something, but how about instead of buying that tool you:

Buy shoes that fit

Mar 10

Instant Edit: a look at the Wiki of the future?

Ajax, JavaScript, Tech 4 Comments »

If you check out Instant Edit you see an example of changing a couple of pieces of content on a web page.

What if you extrapolate that a little, and think of a Confluence Wiki?

Wouldn’t it be amazing, if I could be viewing my Confluence install, and on any page I can just double click, or ctrl-click, or something… to open up the area that I am on in edit mode.

Then I type in my changes, drag an image to the area, and it is all saved.

This is a holy grail of Wiki for me. No software needed. WYSIWYG. Simple enough for non-techies to work with (even CamelCase is too much for some ;).

Another example is Live Preview. Right now, there could be a preview pane, and as you type, it groks your Wiki Syntax and converts to the HTML view… all on the fly!

Mar 09

Iron Coder: TV for programmers

Tech 210 Comments »

Have you seen the goofy T.V. show Iron Chef, where they have an episode to compete on their culinary skills?

I would love to create: Iron Coder.

Type One: The Gurus

Groups from each framework (e.g. Howard Lewis Ship and team for Tapestry, Ed Burns and Craig for JavaServer Faces, Jason and Pat for WebWork, David HH for Rails, etc) would come together to spend a day working on a project.

They would get some docs, and a test suite which has to pass by the end of the day, and they have to build a website with given functionality.

We would get to watch them work, learn from them, and see what they come up with. Points would be given for speed, simplicity, creativity, and elegance.

Type One: The Uber geeks

We would get top programmers from the community, and they would randomly be placed in teams. Then, each team would pull a framework/platform/environment out of the hat and they would have to build the given project using that technology.

How fun would that be! :)

Loading...