Elegant Technologies

Productive software through elegance in research, process, and design.

I recently starting working on making my own WordPress plugins. The twitter feeds you see on this site are a result of that – I creatively call it Elegant Tweets. When I starting working on Ascendly, I wanted to make further use of plugins, so as practice, I tried to polish up my first plugin and share it with everyone. Although I want to add more features, it does work as-in, and does not have any known bugs, so enjoy.

This plugin allows you to configure the tweet stream the way you want it. Specifically, it creates a widget for use in your themes that will display zero or more tweet feeds. You can, for example, add your own Twitter username, but, more uniquely, you can also have certain Twitter feeds show based upon the categories assigned to the current page being viewed.

Motivation: I developed this plugin because I occasionally make apps for the mobile phones. Some of my apps have their own Twitter account to announce things like updates. I wanted visitors to my website see my primary feed (@jjrohrer), but to also see the feeds for the apps, but only if they were on pages related to those apps. Now, my posts that relate to a certain app are assigned to a category related to that app. So, when a user views a page, they will see several Twitter streams depending upon which categories are in view.

 

I like Apple’s Dashcode more than I should.  It is a powerful Webapp creator that is a bit under-supported.  I don’t think it gets the love, or the hacker support, that it deservers.  So, I find myself trying to make it do stuff it wasn’t originally designed for.  Recently, I’ve been using it to create skins for some non-iOS mobile apps.  As part of a budding workflow, I wrote a script to copy an existing Dashcode project and have it ready for the new project, including published to the right (read – ‘new’) location instead of the old location associated with the previous project.  Well, the challenge, is that Dashcode has the concept of a “Deployment Directory” that should point to my new workspace, not my old workspace.  This article describes how to programmatically change the “Deployment Directory

So, how can we script a solution for this?

Although Dashcode project looks like a single executable file, it is actually a Finder package with lots of stuff inside.  The trick is looking to see if the deployment path is stored in something we can mess with. It turns out the value is stored in jj.wdgtuser (my user name is jj).  Sweet!

The good news is that is stored in the .xml file – that is also the bad news.  Apple’s xml formats always sort of sucks, so getting to our variable isn’t super easy, unless you think predicate XPATH programming is super easy.

Inside a Dashcode Project

Here are the general steps I used to accomplish scripting the deployment path:

  • Ensure Dashcode is not running
  • Find the current username so you open the right .wdgtuser file.
  • Use XPATH
    • find the dict element whose previous sibling is a key element with a value of ‘DeploymentOptions
  • Given the above context, use XPATH to
    • find the string element whose previous sibling is a key element with a value of ‘Path’

 

The hard part here, of course, is finagling XPATH.  Here is the PHP code I used, but you’ll need to modify it for your own means:

$plistPath = baseDir($target)."/skins/{$skinName}.dcproj/jj.wdgtuser";

$xml = simplexml_load_file($plistPath);

$result = $xml->xpath("//dict/dict/string[preceding-sibling::key[1][node()='Path']]/node()");

$result[0][0] = $newDeploymentPath;

 

 

$xml->asXML($plistPath);

Here is a stab at explaining the XPATH above:

 

Hope this helps some other poor soul that wanders into the wilderness of Dashcode hacking.

I just got a snooze button! This free upgrade is found in Powernap 1.7 for the iOS. Thanks Tracey for the suggestion. http://bit.ly/hpa1qkThu Apr 07 12:27:34 via web

No comments

My client’s app just got accepted by Apple! First try, too – cool. Good luck David.Mon Mar 28 01:00:36 via web

Finding good software poses a challenge. Here are some that I use in the course of developing and maintaining mobile apps. I can generally recommend these…

Shopping

Mobile Amazon.com Ok – I know that this is a silly link.  I mainly have it here to test my affiliate link that I use in Cash or Click.   If you are browsing from your desktop, instead of smartphone, then you’ll want to click the “Full Site” button at the bottom.

Logo Design & Backgrounds


99Designs.com
I used these guys to crowd-source the sheep-background for Powernap and the logo for Ascendly.com. Actually pretty happy with the process.

Hosting

Webfaction This company has served me well for several years.  I know that there are other firms out there that are quite good.

Nearly Free Speech Probably the cheapest way to host a simply php site.  I used them at my last company.  There are limitation, such as no SSL, but there are quite good.

Server Maintence

Fugu – I use this for getting my files onto the server.  It is one of the few secure file transfer programs available for the Mac.

Server & Site Monitoring

