Dave Harris

General ramlings about Java

City Tour May 12, 2008

Filed under: San Francisco — daveharris @ 2:22 pm

Today was an amazing city tour that took in Muir Woods and Sausalito in the morning and then a city tour in the afternoon.

I was picked up early and we made our way over the Golden Gate Bridge to Muir Woods.  I thought that the Golden Gate was so called because it was golden but it actually crosses the Golden Gate Straits.  It is acutally painted International Orange and the myth that they continuously paint it, is just that a myth.  The locals call the the colour International Rust!  Anyway the Muir Woods is a growth of Redwood trees in a steep ravine that was deemed too hard to mill.  A politician bought the land and therefore saved it from being torn down.  In the photos I have uploaded here, they look like trees but there isn’t really a scale big enough.  The tallest ones are 90m tall, very impressive.  My neck to sore from constantly looking upwards.  We walked to an area called the Cathedral with about 50 trees all in this one area, again very impressive.  Then back up the very tortuous roads to the Italian town of Sausalito.  We had a lunch break break there (and I had what the bus driver sweared was the best hamburger in the Bay Area, and he had obviously enjoyed his fair share over the years.  Sausalito was a really nice place, much more laid back then Fisherman’s Wharf.  It seems that everyone rides from San Fran, across the GG bridge and then catch the ferry back.  I will be doing that later this week, but I might as well ride back too.  The hills are very steep here, even compared to Wellington!!  After a wander around the marina, we jumped back on the bus and back to Fisherman’s Wharf where after an hour we departed on the city tour.

So I took a wander down the geerish Fisherman’s Wharf and found just what I was looking for, an indie rock artist (not busker) playing in a court yard surrounded by expensive Italian restaurants.  I couldn’t resist and bought his album, its very cool.  The tour then started with a history lesson down Fisherman’s Wharf which was cool.  We then went up to GG bridge again (this was a totally separate tour which you could purchase on it’s own) but this time we stopped and I took the obligatory photo, as you will see.  We looped around over and back across the bridge and then went through the massive (larger than Central park, NY) and we had a stop there and a wander through the botanical gardens.  Being a weekend it was packed, but in a good, well-used way.. lots of kids and locals.  We then went through the main neighbourhoods and saw the steepest st in SF.  We drove to the top of Twin Peaks where you get a 360 deg view of the city.  You also get the wind from all 360 degrees though!!! We went through the intersection of Haight and Ashbury Streets, the hangout of the Flower Power and Free Love movements of the 60’s.  Most of that still remains, seems like Cuba Mall but a million times for ‘cultural’.  We saw the ‘Painted Ladies’ (the last photo on picasa) that were used in Full House if you remember.  The most expensive one is now worth a mind-blowing $14M, for this tiny tiny house in one of the back suburbs!  The average house price is $700,000 (but in Sausalito it’s $1.4M!!).  We then came back down Market Street and past my hotel and up the hill into Chinatown and then back to Fisherman’s Wharf.  So I know where stuff is and if I want decent food, I just need to head up.  The awesome bus driver offered many nice places and plenty of funny stories about historical city icons.

I stopped of at Fisherman’s Wharf wharf (that’s the actual wharf not just the area) where all the seafood places are.  I got a bowl of Shrimp and Crab cocktail (freshly caught it said …. who knows) and chips.  It seems that the big meal there is clam chowder inside a sour dough loaf with the middle ripped out so I will have to try that soon.  The cocktail was divine, nothing like it ;) .

I then caught my fist cablecar up and over the hill to Union Square.  A thrilling ride but it was dark so couldn’t take any photos.

 

Photos Uploaded May 12, 2008

Filed under: San Francisco — daveharris @ 5:31 am

I have’nt had a chance to write a post about yesterday’s bus tour around San Fran and Sausalito but I will do that tonight.  I have a had my first sleep in and am now about to leave (10.30am) for a look around the Financial District, Fisherman’s Wharf and I am planning to go to the San Fran Giants vs Philidephia Phillies baseball game this afternoon.

There are photos from the last few days of JavaOne and then some nice shots from yesterday http://picasaweb.google.com/compnewbie (there are even some photos of me to prove that I’ve been there!).  Mum and Dad, don’t you have same photo of Golden Gate when you were there (a million years ago)? :P   How cool is that!

Anyway, I will update you on yesterday and today tonight.

 

JavaOne Day 4 May 10, 2008

Filed under: JavaOne08 — daveharris @ 6:08 pm

