Posts from May 2008

Google IO wrapup

Posted

Though it was a smaller affair than JavaOne which took place across the street at the Moscone, Google I/O, IMHO matched the enthusiam.

Registration
One of the quirks about registration was that it was beneficial to have not registered or have a name later in the alphabet. You could just walkup and register right there and the V-Z line was right next to two Googler lines so we were able to overflow into one of them and shorten our wait. I felt really bad for the A-C’s, that line almost wrapped around the escalator. After registration, I turned in my ticket for my conference swag, a t-shirt, water bottle, and an optional branded canvas bag to hold the swag.

The food
Breakfast was your usual continental breakfast conference fare: bagels, danishes, fruit, tea, yogurt, coffee, various juices. Thursday had the special surprise of Krispy Kreme donuts. Lunch was served in 3 cafes, each with a different theme: Deli, Grill, and Texicali. There were no ticket takers and you could get seconds. In the middle of the second floor lounge area, there was a "candy store" with all sorts of sweet and sour gummis, chocolate pretzels, and M&Ms, and chips. This stand was flanked by fridges stocked with juices, Life Water, and sodas. Thursday afternoon brought Haagendaas ice cream in freezers throughout Moscone West.

The sessions
GWT and Android, as expected were centerpieces of the conference. Though one Coldfusion enthusiast I met refered to GWT as not making much sense and "Google cramming it down our throats," I can safely say that the push was not a tenth as much as the constant JavaFX pep rally at JavaOne. To his own discredit, this particular fellow is just learning Java so the Swing-isms of GWT were lost on him. I prefer to think it’s just that both platforms are maturing and people are realizing how awesome they are. Many GWT and Android sessions ended up being standing room only.

Among the highlights was GWT Extreme, presented by Ray Cromwell. First he showed a GWT wrapper for jQuery called GWTQuery where he implemented CSS selectors using Annotations. Next he showed how to create a GWT local app for Android using bootstrapped JSNI (Javascript Native Interface) methods that allowed the GWT application to interact with and access properties on the phone. It’s very very beta right now and a blog post is forthcoming. Another demo he did was Chronoscope, a GWT, Javascript, or HTML+CSS widget that can plot very large datasets while still remaining responsible. He showed a graph of all the buy/sells of Google stock for the past six months, I believe, and was able to zoom down to a precision of seconds without any hiccups at all. It was completely awesome. There was a session on using Ruby with Sketchup, it was very empty. As in tumbleweed empty.

Google hosting AJAX libraries on their infrastructure

Posted

Maybe about a year or so ago, I remember listening to some podcast where the issue was raised that Google, Microsoft, or somebody should host the different AJAX libraries so that they are properly cached and versioned therefore lessening load time after the first hit. On the eve of Google I/O, Google has answered that call.

You can reference scripts from their absolute path like:

 <script src="http://ajax.googleapis.com/ajax/libs/prototype/1.6.0.2/prototype.js"></script>



or you can use the Google AJAX API Loader’s

google.load()

method:

 <script src="http://www.google.com/jsapi"></script>
<script>
    // Load jQuery
    google.load("jquery", "1.2.3");
 ...
</script>


The currently supported libraries are jQuery, Prototype, Scriptaculous, Mootools and Dojo. Google hosts these libraries on servers all over the world so not only will the download be optimized, it’ll will probably be physically near the user. Yahoo reportedly uses a similar scheme for their YUI libraries.

For Grails, this is extra nice because Prototype is the only bundled Javascript library. Maybe the javascript tag should get some love to point to the Google CDN in the appropriate cases...Just a thought.

 

Thy List Shall Not Span Pages

Posted

<rant>

I get it. It’s a slow news day or you need filler material. So you decide to compile a list. The old standby when you don’t have enough material for a full entry but can come up with a couple beats to substantiate your thought then move on. However, certain websites have decided that lists are an extension of a slideshow, an opportunity to place one item per page, and bombard you with ads. Don’t make me a pawn in your game to artifically inflate your link count.

Lists are meant to be concise and easily scanned. Unless there are more than twenty items, I shouldn’t have to click a link to see the rest.

</rant>

GroovyBlogs Google Gadget

Posted

