Friday, June 30, 2006

JavaOne talks available online

WARNING: This blog entry was imported from my old blog on blogs.sun.com (which used different blogging software), so formatting and links may not be correct.





The JavaOne 2006 talks are now available online. Not only do you get the slides - you get the audio, and even a written transcript! All synchronized on auto play. Sit back and enjoy all the talks you missed! Especially those of you who couldn't make it to the conference this year. This resource is available free of charge for anyone - you just need a SDN (Sun Developer Network) login (also free).



It's pretty cool that written transcripts are provided. That lets you cruise through the talks if you're a fast reader and you don't want to sit and listen to the speakers. Somebody must have gone to a lot of trouble creating the transcripts - actually listening to all the talks and typing them in. In the case of our
Visual Basic talk, it's a bit entertaining though. John was joking that while Herbert is German, he would identify himself as Bavarian. The transcript says Liberian rather than Bavarian...



Not all talks (specifically, BOFs) are included. The Java Posse BOF for example. However, I recently got a link from a Java user group with Google video extracts from the show. See it
here - thanks to Peter Pilgrim. You can obviously get the full audio from the show at the Java Posse website.



You can find all the online sessions here.



Tuesday, June 27, 2006

An Inconvenient Truth

WARNING: This blog entry was imported from my old blog on blogs.sun.com (which used different blogging software), so formatting and links may not be correct.


I decided to go see a movie tonight. Things have been really hectic lately, so I was in the mood for mindless entertainment – and there were plenty of choices to choose from. But on impulse I decided to go and see An Inconvenient Truth instead. If you haven't heard about it, it is essentially a documentary from Al Gore regarding global warming.



Okay, I will admit that it sounded a bit boring. And if there's one impression the Republicans were able to hammer home to the public in 2000, it's that Al Gore is boring.



However, I found the movie energizing – I highly recommend it. (And don't just take my word for it – check out what the critics are
saying
). It was engaging, as well as compelling. Even those of you happy with the current U.S. administration should not dismiss this movie as political propaganda, or place it in the
Fahrenheit 9/11 category - it's not.



One of the points made in the movie is that a lot of people think global warming is simply a theory, and a controversial one at that. That's not surprising given media reporting on the topic. However, scientific publications on the topic universally agree on the global warming trend: it's not just a natural cycle as in past ice ages and subsequent melts. In media reporting, however, more than half(!) of the reports are sceptical. Sure, it's possible that this reporting imbalance is simply due to lobbyists at work. However, I suspect people want to hear that there's no problem. That absolves all of us of any responsibility. "An Inconvenient Truth" is a fitting title - it's a truth nobody would like to hear.



However, the movie presents irrefutable evidence of the trend. One thing is the temperature and CO2 graphs, but the side-by-side pictures of glaciers, evaporated lakes etc. over very short time intervals are hard to argue with.








In the U.S. we now have an ad campaign against the conclusions in this movie, touting the benefits of carbon dioxide! That's right boys and girls, never mind the connection between CO2 and global temperatures. Carbon dioxide is good! It's natural. It comes from trees. Without it, life wouldn't exist! Thankfully, John Stewart on The Daily Show made fun of these ads. But the problem with comedy is that we laugh, then move on to the next show (in my case, The Colbert Report!) and fail to act.



This movie is pretty effective in trying to inspire people to take some action. Not only is it specific in what you can do, but it also has a pretty positive message. You might think global warming is all gloom and doom – and if we don't do anything, you wouldn't be all that wrong. But it makes a point I was not aware of: that we have averted a global environmental crisis in the past, so we can do it again.



Remember the ozone layer problem? I sure do. To this day I still use deodorant sticks because I remember the environmental campaign to avoid ozone-layer hazardous CFCs used in among other things, deodorant aerosol sprays that were popular at the time. What I had not heard until I saw this movie, is that this effort was successful and things are well within control today.



I was heartened to see that the movie was well attended. But then this is northern California, which politically is "out of touch" with the rest of the U.S. And, I suspect the people least likely to see this movie are the ones who need it the most, and vice versa.



It's very easy to ignore global warming. That's right. Click on the next blog story in your reader, perhaps something regarding Web 2.0, and forget all about it. But if you're reading this, chances are good you're in one of the top CO2 emissions countries causing the problems – and that makes you part of the problem. Ignorance is not an acceptable excuse. Watching the new Superman movie may be entertaining, but please consider assisting Superman in saving the world yourself! Watching this movie will make you think, and perhaps inspire you to do your part.



