Fighting with computers

Computers are not always friendly.

Tuesday, September 29, 2009

VirtualBox on Snow Leopard

I've heard some news about troubles with VirtualBox when running on Snow Leopard. It was too late for me as I've just upgraded a couple of my systems. So I installed VirtualBox and I created a sample Ubuntu 9.04 system from scratch. Everything ran smoothly. Network and USB access worked as expected too. I have no idea if there is trouble running a VM you created before upgrading to Snow as I have none.

I used to be a fan of VMware's free VMplayer. Unfortunately there seems there is not a free version OS X. VirtualBox appears to do a nice job too. There is a quirk though, USB devices need to be registered to be used by the VM before you turn it on.

Sunday, September 20, 2009

Dude, where is my C.a.R. ?

While reviewing some of the answers to one of the questions of Code Jam Round 1C, I've learned about this cool software. It can be run using Java Web Start, so you don't even need to install it. What is it about? I reckon it will make some Math teachers very very happy. In short, it is a drawing tool for geometry-oriented drawings. It can export to SVG or EPS too. Mastering on the use of the program may take a while, but I see lots of potential on this tool.

Wednesday, September 16, 2009

Could not make it to the second round

I've failed to make it to round 2 of Code Jam 2009 last weekend.

I failed on getting the first problem (All your bases) right and that ate most of my available time. I was able to get the third one (Bribe the prisoners) right (bruteforcing it, not very elegant).

So I used some time to get the first problem right after the contest :-)

By the way, I later learned that there was a hidden constraint, as output value could not be larger than 10^18. That meant that maximum base could be 16 (as 1023456789abcdefg is base-17 is larger than that, 49030176097150555672 in case you're wondering).

Here you have a simple solution in Java. And, yes, you can use Long.toString(String,int) instead of BigInteger, though the latter will cover a wider range than the problem statement requirements.

Friday, September 11, 2009

X11 on Snow Leopard

A few days ago I've got a shiny new MacBook Pro. Instead of coming with Snow Leopard installed, I've got a rebate on the price for the cost of the update to SL. I've installed Snow Leopard now but the disc does not contain a version of X11. As GIMP and Inkscape software depend on that I'm searching for the right version to install. I could use some help if you already know where to pull it from.

Update: I'm happily running the GIMP on Snow Leopard. Contrary to my claim above, X11 is included on Snow Leopard, you'll find it in the Applications part of the optional install package.

Wednesday, September 09, 2009

SSH into my e-book reader?

Yep, it does sound odd, so a bit of an explanation may be welcome: I've bought me an electronic book reader a while ago (a Papyre 6.1 from Grammata). It is the same device as the Hanlin v3, Bebook, LBook and many other brand names given by sellers on different countries.

The reading experience has been quite good. Actually it's been better than I expected. However, every now and then, like Windows 98, the system would refuse to turn page and freeze. After a few seconds [I suspect] the built-in watchdog timer quicks in and reboots the system. Total time is less than 30 seconds but the worst part is that you've lost the book page you were in.

After checking several forums where many users complain about the same thing but no real solution was offered, I learned that an "alternative" firmware was available for a wide range of devices, including mine. Even better, there was a live version you could try before flashing it on your device. Who could ask for more?

This firmware, known as OpenInkPot, is lacking of any kind of DRM support (which I do not need). And it also lacks of USB storage device emulation. That means that when I plug the USB port into my ebook it does not pop up to my system as a storage device (something the original firmware did) so I can add new files to system. This is not a big problem as I can easily take the SD memory out of the unit and plug it into my computer to add more books to my collection.

However, out of curiosity, I learned that I can use USB network shim so I can SSH my ebook system.
#as root user
ifconfig usb0 netmask

#later you can transfer by:
scp book root@

#or if you want to send it to the SD card
scp book root@

is the magic needed to be able to later connect to the device using Ubuntu.

Now I can use SCP to transfer files back and forth. But I'll have to wait for a few reading sessions to tell you whether the glitches have gone with this firmware or not. The picture on the right shows the looks of the new file selection menu.

There is a long list of supported devices, so if want to give OpenInkPot a go it can be fun. (But don't blame me if you brick your system!).

Friday, September 04, 2009

Code Jam 2009

I've just passed the qualification round of Code Jam with the feeling that I'm getting dumber every year. I only passed the first problem (Alien) and I've got stuck on the second problem (Water Basins). Third one (Welcome string) looked like the Speed Limit problem on 2008, but I did not attempt to do it.

A plausible excuse is that I did not have the time ... Yes, I like that: I was busy working so I did not have time to waste playing this Code Jam thing.

BTW, It was me the guy who asked about the error message on the Q&A. The error message said my solution file did not start with the string "Case #1:" but that was not true. The correct error message should have been that my solution file did not start with the string "Case #1: ". The difference being the space after the colon.

Update: Here you have the three problems solved in Java.

Tuesday, September 01, 2009

Gmail down

A the moment of writing this, Gmail is giving the usual Server Error message you get when things go wrong. I hope the problem will be fixed soon. I've learned that Twiter can be useful whenever this happens. You can check by yourself with this query.

There is also a reporting tool from Google that can come in handy.