Jan 17

AspectJ 5 supports Java 5

AOP, Tech No Comments »

Adrian has been talking about getting Java 5 support into AspectJ. I can imagine how much work that has been, and I am impressed to hear that AspectJ 5 now supports full source compilation of Java 5 programs.

AJDT also has integrated in to Eclipse 3.1 M4 with full Java 5 support, eager parsing, and early error indications all working happily (not officially released).

Check out a SimpleAspect. Java 5 style:

import java.util.List;

@MyAnnotation
public aspect SimpleAspect {

int x;
static List myStringList;

public static void main(String[] args) {
for(String s:args) {
System.out.println(s);
myStringList.add(s);
}
C c = new C();
c.whatCsDoBest();
c.somethingElse();
c.myInt(5);
c.somethingElse(new Object(), new Object());
c.whoAmI();
D d = new D();
d.whoAmI();
}

pointcut annotatedExecution() :
execution(@MyAnnotation * *(..));

before() : annotatedExecution() {
System.out.println(thisJoinPoint + " has an annotation.");
}

before() : call(* myInt(..)) && args(int) {
System.out.println("Autoboxing match");
}

before(Object[] objects) : call(* somethingElse(Object...)) && args(objects) {
System.out.print("Varargs match: ");
for (Object o:objects) {
System.out.print(o + " ");
}
System.out.println();
}

before() : execution(C whoAmI()) {
System.out.println("Covariant match on execution(C whoAmI())");
}

before() : execution(D whoAmI()) {
System.out.println("Covariant match on execution(D whoAmI())");
}
}

class C {

@MyAnnotation
public void whatCsDoBest() {

}

public void somethingElse(Object... objects) {

}

public C whoAmI() {
return this;
}

Progress getAspectJ5Progress() {
return Progress.EXCELLENT;
}

public int myInt(Integer i) {
return i;
}

}

class D extends C {
public D whoAmI() {
return this;
}
}

@interface MyAnnotation {}

enum Progress { OK, GOOD, VERYGOOD, EXCELLENT }
Jan 16

Java 5: String.regionMatches()

Java, Tech No Comments »

Kirk talks about the new regionMatches(..) methods available in the Java 5 String class.

There were questions on readability, and Kirk has a benchmark to proove the micro-performance.

I think the methods definitely harder to grok at first, and there is room for helper methods (e.g. in the first case: foo.startsWithIgnoreCase(bar)).

Case-folding startsWith()

If you

Jan 16

Java 5: String.regionMatches()

Java, Tech No Comments »

Kirk talks about the new regionMatches(..) methods available in the Java 5 String class.

There were questions on readability, and Kirk has a benchmark to proove the micro-performance.

I think the methods definitely harder to grok at first, and there is room for helper methods (e.g. in the first case: foo.startsWithIgnoreCase(bar)).

Case-folding startsWith()

If you

Jan 16

Werner Vogels takes Amazon CTO position

Tech No Comments »

Good luck to Werner on taking the CTO job at Amazon.

I can only imagine that Amazon will be excited to have someone as skillful as Werner, especially for his distributed skills. I am looking forward to hearing more information on what they are up to!

Jan 16

WernerVogels takes Amazon CTO position

Tech No Comments »

Good luck to Werner on taking the CTO job at Amazon.

I can only imagine that Amazon will be excited to have someone as skillful as Werner, especially for his distributed skills. I am looking forward to hearing more information on what they are up to!

Jan 16

MobTaxi: Getting a taxi to you quicker than ever

Mobile, Tech No Comments »

I was stuck trying to hunt down a cab today. I didn’t have a cab number, and although I could 411 for one, I just wanted to hunt one down.

I am sure that someone is probably working on this, or it is already out there, but wouldn’t it be cool if there was a service that did the following?

  • I open my mobile and either: text message, or hit a button in an app, or browse online to an app (depending on what I want to do at the time)
  • A service gets my message, and gets my location via GPS
  • It sends the information to cab companies
  • The nearest cab comes to save me!

The service could then partner with various taxi companies. Perfect :)

Jan 16

Lexical scoping and Groovy closures

Tech No Comments »

Brian talks about closures and anonymous functions, and how closures are different in various ways, one being their lexical nature.

Lexical nature is very natural to certain programmers. For example, it was drilled into my brain when Perl had both a local and my semantic which differed.

Brian also goes on to compare the implementation differences with Ruby, and how a block is a special piece which get optionally get tagged on to a method call (and called via yeild), whereas in Groovy, a closure is just a Closure which can be passed into a method.