P.S. After posting this, I watched tonight's Daily Show and they announced that Al Gore will be the guest tomorrow night!


Monday, June 26, 2006

Happy 10

WARNING: This blog entry was imported from my old blog on blogs.sun.com (which used different blogging software), so formatting and links may not be correct.


Today is my 10 year anniversary at Sun Microsystems. When I joined June 26th 1996 I started working on Sun WorkShop, Sun's C, C++ and Fortran IDE. It's been IDEs ever since, most recently Creator and now, Semplice.



Here's to another exciting 10!


Tuesday, June 13, 2006

When it rains it pours

WARNING: This blog entry was imported from my old blog on blogs.sun.com (which used different blogging software), so formatting and links may not be correct.


I actually have pretty good reasons for my low blogging rate recently, although they're personal so I won't get into it here. But on top of everything, I've been moving to a new place, and with six years worth of accumulated stuff packing and cleaning was quite an effort. Not to mention all the small annoying things I have to deal with, like no internet service for a week (my brother who is visiting is going crazy! Especially when the cable TV hookup is going to take another full week, during the all-important soccer world cup!). Just yesterday I found out that the garbage company is refusing to establish service for me because they claim the previous tenant has not paid his bill. I still don't understand how that's my problem. Garbage company, indeed!



Here are some quickies you might find interesting.




  • There is a "Developing Rich Web Applications Visually using JavaTM technology" class in San Francisco on June 20,21,22. This is being taught by the authors of the Creator Field Guide - Paul and Gail Anderson. There are just a few more seats left in this class. More information about this class can be found

    here.




  • There's a webcast on Ajax with Java, DWR and NetBeans tomorrow (6/14) with
    Dave Johnson, CTO at eBusiness Applications. More information
    here.


  • Oliver Widder did a
    small cartoon on the Java Posse hat mystery...




Monday, May 22, 2006

Keynote Demo Explained

WARNING: This blog entry was imported from my old blog on blogs.sun.com (which used different blogging software), so formatting and links may not be correct.



As mentioned previously, Project Semplice (Visual Basic for the Java platform) was unveiled at JavaOne, both with a technical session, as well as a keynote demo during the technical keynote. The video stream of the broadcast is available - choose
high bandwidth or
low bandwidth.
This is the third part of the keynote, and the Semplice segment begins at around 10:40, where Graham presents the intro slide, and lasts until about 14:40. If you have time, you should check out all the keynotes.



The audio comes through well, but it's hard to see the screen in the video. So let me show you the code in more detail.



I built a temperature converter application, converting Fahrenheit degrees into Celsius. To do that, I dropped three components: a textfield, named fahrenheit, a button, and a label, named celsius.



I then added an event handler to the button click event, which will convert temperatures according to the standard formula:


celsius = (fahrenheit - 32) * 5/9



To motivate why BASIC can be attractive, especially to new programmers, I showed what we'd write in a standard Java application utilizing the above JSF components:


celsius.setText(""+(Integer.parseInt(fahrenheit.getText())-32)*5/9);



I agonized over what code to write here. I personally don't like to use the trick with ""+ to cause integer to String conversion; the code I would have written is using Integer.toString(int):


celsius.setText(Integer.toString((Integer.parseInt(fahrenheit.getText())-32)*5/9));



But I'm not out to try to make Java look bad! And given that many people do use ""+, I went for the shorter solution. There is of course another possibility I could have used, which may be more true to the spirit of JSF. I could have dropped an IntegerConverter on the textfield. I could then have written code like this:


celsius.setText(""+((Integer)(fahrenheit.getValue())).intValue()-32)*5/9);

