Wednesday May 28, 2008 As Karel already mentioned a few weeks ago, the Mobility pack can also be used on MacOS. (The mobility pack is written in Java and does run on Mac OS, but there is no current official WTK and no emulators for Mac OS, so netbeans.org never offered this download option.) Since people asked about it, I tried to install the third-party SDK and emulator and ran a sample app, and ta-daa, it worked. :) Here are a few "Doh!"s I came across, I'll write them down in case somebody else has the same questions.

How to Fix the Eurovision Song Contest :-p
Last night I had this brilliant idea how to "fix" the Eurovision song contest. I only saw the last 20min or so of it, so you are spared my opinion on the actual songs. ;-) But well, the known problem is that certain countries favour each other -- due to a similar culture and musical taste, for political reasons, or due to immigrants -- those reasons are legal and you can't forbid viewers to vote for their neighbours; but it takes out a bit of the excitement if you know who will vote for who in advance. So here's my clever idea:
Every country sends a composition, singers, musicians, a choreographer, a tailor, what ever is needed. THEN they take each song and assign artists and performers to it randomly! :-D
So for example the Azerbaijani composition will be choreographed by an Icelander and sung by a Croat with Swiss dancers. etc. See? But of course they don't tell us who did what, and you cannot always tell the nationality from the looks or accent. I assume here that each song requires a team of the same size, so each country is represented evenly in different functions.
The voting for the songs proceeds as usual and one song wins. Now it is revealed who contributed to what. From that we calculate which country (!) has won, based on how many top songs it has contributed to.
For example countries A,B, and C contributed to the winning song (worth 25 points), and countries D, E, and B to the second (24), and A, F, and G to the third place (23), etc. So country A gets 25+23 points and country B 25+24, and C gets 25, and D gets 24, etc etc. (Or whatever values you want to assign, you might as well go back to the 12-10-8-7...1 system.)
So in the end you have a winning song and a winning country. The song stands on its own and wins for its quality and not for its geographical location. And the country wins because the artists they sent were the best team players.
Of course they won't implement that, because the performing teams are only assembled temporarily for the contest, and you cannot milk them for further money like when selling a band's CDs or sending them on tour... And this variant would also take more time and patience because the randomly assigned teams still have to practice together. But the concept would be fun to try, don't you think? It even adds a degree of excitement: Who makes the best of being thrown into a randomly assigned team? Leave a comment if I missed something obvious, I came up with this idea in a tired state and that doesn't bode well for its logic. ;-)
PS: I followed the voting part on a Swiss TV station, and there was a fun moment when the Czech lady announced her country's votes. She skipped a line or something and corrected herself, so she said something like "and ten points go to... uh sorry..." And the Swiss commentator burst out "Ten points for Züri!!! Oh, wait, she said 'sorry', never mind" -- Züri (Zürich) is a city in Switzerland.. ;-D
Posted by seapegasus ( May 25 2008, 05:49:25 PM CEST ) Permalink Comments [1]Since James is travelling, I will quickly mention an announcement from the Community Docs team.
Varun Nischal, the NetBeans community docs contribution coordinator, reports another milestone: In the less than 4 months since we reached the 100 mark on February 5th, another 50 docs were contributed by NetBeans developers! Varun says:Yes, this means you. :-) Do you have a useful tip lying around in your head, a solution you discovered and think, hey, maybe somebody else has the some question? It's very easy to contribute:All credit goes to you and your passion towards NetBeans making it possible for us to achieve such milestones. There are still potential contributors either amongst you or in waiting, who have still not realised their potential and when they do, we would be unstoppable! Keep up the good work!
How to Get Videos Onto an iPod Touch
OK. I admit it, I caved in and bought an iPod touch. X-) So all I gotta do is copy my favorite videos on it and I will have hours (well exactly 5 hours, because then the battery's empty) of fun on my next 10hour-train trip. :-D
Importing video onto the iPod from a DVD is pretty straight-forward. I used a well-known application called Handbrake. With the "iPod Low-Rez" preset, a 40-min TV show takes up about 150 MB, and the image and sound quality is very good.
Thanks to Lloyd for recommending MPEG Streamclip, a cool free video conversion tool for the Mac. It cannot only encode to mp4, but it's also able to rotate videos by 90 degrees. The latter comes in handy for n00bs like me who record their vacation videos with a small digicam -- in portrait format... I combed through a couple of video forums and the main answer people get is: "Well don't hold your camera that way, stupid!" The second type of answer was to use the linux tool mencoder that you can get by installing mplayer. Read what Scott has to say about how to rotate an AVI or MPEG file taken in Portrait with mencoder.
I've got Ubuntu in a virtual machine at work, but decided to keep mencoder in the back of my head as backup plan. I was still looking for a lazy Mac solution. :-P So back to MPEG Streamclip: You can cut, crop, and yes, rotate the video. You can even re-encode video brighter or louder etc. It exports to AVI-, MOV- and MP4/H.264. (Note the strangely named "iTunes" button to select iPod-ready encoding presets.)
That's not even all, you can give the open command a URL instead of a file, and it will gladly accept youtube URLs and extract the FLV from it! (You can assign the downloaded FLV files to VLC to play them. If you only need a player and no encoder, VLC is probably the best.) Up to now, I had to use Safari's activity window to get them (double click the biggest item in the list to download the embedded video). :-P
Before I could start encoding my AVIs to MP4, I had to get some divX codeces I was lacking. I heard Mac OS 10.5 already comes with them? Well anyway, my 'old-fashioned' 10.4 didn't have them. So I also got XVID and divX (which is mostly a short-lived demo app, but I hope the codec it installed will last longer). -- And voila, my old AVIs come to live in MPEG streamclip, and covert nicely to 200MB mp4's. :-)
I bet all these apps I mentioned have more cool features that I have not discovered yet (leave a comment if you know a cool video trick)... One more tip from me is to make certain that the names of files that you copy to your iPod are unique within the first 15 letters or so, otherwise they will all look the same on the video list and you have to open them to see the full title... It's possible to rename them in iTunes, but it takes (seriously) 4 minutes to sync each rename!
Well, be right back...Gotta download Youtube...ALL of it! Muhahahah! ... OK. Maybe only this. Or this. Or this? No, this!
Posted by seapegasus ( May 21 2008, 11:48:49 PM CEST ) Permalink Comments [1]Where Did My PlanetNetBeans Blog Go?!
Just mentioning it because a blogger asked: What does it mean if your blog has suddenly disappeared from planetnetbeans.org? Did you say something wrong, did we kick you out? No!
In 99.9% of the cases, your xml feed did not validate, and your blog was just temporarily excluded until the 'offending' xml has scrolled off (or until you find a way to fix the xml manually).
Usually blog feeds are auto-generated, so it's probably not your fault, ;-) but if you can fix the xml issue, please do so -- and you're automatically back on the planet in the next cycle.
If you wonder whether your blog is affected, check the PlanetNetBeans error log. Presently, there are only a handful of people on it, but it's good to know where to find this page if you wonder whether your feed validated or not:
See the long list of fellow NetBeans blogger's on the right hand side? The last item in the list says "Where's my blog?!" It'll take you to the Validating Incoming Feeds info page, from which you can always find the error log, and links to w3c approved validators. Happy blogging!
Posted by seapegasus ( May 16 2008, 08:19:10 PM CEST ) Permalink Comments [1]Some plugins (such as Prolog, Jalopy, Groovy, Scala) do exist but they are not on the default update center yet. Inspired by Roumen's blog I added an FAQ entry about how you get access to plugins while they are still in development or, generally, just not quality-tested yet (so use them "at your own risk".)
So here's how to add development plugin centers, hope it's useful to someone out there!
Posted by seapegasus ( May 15 2008, 07:52:22 PM CEST ) Permalink Comments [2]Groovy, JRuby, Jython, Scala: Who Wins the Script Bowl?
Wednesday's Script Bowl was indeed what the caption promised, a rapid-fire comparison of scripting languages. Four developers took on the challenge to convince the audience of their language of choice -- in only three minutes per round. Guillaume LaForge represented Groovy, Charles Nutter represented JRuby, Frank Wierzbicki represented Jython, and Jorge Ortiz represented Scala.
All four languages compile to Java bytecode, but what distinguishes them? The jury, made up of Roberto Chinnici, Carol McDonald, and Ola Bini, made the four contestants compete in three categories: Each developer had prepared three demos, a desktop application, a web application, and one free-form app that shows off what the particular scripting language does best. After each round, the host Rags Srinivas encouraged the attendees to vote by sending text messages.
The rich client app demos were first. The task was to implement a desktop client that allows you to log on to Twitter and view your friends' feeds and status, and search for text in their postings. The ability to post was not required, but some of the demo'ed clients could.
The Groovy implementation clearly followed the MVC pattern and the language features made it very easy to parse the XML input; the GUI made a good impression. The JRuby implementation was designed using the NetBeans GUI builder (Matisse) and the Profligacy library, and therefor looked like a native app on MacOS; the users of this JRuby app will also appreciate that the build script generated native executables for different operating systems. The Jython app could save time by reusing an already existing model for accessing Twitter APIs; still the app was an odd one out, since it had to be started from the Terminal, and despite having a GUI with buttons to select Twitterers, the output was printed to the Terminal (frankly it looked as if he didn't have time to complete the UI). The Scala developer got started quickly by extending a SimpleGuiApplication class for desktop apps; Scala also made it easy to parse XML input, and the jury pointed out the clean error handling.
Next came the web applications. The application should access a MySQL database containing a world factbook, allow the user to browse facts about countries, and sort entries by criteria (language, population, etc). Additionally it should display the selected cities on a map.
The Groovy developer of course relied on the Grails framework together with Hibernate to access the database. The web application contributed by the JRuby community relied on the Rails framework and hooked up the components using the NetBeans IDE. The Jython web application relied on the Django framework with good-looking results. All three web applications made good use of their respective web frameworks and came with nice user-friendly web interfaces. Only the Scala team failed to produce the required web application and lost votes accordingly; instead, they demo'ed two other web apps, a chat client and a task list that use Ajax to keep the view up-to-date.
A quick look at the votes shows that JRuby and Groovy are presently the most popular choices in the audience... Will Scala and Jython catch up in the last round, where each team gets a chance to show off what their language can do best?
The Groovy representative decides not to show off demo apps, but instead he convinces the audience by talking about the seamless Java integration that Groovy is famous for. But then the JRuby submissions wow the audience with their smooth visual beauty: The first demo is a Star Wars-like scrolling Twitter client; the second demo is a 'Face For Steven Hawkins', a flock of colored dots that vibrate and change colors in response to audio input. Yes, admittedly, not very useful, but... pretty! The Jython representative chose to demo the Terminal-based Python help system that will soon be integrated into Jython too. The Scala demo was an application that searches and counts words in RSS feeds; it showed very well how Scala handles concurrency in minithreads.
Before the results were made public, the audience had a chance to pose questions to the experts. Asked about the relation of JavaFX to the other languages demonstrated today, Charles Nutter explained that each language was justified by its unique approach, so he does not see JavaFX as competition, but a powerful contribution to the variety of scripting languages. Another attendee asked how exactly languages such as Scala integrate with Java? All scripts written in these four languages compile to Java bytecode (war or jar files) that run on the standard JVM. Regarding Scala, Jorge Ortiz remarked that calling Java libraries from Scala apps is however easier than calling Scala from Java apps.
Finally, Rags announces the winner: JRuby! Groovy comes second, then Scala, and Jython (Check the final results in Rags' Blog, A=Groovy, B=JRuby, C=Jython, D=Scala). Jython had produced good results, but may have lost a few points for the terminal hacking required to start the applications, since all other contestants used IDEs. Although it felt a bit rushed and it was sometimes hard to pick up the details, this format of comparison is very suitable to get an overview of the "contestants".
Posted by seapegasus ( May 08 2008, 10:52:09 PM CEST ) Permalink Comments [4]A few pics from the Makers Faire...


After the faire... Yup, the instructions are in Japanese. But we went by the pictures and the robot worked right away!

Guess what I found on my way to JavaOne? A wine bottle that says, "Solaris... celebrate the day!"
See you at CommunityOne's NetBeans day tomorrow. I'm off to the maker faire now. That's something like JavaOne, but for hardware only. Kinda Steampunk / MacGyver / Mentos-in-Pepsi / Babbage difference engine themed. You know? Allright I'll take pictures.
Posted by seapegasus
( May 04 2008, 05:55:54 PM CEST )
Permalink