I love the power of closures, and hope they continue to be a core part of the Groovy language.

Jan 16

Behind the season on Google UI Design

Google, Tech No Comments »

Alan wrote about Melissa Mayer (Product Manager for Google), and her presentation at BayCHI lecture at PARC.

Some interesting comments came up:

  1. The prime reason the Google home page is so bare is due to the fact that the founders didn’t know HTML and just wanted a quick interface. Infact it was noted that the submit button was a long time coming and hitting the RETURN key was the only way to burst Google into life.
  2. Due to the sparseness of the homepage, in early user tests they noted people just sitting looking at the screen. After a minute of nothingness, the tester intervened and asked ‘Whats up?’ to which they replied "We are waiting for the rest of it". To solve that particular problem the Google Copyright message was inserted to act as a crude end of page marker.
  3. One of the biggest leap in search usage came about when they introduced their much improved spell checker giving birth to the "Did you mean…" feature. This instantly doubled their traffic, but they had some interesting discussions on how best to place that information, as most people simply tuned that out. But they discovered the placement at the bottom of the results was the most effective area.
  4. The infamous "I feel lucky" is nearly never used. However, in trials it was found that removing it would somehow reduce the Google experience. Users wanted it kept. It was a comfort button.
  5. Orkut is very popular in Brazil. Orkut was the brainchild of a very intelligent Google engineer who was pretty much given free reign to run with it, without having to go through the normal Google UI procedures, hence the reason it doesn’t look or feel like a Google application. They are looking at improving Orkut to cope with the loads it places on the system.
  6. Google makes changes small-and-often. They will sometimes trial a particular feature with a set of users from a given network subnet; for example Excite@Home users often get to see new features. They aren’t told of this, just presented with the new UI and observed how they use it.
  7. Google has the largest network of translators in the world
  8. They use the 20% / 5% rules. If at least 20% of people use a feature, then it will be included. At least 5% of people need to use a particular search preference before it will make it into the ‘Advanced Preferences’.
  9. They have found in user testing, that a small number of people are very typical of the larger user base. They run labs continually and always monitoring how people use a page of results.
  10. The name ‘Google’ was an accident. A spelling mistake made by the original founders who thought they were going for ‘Googol’
  11. Gmail was used internally for nearly 2years prior to launch to the public. They discovered there was approximately 6 types of email users, and Gmail has been designed to accommodate these 6.
  12. They listen to feedback actively. Emailing Google isn’t emailing a blackhole.
  13. Employees are encouraged to use 20% of their time working on their own projects. Google News, Orkut are both examples of projects that grew from this working model.
  14. This wasn’t a technical talk so no information regarding any infrastructure was presented however they did note that they have a mantra of aiming to give back each page with in 500ms, rendered.
  15. Quote: Give Users What They Want When They Want It
  16. Quote: Integrate Sensibly
Jan 14

Pragmatic Programmers laugh at the FBI

Tech No Comments »

/\ndy Hunt of the Pragmatic Programmers reported on a FBI that went wrong:

Following in the pioneering footsteps of the IRS, the FBI now has it’s own monumental software project failure.
In a USA Today article, the FBI said Thursday that it probably will scrap nearly all of a $170 million computer program that was being designed to help agents share information to stop terrorism — because it doesn’t work.

FBI Director Robert Mueller, speaking on the bureau’s technology upgrade plans, said “There were problems we did not anticipate.”

No kidding?

Reminds me of the time the Pyschic Friends Network (remember them from late-night TV?) pulled their IPO stock offering due to “unforeseen circumstances.”

Folks, if you stick to outdated project-management practices, poor build and release practices, and bad-to-nonexisting test practices, you will fail. It’s just that simple.

Maybe I should send the FBI Director a copy of The Pragmatic Programmer: From Journeyman to Master along with a copy of our upcoming Practices of an Agile Developer? Or perhaps we need a new title, The Pragmatic CIO: From Scapegoat to Hero.

You will always have problems you don’t anticipate. What separates the men from the boys (so to speak) is how you deal with that.

Experiencing shock and awe at simply having unanticipated problems is definitely not a good start.

$170 Million. Wow. Although to be fair, in some ways the larger the project the more likely it gets cocked up!

Jan 14

Sam comes up trumps with an Image verification check for JSP 2.0

Tech No Comments »

Blogs are cool :)

I just wrote something about image verification in forms, and Sam comes up with a solution for JSP 2.0.

As he says, it may not be perfect, but it works!

It would be cool to take this, refactor it, make a filter that can do the security work for you, etc etc etc etc.

Thanks Sam!