but as you can see this is not simpler than calling Integer.parseInt() directly - and it adds more complexity to the demo. (auto-unboxing might eliminate the need for the .intValue() call but you'd still need the cast, and that alone is a showstopper for "newbies".)



So the next step was to write what the equivalent code looks like in BASIC. Here it is:


celsius.text = (fahrenheit.text - 32) * 5/9

Notice that this looks a LOT like the original formula. In fact, at the end of the demo I actually comment out the above line and uncomment the original line - and that's the code I compile and deploy!



As I mention in the demo, there are several interesting things to note here.


  • The BASIC code is extremely simple. In this particular instance, Java looks complicated. There are two reasons why the BASIC code is simpler.

    • First, it performs a lot of automatic type conversions. We're mixing strings and numbers here, and the Right Thing happens. Strings containing numbers get parsed into numbers, computations happen, and when a String is needed it's generated from the numerical result.


    • Second, we're able to access Java class properties using simple property syntax. Instead of calling celsius.setText(), we're
      writing celsius = , and the right hand side expression is fed into the setter. Similarly, we can refer to the getText method of the textfield by simply referring to it by its JavaBean property name.



    Java is more strict in which type conversions it will allow. "Automagic" type conversion can be dangerous. In Java you frequently get compiler
    errors or warnings if you do something that is probably wrong. In BASIC you won't notice until runtime - and hopefully it's not a rare scenario that
    goes undetected until a customer runs into it.

    A classic example of this happens in C, where any number is converted to a boolean when
    needed - nonzero is considered true, zero is considered false. If a programmer writes int x = getFoo(); if (x = 50) { ... }, Java would complain, because the if statement evaluates to an integer rather than the expected boolean (notice that it's a single =, not ==). In C, some developers like to
    take advantage of this "expressiveness", but it's usually a sign of a bug.

    Even in Java, where typing is pretty strict, you can run into trouble
    with some of the automatic conversions. For some great eye openers, read Java Puzzlers! See Puzzle #1
    in the sample chapter for example.





  • We're calling into Java classes from BASIC! The celsius and fahrenheit references point to Java objects that are instances of JSF UIComponent classes, written in Java.





  • We've written an event handler (attached to the button event) in BASIC. This event handler is being invoked from Java code (the JavaServer Faces web framework). Thus, we have Java calling BASIC calling back into Java.





  • The reason I could uncomment the original line, the one which doesn't specify the text property of the textfield or labels, is that
    the compiler also understands JavaBean default properties. If you leave out the property, it will look at the default property (which these JSF components specify in their BeanInfos) and use that one. text is the default property for both of these. The compiler cannot always do this - in some
    cases it's ambiguous - but when there is no ambiguity, it compiles without complaining.







Anyway, at the end of the demo I deploy. This compiles the BASIC file down to a Java bytecode class, which is located and instantiated by the
JSF managed beans machinery at runtime. As a result, the application works and the JSF framework has no idea it's talking to BASIC code.



So that's the keynote. At some point, the technical sessions will be made available online, so you can get all the gory details from TS-3576. Last year's presentations are available here - as you can see, you get both the slides and the synchronized audio track. This year they asked us to reduce the resolution on our laptop, even though it was showing fine on the projector, because some recording equipment needed it, so if we're lucky, the demos will be included in this year's multimedia version. As I mentioned the other day, for now you can see some demo screenshots and descriptions in Herbert's blog.






Friday, May 19, 2006

Java Posse live session

WARNING: This blog entry was imported from my old blog on blogs.sun.com (which used different blogging software), so formatting and links may not be correct.


We had a Java Posse live session at JavaOne. The room was packed and it was a blast. And I think the audience liked it too. We recorded it, so you can check out the audio here.



I just noticed that in O'Reilly's OnJava writeup, "JavaOne Day One" by Robert Cooper, he not only mentioned the event, but called it the highlight of the day! Thanks! He has a couple of pictures too. Check out the ridiculous hats! A really weird thing happened later that night at the pub. Somebody, nobody knew who, ran into the pub, grabbed the hat right off my hat and ran off! We never knew who took it. Hey, that was one quarter of the Java Posse's marketing budget :)



We've recorded many other interviews too, that will be posted gradually. Not only because it takes time to edit all that audio, but also such that we can be a bit lazy during the next few weeks, as we recover from JavaOne and all the preparations for it!


Project Semplice (Visual Basic for the Java platform) launched

WARNING: This blog entry was imported from my old blog on blogs.sun.com (which used different blogging software), so formatting and links may not be correct.


As promised,
I was planning on writing a full report from our TS-3576 talk at JavaOne, but my teammate Herbert has already done a great and thorough job. Read his entry for all the juicy details! Here's a teaser screenshot: