Feb 25

First Video Game Written In Ant

Builds No Comments »

Jon Aquino has started a new craze. The last two JavaOne’s have had Vodafone telling us “write video games for mobile phones and you will make millions!!!”.

Maybe this year we will be told to write Ant video games! :)

Fair play to Jon for showing that this is possible. The one, practical, take away point is that you can check out the new macrodef functionality in Ant 1.6, and the Ant Contrib library which gives you the if/then/else/for/.... tags and more.

<macrodef name="check-crash">
<sequential>
<if><islessthan arg1="${left-clearance}" arg2="0"/>
<then><die/></then></if>
<if><islessthan arg1="${right-clearance}" arg2="0"/>
<then><die/></then></if>
</sequential>
</macrodef>
Feb 25

Pugs: Perl 6 interpreter in Haskell

Perl, Tech 8 Comments »

All I can say is “wow”. Autrijus has written an interpreter for Perl 6 in Haskell called Pugs. Kudos.

Oh, and here is a small example of some Perl 6 code:

#!perl6
use v6;

multi sub quicksort ( ) { () }

multi sub quicksort ( *$x, *@xs ) {
my @pre  = @xs.grep:{ $_ < $x };
my @post = @xs.grep:{ $_ >= $x };
(@pre.quicksort, $x, @post.quicksort);
}

(1, 5, 2, 4, 3).quicksort.say;
Feb 25

Google maps subtle UI change to Google Maps

Google, UI / UX No Comments »

I noticed that Google Maps has a slight change on the front page of its UI.

I mentioned the right hand side ‘Examples’ when I first saw the app. Having the text boxes and multiple search buttons was confusing.

Now Google has taken them out and has replaced them with sample text and ‘Try it’ links which run the sample queries.

It took me a bit to change my pattern of:

yp.yahoo.com

find the place that I want

map it

to:

maps.google.com

nameOfPlace in theTown

My next request is due to having my father-in-law with a Hybrid. Have you noticed how you can get obsessed with seeing your hybrid not use the engine, and watching it get energy back via braking etc?

There should be a ‘Show me directions that are most energy efficient for my hybrid” to complement “shortest distance” and “shortest time” ;)

Feb 25

Apples love of the mouse. Don’t forget the keyboard.

Apple, Tech 13 Comments »

Apple pioneered the mouse (via Xerox ;) ). They love it. I didn’t quite understand how much until I was listening to an audio book on my last 5 hour drive from Madison to Minneapolis. I was listening to The Second Coming of Steve Jobs, which is a very frank account of Steve, and details his travels from NeXT back until he is in charge of Apple once more. It shows that he got VERY lucky with Pixar ;)

But, anyway, back to the mouse. When Steve was speaking to a group at Stanford (when he was at NeXT), he took one of the current Mac keyboards from a student who wanted him to sign it. He then went on to pick out all of the keys that he hated. He hated the function keys. He hated the arrow keys, as he felt that we should all be using the mouse.

I understand what a great innovation the mouse was. I would hate to use Photoshop with arrow keys :) However, I actually try to use the mouse as little as possible. This may be because I am from the vi/emacs frame of mind, and I have some weird twisted thought that it will stop me getting carpel tunnel :)

Although, I can setup nice key bindings on my PowerBook, there are STILL areas which drive me nuts.

Tab To Damn Drop Downs!

One of the primary irritants, is how I can’t tab from text boxes to drop downs and select them with the keyboard. This is even the case within apps such as Firefox. I am sorry, but when I fill out a form I want to be able to just use my keyboard and tab between all fields. It drives me nuts that I have to stop and get the mouse out to make the drop down selections.

God knows how people with accessibility problems think!

Feb 25

Apples love of the mouse. Don’t forget the keyboard.

Apple, Tech 23 Comments »

Apple pioneered the mouse (via Xerox ;) ). They love it. I didn’t quite understand how much until I was listening to an audio book on my last 5 hour drive from Madison to Minneapolis. I was listening to The Second Coming of Steve Jobs, which is a very frank account of Steve, and details his travels from NeXT back until he is in charge of Apple once more. It shows that he got VERY lucky with Pixar ;)

But, anyway, back to the mouse. When Steve was speaking to a group at Stanford (when he was at NeXT), he took one of the current Mac keyboards from a student who wanted him to sign it. He then went on to pick out all of the keys that he hated. He hated the function keys. He hated the arrow keys, as he felt that we should all be using the mouse.

I understand what a great innovation the mouse was. I would hate to use Photoshop with arrow keys :) However, I actually try to use the mouse as little as possible. This may be because I am from the vi/emacs frame of mind, and I have some weird twisted thought that it will stop me getting carpel tunnel :)

Although, I can setup nice key bindings on my PowerBook, there are STILL areas which drive me nuts.

Tab To Damn Drop Downs!

One of the primary irritants, is how I can’t tab from text boxes to drop downs and select them with the keyboard. This is even the case within apps such as Firefox. I am sorry, but when I fill out a form I want to be able to just use my keyboard and tab between all fields. It drives me nuts that I have to stop and get the mouse out to make the drop down selections.

God knows how people with accessibility problems think!

Feb 25