I’ve been playing around with Google Gadgets a bit and reading up on OpenSocial. Plus there’s a lull in Java news of late. The following GroovyBlogs.org gadget is the fruit of a couple hours labor. Because the built-in function doesn’t account for an aggregrator feed with possibly a different author per item, I had to write a parser for GroovyBlogs’s feed. Click the link below to embed in a webpage or here to embed on your iGoogle page.

EDIT: Something about the GroovyBlogs feed seems to no longer parse correctly.

 

Groovy Swingbuilder technical session

Posted

Here’s the video from Danno and Andres’ session at JavaOne. This is my first time using my Flip Video camera so just ignore the shakiness that occurs at some moments. I was trying to adjust the tripod. Enjoy!

 

JavaOne Script Bowl

Posted

The Script Bowl was a smackdown between the next generation JVM languages Groovy, JRuby, Jython, and Scala. Voting was conducted American Idol style via SMS to a special number.

Round One – Twitter client

@glaforge demoed Greet, a Groovy Twitter client made by @shemnon. Unfortunately it didn’t appear exactly as it does on Windows and Linux. Nimbus doesn’t exist on the Mac but it still looked good. I would show a screenshot but many improvements have been made between the time of the Script Bowl and now. I’ll leave that to @shemnon to announce it formally and give it its proper due.

JRuby’s(Charlie Nutter) entry highlighted the Matisse integration of JRuby. IMHO, the design wasn’t as good as the Groovy entry but I conced that I’m not exactly unbiased. The Jython entry(Frank Wierzbicki) was the weakest of the round as it was evident that Swing development wasn’t his forte. Also, Jython doesn’t have any DSL goodness like Groovy. After login, the application brought up a bunch of buttons, each of which represented a friend. Clicking a button output that users tweets to the console. He also included a regex parser to search tweets. The Scala entry(Jorge Ortiz) was terse yet polished. The overall user interface had an vi/emacs aesthetic to it with the images imposed on a black background with green text. Groovy and JRuby were the high scorers of this round.

Round Two – Web application using Google Maps and several domain classes

Groovy, JRuby, and Jython competed well in this round. Each capitlized on the strengths of its prevelant framework. Scala, on the other hand, didn’t have a formal entry. The interesting thing to note is that the Jorge Ortiz is a committer on the Scala Lift web framework. Instead he demoed Scala’s continuation support in a chat client. Buoyed by the judge’s praise of encapsulation of the Google Maps API in a taglib, Groovy finished within 0.3 points of Jruby.

Round Three – Open round

Just before the round started, there was a single vote of Groovy 5(highest score) and all others as 1. I admit to being that vote. @glaforge talked about Groovy’s very tight integration with Java and its respective web frameworks and how it is the only other JVM language that can define AND consume annotations. Charlie demoed totally impractical eye candy. Yes it was the open round so he was free to do so but still. After advising that he had approached the community for entries, he demoed a second Twitter client that was submitted. Scrolling Twitter bubbles in outer space. The second demo was an application built on Processing that responded to sound and pitch. I don’t remember the Jython or Scala entries in the last round but they had no chance at winning since the end of the second round.

There was only two weeks’ notice for the rounds so the only thing we can prepare in advance is the stuff for the open round. Let’s take the prize next year.

Groovy and Grails session at JavaOne

Posted

EN: When we entered the room, there was very old French music playing. Something like Edith Piaf. The presentation when well despite a couple technical difficultes but everyone has them. I’d estimate that there were about 150-200 people or so. The room was packed. @glaforge was able to keep the interest and excitement of the crowd by telling little jokes here and there. There were lots of good questions and I really think we’ve gained some users. Given that the sound people made a little nod to his nationality with the music, I figured I’d do the same and post in both languages. I wrote the French version first and then the English so it’s not a word for word translation[so don’t try to but it in BabelFish or GoogleTranslate and think they’ll be equal, it might be slightly off.].

"I’m not going to make you clean anything up" - Guillaume on Groovy’s MOP


FR: Quand nous sommes entrés la chambre, on a écouté les sons de très vielle musique Français. Quelque chose comme Edith Piaf, je pense. La presentation est bien allé avec quelque difficultés mais chaque presentation a une ou deux difficultés. Il y avait plus de cent cinquante gens là-bas possible deux cents. @glaforge a tenu l’interêt de la foule par dire des petites blagues. Il y avait beaucoup des bonnes questions et je crois que nous avons gagnés des utilisateurs.