Dot-Com Monitor – I used this at my old job to monitor how our sites were doing.  It has a nice up/down dashboard and will actually call your phone or send a text message, in addition to normal e-mail alerts.  There are other services like this out there, but when I last evaluated them, these guys were roughly an order of magnitude less expensive.

Pliner.net – I’ve used this free monitoring service for years.  They don’t seem to spam me, they just politely monitor my site.  They only provide (the last time I checked) e-mail based notification, but that is perfect for your less-critical sites.

Network Testing

SpeedLimit I use this to test my apps as if they were on a slow cell phone network.  My network in the house is quite fast, so have a way to slow things down is nicer than driving out to the Edge part of town


SpeedTest.net
This is just one of the many free bandwidth testers available for your iPhone.  The screenshot here shows what type of speeds to expect for a slow Edge connection.  I like to test my apps using SpeedLimit with the Speed set to 384K (3G) and Delay set to 250, for normal usage, and 48k(Dialup) and 1500ms for extreme cases.  Anything worse than the latter means the user is fading in and out of network coverage.

Here is a screenshot I took after running the test from my living room…, upstairs…, next to the window.  Hmm, why can’t we have real cell phone reception in our neighborhood?

JSON File Validation

JSONLint lets you past in your .json file and gives nice hints as to any problems.  There are others out there, too.


Recently, Apple posted, for the first time, app store submission guidelines. They are pretty specific, informative, and useful. Apple has been fairly opaque, in the past, regarding what would get your app rejected, so independent developers and producers, like myself, always lived at risk as to whether or not their new app idea would be summarily rejected. The new guidelines increase transparency and should help lower the Apple-related risks involved in creating new apps.

Ever since Apple introduced the App Store for their iPhone, there have been stories of apps being rejected. In the beginning, shunned developers would post their rejection letters on the Internet, and we would all commiserate and learn from each other’s experiences. Later, these rejection letters themselves were put under NDA, so the specific reasons for rejection became even murkier, and the fear factor rose. Some rejections clearly violated the developer terms and conditions, so there wasn’t much sympathy going around. Other rejections were genuinely surprising, and sometimes, even nuanced. These were scary. Every developer had to judge for themselves whether the time and money was going to be summarily flushed into the bit bucket. I noticed that my clients, even when developing innocuous apps, were concerned about the Apple risk.

So, to protect my apps and my clients, I have spent a fair amount of time over the last couple of years tracking the news sites, talking to fellow developers, and just generally keeping a finger on the pulse of the shifting rejections winds. I don’t think this will still be necessary…at least not to the same degree. For the first time, we have a document to read, and it is readable by actual humans, too. This frees up my time and lowers the risk of rejection. Largely now, I believe, rejected apps will be from software bugs, honest mistakes, and willful belligerence, but not random fate.

Some rules are funny:

  • “Apps that include games of Russian roulette will be rejected”

    This was a problem?

  • “Apps that use location-based APIs for automatic or autonomous control of vehicles, aircraft, or other devices will be rejected.”  My imagination flows with what could have been.

    "The pilot just died - does anyone know how to land a plane?" - "They made an app for that, but it got rejected."

Apple is a funny company. They have a history, mostly pre-iPhone, of being slightly indifferent towards their development community. This reputation has carried over into the iPhone age, largely because of the overwhelming influx of new developers to the Mac platform. However, in my experience, it is largely undeserved. I see them making missteps, like when the original SDK was under a tight NDA gag-rule that forbade developers from talking to each other unless they worked in the same company, and the long lack of specific app submission guidelines. So far, though, they have always, even if very belatedly, addressed those missteps. The gag rule was lifted. The submission guidelines were eventually posted. This impresses me. Their reputation should be modified to: “Will do bonehead things to developers in the short run, but the right thing in the long run, and will always try to protect the end-user.” It could be worse. The company’s DNA seems good, which for Independent Developers and Producers, makes the iPhone and iPad good platforms to invest in.

Must reads for Independent App Producers:
* Apple App Submission Guidelines (Requires Developer Account)
* PR Press Release
* HI Guidelines

I recently upgraded this website. This post is about how well things went, and how this might apply to independent application developers. I had set up the products pages of my original site using Joomla, but I later added a blog to the site, which I powered using WordPress. The product pages highlight the apps that I’ve developed. As time continued, I realized that the schizophrenic origins of my site, having some parts powered by Joomla, while others were powered by WordPress, made some basic things, like tracking usage, ridiculously difficult. So, I’ve finally united the two sides of the site into a single WordPress backed site. Some aspects of the upgrade went well, like unifying on WordPress and making lists of existing urls for easy testing; other things, like forgetting certain urls, could have gone better.

Old Joomla Site

What went well

When I published the original site, mostly in Joomla, I knew that I might upgrade to a different Content Management System (CMS) at some point, and so I tried to plan ahead for that eventuality. It really paid off. The problem with changing CMSs is that the different systems represent their pages using different URL schemes. I, of course, wanted search engine results to still work after I upgraded to the new software because search engine rankings are always hard won and are important to marketing efforts, so I wanted the URLs to stay constant. I did that by using permalinks for each product page, like ‘/aboutwalletzero’ for the Wallet Zero product page, instead of Joomla’s default scheme that looks something like ‘/page.php?id=234′. So, when I moved to WordPress and when I had to recreate a Wallet Zero product page, I simple gave it an identical permalink url, instead of sticking with the WordPress’s default scheme, which looks something like ‘/page.php?page=123′. Now, search engines and anyone that has bookmarked a page, will see the right results because the url ‘aboutwalletzero’ that went to the product page on Joomla also goes to the product page on WordPress.

New WordPress based site

For mobile browsers, I used the WordPress plugin iqTouch (???). This tool pretty much automatically made the site nicely available for iPhones and other mobile devices by reformatting the look and feel appropriately for such a small screen. I had to do a little tweaking, but it was still quite easy. Plugins like this make my heart sing with glee. It would have taken Herculean efforts to make my old set-up mobile friendly. I had experimented with the neat mobify.mo (???), which isn’t a WordPress plugin, but will handle any website by doing the reformatting on their own servers. Mobify.mo is a good service that offers a lot of flexibility for the non-WordPress site, but iqTouch is working better for me. I can now mention my site at conferences and feel happy if an attendee looks at my site right then and there on their mobile phone.

Mobile Web Version

What could have gone better?

I forgot to create a list of urls from my old blog, and also forgot to put in re-directs from old blog posts on the old WordPress to new blog posts on the new WordPress. I was so focused upon the Joomla product pages that I forgot about the blog pages. I eventually remembered to fix it, but it was an embarrassing oversight.

I mainly wish I had made the upgrade sooner. All in all, it probably took several days of effort to upgrade the site, but I could have easily made the change happen a long time ago. It is the type of activity that usually doesn’t require your undivided attention, so you can accomplish most of the work when you need a short break from other projects, say, over your lunch break, or sitting on the couch during family reading time. It is hard to justify putting off upgrades that improve your brand and give your venture increased capabilities, like using the mobile plugin and visitor tracking.

Site wide visitor tracking

Implications for Independent Application Producers

Now, none of these observations are unique or insightful, but it underscores the importance, I think, for planning ahead for structural changes. For example, let us say you have developed several apps that are all listed under your company name, but if you hope to re-sell the app to another company, say, to eBay, then you need to know whether or not Apple will let you transfer the rights from a single app to another company. Technically, how would that work? Perhaps it would be smarter to list each of your apps under different accounts in order to facilitate the transfer. You need to plan ahead for these structural changes. Maybe your apps talk to your servers? Do they use a common domain name, or do they each have their own domain that could be transferred to a separate company? How about the name of your app? It might be available in the Apple app store, but what about for Blackberry and Android? If you ever want to branch out to those devices, you had better plan ahead.

Summary

The upgrade went well enough and I got a nice new look with a unified infrastructure. Planning ahead for these upgrades was the real key to success, but next time I’ll try to do a better job of remembering to track all of the urls that need to move. Planning ahead for infrastructure upgrades is also an important concept for independent application producers, for both technical changes, such as changing SDKs, and for business changes, like selling an app to another company. I just wish that I made the these changes sooner.

I’m quite interested in learning the impact of different distribution channels on the bottom line.  Elegant Words was my first Web App and was a staff pick by Apple.  Since it was listed in the Apple directory, I’ve been continually impressed by the number of users funneled through there versus organic discovery.

openappmkt.com is a new distribution channel for webapps on iPhone. 30 minutes to push Elegant Words as test. http://bit.ly/ewOnOpenAppMktThu Aug 19 14:11:24 via web

We’ll see what happens here. The screen shots below got a little messed up, not sure why.

Oh, I need to add another 15 mins for this write up.

Elegant Words WebApp on Open App Market (Desktop View)

Elegant Words Listing from Phone

Elegant Words as Web App on Phone. Note to self: Fill blank spot on bottom

Screenshot Front

My New Front Screen

