a glob of nerdishness

July 2, 2011

Parting questions for PalmHP

written by natevw @ 2:51 pm

To be clear, I LIKE webOS and want it to succeed. :/
Steven Frank, 2011 July 1

One of my first memories of Palm’s new “New Palm” thing was when they were in the papers every month for making their first webOS device pretend to be an iPod. For USB syncing purposes. Clever way to get some free advertising from MacRumors, but you know what? I hate what iTunes has become and loved being able to just drag and drop MP3 files onto my Palm Pre 2.

Anyone wanna buy a Palm Pre 2?

I tried to love it, just like how for years I’d been trying to love the heavy, bulky reel mower I also bought online. It’s good for the ecosystem, it’s got some very very nice qualities designed into it…

I’ve decided I don’t like either the lawnmower or the smartphone. And while I don’t need perfect landscaping in an efficient amount of time or energy, with greater responsibility at work comes greater need to join the same technological century as the rest of the world. Even though I’ve owned a Palm Pre 2 since last December, it’s never felt okay nor have I had room for it on my person. Thus it was not until this week that I became a cellphone person.

More honestly: I am now an iPhone people. It seems like such a silly insignificant change to go from having an iPod touch always in my pocket to an iPhone always in my pocket, but for me it is a defeat.

When something fails I wanna know why. So here are some poignant, probing questions that will magically make Palm/HP awesome again:Good questions are hard please read the following rants instead:

  • what’s with the HP logo when my phone reboots? The original palm wordmark was a reserved, artistic logo. The new .(h|p)*…thing is a glowing gradient of a corporate wart that only calls all the nice things the Palm people have said about their acquisition into question.
  • for example. why is “http://h41112.www4.hp.com/promo/webos/us/en/smartphones/pre3.html” the URL for the Palm Pre 3 (and why is it down while I’m trying to gather info for this post?)
  • why is the Palm Pre 3 still only [no worky web page, no getty authoritative tech specs...] X millimeters “thin”-ner than the mainframe computer I am typing this on?
  • why does it still have a stupid slidey keyboard thing that I could never shake the feeling would remain in my pocket when I accidentally pulled out only the other half?
  • why, after I really really really wanted to love my Palm Pre 2 but couldn’t, am I now completely uninterested in any incremental non-improvement you’ve not really made at all since then? Since the very first Pre?!
  • I know HP used to be a great company and all, but can you please just license the poor operating system that still somehow shows the most spectacular promise of being potentially both usable and open, try taking it and licensing it to a company that might actually be capable of combining it with some decent hardware before it’s too late?
  • and also: I said “potentially spectacular” operating system, not “actually spectacular”. Pls to put a hard-driving perfectionist in charge of software. No more Mr. Nice People, otherwise only Mr. Nice People will be able to say Mr. Nice Things about the promising prototype-grade rubbish you keep. shipping.
  • Buying an iPhone was a defeat because now i’mStuck with iCloud instead of a Synergy plugin that could talk to data on a server I control. Now i’mStuck with iStore monopolies instead of your fun official instructions for owning the device I bought. Now i’mStuck with the same iPhone that everyone else and their soccer mothers all sport like a luxury item because a truly useful phone still is — and it’s cheaper than yours!

    But the saddest thing about it all is that this sticks me with an even better web browser — w00t! — than I got on a platform called webOS. So even while Apple keeps shoving native adults into a sandbox, they’ve also been pushing web technologies up towards where I suspect native vs. web will meet: the same amount of power, but on the latter: the freedom to innovate that only a real platform can provide.

    The web is the only tool developers have left. I feel defeated because it’s not thriving as or even on anyone else’s operating system and I don’t know what that means.

    May 7, 2010

    Multitouch usability

    written by natevw @ 9:15 pm

    An interesting comparison of the iPad to the Kindle with respect to accidental button pressing reminded me to share some observations and a link about the “naturalness” of multitouch gestures.

    I let Tobias hold my iPod touch occasionally. He’s at the age where flipping it back to front and back is plenty fun and his curiosity is mostly towards how it might taste. He’s not very interested in interacting with it, but I think he could be if it were a little closer to his normal experience.

    Tobias holding an iPod touch

    Of course, with the glass screen he feels no relevant tactile feedback. So there’s a significant abstraction right up front. Furthermore, since my iPod is the first model, it doesn’t have a speaker for regular apps to use. So he rarely hears audio feedback. But the issue that I noticed most is that, typically, he doesn’t even get to see any visual feedback. The touch gesture he is paying attention to simply doesn’t work.

    Since Tobias can’t “palm” the iPod (he just turned ten months old) he’s typically got one thumb smeared across the screen just to hold it. In this situation, most software just ignores the actual touching of his free hand [okay, it's more like slapping, but...]. Software that does handle multitouch often fills its corners with hot areas that activate settings instead, which is even less interesting than interface he might otherwise start figuring out.

    I don’t entirely fault the software; most of it is designed well for adults or at least children who can talk and follow verbal instructions. It’s just been food for thought, making me even more embarrassed that Sesamouse (my utility for enabling real multitouch gestures on the desktop via a Magic Mouse) doesn’t even recognize gestures when they start in the top part of the mouse.

    Multitouch is still a new field to most developers, and gesture recognition is not without challenge. I suspect that as more designers and more programmers are given more time to use and think about handling multiple fingers through multiple frames, multitouch software will become more sophisticated. Not in the “draw a squiggle with your index finger while tapping your pinky up and down” sense (as even many simpler gestures are neither intuitive nor discoverable) but in the “it just works” sense.

    January 29, 2010

    A story NOT about iBooks.app

    written by natevw @ 10:35 am

    Some fellow perfects the bound book. He threatens to have drawn and quartered anyone who tries to make a similarly improved book. Then he says to the writers, “If I like what you write, I’ll bind it as one of my books and give you most of the profits.”

    Some experienced writers say, “Silly books, clay tablets are so much better at knocking sense into people. Part ye from my paddock, fellow!”

    But this man’s books are very well made. And so long as you don’t write a sequel to one of his own stories, or speak against his friend the mayor, you can make a good bit of money writing bound books. Most writers respond, “Books are clearly the future, and look how good they are for the readers!”

    But there’s this other crowd. They’re not really writers, because they spend most of their time patting themselves on the back and talking about politics and how the future isn’t clay tablets or bound books, because papyrus scales so much better. Some of them are stitching their scrolls together so they can be read kind of like books. These scroll-books are a bit awkward to page through, but you can read them in any library branch and even sign some of them out for a few weeks.

    Now the interesting part of this story is that scrolls and, by extension, scroll-books can actually be used on clay tablets and between any sort of book cover, including our book-binding fellow’s. The analogy is falling apart now, so I’ll finish explaining my previous post more directly.

    No cheap, flimsy Chrome OS netbook will have more necessary features or be more pleasant to use than the iPad. I am also sure that native, platform-specific applications will always be superior to web-apps. What I am saying is this: until we can develop native iPhone/iPod/iPad/iPony applications with our First Amendment rights intact, making “native Chrome OS applications” (i.e., web apps) is the only way to publish independent software for Apple’s newest and best devices.

    January 28, 2010

    A Gradual Divestment

    written by natevw @ 10:13 pm

    I’ve been thinking about the last two years’ investment on a number of levels. Regarding the platform I chose, I’ve been struggling to find the right words for several months. I came across them today, at the end of a dead-on post by Alex Payne:

    Wherever we stand in digital history, the iPad leaves me with the feeling that Apple’s interests and values going forward are deeply divergent from my own.

    I’m most energetic while inventing a self-contained tool to improve some aspect of life. Writing native software for OS X was a dream come true. I hope the Mac’s open platform has many good years left, but it’s time I learn to enjoy building native software for Chrome OS as well.

    September 22, 2009

    Be careful when using Uniform Type Identifiers

    written by natevw @ 6:14 pm

    Someone posted a lengthy article today (here, and cross-posted here) claiming that even though Snow Leopard ignores creator codes, applications can use Uniform Type Identifiers to match a file in a generic format to a specific editor. As far as I can tell, someone is wrong on the internet.

    There are two potential problems with expecting UTIs to take the place of creator codes as the article claims. The first is that applications are not encouraged to make their own app-specific UTI if one already exists. Consider the case of a JPEG file, which is a common format that many apps can open. With creator codes, an app that creates a JPEG file could make it easy for the user to re-open it later in the same app by setting its creator code. In common practice, an application would just be using the predefined “public.jpeg” UTI when dealing with JPEG files, instead of an app-specific code, as Apple had never encouraged otherwise.

    Using an application-specific UTI even when a predefined one exists is a clever idea. Update: no it’s not. Doing so would mean no other app could open your app’s files. That would be bad, too. Or it would be, if not for the second problem. A file’s UTI is determined by Launch Services, and there isn’t a good way for an app to set one itself. (I would love to be wrong on this!) When Launch Services needs to know a file’s UTI, it looks at the file’s extension and picks just one of potentially many matching system and application defined UTIs.

    Launch Services’ behavior in this regard is no better than file extensions. It’s worse, in fact. Consider a “.log” file: This common extension could be used for a system log, an application history, a GPS tracklog or any number of file types. If an application lets a user open any file with the “log” extension, it will be able to open its own files just fine. If, on the other hand, an application wants to use the new, shiny, recommend UTI system and offers to open files with UTIs of “com.example.tracklog” instead, it sets itself up for failure. If Launch Services has decided that the “.log” extension means “public.systemlog”, all .log files will have that type and the user won’t even be able to open a file from within our tracklog application itself.

    Uniform Type Identifiers are a neat concept, and I recommend you use them. They do offer many advantages, including the potential to eventually replace creator codes in a future version of OS X. But you must use them with care. The main pitfall is Launch Services. You can use UTIs and UTI concepts so long as you always keep in mind that a file may have a completely different UTI on a user’s machine than it does on yours. When creating an open dialog, include the extensions you may be able to open in addition to UTIs. When defining a document type in your Info.plist, use the old (deprecated!?) CFBundleTypeExtensions instead of LSItemContentTypes. Otherwise, another application on your user’s system could end up overriding your extension’s UTI and your application will be unable to open its own files.

    Launch Services should really report a different UTI based on which application is requesting a file’s type, or report a set of all potentially matching UTIs instead. This would affect some file-handling parts of the Cocoa framework as well. I reported this problem with the current way file UTIs are assigned in rdar://problem/6590416 this past February. I hope it can be fixed, because Uniform Type Identifiers are a win in the long run.

    March 16, 2009

    Avoiding perfection?

    written by natevw @ 8:08 pm

    I tend to let perfectionism get in the way of progress in my software development. This can happen on many levels:

    • coding *too* carefully, not leaving any time to write tests or leave good notes
    • delaying new code to overdo structure, even though refactoring is always inevitable (and usually fun!)
    • overplanning an architecture, in ignorance of all the problems it will *actually* have to solve
    • constantly trying to re-”decide” if a product is worthwhile, instead of seeing what users think
    • worrying about mastery in a given domain, before even setting foot in it

    This isn’t to say that I don’t try to do my best at all levels. It’s to say that time spent practicing — time spent making mistakes and learning from them — is rarely time wasted. Sometimes I catch myself spending as much time trying to make the best decision as it would take to actually try one good option or another. Other times I don’t catch myself!

    Is perfect the enemy of better? Grace is someone willing to pay for my mistakes themselves. I see many of my weaknesses as a programmer and designer, I know there are more I don’t see, and I’m not proud of any of them. My pride ends up working against itself, though. There is just enough grace in the world for me to waste time not making mistakes when I should be making things better.

    April 30, 2008

    Version Control

    written by natevw @ 2:43 pm

    There was never any question that I was going to use a version control system for this year’s development work. The question is, which one?

    Obviously, CVS is out. I’d rather use plain old RCS. Xcode does have nice Subversion integration, and Apple’s development tools are pretty good at working around its precious .svn litter. However, with a lot of development work happening on my laptop now, the server ball-and-chain is very unappealing. (Not to mention that in lieu of a real backup plan, my server was getting powered down and hidden just about every time we left our rental unattended.) Even some of Subversion’s own developers have bravely and frankly admitted that Subversion is not the future of version control, at least not for developers who have any choice in the matter.

    After playing around with a couple of the modern alternatives, I’ve definitely caught the Distributed Version Control bug myself. Other folks have explained DVCS better, and given a number of reasons [pdf] for it. I’m addicted for two simple reasons: it’s light, and it works offline. Making a repository is as burdenless as creating a directory, and I don’t need to be at home for the utilities to work.

    The question remains: which utility? I quickly narrowed my choice down to Bazaar and Mercurial, but was then at an impasse. (Git was out from the get-go. There are some brilliant minds behind it, but that’s also a shortcoming. I’ve got better things to do than comprehend the brainchild of hard-core Linux hackers, and they apparently have better things to do than support their mess on the other two major operating systems.)

    Mercurial has some cool features which I don’t claim to fully understand, like the Mercurial Queues patch management system. There’s a few things that seem strange (like the CVSesque lack of versioned directories) but in practice things like don’t usually come up. I know of at least one other Mac developer who chose Mercurial over Bazaar. I like Bazaar’s clean command line and its clean website, and how it rarely needs me to fiddle with its configuration files. I’ve joined the #bzr chat on IRC a couple of times, and the folks there are friendly, helpful and focused.

    I had told myself originally that I would just use Mercurial, but in the course of playing with them both I ended up accidentally using Bazaar for my original prototype. As I was liking Bazaar anyway, I decided to stick with it for code and have been happily using it for months now. I did start using Mercurial for something else lately, and found myself annoyed at all the manual configuration file tweaking it made me do versus Bazaar, and in the process was reminded how much less polished going to the Mercurial site for documentation feels.

    If you’re having trouble choosing between Bazaar and Mercurial, the best advice I have is a coin. You can even bias it before flipping! Overall, they are both excellent choices for a developer who mostly wants to code. To be honest, that’s kind of a shame. It seems like Mercurial has hit a sweet spot for developers who know better than to try reconfiguring their minds for enjoyment of the heroic git, yet do want something they get to wrestle with a little. I’m happy for the Mercurial team, but would hate for what Bazaar represents to lose out.

    As a Bazaar fan, I really enjoy its usability and polish, yet I so often see “Mercurial or git” as if they were the two options from Subversion. It feels like I’m the underdog with a Macintosh in the 1990s, hearing someone say that they’re “deciding between Windows or Linux”. I do have confidence that even if Bazaar doesn’t have an “OS X” in its future, it is popular enough that I will be able to migrate should the need arise. The Bazaar and Mercurial teams are on good terms, perhaps they will eventually find a way to pool their mindshare against the lead dog. Until then, it looks to be an interesting race!

    April 25, 2008

    Debugging Universal applications in Rosetta

    written by natevw @ 11:02 am

    Apple have a guide on debugging PowerPC binaries on an Intel-based Macintosh. Unfortunately, those instructions do not work if the application is a Universal Binary.

    If Xcode’s build settings dialog hadn’t gone from kinda bad to utterly screwy, it might have been easiest just to temporarily edit your application target’s build settings to build just ppc. As an alternative, you can use the following steps to debug the PPC code of a Universal binary on an Intel Mac:

    1. First, make sure your Debug version of your application’s target is set to include the ppc architecture. It may be set to just the “Native Architecture” to speed up normal debug builds.
    2. You will need the OAH_GDB environment variable set. In bash, use: export OAH_GDB=YES.
    3. Instead of running your application directly as Apple’s reference states, use /usr/libexec/oah/translate /<path>/<your_application>.app/Contents/MacOS/<your_application> from the shell in which you set the OAH_GDB flag.
    4. Open another terminal tab and start gdb using gdb --oah.
    5. Instead of attaching to <your_application>, you will need to attach to the “translate” process that’s running your app. GDB may autocomplete the whole thing if you press Tab after typing just “attach “.
    6. Now use gdb’s c command to Continue (or start, in this case) execution. Prepare for extremely slow execution, since your app is running under both Rosetta and the debugger.

    Note that only the odd numbered steps, especially steps 3 and 5, differ from Apple’s instructions. Since it’s a Universal Binary, you have to force PPC behaviour by manually starting your application in the Rosetta translator.

    Whichever method (compiling ppc-only or running via translate) you like better, you will likely want to load your app’s symbols with the gdb command symbol-file /<path>/<your_application>.app/Contents/MacOS/<your_application>. If you’re like me and generally inept with raw gdb, you may find the tips and links Apple’s Using GDB for Testing article to be a good starting guide for learning your way around gdb. There are some caveats to debugging under Rosetta mentioned in the first Apple guide, especially that you can’t call functions. Of course, I didn’t realize that was even possible, so I guess I’ll have to try that when I’m debugging normally sometime!

    January 10, 2008

    Playing with Mail and Leopard’s Latent Semantic Mapping

    written by natevw @ 6:35 pm

    While clearing Mail.app’s junk mail folder, I might have accidentally deleted a non-spam message. I’ll never know for sure, but as a result I learned a bit more about Leopard’s cool new Latent Semantic Analysis framework that I’d been wondering about since the mailing list leaked back in November.

    Mail stores its spam information in ~/Library/Mail/LSMMap2. In addition to the Latent Semantic Mapping framework, Apple also provides lsm, a command line utility that provides the same functionality (with a little better documentation, I might add). As described in the man page, you can use lsm dump ~/Library/Mail/LSMMap2 to get a list of all the words that Mail’s spam filter knows about. (Some words probably NSFW, of course!) The first column is how many times the word has appeared in a “Not Junk” message, and the second is the count in spam messages. The last line gives a few overall statistics: how many zeroe values there were versus total values, and a “Max Run” value I don’t understand.

    Between this and CFStringTokenizer and its language-guessing coolness, Leopard provides some fun tools for playing around with text analysis. Hopefully someday I’ll have a bit more time to dig into it.

    Until then (or rather, for my future reference), here’s a bit more information on Latent Semantic Analysis: how it works and how it differs from Bayesian classification.

    I’ve also uploaded a really quick and dirty “playground” for testing out the hypotheses the documentation left me with: lsmtest.m

    Update: Came across a more “explainy” article about both Mail and Latent Semantic Analysis over on macdevcenter.com.

    September 15, 2007

    [widget setPreference: for:] is not JavaScript!

    written by natevw @ 12:08 pm

    Widgets can get and set persistent preferences without much hassle. It’s as easy as calling widget.preferenceForKey(key), which will return the value set for the key.

    However, sometimes this doesn’t seem to work, because the developer swapped the arguments when setting. The correct order widget.setPreferenceForKey(value, key) is swapped from, say, element.setAttribute(name,value). This one has gotten me way too many times when developing Dashboard widgets.

    How did this bizarre ordering come about? I’m guessing it’s because the widget object is actually written as an Objective-C plugin and the developers felt obligated to make the method idiomatic in that language: (void)setPreference:(NSString*)value forKey:(NSString*)key. But the function name is rewritten between Obj-C and JS anyway — I wish they could have broken the idiom a bit and used (void)setPreference:(NSString*)key toValue:(NSString*)value as the method signature, for the sake of the end users.

    (Updated to fix method names from original post.)

    Next Page »