iPhone FrozenBubble

Posted January 29th, 2009 in Software, Usability, iPhone by erich

My port of FrozenBubble to the iPhone has finally been approved, after about two weeks of waiting.  There were some interesting coding hoops to jump through, as this was a port of a javascript version which already worked in mobile Safari (thanks Glenn Hanson!), and I was converting it to run completely local/embedded in an AppStore application.

Had to hack the javascripts a bit to load everything from the same directory, as the bundle in iPhone apps seems to be flat.  Or it’s flat if you don’t unflatten it, or something.  No biggie.

Mobile Safari likes to have “bouncing” when you scroll past the end of a web page, even a short one, so gotta turn that off.  And gotta turn off the action menu if you hold your finger down.  And a few hacks to get sounds working.  Most of it came from http://www.codingventures.com/?p=31 - thanks fellow iPhone hacker!

Lots of little tweaks to make it feel like a native app, like using the accelerometer for tilt-based aiming.  The animation isn’t the best, due to poor little iPhone’s javascript engine breathing hard, but it’s pretty darn good for what it is.  And fun!

iPhone Invalid Binary Error – Fixed?

Posted January 17th, 2009 in OSX, Rant, Software, iPhone by erich

The dreaded binary error has bitten me…

“The binary you uploaded was invalid. The signature was invalid, or it was not signed with an Apple submission certificate.”

Okay, in one case, it was actually valid, as I had been using an icon file that wasn’t named Icon.png and wasn’t 57×57.  Thanks to Sean for helping me with that.

But today, it was totally bogus.  I made a trivial change for a resubmit of my PrivateWeb app, and the binary was rejected.  Clean the project & rebuild, still hosed.  Restart XCode, still hosed.  Go to the finder and remove every folder from my project’s build directory and then build again – and it WORKED???  WTF?!

Ahem.  I’m glad it worked, but seriously…  There’s something buggy in XCode land.

Oracle with Java – update your JDBC driver now!

Posted December 7th, 2008 in Java, Software by erich

Some quick testing with JMeter showed me that under some serious load on my webapp (100 Tomcat threads, 300 queries a second, some with multi-table joins), the Oracle 11 JDBC driver performs much better than the Oracle 9 JDBC driver, even against a 9i database.  This isn’t a set of benchmarking results, which I know Oracle doesn’t like anyone to talk about, it’s just comparing old vs new Oracle drivers.

The takeaway, go get an updated JDBC driver, now!  Even if you’re running against Oracle 9i or 10g for the database, the new driver will give you a performance boost.  For free!

TowerSmash for the iPhone

Posted October 20th, 2008 in Software, Usability, iPhone by erich

For a hobby project, my brother Alex and I wrote a game for little kids called TowerSmash.  I wanted to write a game, well really more of a toy, that was truly meant for little kids.  So  many “kid games” on the iPhone seem to have little buttons all over the place and levels that load and things you can and can’t touch and scores and bleeps and then boom the game is over.  Um, did we have fun yet?

I wanted something that was open-ended, and that kids could just play with.  What sprang to mind was how all kids seem to endlessly ask grownups to build towers out of wooden blocks so that they can smash them down using cars or their hands or whatnot.  So that’s what we built.  A toy where it’s easy to create towers of blocks and watch them tumble if they’re not balanced, and then easy to throw shiny balls at the blocks to knock them off the table and off the screen.

Get it from the AppStore – $1.99

Wide Finder 2 in Java

Posted June 10th, 2008 in Java, Software by erich

I wanted to give WF2 a decent shot in Java, to see how it compares to the funky OCaml / Scala / Ruby versions that other people were making. It runs pretty well, about 15 minutes, and isn’t that complex. Okay, I did make it a single class file just to be simpler, but OO purists won’t like it :-) It’s a hack, a test, just to see how well it will run.

Notes from my big run with it…

nohup time ~bratton/jdk1.6.0_06/bin/java -d64 -XX:+UseConcMarkSweepGC -Xmx13000m -Xms13000m -cp . egb.MTNIOStats 40 128 /wf1/data/logs/O.all > nohup.30T.128k.out &

real 15:33.9
user 6:02:50.9
sys 8:36.0

Let’s see…

UseConcMarkSweepGC is a good thing. UseParallelGC sounds like it would be good with lots of cores, but it kept killing the VM about 70% through.

I went with a gigantomous heap, just because :-) I don’t really need it all, but as the queues get bigger, it’s nice to have. It probably would run fine with much, much less.

