Jul 11

Growl: An OS Service which we should all have access too

Apple, Java, Tech 6 Comments »

Stu Halloway is a wise, wise man :) Even though I read about Growl in Pragmatic Automation, I didn’t think anything of it, until Stu re-introduced it to me this weekend.

For those that don’t know about it, Growl is an open source service for the Mac, which gives you a nice standard way to define user alerts. To start with, on the Windows side, think of the system tray fade away alerts that you get with IM tools, email, and the like.

However, wouldn’t it be nice to NOT reinvent that wheel in every application. Growl gives you the flexibility to do just this. Apps can send messages to Growl, and users can determine how much they care about them, and the look and feel for these alerts (e.g. colors, where on the screen, even items such as “read it”).

This is only the beginning though. If you take this to the next level, Growl can tie into external items. Have a text message sent, an email, a message to a MOM queue, and lighting up a lava lamp (Mike Clark talks about setting up build alerts).

I would love to see a Windows based version of Growl (and other OSes), and have them builtin to the OS’es. We should have one way to access this guy (sending messages to the service), and it would work everywhere. We could even have a JSR ;)

If you want to get all aspecty, you could write aspects that tie into various application code, and inject in these alerts.

Very cool stuff Stu! Growl joins my “I wish it was on Windows list”, sitting next to QuickSilver :)

Jul 08

Howards Right: public abstract class Enum<E extends Enum<E>>

Java, Tech 6 Comments »

Howard Lewis Ship is another on the list of “frustrated with generics”.

I totally agree. If we were going to REALLY go generic, then we should have bite the bullet and made all of the changes, especially so we didn’t have runtime erasure.

As someone said, all you need to do is look at the JavaDoc and see something like:

public abstract class Enum<E extends Enum<E>>

Greeeeat. Explain that to the average Java Joe.

We get compile time checking, and we make everything thrice as complicated in the mix. Is that good? Seeing Map<String> looks good and all, and then you get into writing generic code and you scream.

Jul 08

Hibernate3 Example of Annotation Hell :)

Java, Tech 9 Comments »

I am getting to play with Hibernate 3, and they have done a nice job. I was poking around the Caveat Emptor example from Hibernate in Action, which was updated for Hibernate3.

I happened across this file: package-info.java:

@TypeDefs({
@TypeDef(
name="monetary_amount_usd",
typeClass = MonetaryAmountType.class,
parameters = { @Parameter(name="convertTo", value="USD") }
),
@TypeDef(
name="monetary_amount_eur",
typeClass = MonetaryAmountType.class,
parameters = { @Parameter(name="convertTo", value="EUR") }
),
@TypeDef(
name="item_state",
typeClass = EnumUserType.class,
parameters = { @Parameter(name="enumClassName", value="org.hibernate.ce.auction.model.ItemState") }
),

@TypeDef(
name="creditcard_type",
typeClass = EnumUserType.class,
parameters = { @Parameter(name="enumClassName", value="org.hibernate.ce.auction.model.CreditCardType") }
),
@TypeDef(
name="rating",
typeClass = EnumUserType.class,
parameters = { @Parameter(name="enumClassName", value="org.hibernate.ce.auction.model.Rating") }
)
})

@NamedQueries({
@NamedQuery(
name="minBid",
queryString="select b from Bid b where b.amount.value = (select min(b.amount.value) from Bid b where b.item.id = :itemid)"
),
@NamedQuery(
name="maxBid",
queryString="select b from Bid b where b.amount.value = (select max(b.amount.value) from Bid b where b.item.id = :itemid)"
)
})

package org.hibernate.ce.auction.persistence;

import org.hibernate.annotations.*;
import javax.persistence.*;

Is this better than XML? To have this code sucked in?

NOTE: You don’t have to use the annotations of course.

Jul 07

London Bombings

British No Comments »

As soon as I landed in NYC this morning, I started to hear about the London attacks. I was quickly able to call and email friends and family there, and luckily noone was harmed.

There were a couple of close calls:

  • My cousin changed trains at Aldgate station 20 mins before the bomb went off there
  • A friend was on the train behind the train that got hit in the king cross explosion. he was stuck in the tunnel for over 2 hours and had to be rescued from the other side. He said at the time he had no clue what had happened and thought it was a faulty line. The only reson he wasn’t on the other train was because Becky held him up a few minutes in the morning before he left. … to do some washing up! Thank god for a nagging wife ;)

Unfortunately, many of others loved ones were lost and injured in this disgraceful, cowardly act.

I was impressed that Tony Blair came right out, and mentioned that this isn’t about Muslims, as these kinds of events could start a civil war in London if people took things the wrong way. We can’t let a few nutters destroy things.

My heart goes out to anyone who was affected today, including the bombers themselves who are willing to kill for a bad cause.

Jul 07

% maven console

Builds No Comments »

I have recently had a few people on various projects yell “maven is slow!”. I haven’t thought that recently, probably because everything seems slow on the Mac ;)

However, if I know I am in for some solid coding, and will be running maven a lot, I bring up the maven console:

maven-console-cmd.jpg

I have been surprised at how many people using Maven didn’t know about the console.

Now you pay the JVM startup price once, and after running a goal, everything is nicely cached and JIT’d and everything else. Now your mavenisms will scream in comparison.w

Jul 06

torrent: native in browsers

Web Browsing 3 Comments »

Bob has posted about bittorrent integration in: Opera Integrates BitTorrent.

I do concur that it makes sense to have this kind of thing hidden from the user.

I am a little scared that torrent will be the only way to get to something. I often run into situations where the torrents are all screwed up and I shout “I JUST WANT TO DOWNLOAD THIS DAMN THING”.

So hopefully you could do something like:

<a href=”torrent://www.almaer.com/torrents/coolradioshow1.torrent,http://www.almaer.com/media/coolradioshow1.mp3″>

or a level of abstraction:

<a href=”abstraction://www.almaer.com/virtual/coolradioshow1.abstract”>

We need this to be a standard, and not just in Opera ;)

Jul 06

Swik: SourceLabs making it easier to find open source

Java, Open Source, Tech 4 Comments »

SourceLabs has released a search engine called Swik which is:

Swik brings together concepts from wikipedia, delicious, and blogs to provide a service that is both open and structured.

More and more services are popping up to help out in this area, such as O’Reillys CodeZoo, and the interactive JDocs.

The fact that it is a wiki is interesting, and the tagging makes a lot of sense. As always, there are pros and cons to the “wiki” effect.

It is also good to see that “ajax” is a top term ;)

Jul 06

London Olympics 2012

Personal No Comments »

I have already looked online to book tickets ;) I can’t believe that London got the bid, and I am really excited. The east end of London, which is very run down, will get a good revamp here.

I grew up just a couple of stops out on the central line, so it will be easy to tube it into Stratford.

After all the hype you get so excited about it all, you want it to happen now. Suddenly 2012 seems a long way, a-way.

Congrats to the entire Olympic team, and see you in 2012!

Tony Blair and Jacques Chirac at the G8

Tony: “Do you have the time Jacque?”
Jacques: “Oui, it is 18:34″
Tony: “Funny, I have 2012″

Jul 05

Geekiest Website Award: Ben Galbraith

Tech 2 Comments »

My Ajaxian brother, Ben Galbraith, must get the geekiest website for his current incarnation of his homepage, which mimics a unix shell session :)

Currently it is all just in JavaScript, but what will be realy cool is changing it so the homepage is a simple Ajaxian application which asks the server side for the content (for ls and cat).

Jul 04

Lightweight Development, NOT, Lightweight Container

Java, Lightweight Containers, Tech 5 Comments »

The term “lightweight container” has been en-vogue for a few years now (roughly since Pico/Spring came about). At first it kinda made sense, as they did seem tiny little containers compared to the big beasts WebLogic/WebSphere.

However, I think that the term is actually completely the wrong one. This thought came about as people have been saying:

“Spring is far from a lightweight container. Look at how much crap is available for you! Web/DAO/IoC/TX/AOP/RCP/JMX/Portal/WebFlow…. call that lightweight!!!”

It is true that Spring now has a lot of functionality available in its core, and a ton more hidden in the sandbox.

To me, the point is that Spring lets you apply lightweight development. I don’t need my container to be 10kb for enterprise development, and just be an IoC container. I actually WANT my enterprise container to be able to do the HEAVY lifting, allowing ‘lil ‘ole me to write in a lightweight, POJO based model.

So, I no longer think lightweight container. I think lightweight development.

I hope Spring keeps putting on the pounds as it makes more and more aspects of our development easier.

EJB 3 is a perfect example

EJB 3 is not a more lightweight container. They have just fixed the programming model, but the guts are exactly the same! People didn’t complain about the fact that EJB could grok TX automatically for us, they hated the programming model (Bean/Home/Remote interface etc etc etc).

I agree that EJB 3 is going in the correct direction, in that it is making our development simpler, and POJO based. We have to be careful with what we put in annotations though. I hate to see items like SQL hard coded in there, and ending up with a munge of the XML descriptors right in the bean.

Some items should be annotation driven. Others deserve to be external. Deployment is a big issue for large enterprises, and we need to have lightweight deployment too!