E4X: Is ECMAScript the glue language we have wanted? It powers the browser VM.

Java, JavaScript, Tech 9 Comments »

JavaScript has a bit of a tough label. Many developers think of it as a hackers web scripting language which is good for alert("foo") and document.*.

The language is really growing up now though, and we have good implementations on the Java side such as Rhino.

Rhino even implements the latest and greatest of ECMAScript: ECMAScript for XML (E4X).

Now, XML is a first class citizen in the language which allows you to do some of the following:

Create a DOM from XML

var order = <order>
<customer>
<firstname>John</firstname>
<lastname>Doe</lastname>
</customer>
<item>
<description>Big Screen Television</description>
<price>1299.99</price>
<quantity>1</quantity>
</item>
</order>

Walk the XML tree a la XPath etc

// Construct the full customer name
var name = order.customer.firstname + " " + order.customer.lastname;

// Calculate the total price
var total = order.item.price * order.item.quantity;

Construct a new XML object using expando and super-expando properties

var order = <order/>;
order.customer.name = "Fred Jones";
order.customer.address.street = "123 Long Lang";
order.customer.address.city = "Underwood";
order.customer.address.state = "CA";
order.item[0] = "";
order.item[0].description = "Small Rodents";
order.item[0].quantity = 10;
order.item[0].price = 6.95;

Playing with SOAP

var message = <soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<soap:Body>
<m:GetLastTradePrice xmlns:m="http://mycompany.com/stocks">
<symbol>DIS</symbol>
</m:GetLastTradePrice>
</soap:Body>
</soap:Envelope>

// declare the SOAP and stocks namespaces
var soap = new Namespace("http://schemas.xmlsoap.org/soap/envelope/");
var stock = new Namespace ("http://mycompany.com/stocks");

// extract the soap encoding style and body from the soap message
var encodingStyle = message.@soap::encodingStyle;

print("The encoding style of the soap message is specified by:\n" + encodingStyle);

// change the stock symbol
message.soap::Body.stock::GetLastTradePrice.symbol = "MYCO";

var body = message.soap::Body;

Conclusion

It is interesting to see ECMAScript leading the way in some areas. It is an interesting idea to have XML as such as first class citizen. I don’t remember having “tab delimited data” at the same level, and it is a little worrying to think about XML abuse that could occur because of it.

However, maybe it is time to take ECMAScript more seriously. It is installed in all browser VMs so to speak, and with implementations like Rhino, allows you to script Java in a simple way :)

Feb 24

The Office: US Edition Finally Makes It!

TV / Movie 2 Comments »

I was really excited when I first heard about The Office (my favourite UK comedy) coming to the US. Then I remembered Coupling, and how bad it was over here in the US :)

Well, I heard that NBC held off on The Office, and they put on ANOTHER Fear Factor instead. Well, tonight I saw a preview for it, and it is coming soon!

If it is half as good as David Brent and co…. then it will be the best thing on Must See T.V.

Feb 24

Ajax: A New Approach to Web Applications

Ajax, HTML, JavaScript, Tech, UI / UX 10 Comments »

There has been a lot of talk regarding the amazing new UIs that we can build with XmlHttpRequest, and the like ( a la Google Maps, TadaList, etc ).

Jesse James Garrett has given this set of technology a new name, and talks about it in Ajax: A New Approach to Web Applications.

I am extremely excited about the technology, but can’t agree more with Jason Fried when he calls for some caution.

As with all ‘new ways of doint it’, we need to make sure that we don’t confuse the users. One of the sad truths of UI work, is that you often have to keep your UI in a state that users are used too, even if the purist in you thinks they know a better way.

So, its time for us to get creative, but end up with an interface that is as usable, as much as it blows away the customers! :)

Feb 24

Rails 0.10 Released

Ruby, Tech, Web Frameworks No Comments »

David and the Rails team have announced Rails 0.10.0: Routing, Web Services, Components, Oracle.

There are lots of good new features, but one I am excited about (thanks to Brian Mc for pointing it out) is the Action Web Service.

Now I can be in my corner writing more Ruby code, and having other folks talking to me via SOAP (ok, I am not a big fan of SOAP… but hey).

Congrats to the Rails team.

Feb 24

<script language=”ruby”>

Ruby, Tech 5 Comments »

I am finding that Ruby is “my style” of programming language for many tasks. One that would be very well suited to Ruby, would be driving the browser VM, what we end up using JavaScript for now.

Ruby would be ideal for this task IMO, and I wonder if anyone has created an extension for Firefox at least. It would be hard to practically deploy with Ruby, until there was enough of an uptake of course… but you can still dream.

One of the problems to overcome is the fact that now, we don’t really modularize our web scripting code a lot. The most we do is have seperate .js files which encapsulate logic.

What if we had a mechanism in which the script could contain metadata which would look like dependencies in Maven.

E.g.

“My script needs My::Module version 2.4, and ActiveRecord 1.0, and ….”

Then there could be a local repo which would allow us to share code. Something like this would change the way we think about web scripting on the client, and move from a ‘hacker’ perspective, to something more mature. Of course, we would have to have a sandbox-like system to stop people from doing Bad Things.