Posts

Showing posts with the label code

iPhone Web Apps – A Treasure Hunt (Part 1)

I have an iPhone, but no Mac to code up some experiments with. Nothing major, just enough to satisfy the basic curiosity: what is this toy? What can it do that couldn't be done before ? (and let's face it, it is a toy. With multi-touch hardware-accelerated geo-located interactive goodness, but a toy – just like every computing device any self-admitted geek has ever owned) So that leaves building an iPhone web app . Normally there is some web page of documentation, and you read the documentation, and build it. Not so with mobile Safari development. Dust off the old map in the attic, and begin the treasure hunt. Like any good treasure hunt, you get a whiff that "thar might be GOLD out thar." The skull-shaped island on the map is HTML5's canvas element – it's the new black with its 2D flash-less graphics, AND guaranteed to be supported consistently on the iPhone. So I play with it for a bit, and yes, it can draw shapes. And circles, and gradients, and stam...

Quick and dirty file-based database (for Java)

That was harder than I expected. Background: While mining for a collaborative recommendation tool from my delicious links, I ran into some performance issues trying to cram a few megs of data into a java Preferences file – especially when I had it saving every time I added something.  Ok, time to stop using a hack, time to start using a “real” solution.  Saga follows. I’m spoiled by PHP: mysql is there if you need something fast and robust, and you can always use sqlite if you want something fast and thrown togther with no relational integrity.  Plus it saves to a local small file, perfect for distribution!  So I start out looking for a small, native, easy persistent storage solution. Java… database… how about JavaDB?  Do you need the person you send your file to have already installed JavaDB?  Can’t find out.  Still searching. Ah-ha.  It seems that the standard is hsqldb.     Ok, trying hsqldb, it is “what they use for open...

OAuth: not as easy as I hoped

I put together a demo/thought experiment to test “is there an easy way to filter your twitter stream using tag-cloud like UI – things like fading the colors or scaling the fonts.   Easy to build for myself, but when I wanted feedback from friends, the first response was a (in hindsight perfectly reasonable) reaction of “No way am I typing my twitter password into your form – I trust you Benjamin, but not THAT much!” Solution: do it the “right” way using oAuth.   There are some great tutorials on oAuth and a standard pre-packaged PHP library on Google code, and another for Twitter in particular.  But every method ran into problems.  The PHP library wasn’t clear on how to use it to work with the slightly more complex process flow.  The twitter oAuth code threw lots of warnings when you turned on error warnings. So, instead of building “down” from the oAuth standard, I pulled out the chunks of code I needed and built “up” from the oAuth steps necessar...