Well last day of JavaOne :( , its been quite a ride.  In this morning’s General Session James Gosling (the creator of Java) did a show-off of all the awesome toys that had been shown off during the conference.  Some of them were:

The robotic car Tommy
These little sensors running Java that create a MESH RF network so they can talk to one another and a base station
A pen with a computer and camera in it that records your writing and is able to play it back and import it into the computer and all sorts of awesome stuff
VisualVM, a tool that allows you to connect to a local or remote java process and see the resource use with graphs and stuff, very handy
Some of the Java technology used at the CERN particle accelerator
JMars, a mapping tool used to collate all the data from the mars probes and help NASA choose a landing spot near to mineral deposits and the like
And there were some more.  Very cool stuff.

First session today was how Yahoo! (they said it was the largest website in the world…) use Java technology and how they manage thousands of servers around the word and also hundreds of developers around the world too.  I didn’t learn anything useful but it was interesting nontheless.  Then a session about how to create your own SMS based application, and how you can hack the google text api to do what you want!  Then a performance comparison between the 3 big web frameworks, SpringMVC, Structs and JavaServer Faces.  SpringMVC beat the pants off the other two (and quite rightly so, but I am biased).  Then there was a session about how NavTeq use thousands of sensors and GPS devices to gather statistics about traffic flow.  This information is sent to radio stations and GPS units so they can re-route around the problem if possible.  the final session of the day was perhaps the best.  It was brilliant talk by the lead developer from SpringSource about the new changes coming to the Spring Framework and SpringMVC in version 2.5.  Basically they have heard the community’s hatred of xml config files and now EVERYTHING can be done with annotations.  But you can still do xml if you really want to.

So that was JavaOne I guess.  What a ride it was, I have learnt so much and talked to so many amazingly smart people.  I’ve seen some mindblowing use of Java and technology in general and has really invigorated me back into Java.  Java cops a lot of flack from the scripting language world (some of it quite rightly too) but it was nice to have a week where everything was Java and how awesome and extensive and fast moving it is.

I don’t think I mentioned that the slogan for JavaOne was ‘Java + You’ to go with Time magazine’s person of the year ‘You’.  There was a huge focus on Ajax and web services and open standards that was really nice to see.  This will definitely not be my last JavaOne that is for sure!!!

There is no rest for the wicked around here, so on my first day off I am going on a day-long tour of all the sights and sounds of San Fran and then across the Golden gate Bridge to the Italian town of Sausalito.

This will be my last post in the JavaOne category so if you just subscribed to that, I will see you when I return next week.  But for me its a week of fun and games…

 

JavaOne Day 3 May 10, 2008

Filed under: JavaOne08 — daveharris @ 6:08 pm

Another very full-on day at JavaOne, but no labs today.  I had had enough of Ajax for a while, although I will definitely keeping an eye on jMaki (especially after they gave me a tshirt and talking to the lead developer over a coffee on morning!)

This morning the General Session was hosted by Intel.  The big announcement was that the developers of Sun and Intel have been working together to try and optimize the jdk running on Intel x86 processors.  Well it seems that they have done pretty well with a 69% performance increase!! This really blew us away as most optimizations come in the form of single digits.  Im sure its not that high in real world, but a huge leap forward nonetheless.

The first session of the day was comparison of the Swing/SWT builders within Netbeans and Eclipse.  This was interesting to me (and Vipul) because our little tv renaming app is SWT based.  Not that we are going to re-write it in Eclipse RCP now, but it was nice to see what can be done with drag and drop (as good as .NET now!).  Then there was Java in real life, a robotic car that was created by a university for the DARPA Urban Challenge.  This car can be seen here.  It is a completely autonomous car that had to drive from one end of a city to the other performing normal maneuvers along the way such as passing, ad giving way and parking. It was all running Java too … very impressive!

I then went to a quick session about how to used dTrace on OpenSolaris to see what is going on inside the VM and the system in general and find performance issues and memory leaks.  It sounded all well and good but I’m sure it is much harder then they made it out to be.  And no-one actually runs OpenSolaris.  Speaking of which, the photo of me in the OpenSolaris t-shirt does not in any way, shape or form mean that I support it …. just means they were giving out free stuff!!!  I have about geeky 6 tshirts now)

Then an interesting discussion about how to use the Java Persistence API when not using a web container (and therefore inherent transaction management) in Swing based apps with many clients.  Raised some interesting points that I hadn’t really thought about before.  Next was another deep and meaningful look at design patterns and how some of them really aren’t as good as they are made out to be, but did offer some solutions.

