You won’t regret it. Really. MacRuby is like filet mignon, while RubyCocoa is just a sad, undercooked rumproast. Did I just paraphrase a joke from American Pie 2? You better believe it, buster.
Anyway, if you have a RubyCocoa project that needs a little bit of shininess, it may be surprisingly easy (and satisfying) to quickly port it over to MacRuby. I just spent about 4 hours converting a fairly sophisticated app (aside from its MIDI interface, which is a bit more tricky, but you probably won’t be dealing with that).
My first stop was this post, a very nice summary of the basic steps that need to be taken. However, I encountered quite a few additional snags, and I thought I’d post them just in case you, random internet denizen, want to skip them all together. Most of them are covered in the MacRuby docs, of course, but they’re here in a nice digestible table format so you can more easily knock out your conversion. Because as fun as prettying up your code is, you’d still rather be adding functionality, right?
Read the rest of this entry »
Apparently Apple’s App Store Databases Are So Complex That They Take 5+ Weeks To Update My Goddamn Name
You can be up and running on the App Store in 24 hours if you want to parade your apps around under your own name.
However, apparently the additional overhead of having a company name adds so much stress to Apple’s systems that you’re placed in a queue and told to be patient while your “updates” chug along for FIVE weeks. And COUNTING.
So, developers be warned - think of your company name NOW, file for an LLC, and submit for an account (or conversion of an account, like I did) before you even begin programming. Because sitting around for weeks with a ready-to-go application sucks.
Also, definitely telephone the developer connection if you need to convert from an individual to company account. Don’t just send them an e-mail. I did that at first, and I never in three weeks even received a response. I had to actually call in to get things rolling (and then I had to *fax* my business documents in. What is this Apple, 1984? I thought you were running in slow motion and throwing objects through large oppressive screens?)
However, apparently the additional overhead of having a company name adds so much stress to Apple’s systems that you’re placed in a queue and told to be patient while your “updates” chug along for FIVE weeks. And COUNTING.
So, developers be warned - think of your company name NOW, file for an LLC, and submit for an account (or conversion of an account, like I did) before you even begin programming. Because sitting around for weeks with a ready-to-go application sucks.
Also, definitely telephone the developer connection if you need to convert from an individual to company account. Don’t just send them an e-mail. I did that at first, and I never in three weeks even received a response. I had to actually call in to get things rolling (and then I had to *fax* my business documents in. What is this Apple, 1984? I thought you were running in slow motion and throwing objects through large oppressive screens?)
Your mobile device has encountered an unexpected error (0xE8000001)
If you’re building & deploying apps to your iPhone, you may encounter this dreaded and shamefully unhelpful error message at some time. It’s happened twice to me; the first time, after scouring the Internets for answers, it looked like I only had a couple of choices: either jailbreak my iPhone and do some SSH trickery or restore to a previous version. I went for restoring, and it was even more irritating than I thought it would be.
But you don’t have to restore your phone, and you don’t need to jailbreak, either; just change the application’s package identifier:
=>
The hidden problem (as explained by the post linked to above) is that there are broken bits of your app hanging around in an inaccessible folder on the iPhone. However, if you change the package name, it will use a different folder for deployment, so you will no longer be dealing with the broken parts.
Of course, if you’re really sold on that initial app identifier, then you’ll have to restore or jailbreak eventually. But maybe by the time your app is ready to send off to the Committee of Endless Deliberation, you’ll be on the next OS, and it will have some sort of automatic cleanup to deal with this issue. I mean, it had better.
But you don’t have to restore your phone, and you don’t need to jailbreak, either; just change the application’s package identifier:
com.initech.jumptoconclusions
com.initech.jumptoconclusions2
The hidden problem (as explained by the post linked to above) is that there are broken bits of your app hanging around in an inaccessible folder on the iPhone. However, if you change the package name, it will use a different folder for deployment, so you will no longer be dealing with the broken parts.
Of course, if you’re really sold on that initial app identifier, then you’ll have to restore or jailbreak eventually. But maybe by the time your app is ready to send off to the Committee of Endless Deliberation, you’ll be on the next OS, and it will have some sort of automatic cleanup to deal with this issue. I mean, it had better.
Dancing Girl Will Sell Your Miscellaneous Product Like Hotcakes
No matter what you’re selling, dancing girl will make it happen.
Wordpress to the Rescue
Last year, I embarked on a mission - to code my own blog software so I could say that I coded my own blog software. My hubris got the best of me, though, revealed in a severe lack of friendly blog editing, which kept me from writing the fancy words that I know my internet readers crave.
As a result, I decided to shake things up a bit and install wordpress. It’s - shudder - PHP, but sometimes ol’ Personal Home Page (yes, that’s its etymology!) fits in quite nicely, like when you don’t want to manage a burly Rails stack. Which is All The Time in my case. Don’t get me wrong - I frickin’ love Rails, but as a programmer I’m just not terribly interested in administering anything at all. I can dream about load balancing and memcached server side includes all night, but at the end of the day I’d rather hand the reigns over to someone else (preferably a guy who wears a localhost shirt).
I hope this means my writing juices began to flow again. I believe it’s my duty to flood the internet with as much inanity and alliteration as humanly possible.
Flex Benchmarks Are Fun For the Whole Family!
I’ve spent the last few months digging deep into ActionScript, the programming language for Adobe Flash Player. The result: I now have the power to create unspeakably irritating advertisement banners, surprisingly fun 2D physics-based games, and various charts of dubious usefulness. In the spirit of sharing, I now give you one of the latter: a smattering of ActionScript benchmarks in colorful, bubbly chart form.
This little project was originally inspired by a JavaScript benchmarking page I stumbled across, wherein the author quips “no one should care about JavaScript performance. But if you do, this page will help you get a feel for which operations are fast and which are slow.” Pretty much the same rationale applies here - unless you’re building a complex, cpu-intensive Flash game (like myself, hence my own interest), you don’t need to worry too much about outer static variable access taking a few microseconds longer than inner static variable access.
Usage: click ‘Test Iterations’ to perform each benchmarking action the specified number of times. Unless you’re on a very slow computer, even 150,000 should fly by fairly quick. On some pages, you can also click the ‘Auto Test’ button, which will incrementally test more iterations until it has a total duration of at least 100 ms, which should give you a decently accurate average duration (note that the number of iterations may be different for each benchmark). You can also hover over the individual bars to see more detailed statistics and the code performed in the iterations (typically without the loop code itself, with the exception of linked list iteration.) Also, feel free to right-click and select “View Source” to look at and/or grab the source code. As usual, the code is licensed under the Creative Commons Attribution-Share Alike 3.0 United States License.
Caveats: I’m still trying to build a better AxisRenderer so the benchmark groupings look more, er, grouped. The Flex BarChart can group (”cluster”) by default, but I haven’t found a native way to omit empty bars for unequal group sizes or display titles for all group members. Hopefully I’ll get that figured out soon, along with a staggered benchmarking engine so that you don’t have to wait for all the benchmarks to complete before the chart updates.
And naturally, I’ll be adding some more benchmark variations in the near future. Function calls *are* positively thrilling, after all…
This little project was originally inspired by a JavaScript benchmarking page I stumbled across, wherein the author quips “no one should care about JavaScript performance. But if you do, this page will help you get a feel for which operations are fast and which are slow.” Pretty much the same rationale applies here - unless you’re building a complex, cpu-intensive Flash game (like myself, hence my own interest), you don’t need to worry too much about outer static variable access taking a few microseconds longer than inner static variable access.
Usage: click ‘Test Iterations’ to perform each benchmarking action the specified number of times. Unless you’re on a very slow computer, even 150,000 should fly by fairly quick. On some pages, you can also click the ‘Auto Test’ button, which will incrementally test more iterations until it has a total duration of at least 100 ms, which should give you a decently accurate average duration (note that the number of iterations may be different for each benchmark). You can also hover over the individual bars to see more detailed statistics and the code performed in the iterations (typically without the loop code itself, with the exception of linked list iteration.) Also, feel free to right-click and select “View Source” to look at and/or grab the source code. As usual, the code is licensed under the Creative Commons Attribution-Share Alike 3.0 United States License.
Caveats: I’m still trying to build a better AxisRenderer so the benchmark groupings look more, er, grouped. The Flex BarChart can group (”cluster”) by default, but I haven’t found a native way to omit empty bars for unequal group sizes or display titles for all group members. Hopefully I’ll get that figured out soon, along with a staggered benchmarking engine so that you don’t have to wait for all the benchmarks to complete before the chart updates.
And naturally, I’ll be adding some more benchmark variations in the near future. Function calls *are* positively thrilling, after all…
Rails-Style Dynamic Finders For Ruby Arrays
One of my favorite little elegances in Ruby on Rails is ActiveRecord’s dynamic finder magic. It lets you perform simple model queries with as much readability as is conceivable in a method call:
Lost in the wonders of such syntactic saltiness (er, sugariness), I frequently found myself using these kinds of commands on arrays of model objects I had already retrieved from the database. Naturally enough, all I encountered was a variety of colorful exceptions, but I continued to dream of a world where dynamic finders worked for arrays, too.
Fortunately, a little experimentation, a covert glance at the ActiveRecord code, and a timely discovery of the wonders of inject led me to a successful implementation:
Read the rest of this entry »
# Normal ActiveRecord call - tasty, but still a bit bland.
Sandwich.find(:all, :conditions => ['meat = ? and tastiness = ?', 'turkey', 'medium'])
# Dynamic finder - unequivocally delicious. Try it with chocolate!
Sandwich.find_all_by_meat_and_tastiness('bacon', 'very')
Sandwich.find(:all, :conditions => ['meat = ? and tastiness = ?', 'turkey', 'medium'])
# Dynamic finder - unequivocally delicious. Try it with chocolate!
Sandwich.find_all_by_meat_and_tastiness('bacon', 'very')
Fortunately, a little experimentation, a covert glance at the ActiveRecord code, and a timely discovery of the wonders of inject led me to a successful implementation:
Read the rest of this entry »
Celebrating Twelve Years of Rather Poor Surfing
Nearly everyone has a collection of photos, scribblings, crafts, and innocent/incoherent writings that form a sort of quirky, historical self-portrait. More often than not, parents are the gatekeepers of these items, hoarding them at their parent-ish domiciles - which is fine in my book (do you really want your colleagues to see naked little you in a bathtub?)
But thanks to the Interweb, these self-portraits are merging into the online world. Today’s social-networking-hungry teens, what with their obsessive personal blogging and drunken Facebook photography, are the most obvious benefactors, but you might be surprised at what dirt you can dig up on the 9600 baud geek crowd - like me, for instance.
Because when you’re thirteen years old and building up your fluency in QBasic, you might just want to make a game about… surfing. And jumping. And doing stunts. And sharks. I give you "Stunt Surfer":

