Thursday, June 25, 2009

Ant builds targetting a particular Java SDK version

I've wanted to blog some development topics for quite a while now, so here goes. Please stop reading here if you are not a programmer. No, really, you'll damage your eyes!

Ant's javac task offers handy access to Java's javac compiler options, including the seductive but deceptive -source and -target. Seductive because it allows you to easily declare and ensure that your source and the resulting classes comply with a particular version of the java language and JVM, respectively.

Deceptive because it does that and only that! A JRE or JDK contains a JVM, but also a whole lot more! I was recently caught out when working on an old project by java.lang.String.IsEmpty(), which Ant happily compiled into a JVM 1.4 compliant class, even though the method was introduced in Java 1.6.

It's obvious when you think about it, but the JVM (and its contained classes) running Ant will determine whether something like that compiles or not - there's no practical way for javac to know which methods are in which JDK. It just checks the JDK classes given to it by Ant.

So the moral of the story is, if you are targetting a particular JDK, run Ant on that JDK to build your project. You can include a version check with the fail and condition tasks before your javac task. For example:

<fail message="Use JDK 1.4 to run this Ant build">
<condition>
<not>
<matches pattern="^1[.]4.*$" string="${java.version}"/>
</not>
</condition>
</fail>

Thursday, May 08, 2008

Sony LCD TV for HTPC via DVI to HDMI


This isn't an acronym strut. I'm trying to hit as many keywords as possible in the off-chance I manage to help someone else trying to do solve the same problem I had. How to choose a good Japanese TV for a home theater PC. What follows is pretty much for home theater geeks only!

Our nearly 3 year old JVC Victor LCD TV was great - having an HDMI input when that was a very new feature even here in Japan. But at 32 inches (81 cm) it was a tad small, and the same money we spent then could buy a better set now. Also, the native resolution of the LCD panel was 1366 x 768, fine for 720p, but not for true "hi-vision" 1080i or 1080p, for which at least 1920 x 1080 is required.

But the true purpose of my upgrade was to get a TV that exposed its native LCD panel resolution to a computer with a 1 to 1 pixel mapping. The JVC didn't do that, resulting in two problems. (1) Our Mac mini's overscan pushed the picture off the screen, whereas disabling it (i.e. underscanning) left black borders that reduced the viewing area to 70 cm. (2) The scaling resulting from using a scaled non 1-1 pixel mapping made text look terrible.

Reading the specs in brochures collected from my nearest Bic Camera, the best contenders looked to be the Sharp Aquos series. Several models were actually noted (in Japanese) to support 1920 x 1080 on a PC via DVI or mini-D sub 15 pin (VGA) connectors. There was even a list of other supported standard modes like WXGA.

As a side note, when I bought the old JVC TV, the only DVI/HDMI adapters available were labeled as HDMI -> DVI, because TVs that supported HDMI were so rare at the time - and new HD recorders etc had HDMI output. Of course, the conversion is simply a wiring mapping, and works fine both ways.

Anyway, during a trip to Yodobashi Camera Akiba I carefully analyzed Sony's Blu-ray demo disk (which a shop attendant initially insisted was DVD) and compared hi-def material playing simultaneously on Bravia and Aquos sets. While the Aquos sets are lovely, the Bravia sets are stunning.