Java6 does much better than Java5. I’m using a locally-installed version since the /usr version wasn’t working. You need to unpack the 32bit sparc9 binaries first, then unpack the 64bit binaries on top of that. Have to use -d64 to get a heap bigger than 3G.

The -server JIT flag didn’t make any difference in processing time for me.

Interestingly, NIO block read size didn’t matter that much from 32k up to 4M, and neither did the number of threads, whether 25, 30, 35, 40, 50, 60, or even 90. Wacky! Not too much overhead in terms of context switching…

My app design has a single thread doing all the IO, simple reads, and then it hands the ByteBuffers to a separate blocking queue for each worker thread, to avoid any lock overhead. I think that’s probably irrelevant now, and that locking would be nanoseconds, so maybe I’ll redesign it, but it works fine.

My biggest problem is that my worker threads are for the most part waiting on IO to get more data to process. And the reduce phase at the end is not very long, 64 seconds, and it’s actually single threaded for now because shrinking 64 seconds to 64/5 seconds isn’t going to drop me from 15 minutes to 7 minutes :-P

And okay, my results are off by .01% or something, but I haven’t re-run since I updated my parser to handle spaces in URLs. Close enough for me, not close enough for some other WF2ers. :-) It all depends on your business domain what your accuracy needs to be.

MTNIOStats.java – file name capitalization may be munged – thanks WordPress! :-(

Apache Derby Data Corruption

Posted November 12th, 2007 in Fubario, Rant, Software by erich

It saddens me to say, but after a year of fiddling with Apache Derby, working around its quirks, making a custom statement cache so that it’s not so frickin’ slow, that it’s finally time to call it quits and move on to something else.

Data corruption… Over the past year, I have been using Derby as an embedded database inside of Fubario. I’ve been running it on Windows2000, WindowsXP, and OSX 10.4. On all of these OSes, some are laptops, some are desktop machines on all the time, I’ve had varied data corruption scenarios occur, even under relatively little load.

I will admit, I haven’t done a good job keeping records of each kind of data corruption, probably because of foolish optimism that when a big point release of Derby came out it would have solved the problems with the prior version. But alas, every release has had various things go wrong. I’ve had entire databases corrupt so that Derby would refuse to startup, or even an interesting “poison table” corruption where everything was fine until I issue a query against a particular table that was corrupt, at which point Derby went out to lunch.

And when I say little load, I mean pretty much the databases were idling 24×7, with maybe a few thousand rows in them. And to think that I switched to Derby specifically to get more reliability than I had been having with hsqldb or its shiny new cousin h2

So where am I now? I’ve built a custom flat-file store for Fubario for storing encrypted backup files. It’s pretty simple, really, with a few key characteristics of secret sauce that make it perfect for Fubario and it’s really tiny in terms of amount of code, because it doesn’t have to do very much at all. I’m also using h2 again for storing maybe tens of properties or something like that, miniscule really, probably could use properties in a flat file, but I’m just reusing the sql-driven classes that had been talking to Derby.

I’m done with the 20 second startup and shutdown times.

I’m done with these random and varied and all peculiar data corruption scenarios.

I’m done with foolish optimism? Maybe.

Fubario Badges

Posted October 8th, 2007 in Fubario, Software by erich

How much you back up isn’t usually an “in your face!” kind of moment, but hey, why not?!

Learn more at fubario.com

Fubario Public Beta

Posted June 29th, 2007 in Software by erich

I’ve got a public beta of Fubario up now. It’s a peer-to-peer backup program where you store your backups on your friends’ computers. Easy to set up, leave it running forever, never think about it.

Things still to do – backing up in-use files and firewall traversal…

How To (Not) Get an Interview With The Google

Posted June 27th, 2007 in Rant, Software by erich

A week or so ago, I read Tim Bray’s post about X-Me on Facebook being a virus, and I had to respond, being one of the “little guys” that has low usage numbers. A friendly Google tech recruiter read my post, found this dusty blog, wandered over to CLG where I work, and emailed me to ask if I had any interest in working for Google.

At first glance, seems kind of cool. But I’m not moving to California, as I’ve got all my family and extended family in the Chicago area. The recruiter kindly mentions that they have a Chicago office. Nice! Let me google them up…

*stomach lurches*

It appears that the Chicago office for Google is essentially an ad sales office (fine) with 3 developers who work in a corner. The developers are (mostly) the people behind subversion, which is one of my least favorite technologies that exists right now. I am struggling to understand why so many people are in love with it, apache/jakarta is switching their projects to it, and yet CVS works just fine, barring some warts. Eclipse covers up most of those warts, and since I breathe Eclipse 24×7, I’m fine with it.

But subversion… Well, I am one of the few non-believers, apparently. It was forced on me at CLG (long story), and turned out to be slooooooooow, taking 5 minutes to sync our projects, vs maybe a minute or less with CVS. It must take extra time to not do keyword substitution (j/k) which okay, I don’t like that CVS does, but whatever.

The big one for me is that subversion crapped out on me. Our repo server died, and I had a backup on another box, but apparently one of the files had some kind of strangeness in it, such that svn couldn’t read it. Um, okay, well that’ll just break one file, right? Nope. Entire repo, dead. WTF? You gotta be kidding me. An error in a single file kills my entire 6-year commit history??? And the error was caused by svn’s file handling, as far as I can tell, as I googled for it and a few other people had the same problem. When they asked the developers about it and showed them the corrupt file(s), the developers’ answer was, “that can’t happen” (paraphrasing). Um, except it did. To him. And me too. To be fair, the developers went on to try and fix the problem(s). But problems that are this varied, complex, and almost impossible to reproduce on demand are unlikely to be completely resolved. The bottom line is, the svn guys have made their own database thang for storage, and it sometimes blows up, taking your entire repo down with it. Not cool.

Don’t tell me I should have had more backups going further back in time – that’s a cop out. I had backups, but they were useless because one file in the middle was busted. Unacceptable.

No subversion for you! Er, me. I’m sticking with good ol’ CVS, which sucks a little, but it’s a devil I know, with warts I know, and if I back up the files for it, then I know goddamn well that I’ve got a reasonably good backup of my repository even if there’s a twiddled bit in there somewhere due to disk failure or whatever.

So I was compelled to mention my anti-svn feelings to the recruiter, in as friendly and upbeat a way as I possibly could, and I asked about working on other projects or remotely for another office, and haven’t heard back. So methinks, no interview for me. Could have been an interesting experience, but seeing as I hate goofy interview questions/riddles about manhole covers, numbers of gas stations, and any of those moving Mt Fujiisms, it might be for the best.

:-)

