Fighting with computers

Computers are not always friendly.

Monday, February 28, 2011

The rise of plug computers?

A while ago I invited an old classmate over to give a talk on campus. He is working on a new project called Amahi. It is a Linux-based server software. But instead of aiming at the regular PC --maybe the old computer you might have at home-- they are focussing a relatively new breed of computer that some have called "plug computer". But ... what is a plug computer? They are small low-power headless computers that are built inside a power supply. Usual connections are USB ports (to enable external storage or other peripherals) and Ethernet network. These computers do not have a hard-disk drive but a small flash-based storage on board.

What these plug-in computers really shine for is as home servers. They need a really small amount of power, usually less than 10 watts, so keeping them on 24/7 is not going to have an impact on your utilities bill. The compact size and silent operation open up many interesting applications (ie. media server, download server, personal website server, etc).

The unit I am testing is called guruplug and it includes Wifi and Bluetooth wireless connections. It is powered by a 1Ghz Marvell's ARM CPU and it uses 3.5 watts while streaming flash content over wifi. A JTAG interface can be used to write a new system image on the guruplug.

I'd say the future format of the entertainment system around the TV set is not clear (at least not at my home). Some modern TV sets do have an Ethernet socket enabling media streaming (ie. DLNA) and others may also handle YouTube or Netflix without additional hardware. Other manufacturers are selling Blu-Ray players that include plenty of streaming features (ie. LG BD570) to be connected to a [dumber] TV set using HDMI socket. Streaming companies operate only on certain countries (ie. Netflix is not available in Spain), so they are not always a choice. And both Apple and Google have their own offerings (ie. Apple TV and Google TV). It is going to be interesting to see how this market develops.

Monday, February 21, 2011

Annoying Java behavior

A recent class exercise required students to create a program that handle a list of scheduled events. While I was not suggesting a specific approach, I used java.util.Date for handling the time.

Events happening in the future can be scheduled by adding a certain value to the current time. System.getCurrentMilis() gives you the value of milliseconds since January 1, 1970 00:00:00 GMT.

When creating a new Date object, the default value is the current time, but any number of milliseconds could be used to create any time into the past or the future. I was using this approach for scheduling future events. Later, I was checking, every second, if any of the future events on my list was already due. Unfortunately, I was using .equals() function for that but only a few times worked as expected.

The problem was that .equals() function works on a millisecond time base. If the two values compared are not exactly the same number of milliseconds since January 1, 1970 00:00:00 GMT then the answer will always be false.

If you are like me, you might be expecting two dates to be the equal if date, hours, minutes and seconds are the same. The simple solution is not to compare the two Date objects but the strings you obtain with the .toString() function of each one.

This site also seems not happy about Date class.

Thursday, February 03, 2011

It is the Android year!

Well, I might be wrong but apparently Android shipments just overtook Symbian platform during the year 2010. I have been using for quite a while a Nokia E71, which I can wholehearted recommend, but I was told by my carrier that it was time for a change.

Of course the question to iphone or not to iphone was raised. Owning five different Apple computers over the years plus an iPad seemed to make me the obvious iPhone customer. Did I tell you we have our own share of ipods, including a couple of iPod touch? However, after buying our iPad it became clear that the way Apple wants customers to behave and use their expensive devices was not very customer friendly. I really hate to have to use iTunes to just add a file to my iPad (thanks Dropbox to make my life a bit easier here). And I find despicable that once I have sync my iPad to a music library I have to lose everything if I ever dare to try to sync with another of my computers at home. I am sure that Apple can make a long case about how they worry on enforcing the copyright owners rights, but as the owner of my own iPad I strongly object against that. So much that I bought an Android phone instead.

Unfortunately, Google Nexus S is not yet available in Spain. I was having a googler from the UK office coming to my city for a talk and I was tempted to ask him to bring one Nexus S from London, but finally I settled with a Samsung Galaxy S from which I have heard several praises from some of my colleagues. In the last minute I double checked with another colleague who owned a Nokia N8 but he was not happy so I made my move.

After a few days of use I'm quite happy with the Galaxy. It is lighter than the E71 and quite slim too. The screen is large and I like it very much: colorful and bright. And, as most of the smartphones cannot stay away from a charger for more than a couple of days (though daily charge is the way to make sure you won't run out of juice unexpectedly). The use of microUSB charger is nice and I can keep the power mains charger at home and the USB charging cable at the office.

Both Google goggles and Google Translate apps are interesting enough to have at least some fun. But Skype app proved to be a disappointment as it refuses to work. The technology that I think it is missing in the Galaxy but present on the Nexus S and it is presumed to be on iPhone 5 too is the NFC (RFID) interface.

Update: One successful upgrade later, I'm running Android 2.2 on my Galaxy and it feels more responsive, battery lasts longer and Skype works. In the mean time I can see there is a new Galaxy S II from Samsung that looks cooler than Galaxy S and Nexus S (and it includes NFC interface too).

And regarding my Android experience, so far so good. I have found lots of interesting applications for my phone, including the Wifi-Analyzer. And the phone keeps on working no matter the way I hold it in my hand. But, as expected, you need to recharge every day.