The graphics are clearly way ahead of their time - these days you’d need a next-gen 1024 MB nVidia just to keep up. And you wouldn’t believe the gameplay, not to mention the veritable cornucopia of secret moves available for discovery. And check this out - you even get to choose the color of your surfer shorts:

Why on earth Midway didn’t pick this up back in 1996 we’ll never understand, but what we do know is that some people just can’t see the sublime beauty in surfing/blackflip combos, decrying it as:
In any event, I guess this means that my digital self-portrait has neon purple swim trunks. Beat that.
PS: Yes, you can actually download the game from games.qbasic.com, and yes, I called myself "Michael Ziphrus" online back in those days, because the Internet was still a shady place. It’s completely un-shady now, of course.
But thanks to the Interweb, these self-portraits are merging into the online world. Today’s social-networking-hungry teens, what with their obsessive personal blogging and drunken Facebook photography, are the most obvious benefactors, but you might be surprised at what dirt you can dig up on the 9600 baud geek crowd - like me, for instance.
Because when you’re thirteen years old and building up your fluency in QBasic, you might just want to make a game about… surfing. And jumping. And doing stunts. And sharks. I give you "Stunt Surfer":
The graphics are clearly way ahead of their time - these days you’d need a next-gen 1024 MB nVidia just to keep up. And you wouldn’t believe the gameplay, not to mention the veritable cornucopia of secret moves available for discovery. And check this out - you even get to choose the color of your surfer shorts:
Why on earth Midway didn’t pick this up back in 1996 we’ll never understand, but what we do know is that some people just can’t see the sublime beauty in surfing/blackflip combos, decrying it as:
Well, there you have it. Personally, I’d call the gameplay something like "dubious" or "convoluted" rather than ganging up on it with two such sinister, ugly adjectives, and I’d certainly place "well packed" before "rather poor" in the name of good paragraph design, but who am I? I’m just a man who used to be a boy who wanted to do some tricked-out backflips over some killer waves.A rather poor surfing game featuring minimalistic graphics and highly doubtful and awkward gameplay. It’s a well packed game, featuring nice menus and very good documentation.
In any event, I guess this means that my digital self-portrait has neon purple swim trunks. Beat that.
PS: Yes, you can actually download the game from games.qbasic.com, and yes, I called myself "Michael Ziphrus" online back in those days, because the Internet was still a shady place. It’s completely un-shady now, of course.