A party was held that night in the Yerba Beuna Gardens, behind the Moscone Center.  There was some food on offer but the main event was Smash Mouth playing a private set for us.  they didn’t have much stage presence (it probably didn’t help it was like -10 degrees) but they made the place rock with the classics of All Star and Walkin On The Sun.

 

Odds and Ends May 9, 2008

Filed under: San Francisco — daveharris @ 5:30 pm

There are a few things that I want to post that are not related at JavaOne. These are:

Crossing Roads
No-one jay-walks … ever. Everyone waits at the lights and then crosses when its green. There is also no sound to inform you that the light has gone from red to green, so you need to keep watching it or keep an eye on other people and move then they do. There is also no button to push to say ‘I want to cross’. I guess the road are always so busy that all the 4-way intersections around Union Square are equal phased. They also have the number of seconds till the lights go from amber to red so you know if you can cross, like they do down Queen St, but here they are everywhere. If we didn’t jay-walk in Wgtn no-one would get anything done!!!

Food
The food is kinda strange here. There is a Burger King down the road, but that is it. There is a dairy below us and then there are the really nice restaurants in the nice hotels but I couldn’t seem to find any normal restaurant … until last night. I came out of a lab late and needed something to eat. I decided to take one of the side streets off Moscone Center and found a normal looking italian restaurant. It was a brilliant find. The meals are ‘family style’ (meant to be shared) but you can ask for a single portion of most things. So I got the chef’s family recipe for spaghetti and meatballs. It was divine. Once the waitress found out I was from NZ, I was treated like royalty (in the typical American sitcom way) and she surprised me with some italian beer. it was good but it tasted suspiciously like Stella! I will be going back there again thats for sure. it was pretty good value too, some focacia bread and oils, the main dish and the beer for UDS $18.

The food at the conference is another story all together. I don;t know if this is hw American’s usually eat but wow … its a lot of stodge! Breakfast is a bagel and something (your choice of danish, apple tart or muffin). Lunch is big roll or a chicken salad (a huge breast on lettuce) with a can of coke and a sweet slice of some description. No fruit to speak of. There is usually a guy with a massive thing of coffee on his back running around ready to pour you a cup then and there!!!

People
There are two extremes really. The people I have met at the conference have been really nice and friendly, although many are not from North America admittedly!! I have kindof got used to walking around the people on the street begging for money, some more vocal than others. Some are sitting there. others are asking you for it. Some stop you in your path and beg. Others just walk along in a drunken stupor talking to no-one about nothing. Then there is the guy on Market St trying to tell me that the sky is falling and Armageddon is coming. Just takes a little getting used to making sure you are in a bunch of people at night, which around Union Sq isn’t an issue. Its going to be strange back in Wellington to look at people in the eye as you walk towards them!

But in saying that, the other Americans I have met have been super sweet, almost sickly sweet. I am sure they mean well, again just something I am not used to. The other people in the hostel are really friendly too. They do a free breakfast and a $5 home cooked dinner. I will be using that more often as normal food is hard to find here.

In a very strange mix of cultures today I saw an old Chinese man playing an electric guitar (not pluged in to an amp!) with a bluetooth cellphone headset in one ear…

Well that is about it, its the same but very different!!! Last day of JavaOne tomorrow :(

 

JavaOne Day 2 May 8, 2008

Filed under: JavaOne08 — daveharris @ 1:15 pm
Tags:

Day 2 started off with a really cold morning but turned out a really nice day in the end. The General Session this morning was a blatant marketing mouthpiece for Oracle and all their Enterprise Applications… yawn. It wasn’t very full either and most people walked about about half way, we have better things to do than be talked at about products we don’t care about.

Anyway, after that I went to a quick session about some Sun developers who tried to make a hardware application server appliance (like a wireless router appliance) that you just connect to the network and it just works, all in about 4 weeks. Some important lessons were learnt. I then went to a session about Web Beans which kindof went over my head as he started assuming we all knew what they were. It seems like a framework built on annotations to help with compile-time validation of beans and attributes and stuff. It is being looked at at the moment to be integrated into Spring.

The main event today was a hands on lab using the Woodstock Ajax library and that seems really cool and nice and easy. Really good support from NetBeans IDE as well. Then a packed session about how to get the most out of DBUnit which I really should know more about. Then another packed session with a few developers from Sun who are creating the new Media API so Java has much better video and sound support. Currently it has a few cross platform codecs (such as ogg/theora) but otherwise uses the native codecs for each platform. It has been made into a Swing JComponent so it is really easy to embed in any JFrame you happen to have lying around. I expect to see big things come out of this.

I am waiting to go to another ajax session, this time using jMaki which seems to do the same thing as WoodStock, but it will be interesting to see what the differences are. Im in the big hangout space and The Matrix is playing on a big screen so everyone is standing around watching that ;)