It was a good day

Posted

Thanks to the Dice Lounge at the W Hotel, I was able to avoid the box breakfast and lunches at the Moscone and actually get good food. I also maxed out on the Dice swag except a t-shirt (they ran out :-( ). In the morning they had laptop covers, coffee mugs, and very expensive heavyweight luggage tags that seem to be made from circuit boards. I tweeted @aalmiray and @shemnon that there was a breakfast buffet. @JavaOne2008 picked up my tweet and broadcast it to everyone on the #javaone hashtag. Lunch was a lot more crowded. It was a good thing while it lasted. It was dead again when the afternoon tapas came out so I was able to get seconds and th‏irds.

Swag crawl
After heading back to the Moscone, I hooked with @shemnon and we went on a Pavillion swag crawl. SpringSource ran out of t-shirts in‌ regular people sizes. So we had to settle for IceFaces. Still cool but the SpringSource shirts were really designed well. There was surprisingly a line for t-shirts from JenniferSoft. They were white with hot pink on the back. I hope the guys in that line were getting them for their gfs. We meandered about a little more and got to the Google booth. There were three fourths of the JavaPosse present and I proclaimed, "Hey! It’s most of the JavaPosse and the pseudo-Java Posse(referring to Romain Guy)." After getting over being starstruck for a bit, I spoke with Romain and @joeracer about his new company Navigenics and how they are taking steps to ensure patient information doesn’t make it into the wrong hands. Very cool stuff. Oh and @crazybob was there too but I didn’t talking to him. Then a little chitchat with Romain about Android and expressing mutual respect for each other’s work. Joe mentioned that he should be interviewing people and got out the mike and recorded and quickly interviewed @crazybob then myself. If it doesn’t hit the cutting room floor you’ll hear me contest Ruby’s upset win at the Script Bowl(whose name eluded me at that moment) and a quick mention of the new Groovy 1.6-beta-1 release, its speed increases, and my attempts and desires for Groovy to run on Android. In the heat of the moment, I forgot about @Bindable automagically wrapping PropertyChangeListeners around nodes. Oh well.

The BOF
I’d have to say it was a victim of bad timing. @shemnon’s and my BOF on extending SwingBuilder was scheduled two days before the actual technical session on SwingBuilder. The technical session was a late addition. The other problem is that our BOF was in the 8:30P time slot so everyone who had commuted already heading home, and those that remained might have been at one of the three parties taking place that night or the free showing of Iron Man. But it’s okay, one has to pay his dues before having major pull. If we’re invited back next year, we might have better slots. So on to the BOF, after being miked up, the first thing I noticed was how insanely bright the lights were. I don’t usually have a problem looking people in the eyes but the bright lights made it where if I did for more than 5 seconds(rh, my eyes would start to water blurring my vision. Other than that, the BOF went pretty well. I was silently chastised by @glaforge though. Because of the aforementioned lighting scheme, I guess I was looking down at the laptop during one section and I got this smirk and hand signal to look up by @glaforge and then a thumbs-up when I did. I had a sudden flashback to the high school play when you teacher and parent is sitting in the audience and you’re scared to disappoint them.

Thus was my Wednesday at JavaOne.

The Conundrum of the Social Innovator

Posted

I’m sitting here in the XYZ Lounge of the W hotel in San Francisco reading Jen’s post Social Media Evangelists, We Are Our Own Worst Enemies. Jen is one of the bloggers I met at BarCamp San Diego and has some cool ideas about social networking. Other than the reference to the Lit song, which I was hoping to be able to quote in some fashion (but alas no), the title pretty much indicates the gist of the article.

Do we, as permanently LinkedIn connected individuals, push so much of our lives online that someone who is not equally online regard us as aliens? Does our new dialect of natural languages make us also linguistically foreign? I would say yes and no. Yes because it does make us all of those things. We are the early adopters and it comes with the territory. I remember when I was in middle school before having a personal computer were big. I was fortunate to have my own and I remember more rural family members saying to my parents that I was “addicted to that thing.” Now computers are a way of life. The world caught up to me.


It’s just like when the Internet consisted of monochromatic IRC chat, craptacular websites and BBSes that eventually evolved into Twitter, AIM/other IM clients and all the sexiness that AJAX provides. The introduction of the more friendly versions didn’t make the older ones obsolete but built upon the good ideas, refined them and evolved them. The original way is still there for those that seek it. For some software projects, the quickest way to get in touch with a dev is through IRC. Social networking will evolve and the world will catch up with us. By that time, we will have moved on to something more innovative.

Just as Jen said, we do need to make ourselves more approachable and out there, because we need to act as Odysessian Sirens to indice them to join our way of life....you know only without the sinking of ships and drowning of people.

 

On a totally unassociated note, bringing an eeepc to a conference is one way to get noticed and have people spark up convos with you.

BarCamp San Diego Day 2

Posted

Due to an air traffic control hold at San Francisco Airport that has delayed my flight until 9:30P, I’m sitting here writting this post whilst sitting "Indian style" a little too close to the trash can than I would like and next to a chatty female in her 20s talking on her phone. It could be worse. Thank God for free Wifi.  I’ll take this unexpected repose to blog about day two of BarCamp San Diego.

As with most of the two day BarCamps I’ve been to(and by most, I mean the other one), the second day is more low-key, chill, and intimate. The hot topic of the day was Twitter with no less than 3 sessions on it: The Great Twitter Debate, Managing Extended Relationships(or something like that) and a third whose title and content don’t make it worth remembering. The Great Twitter Debate, led by @mattsurfs and @jbruin can be viewed here on mattsurfs’ blog. The second one, led by @Madrox I think, focused on how we do things (like define criteria, advanced tagging and/or multiple user roles) to make Twitter work better for us. Coincidentally, just as I was posting the last blog entry, those slides came up in the queue. Great minds think alike I guess. The third, though I’m sure it could have sparked a good discussion under other circumstances, came off as "tell me what you think is cool that Twitter should do so I can take it and make money off it." I’m sure that wasn’t his motive. I fault the delivery not the idea.

So I don’t sound negative, I’ll end with the overnight activities. Of course there was drinking and marathon gaming (GTA IV). There was a Wii Bowling tournament, a bunch of Wii tennis and Mario Kart and some more Extreme Four Square.

Hopefully I’ll make it to SFO tonight but atleast I’m prepared for the worst, I brought my sleeping bag along for BarCamp. :-)

Twittering on blog update

Posted

During the twitter talk, someone mentioned blog software having tie-ins so that tweets when you make a new entry. It seems that this isn’t that popular yet or I’m searching the wrong twemes. #newblogpost has been used a couple of times but #blogupdate, #blog-update and #blog-updates are unused. What do folks think about using one of the aforementioned hashes along with one or two of tags you used to classify it on your blog?

It would provide an extra resource for folks who may have never known about your blog. As more applications start to semantically filter tags, some friends could subscribe to only my general posts, my java friends to my groovy posts, etc. But given the many niche market RSS aggregators, is it really needed? Does the desire to give your followers an inside track to what they may find useful classify as rising your noise to signal ratio? Without some sort of semantic search, is it too much information?

The reason I ask is that my blog host software is personally written so it’s not a question of can I but should I?

Comment or tweet me a reply.

BarCamp San Diego

Posted

Today was officially day one of my two week tech marathon (BarCamp San Diego ->G2One meetup -> JavaOne -> GAE talk @ SVGTG -> Where2.0 conf). That would be tiring enough if I didn’t also have 2 BOFs to give at JavaOne. The day was almost over before it started with a couple of missteps having set my alarm but not turning it on and an airport shuttle driver who couldn’t find the BarCamp location.

BCSD hasn’t disappointed so far, with lots of cool discussions and sessions on emerging technologies and products. And the four square during the break...geeky but awesome.

My fave today were the DiSO(Distributed Social Networking) talk.  The project is targeting Wordpress planning to move on to other platforms later. Looks like some good opportunities for Grails plugins.

Twitter mobbing at JavaOne

Posted

Crazybob made the call this afternoon for one and all to twitter at JavaOne. At the risk of sounding like a Java ditto-head and mostly because it’s a good idea,  I’ll repeat that call. Should we groovy folk additionally tag stuff #groovy?

I see a possible evil application though: say some booth has some cool schwag and someone tweets about it. Suddenly there’s a twitter mob looking for whatever cool tchotchkes they had...

Follow me @ http://twitter.com/ecspike

 EDIT: Soon after this post was published, MrG tweeted the same. So it's official.

Android talk at Tampa JUG

Posted

Tuesday I gave a talk at the Tampa JUG and for the most part it went well. The projector in the JUG space didn’t like my Hardy (Ubuntu) partition, nor my Windows partition. Nor the Xandros on my eee pc. After some playing with settings and rebooting, I got the projector to be recognized as a secondary screen for XP. Matters weren’t helped by the fact that I live in Ubuntu and even my thumbdrive is formatted as ext3. Oh well...but I was able to show the demo and some of the code. Here’s some of the random stuff I didn’t get to show or I think needs a little bit more explanation.

General structure of a Android app
/build.xml
/AndroidManifest.xml        <---Registration of Activities, Intents, and IntentFilters/Receivers
/IDE specific build files
/src
/res
/res/drawable            <---Images
/res/layout            <---XML Layouts of Activities
/res/values            <---Strings/Arrays for Spinners and such
/bin
/bin/classes           
/bin/classes.dex
/bin/<Your Application>.apk    <---Application file that is loaded to phone

Background Images

The background is set in the outermost layer tag with android:background.

 <AbsoluteLayout
android:id="@+id/widget0"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@drawable/trafficviewer"
>


The @drawable refers to the above drawable directory and also notice that the filename leaves off the extension.

TrafficViewer

TrafficViewer is a small Android application that allows a user to input a mile radius and a zip code or city and state to find accidents in that area. The input from the user is sent to the Yahoo! Traffic APIs and it returns geocoded lat/long points indicating accidents.

Traffic Viewer Screenshot

The background image is a Creative Commons licensed(by-nc) by Thomas Hawk

 

Some of the files I didn’t get to show as much were the YTrafficFetcher, TrafficRecord, YTrafficHandler, and TrafficMap.

YTrafficFetcher, like it’s name states, is an interface to the webservices. It constructs the uri query strings, and acts as a buffer for the YTrafficHandler which parses the code and loads them into the POJO TrafficRecord.

 URL url = new URL(this.query);
SAXParserFactory spf = SAXParserFactory.newInstance();
            
SAXParser sp = spf.newSAXParser();
XMLReader xr = sp.getXMLReader();
            
YTrafficHandler handler = new YTrafficHandler();
xr.setContentHandler(handler);
            
xr.parse(new InputSource(url.openStream()));
r = handler.getTrafficRecords();

YTrafficHandler walks the XML and has convenience methods for marking the start and end elements and gets the enclosed characters.

TrafficMap, as a MapActivity, wraps the functionality of a MapView. From it, I created a basic map and overlay reading in the location and the title of the incident. The map auto-zooms to the last point in the list. Actually it sets the zoom to each point as it is parsing them. I’ll admit that this was lazy and a more elegant solution would have been to find an equidistant point between them but lack of time requires some compromises.

Here’s the pertinent code that draws the overlays on the map [mostly borrowed from tutorials on anddev and helloandroid]

 // Create a Point that represents our GPS-Location
Double lat = record.getLatitude() * 1E6;
Double lng = record.getLongitude() * 1E6;
Point point = new Point(lat.intValue(), lng.intValue());
TrafficMap.myMapController.centerMapTo(point, false);
int[] myScreenCoords = new int[2];
// Converts lat/lng-Point to OUR coordinates on the screen.
calculator.getPointXY(point, myScreenCoords);

// Draw a circle for our location
RectF oval = new RectF(myScreenCoords[0] - 7, myScreenCoords[1] + 7, 
                    myScreenCoords[0] + 7, myScreenCoords[1] - 7);

// Setup a color for our location
paint.setStyle(Style.FILL);
paint.setARGB(255, 0, 0, 0); // reddish color
// Draw our name
canvas.drawText(record.getTitle(),
                    myScreenCoords[0] +9, myScreenCoords[1], paint);

// Change the paint to a ’Lookthrough’ Android-Green 
paint.setARGB(80, 156, 192, 36);
paint.setStrokeWidth(1);
// draw an oval around our location
canvas.drawOval(oval, paint);

 // With a black stroke around the oval we drew before.
paint.setARGB(255,0,0,0);
paint.setStyle(Style.STROKE);
canvas.drawCircle(myScreenCoords[0], myScreenCoords[1], 7, paint);



Slides

Source code (Yahoo Developer ID needed)