asInt_either

Tuesday, January 20th, 2009

Real World Haskell, Exercise 4, p. 98:

The asInt_fold function uses error, so its callers cannot handle errors. Rewrite it to fix this problem.
(more…)

Android Notebook, page 3

Tuesday, January 20th, 2009

Perhaps just because it’s an initial tutorial, but the event handling model feels like a sort of monolithic Java 1.0/Mac OS 6 event loop rather than the more flexible event listener based approaches of Swing and other more modern GUI frameworks.

Local variable access is much more efficient than field access in the VM. I guess the CPU (or battery) is too underpowered to do fancy JIT tricks, as I’d expect a good optimizer to account for this. Worth remembering. Hmm, does Dalvik even have a just-in-time compiler? Apparently not.
(more…)

Android Notebook, page 2

Monday, January 19th, 2009

There’s a tab character in the Notepadv1.java sample file. Tab characters should not be used.

Android has an embedded SQL database, Useful.

I wish XML layout files would open in XML view by default rather than layout view.

The tutorial is a little flaky with XML terms. It’s an XML declaration, not an “XML header”.

Some things that look like XPath expressions at first glance, aren’t.

Trying to read a tutorial in one window and use Eclipse in the other is painful. Maybe if I put my laptop on the desk?

The tutorial’s naming conventions aren’t following Java standards. Someone likes to put “m” in front of all the instance fields.

XML localization and UI construction: nice.
(more…)

Android Notebook, Page 1

Sunday, January 18th, 2009

Had to upgrade to Eclipse 3.4.1 to to get the SDK working. No big deal.

Hello World is now running. The emulator took a while to start up.

“Warning once: This application, or a library it uses, is using NSQuickDrawView, which has been deprecated. Apps should cease use of QuickDraw and move to Quartz.” Oh well, it’s just an emulator. No big deal.

It is nice that the emulator works well on a Mac.

transpose

Sunday, January 18th, 2009

Real World Haskell, Exercise 4, p. 84:

Write a program that transposes the text in a file. For instance, it should convert “hello\nworld\n” to “hw\neo\nlr\nll\nod\n”.
(more…)

Turning Off Captions

Friday, January 16th, 2009

Let’s see if this worked. If you don’t see a caption it worked:

A Jumping spider on top of my monitor
(more…)