GIVM and the Facebook Platform

Posted June 25th, 2007 in Business, Software by erich

For the (entire world’s population – my direct family) who don’t know about GIVM.com, it is a very cool (IMHO), Web 1.0-ish shared gift list manager. It was born out of the frustration of trying to coordinate xmas and birthday gift giving amongst family members, especially as the family(ies) grew from people such as myself getting married.

So, the GiftList was born, originally running at bratton.com/giftlist, and it has been running for six years now, with about zero problems. It’s also been running with about zero growth. *sigh* Granted, I haven’t really tried to market it at all, because of the hope that it would virally take off.

The big problem is that the viral analogy doesn’t work for gift giving, because most gift circles are just that – circles. They have very few branch points to virally spread the word. Okay, yes, in a perfect world, somehow overlapping families would spread the word, but it hasn’t happened much at all.

One of the most amazing things about GIVM is that I managed to snag givm.com a while back. Crazy! I love the name, and when I saw it as available, I was in shock for a while before I bought it.

So, last month I heard about Facebook opening up their “platform” API thingamdooey, and I spent a few long nights porting GIVM to run inside of Facebook. One big bonus was that I back-ported some of the CSS to givm.com, so now whether you use givm.com or the GiftList app inside of Facebook, they both look pretty good.

Overall the dev experience was fairly straightforward, but I lucked out a lot that my schema design matched up very cleanly with Facebook’s. And I rock, of course.

After a week or so of anxious waiting to be approved into the Application Directory, I was in! There are a few other gift list type apps available on Facebook, but none of them have the same usability that mine has. I’ve had six freakin’ years to make sure that grandmas and grandpas can use this thing! I know where most gifts come from, baby, and you’ve got to play to your audience.

Facebook? Grandparents? Hm, not quite a match-up there yet. And that of course is the cart before the horse problem I’ve got, which is that Facebook is supposed to grow from 20ish million users to 50ish million users by the end of the year. Okay, a lot of those will be older people, not just the current FB highschoolers and college folk, but it probably will be a slow growth curve for the gray set. Which means my GiftList is probably not going to explode with high user numbers on Facebook.

After 3 weeks, I’m up to about 430 users. Lots more than givm.com, but dust in the wind compared to silly trifles like X-Me…