Monthly Archives: February 2014

Easy Choice

By managing two different teams at the Apple developer site, I’ve been able to compare iOS developer programs over time.  The $99 individual and company programs are an OK first step, but you get what you pay for. With these programs, ad-hoc (pre-store) distributions are limited to 100 devices, each of which must be registered. And every new device registration requires updating provisioning profiles, refreshing, and repackaging. This also makes testing at cloud services like DeviceAnywhere a major hassle.

With the $299 enterprise program, you can get that magical ProvisionsAllDevices in your embedded.mobileprovision and get out of the device registration business. Unless you’re only distributing internally to a very small team, the $200 shakedown is well worth paying for.

Of course, when it’s time to submit to the store, you must use the non-enterprise membership, so that $99 company membership isn’t wasted.

Groovy Fast

I sometimes find myself trying out small, standalone Java snippets, much as I do in other languages. But unlike other languages, Java doesn’t provide a built-in REPL for this. Sure, I can wrap the snippets in JUnits or small main programs, or use Eclipse scrapbook pages, but that’s the slow way to experiment. I want something lightweight and fast for this decidedly heavyweight and slow language.

In the past, I’ve used different Java shells and sites to fill this gap, but since I’m working in Groovy more lately, my new favorite is the Groovy Console. And when I need snippets integrated with my code and environment, the Groovy-Eclipse plugin provides that.

CDATA Run

I had to write an XML transform today that included CDATA, passed though exactly as received without encoding or escaping characters. It had been awhile, so I dug through an old project to find the incantation – ah: cdata-section-elements.  Just include that magic word in xsl:output, listing the elements to pass through, like so:

<xsl:output 
   method="xml" 
   indent="yes" 
   encoding="UTF-8"
   cdata-section-elements="myPassThroughData" />

BTW, this tool is quite helpful when fiddling with XSLT fragments: http://xslttest.appspot.com/.

You Again

Remember back in the JDK 1.5 days when some genius changed BigDecimal.toString and broke half the universe? I’ve felt the impacts in DB2, Oracle, VoiceObjects, and other places. I’m over that now (and all the cool kids have updated or switched to toPlainString), but this thing just keeps coming back to haunt me.

Like this week, when old DB2 JDBC (JCC) drivers kept showing up on some platforms, prompting these intermittent errors:

[ibm][db2][jcc][converters] Overflow occurred during numeric data type conversion of …

This error can sneak up on ya’ because it often takes just the right numbers to kick in. Like the lottery, and sometimes with the same odds.

Fortunately, the fix is easy: just update JDBC drivers to something from the modern era.

Storyboards in any Language

Since the advent of NSLocalizedString, iOS localization practices haven’t changed much. But the new storyboards are easier to translate, particularly if you enable internationalization from the outset. To do this in Xcode 5:

  1. From the project settings (Info page), check Use base internationalization.
  2. For each storyboard, go to the File Inspector (utilities pane), enable Localization, and check at least Base and English.  This will extract strings files that others can translate or customize.
  3. Un-install and then re-install the app from target simulators or devices.

After initial setup, adding languages and dropping in strings files is easy, and quicker than ibtool-importing strings into individual xibs.

Short Form

A friend today challenged me on letting this blog go a bit dormant.  True, I once averaged about a post a day; now it’s about one a month.  The thing he missed most were the (searchable) tips and quick fixes that I often tuck away here.

So, I’m going to pick it up a bit, favoring short form over long form and frequency over duration, but hopefully not quantity over quality. It won’t be thing a day, but at least it’ll be better than silence. Hopefully.