No photos today sorry, there wasn’t anything new that you hadn’t seen before.

Catchya tomorrow ;)

 

JavaOne Day 1 May 7, 2008

Filed under: JavaOne08 — daveharris @ 6:27 pm

The first full day at JavaOne was fullon, I left the hotel at 7.30am and have just got home now at 10.45pm!!! First call of the day was the free breakfast and then the first General Session of the conference. The queue was huge, with basically everyone attending queuing to be in the same room all at the same time. It filled up three walls of the massive food hall. We got in really quickly though (the whole conference has been really efficient really, it has to be with 15,000+ people attending). As we got closer I could hear Hey Ya by Outkast playing and when I walked in the door to the literally the largest room I have ever seen there was a bunch of people dancing on the stage. As we crowded for a closer look, we found out that it was actually Outkast (not what sure what they have to with Java but anyway) and they basically rattled off all their hits as the room was filled. I will take some photos of the main hall, words cannot describe how large it is!

The keynote then started with some big wigs from Sun and it was really interesting. They invited guests in Amazon (to show the Kindle), the CEO of Sony Erricsson and then finally Neil Young. Neil was showing off his latest discography collection on Blu Ray that makes use of Java for the interactive menu system, pretty sweet really. It was announced that 100% of all Blu ray players run Java too, so it definitely gives us a foot up in the market. They also threw out some numbers, NetBeans has been growing at 44% for 3 years in a row now, and MySQL now has 65,000 downloads per day (up from 50,000 before the takeover by Sun).

For some really flashy stuff, there was an awesome demo of JavaFX. It allows Java to run on the web, desktop and mobile devices with no change to the source. The demo was called ConnectedLife which was a mashup of Flickr, Twitter and Facebook. The next JavaFX demo showed off how it could use the specific hardware for graphics acceleration and stuff. It was an app running on a mac that played about 100 different HD movie trailers simultaneously, while swirling around in a globe, very cool. Hard to believe that is Java!!! The big announcements were that Java 6 update 10 was being shipped today and that OpenJDK had made it into the latest releases of Ubuntu, Red Hat and Fedora (to much rapturous applause).

That set up for a really good and full on day, with my first session taking an in-depth look at Java 6 update 10. the new features are:

  • A new Java Plugin to replace the aging WebStart browser plugin. It is now modular, so just downloads what parts of the JRE it needs
  • A new Deployment Toolkit
  • A new modular Java Kernel
  • No more cold starts, jre running in background process
  • Better AA fonts on windows
  • Nimbus Swing look and feel to replace Metal
  • JavaFX updates

Then a quick session on the next Eclipse release (Ganymede) due for June:

  • A new Update Manager (finally)
  • Subversive SVN client
  • RAP and RCP improvements. These allow rich swing based clients built within eclipse to also be deployed on the web with Ajax with some changes to config files… very cool

Then a session aptly named ” JavaScript™ Programming Language: The Language Everybody Loves to Hate”. This was a really good session if you had an indepth knowledge of the intricacies and anomalies within javascript. Most of which went way over the top of my head, especially when he talked about Higher Order Functions (thats 2 or more nested functions….) …. ahhhh wow

After that was a totally packed session called “Defective Java™ Code: Turning WTF Code into a Learning Experience” which was taken by a lecturer and lead developer on FindBugs. I highly suggest you take a look at his slides here. He showed some common traps for young developers such as:

  • When writing multi-threaded apps, they use the field that they are synchronising as the lock/mutex which fails miserably
  • Using the same simple class name as a class in another package and not realising
  • DateFormat should be called DateFormatter and is not thread-safe
  • The intricacies of overriding .equals because it can mean different things in different circumstances

The last 2 sessions were how to develop desktop games with the jMonkeyEngine engine. This is very very cool… and so easy to make something with water effects and 3D effects and stuff. Nice and fast too. The other session was to do with the new field-based annotations (such as @NotNull and @Immutable) to be included in jdk7 as part of JSR308.