The Bravia X series looks a bit haughty with its glass frame, but the W series has a nice matte frame, most of the high-end Bravia features, and can be had for a good price to boot. So we bought a 40 inch (101 cm) KDL40W5000. (There's no 42 inch Bravia.) Sony doesn't advertise these models as being capable of delivering 1920 x 1080 to a PC over HDMI. They only specify PC connectivity via D-sub 15 pin (VGA), but I presume the same capabilities will extend to similar models in other regions - that is 2008 models with 3 HDMI inputs.

So, pictured is a 101 cm Mac desktop of 1920 x 1080 with a 1 to 1 pixel mapping. Text looks good, but one has to remember that colour and other digital processing will interfere with antialiasing, so it's not quite as crisp as a standard LCD computer monitor. The mode offered to the Mac mini is actually 1080i, but I presume the set de-interlaces this. With digital colour there is none of the shimmering or dot sync issues that plague analogue RGB/VGA.

The Mac desktop is fine; Mac video is great; and of course HD digital broadcast is amazing. I can recommend the Bravia series in general, and for home theater PC use in particular, and I can't wait to check out Blu-ray.

Wednesday, December 26, 2007

PSone LCD + Apple II c



With the advent of Facebook for catching up with friends, it seems about time to add my geeky news items to this patchy blog. That way anything approaching usefulness can be linked to and indexed by search engines.

This time it's the use of a PSone (AKA PlayStation One, PSOne, PS1 etc) LCD monitor on my old 8-bit Apple //c computer. This model which I bought on Yahoo Auctions Japan is a GameHome 4" COLOR TFT LCD MONITOR LCM-40. Setup looks simpler than the equivalent Sony monitor which, in addition to being an annoyingly circular shape, has a funky combined audio/video input socket.

The LCM-40 is a marginally nicer square shape, and has standard RCA inputs in addition to a small built-in metal stand which can be seen below the yellow video jack in the second pic above. Colours are fine, though it is a bit too small and is quite grainy because of its low resolution. I feel the need to buy the Sony screen which looks excellent in Dean's photo's.

Baby #0


Well, blogging has been moved aside by Facebook for most of my friends, and who am I to argue. If you want to catch up with me online, just search for my name there and add me as a friend.

The big news in the lives of Satoko and me is the birth of our baby daughter Sara. She's a cute little thing, but of course she needs all the love and attention (=time) that we can give. That means even less time for computer-related hobbies like blogging etc.

Well, as a friend said, that's the price of becoming immortal.

Thursday, August 23, 2007

Free disappointment?


Friends and family will know I'm a Steely Dan fan (thanks to my dad), so when I discovered that they would be the inaugural act at the new Billboard Live Tokyo venue, planning commenced with great excitement! Steely Dan have never been to New Zealand before, and since these are aging rock stars of the best calibre, this would be a once in a lifetime opportunity!

Satoko was indispensable in securing tickets to the gig, starting with joining their member's club 4 months ago to be eligible to purchase tickets early. Then 2 months ago she spent 4 hours on the phone hitting redial in order to reserve seats 2 tables away from the stage! I was so grateful, and we have both been really looking forward to the concert ... which we attended last Sunday night.

What could go wrong? We had great seats at a brand new venue that is compact enough to be described as intimate, and only a 15 minute train ride away from our apartment. But this is Japan ...

That one short train ride stopped shortly after we embarked, announcing a "jinshinjiko" - an all-too-common train suicide - had occurred, stopping the line. Oedo-sen is the deepest subway in Tokyo (I remember catching an elevator up from level B8 once) so we struggled up the escalators - very tiring for Satoko, who is 6 months pregnant - and eventually made it to a taxi.

The taxi driver was very helpful, and our fears were put to rest when we arrived before the 9pm start time - though still a bit later than we had planned. Spirits buoyed, we sashayed in to the small concert hall, and were ushered down to the stage level (3F in the pic) ...

Only to find that the Japanese staff had allowed a free-for-all on the reserved seats in front of the stage! We stood by awkwardly while they flapped about like headless chickens for 10 minutes before herding us to seats two tables even further away from the stage - instead of like, you know, moving the people who were in seats they hadn't booked tickets for!

Satoko was livid, but what could I do except sit back, sip red wine and do my best to enjoy the short but energetic set. I've written a mini review below if you want to read about it.

The staff's poor attempts at making it up to us by offering ... (a) free wine to my NOTICEABLY 6 months pregnant wife! (b) "No charge" - or as it felt to me - "Free disappointment!" ... were not appreciated, and after the show the club manager finally came to chat as we were etching our frustrations onto questionnaires.

He listened patiently, was very gracious, and we eventually accepted his offer of another free show, this time in seats on the mezzanine floor (with no heads in the way) at the final Tokyo gig on Friday.

So, the club's loss: over US$1000. Our loss: our only chance to see Steely Dan close enough to get hit by Donald Fagen's spit when he goes nuclear - like he did on "Josie" at the first show. I hope our second attempt goes more smoothly, but what I wouldn't give for those original seats!

A sadly coincidental note: Sayoko Yamaguchi the Japanese supermodel from the album cover of Aja died just last week. The news was announced on Monday, so I wonder if the band will mention her in the Friday night gig.

For those interested in the Steely Dan '07 tour here's a mini review, but first a warning - you might not want to read this if you are planning to see them!

** POSSIBLE SPOILER ALERT **

The Billboard Live Tokyo venue is best described as intimate. Here's me whinging about being moved a couple of tables further away from the stage, but the band still filled my field of view - closer than you'd sit to a movie screen. The proximity is palpable, and it's a rare pleasure to watch and listen to world-class musicians like it's happening in your living room.

Even the 1st mezzanine floor (4F) front seats (which I'll watch from on Friday) are less than 10 meters from the stage. If you look at the floor plan in the pic, the levels align at the stairs so you can see how tightly it's all sandwiched together.

Here are a few memories from the night. (Just so _I_ don't forget!)

Set list:
Intro

Time Out Of Mind
Bad Sneakers
Hey Nineteen (with Walter's "date" speech)
Haitian Divorce (sung by Walter)
Green Earrings (great solo by Donald)
Dirty Work (sung by the girls)
Josie (smokin', with band intros by Walter)
Chain Lightening
Bodhisattva (sizzlin'!)

Encore: Peg
Outro


Walter did most of the talking. Donald said a few words at the start of the show, but during "Hey Nineteen" Walter broke into the song and spun a little reverie about taking a girl somewhere on a date. This seems to be a regular part of this tour. The band just stretched the tune while he set up for the girls to sing the great line that followed ... "You reach into your little black bag, and pull out ..." two items guaranteed to "Make the night a wonderful thing." Nicely done.

Walter also sang "Haitian Divorce". I kind of missed Donald's intonation on some of the lyrics, but it was ok. It was during this song that I really noticed lead guitarist Jon Herington, who was performing superb and flawless interpretations of our favourite solos and sometimes playfully jamming against Donald. I thought Walter might play rhythm the whole night, but he did tackle lead on some other tunes.

In fact Walter and Donald did some jamming of their own on "Green Earrings", which featured a long jazzy piano solo from Donald which got the whole band popping. Dirty Work was a bit of a breather, though the girls' vocals were as impressive as any instrument, and then the band rallied for a really high energy "Josie", which paced itself midway into Walter introducing the band members one by one.

As the individual instrumentalists bugged out it was perhaps predictably Keith Carlock (voted world's #2 all-round best drummer) who made the biggest splash - whilst still retaining the Orchestra's jazz cred. In fact Walter made a point of noting "Japanese jazz enthusiasts are some of the most discerning in the world" (paraphrasing) and how pleased he was to be able to introduce and play with some of the finest jazz musicians of their generation.

Donald introduced "Chain Lightning" as "a little blues" and started getting worked up for the finale. "Bodhisattva" seemed like the crescendo the whole band had been waiting for, and they gave it their all - and the whole audience, so close and focussed, was tapping and swinging too.

When they wrapped it up, said goodnight and left, it really did feel a bit too soon. A Japanese guy near me said "What! That's like 40 bucks a song!" He's close - it's about US$250 for some of these Tokyo tickets (like ours!) so the audience clapped in rhythm as best they could (mezzanine floors make it difficult) for a couple of minutes until the band relented with "Peg" for a single encore.

The audience wanted more, and hopes soared when the curtain behind the stage drew back to reveal a rather impressive expanse of Tokyo skyline. It's a shame they didn't do that before the encore. Instead it signaled the end of a slightly short but very intense and immensely enjoyable set.

The acoustics of the venue are great, and overall I highly recommend it, especially since the club manager (though not the regular floor staff) dealt so well with the aftermath of the disastrous seating snafu.

I'd love to hear from anyone else who sees them!

Monday, July 09, 2007

Happiness is a state of mind


So I just found out there are more granular maps available at World66 for the US, Canada and Europe. The pic above of the five US states I've visited is good, but the European map is a bit disappointing since it doesn't show borders. Here's mine.

Sunday, April 15, 2007

I'm a country member


Well, I've found a reason to blog again, which I'll get around to actually blogging about soon. In the meantime, see above for a visual résumé of my worldly exploits courtesy of this very cool little webapp at World 66. You can save either the resulting GIF picture, or a link which encodes your travelling conquests.

It's a nice idea done well, but it could do with some improvement in granularity. Visiting 5 states of the US has convinced me that it's a bit like a large collection of countries - certainly in size as the map shows. There's a lot of red there I haven't visited yet, like Alaska. The same could be said for Australia I suppose.

Anyway, friends reading this, feel free to leave a comment with a link to your map. I'm pretty sure Zeal will be hard to beat. Here's what you should put in your comment: copy the example below, but replace "USATBECZFRDEGRNLCHUKIDJPPHTWTHAUFJNZ" with the similar stream of letters from the text box you see below your map on World66.

Note: I've broken the example up to make it more readable here, but there should be NO spaces or line-breaks inside the link. That's the bit inside quotation marks: "http://..."

Example:
My map is <a href="http://www.world66.com/
myworld66/visitedCountries/worldmap?visited=
USATBECZFRDEGRNLCHUKIDJPPHTWTHAUFJNZ">
here</a>.

The comment will show as:
My map is here.

Tuesday, July 25, 2006

Only the good die young


Something stopped me in my tracks there for a while, and it's time to blog about it and try to move on. On March 22nd, shortly before visiting NZ for the first time in 3 years, I was informed that my good friend Jeremy Morrison had taken his own life. This was a heavy blow; one that affected me profoundly, and one I don't think I'll ever completely get over. Of course I was and am still heartbroken for his fiancee Mia, and all his other friends who were affected by this tragedy. There's so much I could write, would like to write, but on this topic I agonize over every word, so I'll just have to bluff my way through it. There's a lesson to be learned if you can get to the end of this ineloquent ramble ...

The above photo of Jeremy and his fiancee Mia has been in my digital camera since 22nd April 2003, 3 days before I left NZ for Japan. As I slowly removed older photos to make room for the new ones I took, this photo was one of the few reminders of all the friends and family that I had left behind. Unfortunately, Jeremy didn't know about this, and it's to my great regret that when I talked to him a week before he died, I didn't tell him how much I was looking forward to seeing him and Mia again upon my imminent return.

I first met Jeremy when he was DJing at a friend's birthday party early in 2000. He was a quiet guy, so I was the one to strike up our conversation about the future of music. Vinyl, I proclaimed, was history, and digital music (MP3 etc) the future. Jeremy begged to differ, of course, and yet a few months later there he was: unleashing a Big Beat and Drum'n'Bass set at my 30th birthday party mostly via MP3s mixed by computer. In fact he proceeded to freak me out by selling his turntables and all his records, saying he didn't need them! I agreed to finance a PC for him, and my buddy Sean and I helped him spec it and put it together. Jeremy was a talented guy - persistent, and a quick learner. Soon he was mixing just as well on a PC as he did on decks. He was also naturally athletic, and we started hitting the gym together a couple of times a week. Our last workout was shortly before I left for Japan a couple of years later.

Being gym buddies breeds a special friendship. Apart from being a somewhat social activity, there's a closeness that springs from becoming more aware of someone's body through exercise - how they use it, what their strengths and weaknesses are. Working out is positive and progressive. It's about enjoying life, and the effort to improve ourselves. For three years in Japan I went to the gym alone twice a week or so, and missed my gym buddy Jeremy. The image of him that lives in my head is still the young, strong, enthusiastic young man that he was. I didn't have the chance to go to his funeral and grieve. I still see his smile, hear his laugh, feel his concern and kindness, always placing others before himself. And so now, I go to the gym alone twice a week or so, and there's a hole in my heart.

After the gym we would eat together and chat. Other times too, but usually this was when I would find out how Jeremy was really doing. His life was no cake-walk, and I felt privileged that he was comfortable confiding in me when things were tough. But with hearing hard things comes saying hard things. If you know someone well, after a while you'll know if things are tough for them - no matter what spin they put on it - by the coping strategies they fall back on to make themselves feel better. If you see someone heading down the wrong path, you need to be prepared to express your disapproval in a supportive way. It's not about telling someone how to live their life. If they respect you, your opinion will matter, explicitly voiced or not.

I wish I could berate him now about how much he has disappointed me and the others who loved him. And even more - so much that it hurts - I wish I could see the man he was becoming, his potential realized, his love fulfilled. He gave so much, deserved so much, and some of us gave back all we could. But he threw it all away, and that betrayal is hard to forgive.