The iPhone 4 comes out on Thursday, and a few lucky folks have already gotten theirs. As a developer, I’ve been using the upgraded iOS4 operating system for a few weeks now (but I’m still waiting for my iPhone 4 to ship) and Apple is now allowing official reviews. So here is the only thing you need to know. The most useful feature of the new operating system is the addition of Folders. This is the one features that has impacted my day-to-day usage the most.

Now, I know everyone is excited about multi-tasking, which is cool. I added it to PowerNap and Nightlight, and am working on Time-to-Read, Meeting Timer, and Time-to-Eat, since they all have timers in them. I’m just added the first round of Retina-display graphics to Wallet Zero and added iAds to start recuperating some of my investment in that app. But, these features in my apps, and others, are not really that big of deal, compared to Folders. Those other features are simply nice improvements, but Folders have dramatically improved my daily iPhone experience.

Folders do a great job of letting me get to my apps and data faster. I can now put every app I need on the first three pages, making most of them about two away, or, at most, two taps and two swipes. That isn’t bad. Since I group apps by activity, like news sites that I read regularly, then they are typically only one tap away as I switch from one app in the group onto the next app. It is good enough that I now prefer reading on my iPhone over reading on my iPad, simply because my iPad is tending to get a little cluttered.

Folders also makes it way easier to share my phone with kids. My seven year old son hoards games, which tends to scatter icons over several screens, but I can now tell him, “These last three screens are yours, the rest are mine,” and have it work out fairly well.

iPhone screenshot

Lots of games

So, what does this mean for the independent application publisher? This brings into focus the concept of app refinement. For apps, the devil is in the details, and little refinements that impact workflow create a big payoff in user experience. From a technology perspective, folders just are not that big of a deal, but it makes everyday tasks, like finding my app, more pleasant, more refined. Your app might have the coolest technology in the world, but those ‘hard-to-do’ things are not necessarily the most important. So pay attention to how people use your app and focus on adding refinements that improve their user experience. Sometimes the biggest payoffs are the easiest to do.

The Old Schoolhouse

I recently had my 10 year business school reunion. Being the business nerds we are, we had additional classes. Here are some thoughts from one of those:

Behavior Finance by Professor Malcolm Baker

From the session summary:
“At the foundation of finance theory is the idea that investors and managers act rationally… behavioral finance proposes a broader role for social, cognitive, and emotional biases”

Think of it as a bridge between psychology and economics. Economists, basically, work to find the underlying models that best describe how we make decisions in our lives. They don’t believe that we actually do complex math when deciding whether to buy the Tall vs. Grande, but they say, that on average, we all behave as if we were actually doing the the math. Do you wake up and think about your “Expected Utility”? You act like it. Psychologists focus more upon the times when individual act against their best interests. In other words, when their emotions or biases make them behave against the economists model. The press likes to point out the gap between the economists and psychologists, but it isn’t as wide as they paint.

One Hour Crash Course on Behavior Finance


Modified Kaynes Quote:

If you owe your your bank a hundred dollars, you have problem, but if you owe bank a billion dollars, the bank has a problem.

The market can stay irrational longer than you can stay solvent.

So are people rational? Here are a couple of possible observations and possible ways of answers:

* No, but this is the basis for our intuition.
* So ask yourself, do most homebuyers have good intuition for ARMs when buying a home?
Well, maybe. By metaphor, think about the expert pool/billiards player. He plays as if he were an expert in physics, but he isn’t. Economists like to work on the physics problems of billiards. Psychologists like to focus on the time when he chokes if he isn’t wearing he lucky socks.

* No, but we delegate this process to advisers, that do act rationally.
Should you delegate the deicsion to advisers? Imagine that you are thinking about buying a house. Your banks will push you buy, your agent will push you to buy, everyone but maybe your fianancial advisor will push you to buy. My wife and I recently bought a house a house and, apparently easily qualified for a mortgage (this is after the recent financial crisis). Now, the kicker is that the bank didn’t know about some additional income that I used to calculate our budget, because it wasn’t part of a salary. As far as our advisors knew, they were putting us into a house that we simply couldn’t afford, and they were doing this even after the recent financial crisis – so you can not trust your advisors when their interests are conflicted.

* No, but this is the way “smart money” makes decisions.
Do the capital markets price these correctly?

Framing matters:
So, when asked, people will have very different answer to a question when it is just framed differently.
So, imagine the following scenario: Given the recent H1N1 outbreak, which course of treatment, if you were the president, would you take:
Framing One Way:
*Option 1) A treatment where 400,000 people out of 1M will die, or 38%
*Option 2) 1/3 chance that no one will die and 2/3 chance that all 600,000 will die: 62%

