January 9, 2009

Palm Pre

I've been looking for an alternative for iPhone, not because I wasn't happy with it but because it lacks some of PDA features that I need (also, $69.99 per month is too much for me). At CES 2009, Palm demonstrated a new phone called Palm Pre. The hardware looks decent; it comes with built-in keyboard, which I prefer not to have (it makes the device thicker, plus I'm quite happy with graffiti).

They came up with a new OS called, Palm WebOS, which looks fabulous. The fact that all your info can be synced via web is very attractive, their multi-touch is pretty responsive, and most of all, their new 'card system' for multi-tasking is absolutely stunning.

I'm looking forward to getting my hands on the device. I stopped using Palm since 2002, but this may lead me back to a PDA I actually liked.

My new system

I ordered a new system from X-infinity. Although I'm satisfied with the machine so far, I wasn't pleased with the vendor. It took about a month to get the machine since I ordered, plus they upgraded three of my initial components (motherboard, graphics card, case) without asking. A funny thing is that they upgraded the graphics card without charging (and I don't think they noticed) so I didn't complain too much. Here is what I got.

Motherboard: Asus P5QL PRO Core 2 Extreme (Intel P43) - $99.99
CPU: Intel Core 2 Duo Processor E8500 (3.16GHz, 1333MHz, 6MB) - $199.99
RAM: Super Talent PC6400 2GB (DDR2, 800MHz) x 4 - $89.99
HDD: Seagate ST3750640NS (SATA2, 750GB, 7200RPM, 16MB) - $89.99
ODD: Samsung SH-S203N (SATA, 20X, DVD+-RW) - #32.99
Graphics: nVidia GeForce 9400GT (1GB, 2-DVI) - $49.99
CPU Fan: Thermaltake CL-P0391 - $49.99
Power: Seasonic SS-600HT (600W, ATX) - $65.99
Case: Thermaltake M9 VI1000BWS - $79.99

Overall system costs $758.91, which is a pretty good deal (as long as it stays well). I just figured out similar machine could have been bought from Dell with $1,099 (including MS Windows) but what the hell; after all, it is $300 cheaper and I didn't have to buy Windows.

January 6, 2009

Apple: iLife '09

I like Apple not only because their products (both hardware and software) are so beautiful, but also they always strive to be on top of what they do. Today, they released iLife '09, which blew my mind. As a person studying AI, it is exciting to see that Apple constantly makes effort to integrate AI to their OS (spotlight, genius, etc.), which no other vendors have tried (as far as I know). iPhoto '09 uses face detection and recognition, technologies that are still on development, but obviously ready to be used.



Interestingly enough, I was just thinking about switching to Google Picasa to organize my photos, but Apple once again succeeded to drag me down to their side. I hope they will keep up the work so I don't need to switch my main OS anytime soon.

January 5, 2009

Dell PCs featuring Ubuntu

I've been a Mac user for 2 years now: ever since I tested Windows Vista and realized that there was no hope for MS to come up with an OS satisfying my needs (they may someday but not anytime soon). By then, I had to make a decision to buy a PC, install Ubuntu, and throw away Vista or buy a Mac. I chose Mac (Macbook) and it has been a pleasure using the machine.


However, the decision would have been really difficult if Dell started releasing their PCs with Ubuntu as they do now. As a PC, Dell XPS series are very compelling, plus you save money for buying Vista.


Ubuntu has caught up with many features that were bounded only to Mac OSX (Expose, Spaces, etc.), which gives me some reasons to go back to linux.

Apple Keyboard on Ubuntu 8.10




I have 'Wired USB slim aluminium Apple keyboard'. Its design is stunning and it types very smoothly; however, since the keyboard uses slightly different keycodes, some works needed to be done to use it on Ubuntu.

First, [alt] doesn't work as it is: it needs to be pressed with [fn] in order to act as [alt] in PC. Here is how to fix it.

$ sudo vi /etc/modprobe.d/options
> options hid pb_fnmode=2
$ sudo update-initramfs -u

Second, some may find it convenient to have [alt] and [cmd] switched. I personally prefer not to switch them (and it can be done by using compiz manager) but in case you need, here is how to.

Third, if you configured the keyboard layout (Menu -> System -> Preferences -> Keyboard -> Layouts) as 'Generic 102-key', you won't be able to use [F13] ~ [F19]. To overcome this, you need to add the following keycodes.

$ vi ~/.xmodmap
> keycode 191 = Insert
> keycode 192 = Print Sys_Req
> keycode 193 = Scroll_Lock
> keycode 194 = F16
> keycode 195 = F17
> keycode 196 = F18
> keycode 197 = F19

The script assigns F13 to 'Insert', F14 to 'PrintScr', F15 to 'ScrollLock', and so on. Now, you can use the keycodes to configure system shortcuts (Menu -> System -> Preferences -> Keyboard Shortcuts), or to create your own shortcuts.

java.io.IOException: Too many open files

This indicates that Java Virtual Machine(JVM) tries to open more files than the max-number of file descriptors. The max-number of file descriptors varies by OS: 1024 for Ubuntu linux, 256 for Mac OSX. You can check the limit by typing

$ ulimit -a

A frustrating thing is that the exception still occurs even when there is no way that the number of currently opened files exceeds the limit. This can happen when the Java program opens a new file before JVM closes the old file: it takes longer for JVM to close a file. Hence, if your program keeps opening and closing files without much break, you will most likely experience this exception.

How do we get around with this problem? If you are a super user, the easiest way is too increase the limit of file descriptors. Here is how.

$ sudo vi /etc/security/limits.conf
> userId soft nofile 4096
> userId hard nofile 4096

This will increase the max-number of file descriptors to 4096. I haven't tried any number greater than this, but this should be enough for most programs.

One interesting thing. Although Mac OSX has a smaller limit of file descriptors, I never experienced this exception in OSX. Is this because OSX's JVM handles file descriptors better than Ubuntu's one?

April 24, 2007

Eclipse - Compiler Compliance Level

To fix 'The type Vector is not generic' problem,

[Menu] -> [Project] -> [Properties] -> [Java Compiler]
- check [Enable project specific settings]
- Compiler compliance settings -> higher than 5.0