Thursday, September 24, 2009

My Nokia 770

I love my Nokia 770 and it's much more useful than the iPod - I must say...Since I was bashing all device manufacturers other than Apple, I must exclude Nokia from the list...

Having the courage to come up with a Linux-based Internet tablet, when they did, puts them squarely in front of Apple...

The thing is that I use them both (iPod Touch and the 770) as remotes to control movie playing at home and the Nokia is better equiped to be the remote. It is a little bulkier and sluggish to reconnect the WiFi, but the web browsing experience is much better, for the simple pages my application requires (larger screen helps, but the ergonomics of full-page and persistent zoom are what make it the better one).

Fully customisable home screen and a host of applications out-of-the-box actually make it the winner...just to think that I've had it for a few years now and it cost half what the iPod did...why is this new iPod touch so backwards? Target market? Well, I guess simplicity does have its is a portable music player first of all!

Monday, September 21, 2009

iPods suck nicely

Just gave in and got the new iPod Touch (32G) this weekend. Let's see...

Couldn't even take it out of the box - I was afraid to break it - I went back and asked a "Mac Helper" for help and he explained how to take it out - apparently Apple just won the abnormal packaging contest!

Walked again out of the store only to come back: when turned on, the thing only displays an image suggesting plugging its USB into iTunes. I had to go back and explained that I just paid 400$ for a toy that doesn't work...they finally convinced me to just refrain from returning it and wait until I got home to plug it in and see what's what.

Well - finally got home and started playing with it. It does grow on you and you start to wonder how come every OTHER device manufacturer out there seems to be sooo stupid. They do deserve the market share they're left with!

But then you start to notice the noticeables:
- the only dark screen is the home screen...most others are the same stupid black on white as your microsoft outlook...and there's no obvious way to change the "skin".
- the browser, while smart, is also stupid. I.e. the "zoom", while nicely done with the pinching manouver, is not remembered when you click on the next page
- the home screen doesn't go wide when you turn the thing...non-sensical since when you can go back and forth between "wide" apps, you pass through the home screen and have to turn the thing again...

Overall, they can get away with all these, just because the thing is so nice in many other ways...but it goes to prove the limits of every day life - nobody's perfect.

Wednesday, September 16, 2009

converting Java collections to scala collections

This took me many hours to figure out. I didn't find a word about it in the (quite a bit of) stuff I read, including the "Programming in Scala" book, blogs, posts etc.

How to best convert java collections into scala collections and back. This is crucial, as lots of would-be scalaistas would still carry around some kind of Java library, be it JNDI or JTA or some in-house non-rewritables!

As of scala 2.7, scala.collection.jcl.Convertions is your friend. As of scala 2.8, scala.collection.JavaConversions is your best friend. Enough said.

Interestingly, I use List pretty much everywhere in my code. However, as you'll see, since List is the only one that doesn't freely convert from one to the other, it follows that you should use Seq[A] in all your scala code...hmmmm

[later edit] Also, your arguably best friend in scala is the scala.collections.mutable.ListBuffer - check it out, it's all you thought List would be! Although, after a while, you will find yourself relying on mutable collections less and less...

To get the full power of the implicit java to scala conversions, make sure you import the contents of the class, note the underscore below:
import scala.collection.JavaConversions._
[Later edit] I removed my examples here as being too clumsy :) use the import above instead.