Framing another way:
* Option 1) 200,000 people will be saved: 62%
* Option 2) 1/3 chance that 600,000 people will be saved, and 2/3 chance 400,000 will be saved: 38%

When a two groups of students where asked their recommended course of action, the percent of students that chose Option 1 when the question was framed the first exactly matched the percent of students that chose Option 2 when the question was framed the second way. Now, if you look at the two framings, they both represent the exact same outcomes, so there is no logical reason for the percentages to flip – it is just how it is presented.

Saturday Galla at Boston Public Library

So, how can we apply these insights into human nature to software development?

I would argue that this is important to software development in a couple of ways, namely for project management, technical risk assessment, and marketing.

Project Management:
Programmers are notorious for over-estimating their own productivity. When asked to estimate how long feature X will take to build, they will routinely be off by several hundred percent. Granted, often with good reason. Sometimes management changes the spec because managers greatly over-estimate their own ability to deliver a perfect and unchanging spec.. Sometimes more urgent project cause frequent interruptions, seriously undermining concentration and flow.

Framing: I’ve observed that when I have freelancers bid on a project, the price is quite different between when I am vague, but still accurate, and when I specify, in detail, the project details. The estimated price increases significantly by bidders by several hundred percent, even though, the detailed spec actually significantly lowers bidding risk.

Category framing: effort to do the project vs. the effort to do each identifiable effort.
When a bunch of students, about 160 of them, where asked to estimate what the temperates would be during March and April, they would artificially group their answers in large chunks according to the month instead of thinking about the pretty smooth change in weather between each day.

First Group: March 12th: 37.5F, March 24: 39.0 ( a 1.5F change over 12 days – but within same month).
Second group: March 24.5F, April 5, 48.8 (an insanely high 24.3 degree increase during 12 days, but the this last date they were asked to estimate was in a ‘hot’ month – so they cranked their estimates up to 11!)

Take away: the march / april barrier caused the estimators to pool their answers into two distinct groups instead of thinking about the answers as lying on a continuous scale, which they clearly were. People think about stuff in large categories, not on a continuous or high-resolution scale. For software developers, this makes us, I think, underestimate the work in involved for poorly specified projects and over-estimate the involved in well specified projects. I’ve observed this several times when outsources projects to freelancers. When I’m sort of vague, but accurate, about a project, the prices seem sort of low. When super well specified, the price for the same project inflates greatly. Unscrupulous Publishers might be able to take advantage of naive freelancers and consultants, and vice versa. Basically, be aware, and act accordingly, to avoid all around pain.

Self worth bias (most people think that they are above average): Time for somebody to do a project = 2X, time for me to do a project = 1X. How much should I be paid to do that project if I charge a fixed fee? What if I charge per hour? What is my hourly rate? What has my hourly rate actually been. Let’s call the Implied Rate the hourly wage calculated by taking the total project cost divided by how many hours a project took. I guess we figure there is no reason to track our time if we aren’t charging by the hour. In my experience, we programmers show a large internal inconsistency in our proclaimed hourly rate depending upon how the project is setup, hourly vs. flat fee, and we don’t go back to calculated our implied rate, even when taking things into considerations such as payment risk, self insurance, etc.

So, what can do about this?
Well, I’m certainly not in a position to fix the whole software development lifecycle problem, but I feel like I can suggest a couple of courses of action.
1 – Track your hours, even when working on own projects or flat-fee projects
2 – After every project, conduct a post-mortem to analyze why the project went off schedule (they all go off schedule)
3 – Develop and grow your own well-vetted library of software components to minimize custom develop of technology. Keep the custom development, and thus the schedule risk, to just the new business logic of the project.
4 – Do mockups to vet with the customer/stakeholders what, precisely, needs to be built before the code starts flying. Fixing mistakes in the design phase, as we know, is ten times cheaper than fixing them after coded.
5 – Well, I could go on.

I’m working on a new client project and I’m trying hard to apply these principles, but it isn’t easy. My client gave me a great spec, and I’m working on turning that into a working mock-up, to work out some previously unforeseen UI issues. I’m also refining my own library with an eye towards workflow. This might be a long process, but, in the long run, well worth it.

Further Reading
Books: Nudge, The upside of irrationality, Animal Spirit, Predictably Irrational
I haven’t read this yet, but it was referenced in the talk.

Video: Nova: Mind Over Money
This was my first introduction to modern Behavioral Finance. Really an easy way to quickly grasp the whole field. Recommended.

Innumeracy: Mathematical Illiteracy and Its Consequences (Maybe a stretch, but I really liked this when I first read it. It was a hit in its day but seems to have since faded.