After that (yes there is more) I managed to squeeze into a full hands-on-lab session using OpenPortal and GWT to create a simple Ajax application that uses WebServices to display stock price updates. There seems to be a huge focus on Ajax and Rich Internet Applications (RIA) so it was nice to get hands on with some of this.

I have another very full day tomorrow but will try and upload todays photos asap. They will be here

I see the iPhone is going to be released in NZ…. hmmmmm lol

Seeya all tomorrow night ;)

Dave

 

CommunityOne (JavaOne Day 0) May 6, 2008

Filed under: JavaOne08 — daveharris @ 5:07 pm

I had an awesome day today at the first day of the conference. It was called CommunityOne and was free and open to anyone who was interested in the java platform. There was a big focus on Rich Internet Applications and therefore running scripting languages (like ruby and python) within the JVM and taking advantage of the 15 years of optimisations and new features.

After walking about 10 mins down the road, past Union Square I got to the Moscone Centre. I can’t really describe how huge this place is… really. I will take some photos. I completed registration and was given the access card and then picked up the first load of corporate tat. This was a sweet JavaOne bag with a really nice laptop section, a JavaOne tshirt and assorted advertising and cds. Then down the main pavilion to get the CommunityOne tshirt and OpenSolaris cd.

With the change of timeframes I missed the keynote at 9.30am but made it the first session of how to use jMaki to make really simple ajax applications. Although in a demo, everything looks easy, it is not until you need to customise it you realise how good it is. The next session was how to build Ajax applications within NetBeans (I see a theme emerging here!!). This was good to see some real code being written and I am seriously going to look at Apache Wicket. This framework allows you to write Ajax applications with just .html and .java files, not .js files anywhere to be seen which is great for us java devs. Although that is a pitty because we can’t use the brilliant JavaScript Editor Plugin for NetBeans. Yes yes I know, I should be flying the Eclipse flag, but NetBeans is pretty amazing for web apps. I will be extolling the virtues of OpenSolaris by the end of the week I’m sure!

After that was a presentation from the OpenSSO developers about how to use federated identity across multiple applications, basically what I am doing at SSC. The example they used was a corporate person logging into SalesForce via NT Authentication (ie, not username/password needed). Then a quick introduction to the new Java Persistence API 3.0.

After that was the Community Reception in the MASSIVE main hall with some nice sounds on a bass machine (formerly known as a stereo) and free American beer (yuk) and even more free OpenSolaris stuff (this time a tshirt and stickers). I am definitely loving the corporate tat, I barely needed to bring any clothes!!!!

There is breakfast at the conference tomorrow and then the keynote (there is one every morning) starts at 8.30am. This one is hosted by the EVP of Sun.

If you hadn’t guessed I’m having a great time ;)

I will post some photos from the first day tomorrow when I have faster net. The internet speed is blazing over here, with everyone twittering etc, I was downloading at flat 2 MB/sec from a US server ;)

UPDATE: Photos are now up here

 

VLOOKUP Excel Function March 19, 2008

Filed under: How-to — daveharris @ 9:04 am
Tags:

Have you ever had list of status flags that have a meaning and within excel be able to change the number for the actual meaning? Then this is for you!

Assume you have this data:

Customer Id Payment Type
1 2
2 0
3 1

And you have a set of Payment Types:

Payment Type Code Payment Description
0 Cash
1 Eftpos
2 Credit Card

If you have this data in an Excel spreadsheet you can use the VLOOKUP Function to translate these numbers into meanings. The VLOOKUP function is defined as VLOOKUP(lookup_value, table_array, col_index_num, range_lookup) where:

  • lookup_value: the id that is to be looked up
  • table_array: the table which holds the key and the value (can be on another sheet)
  • col_index_num: the column number within the table which holds the value
  • range_lookup: boolean to specify if ‘approximate’ values should be looked up

Therefore a simple formula could be: =VLOOKUP(B15, A26:B29, 2, FALSE)

If you need to perform this action on a whole table of data and need to keep it in a constant column, and the lookup table is on another sheet, this can be used: =VLOOKUP(B2,Sheet2!$A$2:$B$5, 2, FALSE)

I cannot claim the credit for this albeit simple and well-documented function, all credit goes to Phil Wheeler

 

Anyone going to JavaOne from Wellington/NZ? March 3, 2008

Filed under: JavaOne08 — daveharris @ 11:35 am

I am being sent to JavaOne by my employer Fronde and am wondering if anyone else is going there from either Wellington or NZ and wants to meet up somewhere along the way or in San Fran?

Leave a comment to this post and I will email you back ;)

Dave