Droooooooid!

Okay, so I’m not rocking a Moto Droid, but I am now rocking an HTC Desire Z.  The wifey helped to make this happen so thanks go out to her.

It’s currently 2:47AM so this will be short to begin with; I’ll have to come back later to flesh out this post a little more.

First impressions:

  • I will not be rocking CM6.1 or CM7 (?) on this device.  As it turns out, HTC Sense is cooler than I thought, and it’s a more polished experience than standard Android.  Yes, I realize that this places me at the mercy of HTC/Bell to feed any potential update craving that may arise in the future, but for now I’m willing to live with that
  • The screen is beautfil.  Nuff said.
  • Hinge isn’t the snappiest but I can definitely live with it.
  • It’s really nice to have a phone that actually hangs up when I tell it to (and not a few seconds later – Touch Pro, here’s looking at you kid)
  • It’s a little weird going into so many apps and just… leaving them to go elsewhere.  I could do this with the Touch Pro as well, but given the speed of that device it wasn’t often that I’d go into 6-7 apps in one sitting.  Perhaps it’s the new-car-small of the Z that’s got me bouncing around in apps (particularly as I’m still trying to get the thing setup to my liking).  However, I will say that some apps do seem to restart when you go back to them, and that’s definitely weird coming from WinMo, which would leave apps open until memory constraints forced them closed.  I don’t think I’ve hit any memory issues on the Z yet, so it may just be that Android is a little more aggressive in the task management department.
  • Battery life isn’t as good as the Touch Pro.  Again I’ll say that I’m using the device extensively in order to get it setup, and I have a feeling that two mail apps were trying to IMAP IDLE on my mail account – a consequence of not having my mail setup correctly yet.
  • I never thought I’d say this, but I like that I can link my local contacts to my Facebook contacts.  Having this integration – provided by HTC Sense – is nice, although I’m still adamant that I wouldn’t go so far as Windows Phone 7’s penchant for throwing Facebook photos into your local photo gallery.
  • L-O-V-E the way that the notification bar works.  Very cool to finally be able to see what a notification is  about without having to make any overt gestures or load the relevant app.
  • Maps on Android is AWESOME.  Especially Maps 5.0.  Check it out if you’re rocking an Android phone.

I’m sure there’s more, and they’ll come when I follow-up on this post.  It may be possible that many of these enhancements could be had on the WinMo platform, particularly considering that HTC Sense is available (indeed, was conceived) on Windows Mobile.  Still, the speed of my Touch Pro can’t compare with the Z, not to mention the screen resolution, vibrancy and size.  I will say that for now I prefer the layout of the hardware keyboard on the Touch Pro, but that could be a case of a year’s worth of familiarity with said keyboard.

One negative I noticed today – and I hope that this is was an isolated occurence – was trouble staying connected to the Bluetooth kit in the car.  I had problems like that on WinMo, where Bluetooth on the phone would actually turn off.  My solution was to write a native program and some Mortscript to force Bluetooth on whenever it inexplicably turned off.  Well, it seems that the Z’s Bluetooth is staying on, but the connection is dropping.  Will investigate more later.

Off to bed now.

Is it really that easy?

My last post may have started a trend… based on a conversation I had recently I’ve started thinking about more areas that could benefit from some forward progress.

My Whole Home Automation project is based in ASP Classic at present, with VBScript the language of choice on the backend.  This has necessarily meant some familiarity with (D)HTML, Javascript, and obviously VBScript itself – not to mention SQL for the DBMS interface.  I’ve never blinked an eyelash at the level of know-how required to get all of this stuff done.  If anything, I figured that it must be trivial in light of the move to ASP.Net and what I perceived to be a marked increase in code complexity to go along with the marked increase in features.

And perhaps I was half on the mark and half off of it.  Sure the code itself can be more complex than VBScript, what with inheritance and classes and all the other good stuff you get with an OO-capable language (C#).  But getting down and dirty to the point of making something functional?  Oh, that only requires that you’re good with a mouse.

It’s all down to the IDE, the Integrated Development Environment.  And I’m here watching an intro video on the asp.net site where it took something like 2-3 clicks to make a DBMS-linked table, complete with end-user editing functions.  It’s so easy, a monkey could do it.  So surely this code-warrior could too, right?

To be honest, I’m dismayed.  Though I shouldn’t be surprised.  A recent article in Wired talked about making programmers out of everybody – that having a good idea but no programming skills shouldn’t keep your idea from seeing the light of day.  The article seemed to suggest that the real innovation today is with the developers who are making these drop-dead-easy design tools a reality.

I suppose it’s just how this industry works.  What’s complex and out-of-reach for the masses today becomes a commodity in short order.  Just look at the Kinect and all of the functionality it has afforded, which was once the realm of big money and big brains.

It almost makes me reluctant to go the ASP.Net route, if only because it seems that it makes things *too* easy.  But it’s hard to argue with the notion of concentrating on ideas->reality rather than ideas->how?->reality.

Perhaps there’s hope for me in the Perl and/or PHP arena.  Ahh, LAMP, embrace me in your searing glow.

Fateful decisions

Fear not, there will be no dark foreboding here 🙂

I’ve made a couple of game-changing decisions recently.  One, is that Android is definitely in my smartphone future.  Two, is that UPnP is in my Home Automation future.

We’ll look at each decision in order.

Android

My PDA/Smartphone history started with Palm and has been mostly devoted to Windows Mobile.  Then, Microsoft decided that its mobile future lay in Windows Phone 7, thereby rendering Windows Mobile 6.x a parent-less drifter.  This isn’t entirely true, as they’ve pledged to support 6.x in the enterprise space; but for consumers, Windows Phone 7 rang the official death knell for WinMo 6.x.

I honestly can’t recall the timing, but around this time last year I decided that my TyTN wasn’t cutting it anymore and I sourced a used HTC Touch Pro, which I promptly upgraded with a WinMo 6.5 build.  It was never my intention to use this device for Many Years To Come(tm), but I think I was looking to get maybe two years out of the thing.

And, if push came to shove, I probably could deal with the software limitations.  But I’ve been getting increasingly frustrated of late over touch sensitivity, system lockups, speed… the gamut of issues that people typically cite when thumbing their noses at Windows Mobile.  Add to that the GPS that I’ve all but abandoned, since it seems almost impossible to get a lock these days.

It’s a crying shame, to be honest.  I don’t have money to be throwing around on phones, and I never want/wanted to be one of thoese people who buys a new phone every year.  I was either blindsided by Windows Phone 7, or didn’t take the threat seriously, but when that OS was announced and devices actually started shipping – well, my 2-year investment dead-ended rather quickly.

The larger problem is the dearth of development activity.  No reputable company is releasing WinMo apps anymore.  It goes without saying that iOS and Android are occupying the hearts and minds of mobile developers across the globe.  More accurately, Windows Mobile is on nary a developer’s lips.  So the gist is that I’m stuck with buggy/slow versions of mildly interesting software (Facebook, Twitter), and staples – like my software keyboard and UI shell – are frozen in time, bugs and all, and I’ve got to deal with said bugs every single day.

Don’t get me wrong.  When the software is running smoothly, it’s All Good(tm).  Unfortunately, I get hair-pullingly frustrated even after 2 or 3 soft resets in one day.  Nobody should have to reset their phone 2 or 3 times a day.  And then there’s the one thing, the most intrusive and dasterdly demon of them all – the resistive touchscreen.

Sure, pinch-to-zoom would be nice.  I can live without it – for now – but what I can’t live without is accurate touch response.  I’m sick and tired of trying to scroll but selecting an item instead, or trying to select an item but scrolling instead.  And this isn’t the sort of thing that happens, oh, once or twice a day.  It’s a regular occurence!  It’s so annoying that I toyed with the idea of writing a touch driver to smooth out inputs, but that’s a large undertaking whose value is severely lessened by the diminished attractiveness of the platform as a whole.

My recent foray into tablet research opened my eyes to the wondrous world that is a modern mobile OS.  Even Shelly’s Nokia E71 has outshined my Touch Pro since the moment her phone came into our house.  She has jokingly said to me – on more than one occasion – “It’s okay Deryk, you can have my phone”, as a result of my penchant for Getting Things Done(tm) on her phone quickly and easily.  The problem with her phone is that it’s not a touch device, and it’s not a slider.  Those things aside, she has nothing to be ashamed of for wielding that thing.

Although, she’s pined for an Android device herself.  I think she’s been starstruck by the touch experience in general, with all the whiz-bang animations and such.  But she’ll also put on her Practicality hat, and realize that nothing beats a hardware keyboard and numeric keypad when it comes to calling people and texting/emailing.  I can even navigate faster in Opera Mobile on her phone, with the D-Pad, than I can on my phone using touch or the D-Pad.

But I digress.  Being somebody who values functional technology, rather than having the latest and greatest (witness my T1i when the T2i was already out), I was rather impressed at how easy it is to get things done when using a modern mobile OS.  And there are two pieces to that particular puzzle: a capacitive screen and properly-tuned touch driver, and native apps that are constantly refined under the banner of getting things done easily and accurately.  My Touch Pro has neither of these things going for it, and it shows.

This culminated quite nicely (and shockingly) the other day when I realized that I don’t want to have to tweak my mobile phone anymore.  It should just do what I want, period.  I’ve never been big on custom wallpapers and ringtones – everything I’ve tweaked on my Touch Pro has been to make it useable, not to make it fancy.  I decided that I want my device to be useable from Day One(tm), and I want somebody out there working to make it useable throughout its useful life.

I also like a pure experience.  And it may surprise you to learn that, if I did get an Android phone, I’d either want to flash a stock, non-branded ROM – or install a credible custom ROM like CyanogenMod 6.1.  But really, that’s as far as I’d want to take it.  I thought I’d be able to do the same sort of thing with the Touch Pro and the Energy series of ROMs, but again – people are moving away from WinMo, certainly from the TouchPro.  Regardless, you can’t tweak away a resistive screen, or the other things that probably could be nailed down in time by the ROM developer but which won’t be nailed down by the ROM developer since nobody wants to develop for the platform anymore.

So why Android?  I played with a Windows Phone 7 device in the stores, but from the first set of leaked videos it was apparent to me that Windows Phone 7 would not be in my future.  I’m a developer at heart – and I have a very strong feeling that Android is the closest you can get to development/tinkering nirvana.  Windows Phone 7 is getting a very glossy treatment as a social, consumer device – just look at the supporting ads that are airing, citing the ability to get in and get out quickly.  But it’s a guided experience that I don’t care for.  I’m quite content to run a Facebook app when I want to see what’s going on on Facebook.  I would not be at all content to have Facebook’s crap smeared all over my phone in every nook and cranny.

And iPhone?  You should know how (un)impressed with the whole walled-garden approach in general.

Really, I probably would have skipped the Touch Pro and gone straight for a Milestone if not for a few reasons:

  • holding out for carrier promotional pricing (the Milestone never showed up on Rogers)
  • a preference for HTC hardware vs. Motorola hardware
  • wanting to see how dominant the Android platform became

Let’s face it though – what I’m really talking about is obsolescence.  And it’s true that every piece of consumer electronics out there is obsolete as soon as it hits the store shelves.  Wouldn’t it be the case that anything I got now – Android-based or otherwise – would suffer the same fate, and I’d find myself back here in a year?

I’m not entirely convinced of that.  I pride myself on having a particular set of criteria, and not compromising on that core set.  I’m not trying to chase the latest and greatest, I’m simply trying to get something that works for me.  I never believed that the Touch Pro would be my main phone for the forseeable future; rather, it is/was a stopgap since the TyTN couldn’t get my basic needs accomplished anymore.

Well as it happens, the Touch Pro now has certain limitations – some of which are inherent, like the finicky GPS and crappy camera – and others which only became apparent after trying to make the device do what I had envisioned it doing.  My expectation of the Touch Pro is that it’s finger-friendly, as this was one of the primary reasons why I sought to replace the TyTN.  And while the Touch Pro is more finger-friendly than the TyTN, it has become apparent – after a year of using it in a manner that the TyTN could not support – that a resistive touchscreen simply cannot get the job done.  This is not something I would have known implicitely from using the TyTN in this capacity, as the TyTN had other problems which restricted its finger-friendly usefulness.

Basically, the software and hardware of the Touch Pro was never designed for a seamless touch experience.  Even the latest versions of WinMo cannot make this claim, as the shell itself simply is not designed appropriately.  However, even a device like the HTC G1 – with a capacitive screen – has a leg up, despite its age.  And yes, you can flash CM6.1 to a G1 and have the latest Android kernel on your old device (well, the latest up to a few days ago, when 2.3 was released).  The hardware wouldn’t be as svelte as a G2, the camera not as nice, the processor not as speedy – but assuming you could live with those things, the fact of the matter is that you would not be left behind in the software world.

Yes, you have to consider things like available memory, and that’s something that you can never beat without investing in new hardware.  But for comparison, here it is that I’ve installed all my apps to the Touch Pro’s internal memory and I haven’t really had any memory issues to speak of.  I think it’s the case that most modern smartphones have way more memory available than you actually need – particularly somebody like me who is very adverse to storing media on my phone.

Ultimately, the undeniable truth here is that it’s time for me to switch platforms.  And I have to tell you, the prospect is exciting, if only because it means learning something new – and if you know me, you know that I like to learn.  I don’t often do an “out with the old, in with the new” paradigm shift, but when it happens it does make me quite giddy at the prospect of building a whole new suite of solutions that I simply could not do before.

Android is now mature, in my mind, and the hardware is at that point that I believe it could serve me adequately for the next three years.

UPnP

This is another doozy.  I’ve spent the last, what, 3-4 years (longer?) designing this Home Audio system and making incremental updates to the interface and backend. I had visions of a very dynamic interface with DHTML transitions galore and loads of AJAX.  And that’s admirable, but it’s time for more.

Again, this was partially spurred by my tablet research, and a major dislike of placing media – music, photos, videos – on any one particular device.  My belief is that those things should be “in the cloud” and accessed on demand.  Not the Google cloud, not the Amazon cloud – rather, my own personal cloud.

My approach has always been network-centric, where devices are simply clients to my network.  The Home Audio interface is an example of a project that encompasses both the network – the DBMS, the filesystem – and the client – the physical zones and SHOUTcast servers.  But it’s still closed in that you can’t take full advantage of the network unless you pass through the web interface first.

And for physical zones, this is fine.  For consuming media on tablets, not so fine.  But I don’t want to just throw a media server on my network and let it have at my filesystem.  One – that’s not very challenging.  Two – it sidesteps years of development work on my part, and it doesn’t allow any future development.

I realized the other day that my approach to my Home Audio setup may have been the Right One(tm).  It’s all HTTP-based.  It’s all database-driven.  A new media server would have to catalog my filesystem in its own native database in order to function.  Well, why reinvent the wheel?  Why throw away design and useability decisions that I’ve made?

In this modern age of standards, there’s no reason why I can’t take the work I’ve done and evolve it to support different types of clients.

That’s where UPnP comes in.

So my current design goals are to add UPnP support to my Home Audio system.  And by extension, this will actually allow my media to be consumed by a UPnP client device.  I can finally rip my movies to disk and play them on a wide array of devices.  I’m getting a little ahead of myself here, but even without a single UPnP client on my network today I can say that I firmly believe that this is the correct direction to go in.

Tablets – ready for (my) primetime? [updated 01/27/12]

I’ve heard a yearning for a tablet for a long time.  I made a (misguided) foray into the world of pen computers, scoring a used device on eBay some number of years ago.  Suffice it to say that that particular puppy hasn’t seen the light of day in some time.

The iPad is now all the rage.  And while I understand the allure of the device, and the particular niche it fulfills, the more I look at the iPad for my intended purpose the more I’m realizing that there are way too many shortcomings to even consider dropping $600+ on the thing.  And unfortunately, the same goes for the Samsung Galaxy Tab, the current champ in the non-Apple tablet world.

Here’s the thing.  I’m not looking for a device to carry around with me.  That’s what a smartphone is for.  Which isn’t to say that I wouldn’t want to travel with the tablet; rather, it would tend to “live” mostly at home.  So I’m not particularly adverse to the 10″ form factor; weight may be an issue, but if we’re talking solely about “portability” then there’s nothing wrong with 10″.

Now, I decided a long time ago that every portable device deserves a wireless connection.  I didn’t spend long with my Compaq iPAQ 3630 before an expansion sleeve and PCMCIA WiFi card were ordered.  Fortunately, any modern computing device worth its silicon has a myriad of wireless connectivity options – one of which is “3G”.  The carriers love to push this, as more 3G-toting users means more revenue.  But again, given that my intended use for a tablet is for home use, I’m pretty sure I can get by with WiFi – and tether to my smartphone whenever truly mobile connectivity is needed.

So what of these shortcomings?  I’m getting to that.  And in order to get to that, I have to talk about the fact that these devices are actually quite capable little devices.  The Tab, in particular, feels very powerful to me.  It screams “computer” much more than the iPad, and that’s not a bad thing.  It does its job so well, in fact, that I’m chomping at the bit to cram an Android smartphone into a pant pocket.  As a mobile platform, I must say that Android is getting it done quite nicely.

The iPad, on the other hand, still comes off as a large toy.  I just can’t shake the feeling.  Sure, you can run cool apps, but I’m not looking to run cool apps at home.  My home needs for a tablet are quite modest – surf the web, control my home automation systems, check email.  It really doesn’t have to get more complex than that.

And in that vein, the Tab also falls short.  Every time I pick up a Tab I feel like I should be putting it in my pocket and carrying it around with me for the entire day.  This is not a feeling I want to get from a device that’s supposed to live on the living room table.  I think that Samsung is intending the tab to be a mobile, portable device – but that’s not the niche that I want it to fill.

Then there are more tangible shortcomings – like the complete and utter lack of multi-user support.  Some of the coolest things you can do with the iPad and Tab come from using the native apps, which are the most pure reflections of what the manufacturer intended you to use the device for.  And some apps, like email, are very personal in nature – do I want some house guest to pick up my tablet and start reading my email?

And so… I’m conflicted.  On a few fronts.  I don’t like Apple’s walled garden, but I think I do like the 10″ form factor.  I like Android’s utility, but I don’t want/need my tablet to be that powerful.  So what am I saying, really?

One, is that none of the tablets on the market now are going to get the job done for me.  I mean, I’d take either one if I won it (though I’d probably sell the iPad), but there’s no way I’m paying $600+.

Two, is that I know what I need:

  • multi-touch interface
  • capacitive touchscreen
  • tabbed browser with Flash support

I think I’d like a capable built-in media player, but I do not want to store media on the device.  Not even pictures.  Any media should be streamed over the network  – perhaps using UPnP or DLNA.  And while I’m not adverse to accessing a marketplace and running other native/3rd-party apps, I think that this capability must go hand-in-hand with the some sort of fast-user-switching ala Windows XP Home.

Until these criteria are met, I may find myself sitting on the sidelines of the tablet game.

[update 2011/08/30]

Interesting article from Engadget, questioning the tablet’s position as a productivity device and the real necessity for a “third device”.  At this point I really wish I had scored a $99 TouchPad – not quite “taking one if I won it” that I mentioned above, but close enough.  Oh well, so it goes.  I figured I could move run an Android port on it as soon as that technical feat was accomplished.  Surely it wouldn’t be long, right?  But something strange happened when I played with a TouchPad in-store for 30 minutes or so, followed by a couple of Honeycomb tablets – I was far more impressed with WebOS than Honeycomb.  In fact, Honeycomb felt like the cross between a media device and a mobile computer that I alluded to earlier in this post, to the point that the promised functionality belied the limitations of the device (reported so well in that Engadget article).  I suppose that experience reaffirmed an earlier tweet I had made that WebOS on a tablet would be killer.  It’s unfortunate that software support will be lacking though; I did note some issues with the native web browser, and it’s very questionable how timely updates would come out (if at all) to address such issues.  If a port of Honeycomb or even Gingerbread ever surfaced for TouchPad, then certainly updates would be frequent – but again, Honeycomb felt like an entirely different beast, with WebOS wearing the tablet pants much better than Honeycomb.

So it seems that not much has changed.  My requirements still remain the same – multitouch with tabbed browsing and Flash support.  If anything, I’m now more convinced of the things that I don’t want – ie, a tablet with a complex interface.  Keep It Simple Stupid.

Even the multi-user conundrum has a workable solution on WebOS.  Firstly, I imagine that the only player who will solve this problem outright is Microsoft with Windows 8.  And I already know that such a tablet will be insanely expensive and too powerful for the light duty I’d want it to perform.  Secondly, a tablet’s increased real-estate means that visiting webpages is a very practical alternative to running the dedicated app (think Facebook, Gmail, etc).  Thirdly, I’m not of the mind that – even at $99 – it makes sense for a household to have multiple tablets for the sole purpose of casual usage; quite simply, it’s an unnecessary indulgence and a real distraction.

So how is the conundrum solved?  Whether through fast-user switching (ala Windows) or actively logging in/out, the fact is that a multi-user system requires a user to reauthenticate and “unlock” the device.  Now, if you’re working on a tablet that’s little more than a casual media consumption device, I can imagine that it’s enough to do this un/lock dance on a per-“app” basis.  And the ability to login and logout is something that every website application presents as a matter of course, but no native tablet app presents as a matter of course.  Many people are probably used to doing so within their web browsers.  So right there, the “requirement” to run the web version of your “productivity” apps – and crucially, the ability to do so on a generously-sized screen – means that you don’t have to worry about somebody sticking their nose into your private data.

But here’s where WebOS shines.  If I’ve got a video open on the family tablet, or a series of webpages – neither of which are “private” – then somebody else can pick up the tablet, stack my open apps, and open their own apps and webpages.  And so you end up with a shared user space, where each user’s resources are sitting in their own stack.  When I want to use the tablet and restore the state of my “apps”, I stack all other apps and unstack mine.  And finally, since we’re talking about a simple tablet here, I can imagine that each stack would only be a handful of cards deep – ie, very manageable for both user and system.  I certainly wouldn’t have 10-15 apps open simultaneously like I tend to do on a desktop computer.

I’ll say it – it’s unfortunate that TouchPad went from overpriced at $500 to unsupported at $100.  A happy medium may very well have been $150-200.  Here’s to hoping that WebOs lives on and that somebody picks up the hardware mantle.  Certainly everybody has seen that there’s demand for a non-iPad tablet at a lower price point?  It doesn’t have to compete with iPad; rather it just needs to fill the niche that the $99 fire-sale flushed out.

[update 2012/01/27]

Well well well

That may change things.

Back to where we came from

I’ve had a small, but noticeable problem with my home audio interface.

Yes, I’m well aware that I often seem to have small problems just begging for a resolution, but neglected nonetheless for some period of time until… a blog post is finally written.

Anyhow, this particular problem stems from the dynamic tables that are oh-so-cool in giving us super-long tables that are filled dynamically by the backend.  It’s somewhat of a good problem to have, in fact.

Here’s the deal.  You execute a search and you’re staring at your results.  Were you to press F5 now, you’d see the exact same page starting back at you (provided you hadn’t scrolled down at all).  This is the case because a search always refreshes the whole page, or more specifically, requests a new URL in the browser’s address bar.

That’s great and all, but then you decide that you want to sort on a different field.  So you do.  And because the table is dynamic, the sort occurs without refreshing the entire page.  Now, if you were to press F5, you’d be looking at the same search results but the original sort order would be restored.

The truth is that this situation still occurs today, and pretty much occurs in many DHTML apps unless you do some cool work to alleviate it (like I did at work, for a different but similar situation).  However, there’s more to the story.

Now, some links are smart enough to (essentially) ask the table about its condition and then make a request to the server based on the table’s answer.  So for example, if you click a link to add the results to a playlist, then the results will get added with the correct sort order.  And this could be done for every link on the page.

Except… they would have to become javascript links, vs. the straight HREF’s they are now.

Why does this matter?  Well let’s take allmusic.com as an example.  It used to be that some links – particularly those that were presented in list format – were javascript links.  If you attempted to open them in a new tab, well, any number of things could happen.  Recently allmusic made some changes and now many of their links are straight HREF’s, meaning you can open in a new window or new tab or whatever and it works as expected.

In our home audio interface we have the similar, occasional requirement of wanting to open a link in a new tab.  But if the link is a JS link, then you’ve got a problem.

It’s because of this that I decided that I didn’t want to present all of links as JS links.  But I still wanted to be able have the links reflect the state of the main table.

The solution I came up with is creative, though not the prettiest.

Basically, we leave the links as they are.  But, if the table changes for whatever reason, then we go out and explicitely rewrite links to reflect the changes.  This isn’t an ideal solution since it involves some overhead on the client.  But I can’t think of any other way to have regular HREF links which reflect changing properties elsewhere in the page.

So the act of initiating this update is fired by the table’s scroll handler.  I decided that this was the best place to start the update, as the scroll handler has the singular task of determing which rows/tiles are in the viewport and hence need to be brought in from the backend.  Recall that every time you scroll, it’s necessary to make sure that you’re actually looking at something.  This is the job of the scroll handler; he does some calculations, determines what should be there, then starts to calls to put those things “there”.  Since the scroll handler is so integral to the operation of our dynamic tables, I thought he should be the guy who starts the HREF updates.

Now, it’s entirely possible that there are hundreds, even thousands of links on a page at any point in time.  Fortunately, the majority of those links are contained in the scrolling table itself.  It’s on oversimplification, but I can say that those links are already aware of the state the table is in.

That leaves a handful of other links scattered around the interface.  Meaning, the actual process of updating those links is not particularly CPU intensive.  And I even have some nifty “process control” code that makes sure that only one update process can run at a time, and only the most recent one will run.

(fine, I’ll explain how it’s done.  The scroll handler starts the update process as an async process (using a JS timer).  It’s entirely possible that the scroll handler will fire again while the update process is still running – unlikely, but still possible.  So before an update process is started, a random process ID is generated and stored with the table’s other properties.  The update process is then “launched” and is told its process ID.  Once the update process starts to run (and while it’s running) it checks that the table’s record of the update process ID matches the processes own ID.  If there’s a mismatch – which will occur if a newer process is spawned – then the process halts and exits).

Anyhow, the end result is that a few things happen:

  • you can move to another page (zones, lists) and return to your browse results and the table will be positioned where you left it
  • you can resort your results, move to another page, then return to your browse results and the table will be positioned where you left it

Probably the only things that’s left, then, is to store the selections.  Sometimes you make some selections, but then you want to drill into a record and get more info.  This requires you to abandon your selections, or perhaps open the drill details in a new tab.  It would be nice, perhaps, if you could move around and not worry about your selections, knowing they will be there when you return to the browse results.  This is much harder to do though… I mean, there are ways around it using cookies, but I’m trying to avoid those methods.

A further refinement to occupant detection

Occupant detection has been working pretty well (for the surveillance system) but on occasion it’s had some hiccups.  These have been difficult to pin down to a particular cause/effect relationship, but I recently decided to take a step back and make some design decisions.

As things were written, the occupant detection code kind of hard one in the door and the other foot out of the door.  I say this, because the code still seemed to want to abide by a fixed schedule (to set the Home/Away macro states) but also rely on occupant detection to explicitely set these states.  And it dawned on me (much too late, perhaps) that this can cause unnecessary problems.

Conceptually, there’s really no need for a schedule if you’ve got an active, automated occupant detection system active.  There’s no need to set an explicit Home/Away state based on time-of-day or day-of-week, if the system is able to make a more representative determination of that state completely of its own accord.  And further, in the absence of a working detection solution (where that solution is present but broken for some reason) it makes more sense to default to an Away state – a sort of failsafe, if you will.

So my schedule pretty much said to set the system to Away at all times, and the occupant detection would override this.  But the thing is, we were bridging two worlds – there’s the detection world, which consists of occupant detection and also surveillance events.  Then there’s the notification world, which decides which events should lead to an administrative notification.  And the mechanism to pass state changes between these two worlds… well, rife with odd bugs.

So instead of chasing down these bugs – which is about as much fun as getting standardized web code to work in Internet Explorer – I decided that it made much more sense for the notification world to always believe itself to be in an Away state, while the detection/surveillance world would change based on occupant state.   Then, the notification world only has to query the detection world to see if anybody is home when an event occurs.

You might be wondering – if occupant detection and surveillance exist in the same world, why do we ever get to the point where the notification world needs to check in again with detection?  Why can’t detection tell surveillance to stop when it determines that occupants are Home?

The simplest answer is, again, conceptual.  The surveillance system is always active.  Even when we’re home, we want the system to start recording when it notices activity at the front door, for example.  We want that record to exist in case something odd happened.  And because surveillance is always active, notifications are always being generated.  The question is whether those notifications should be quenched.

So there it is then – the notification system has to query the detection system to see if occupants are home before a notification is sent.  If occupants are home, no notification is sent.   The surveillance event will still be recorded and archived, but no notification will be sent.  Then, if the detection system is in failure mode, the failsafe is that both worlds – detection/surveillance and notification – believe the entire system to be in Away mode, and a notification will be sent for every qualifying surveillance event.

This equates to a polling, or “pull” model.  The notification world has proven to be very stable, so in the current design we need an explicit “Home” result from the detection world before a notification is quenched.  And that’s the extent of the communications.  The surveillance world no longer attempts to push its state information to the notifications world.

So this approach has worked quite well over the last few days.  I’ll keep an eye on it, and of course I’ll be sure to report back here if something comes up 🙂

Collaborating a huge honking mess

Web 2.0 is nothing new.  Sites like Facebook and Flickr would not be half the sites they are today if not for the willingness of the masses to bring some semblance of order to the chaos.  Today we think of Web 2.0 and nobody bats an eyelash.

In some way, shape or twisted form, both Facebook and Flickr – and a host of  other Web 2.0 sites – are nothing but empty shells without the mass of user content that fills them.  Granted, Flickr’s initial mission was to bring order to the masses of images already on the web.  But there’s no denying that today, both services are intimately tied to user-generated content.

And it’s not enough to just amass content.  Google owes its bloated success to the very fact that it started off with a single focus in mind – bring order to the chaos.  Google itself has no content – that’s not entirely true, but when you think of its search engine and even its AdSense program, we’re talking about algorithms that sit atop the unfathomable amount of information out there on the Interwebs.  Whatever content Google has that it can call its own pales in comparison to the content on which it has built its business – content that’s not its own.

And that’s okay, because Google is good at what it does.  I like Google.  I don’t like Facebook.

Now, is it even right to put Google and Facebook in the same sentence?  One is a bonafied Web 2.0 company, the other isn’t.  And yet I believe that the answer is a resounding “YES!”, since Facebook is quite intent on becoming the most important thing to hit the Interwebs since… well, since Google.  Where Google crawls the Web and all of the loosely-connected content therein, Facebook is attempting to replace the content of the Web with the content within its own walled-garden.  Content created by the users, for the users.

Here’s the problem with Facebook.

People are not good at managing huge quantities of data.  We make spelling mistakes, we say “toMAYto” and “toMAHto” and mean the same thing, we say “bear” and “beer” and mean two different things.  One person sees a butterfly in an ink blot, another sees a unicorn.  Some of us are colorblind.  Some guys think Nicole Kidman is a knockout, others think her plastic is showing (I’ll take my N.K.  pre-“Peacemaker”, thank you very much).  20  people will watch Ali Velshi play with an iPad and record it, then post 20 different versions online of vastly differing quality and post individual links to each of their Youtube uploads.

In all of this, the single question is – who is correct?  Or, what’s the one right answer?

Who do we trust?  When Google attempts to bring order to chaos, it’s very simple – you either trust Google’s algorithm (and believe that Michelle Obama is a monkey – uh oh!) or you don’t.  It’s in Google’s best interest to keep their algorithm relevant and accurate.

Not so with Facebook.  Besides the ridiculous amount of information overload that comes with watching people try to one-up each other with the frequency of their status updates and wall posts, you also have the potential to see the same information repeated ad infinitum by a multitude of people (hello retweets!)  Logging into Facebook is like taking a trip down the rabbit hole, and getting out is harder than knocking the socks off of any Agent that the Wachowski brothers could ever dream up.

And then there’s the question of tagging.  Oh goodness, tagging.  Is that flower red, orange, or auburn?  Nuff said.

Before Web 2.0, we had IRC.  We had newsgroups.  My goodness, we even had Bulletin Board Systems.  Then we got Geocities, then MySpace, then Facebook.  I’m sure I’m missing some stuff, but that’s secondary.  Of prime importance is that the only thing that’s really changed is how much free reign we’ve given people to paint the world in their own colours and shove it on your monitor.  Then we’ve asked a million other people to comment on it, tag it, link to it – then we called it “the future” and attempted to monetize it.

I’m not sure which adage is more suitable: “Too many chefs in the kitchen”, or “An infinite number of monkeys with typewriters…”

Understand that I’m not against user-generated content.  Rather, I’m against free-form, user-directed collaboration.  I mean, if you have some data that you want classified into one of five categories, by all means let the users have at it – as long as all of the information gets classified, there are no duplicates within the data, the categories are strictly defined, and the majority wins.  Anything less is a failed experiment.

Facebook, take heed.

Artists – What many names can do

(this title brought to courtesy of Beres Hammond, who’s “What One Dance Can Do” bubbled to the front when coming up with names for this post)

I’ve had a recurring problem ladies and gentlemen, in that artist names have been driving me crazy.

Here’s the situation.  An artist is named “artist”, and she publishes albums in this name.  Then the artist decides to change her name to “artois”, and publishes further names under this new name.  And so on and so forth.

The problem, then, is trying to determine which albums belong to a particular artist, regardless of pseudonym.  The problem can even crop up when, say, a gospel artist works with a choir and publishes an album with the choir’s name.  You want to give credit where credit is due, so the album artist field dutifully contains both the primary artist and the contributing choir.  But what happens when the artist publishes a solo album?

I’ve turned this one around in my mind for some time.  It becomes a problem when listing artists, in which case a single artist can be listed 2, 3, even 4 times.  Or when trying to browse an artist’s discography.

Part 1 of the solution was to introduce an “artist alias” field into the backend database, which is intended to contain the most recent pseudonym for that artist.  This isn’t the same as “TLC” vs. “Left Eye”; rather, it’s intended for people like “Puff Daddy”, aka “P. Diddy” aka “Puff Daddy” aka “P. Diddy and the Bad Boy Family”, etc.

OK, so we then had the ability to search on alias.  And the alias field is a calculated field, in that it will return the value of the artist field if the alias is empty.  Groovy.

However there was still the problem of listing and browsing.  You’d think that the artist alias would be enough, but you’d be wrong.  Take Bobby Valentino, aka Bobby V., aka Bobby Wilson.  I don’t believe he’s published any names under Bobby Wilson, yet that’s his current psuedonym (in this case, his real name).

Now, it would be fine – I think – to browse Bobby’s discography using nothing other than the Bobby Wilson alias.  However, we get into major problems when we want to see all songs where Bobby Wilson is the primary artist.  Those songs may exist on albums that are not Bobby Wilson albums at all – ie, soundtracks – or he may have still been going by Bobby Valentino at the time.

Basically, you’d need to search by all known aliases in those cases.

So after much consternation, I finally put together the code to make this happen.  Works a treat.  You have to take some care when putting together a manual search, as you have to understand exactly what it is you’re searching.  This is a fairly standard condition though, I think.  Otherwise, use the plethora of buttons and links which will do the heavy lifting for you.

While I was at it, I decided to tackle another dilemma: handling artist names that contain quotes.

Quotes are Bad News(tm) in the programming world.  You have to escape them, which isn’t bad.  But still, they can cause major problems.  Take the following example:

Give me all albums by Damian "Junion Gong" Marley, or by Lisa "Left Eye" Lopes.

Those are both valid artist pseudonyms.  And, if you construct the search with two artist fields OR’d together, you’re fine.

But in some cases – and this is true for our discography browsing code – you use a search specified like this:

artist is "Lisa "Left Eye" Lopes" or "Damian "Junior Gong" Marley"

There may be any number of reasons why you have to use this format versus the one above.  In my case it’s due to restrictions in the code and how parms are passed around.

Regardless, what you’ve got there are nested quotes.  And previously, my code would spit it out and give some unknown result.

No longer.  There are some basic assumptions that you can make:

  • a quote followed by a non-whitespace character is an opening quote
  • a quote followed by a whitespace character (or end-of-line) is a closing quote

There may be more, and more complexity, but you get the picture.  And indeed, these may be rules that you enforce rather than simply assume to be true.  With those rules in place, the code can now track nesting levels.  Escaping is another simple step away.

DP’s 2010 Gift-List

My my my… we haven’t been this early since 2006!

The only reason I’m posting so early is because Shelly recently (ie, yesterdy) asked me what I want for Christmas.  And although she bemoaned the traditionally high-roller nature of the items on this list, I calmly reminder her that all of these lists have featured items as cheap as a pair of socks.  And some even cheaper (again, 2006… not so good of a year?)

I also can’t believe that there was no list for 2009???  Very odd, that one.  Perhaps the arrival of a son was gift enough 🙂

Anyhow, time to reflect on things that have dropped off the list because they’ve been acquired by yours truly:

  • Canon EOS Rebel DSLR.  Yup, took the plunge and picked this up after it was on sale for $210 off.  Shelly thought it would have been a good idea to wait for Boxing Day sales, but in my books you can’t argue a 23% discount.  That, and having realized that Mr. Man (ie, the aforementioned son) is growing by leaps and bounds, I no longer wanted to let good photo opportunities pass by.
  • New laptop.  This news isn’t so new, but it was on the 2008 list.  Completeness, you know?

Okay, on to the good stuff!

(as always, this list is subject to change)

From previous lists, and in no particular order:

  • An electric toothbrush, with induction recharging.  Yes, I’m still using Mr. Whiny
  • Dress socks, assorted colors (including black) (no brown either, I picked these up recently – I guess that leaves blue..?)
  • White undershirts and vests
  • Winter scarf/scarves: black, grey, blue, brown… RECEIVED!!!
  • Casual and/or dress belts; last time I checked ye olde waist is in the 32-34 range

Staples:

  • Clothing (ask Shelly, she knows more about this than I do apparently).
  • Kicks (ie, sneaks… you know sneakers.  Again, ask Shelly.  Size 11 1/2 or 12).

New for 2010:

  • a 55mm-200+mm Canon EF-mount IS zoom lens.  This would have to fit a Canon EOS Rebel T1i (hence the EF mount).
  • A camera bag with shoulder strap, capable of holding an SLR camera w/ attached lens, plus one additional lens.  Nothing too huge, just large enough for the mentioned items – plus the obligatory (slim-) pockets for stuff like memory cards.
    [Edit: This is nice, in form if not in price]
  • Door-frame-mounted chin-up/exercise bar.  Shelly has a good idea what this is all about, so you bettah axe somebody.
  • A storage shed (!) for the backyard.  Hey, why not.  It would get used, trust me.
  • An Apple iPad.  Oh my goodness, did I just say that?  It’s not so much that I want an iPad – rather, it’s that I want a touch-optimized tablet.  The Win7-based bad boys are too $$$ and lame.  The Android guys are either too small (7″ and smaller) or have resistive touchscreens (blyech) or are running some 1.x variant of Android (too old).  Perhaps Google will have released Chromium OS by Christmas time, in which case a 10″ Chromium tablet with a capacitive touchscreen and WiFi (no 3G) would be purrfect.  ***NOTE*** – I’ve changed my mind on the 7″ Android tablet, after having done some reading on the Samsung Galaxy Tab.  I like it so much (in reviews) that I’d burn my Rogers Hardware Upgrade on it.  So ya, holla at ya boy if this gift fits your bill.
    I’ve since decided that a tablet will not work – but the HTC Desire Z certainly would! Unfortunately Rogers sucks large grapes re: worthwhile Android phones so I guess I’ll be holding on to my HUP for a little longer.  Somebody on the Interwebs suggested HUP’ing to an iPhone4 and selling it, which would then offset the cost of a no-contract Desire Z from Bell – but apparently i4’s aren’t selling so well…?  I dunno… if you have a Bell hardware upgrade that you have no use for, well, consider gift-wrapping it and sending it my way – I’ll slap some Benjamins on that bad boy and everybody’s happy! RECEIVED!!!
  • Some 1TB USB2.0 external hard drives, and a PCI USB 2.0 card.  I’ve given up on the TeraStation NAS, and I need the PCI card since my home server only supports USB 1.1. RECEIVED(1)!!!
  • An electric finish nailer (not pneumatic!).  Ideally, one that’s versatile enough for hardwood flooring as well as baseboards.  Otherwise, one that’s suitable for trim and general woodworking projects.  These things are plenty handy, I wish I had one.  A used unit from the Home Depot rental store would be just fine (hint – talk to somebody at a Home Depot rental store to get the 411 on these things)

Wifey say, wifey do: zone drag/drop active

I don’t really know what to say about the titles that I come up with.  I mean, they’re my ideas, so I can’t sit here and shake my head in disbelief or some mild form of pity.  But really, what the heck does this one mean?

Well, at least the second part is fairly self-explanatory – to a degree.  It’s now possible to drag-and-drop an album or song directly onto a zone while in the browse view.  The idea is that you can queue up – or begin playing – an album/song without going through the steps that previously existed (and still exist) to perform this apparently arduous task.

Yes – “apparently” – and this is where the first part of our interesting title is explained.  One day, a long long time ago, Shelly said that it really should be possible to drag-and-drop an album onto a zone.  I believe that I was in the midst of showing her the ability to drag-and-drop an album/song onto the working list and have the item added to the list.

I’m not sure what prompted her to make this suggestion.  The thing is, the drag/drop facility is only available on platforms that support dragging – like a laptop or desktop – and not at all on platforms like smartphones which have no concept of how to perform a drag/drop action.  And – you guessed it – Shelly users her smartphone to interact with the system.

Nevertheless, I said “yes ma’am” and eventually got to work.  And the fruits were fully realized today (well, a couple of days ago but polished a bit today) with code that makes Shelly’s suggestion a reality.  As I said, from the browse view, you can drag an album/song over the existing play icon, which will cause a popup to be dynamically created containing all of the zones.  Finish the drag/drop operation by dropping the album/song on one of these zones, et voila, Something Happens(tm).

That “something” is dependent on a few things.  For an unloaded/unlinked zone, the operation will always end with the zone being shown and playback started.  Depending on your prefs, you may be asked if you want the zone to be linked.

For a zone that is already linked, the operation will cause the dragged item to be added to the linked list.  You remain on the browse view, but there is a helpful popup that says “Added” just to confirm that, indeed, Something Was Done(tm).

Now, the 5-billion-dollar question is: is this really necessary?

Well let’s look at the title for the most obvious answer: Wifey say, wifey do.  Wifey said “Do it”, and now wifey can do it.  Easy breezy.

Okay, how about a more general discussion?

I’ll oblige.  If you have the ability to perform this drag/drop operation, then you have the ability to use the other nifty features presented by the interface – most notably, the ability to take advantage of dynamically-loaded popups and inline information.  Previously – and currently – the steps to play an album or song (we’ll just say an “entry”) could most easily be performed by clicking the popup icon for that entry, clicking the play icon in the resulting popup, and then clicking the zone in the resulting zone list that got dynamically loaded into the popup.  This operation would always result in you getting transferred to the zone, where playback would have been started.  In the case of a zone that was previously linked, the linked list would be overwritten (unless the list was not an auto-generated linked list – in which case you’d get an error).

So if anything, that’s three clicks and waiting around for two dynamic operations to complete (the popup and the inline zone list) before anything could happen.

With the new drag/drop ability, you really only click once and you have to wait for one dynamic operation to complete – ie, the popup containing the zone list.

So from that point of view, I suppose I can agree that the new method is indeed more efficient.  I have to wonder how many times in one session a user is likely to load an entry to a zone – or in other words, how much impact this increased efficiency would have in the real world – but I suppose one can’t argue when it comes to the inherent goodness that is “increasing efficiency”.

But wait… perhaps there’s more to this.

What really makes this worthwhile is that the code is linked-status-aware.  Meaning, it does different things depending on the linked status of the destination zone.  This was alluded to earlier, but allow me to focus on it in more detail.

While it’s all well and good to drop an album on a zone and call it a day for the next 60 minutes, what happens if you’re putting together a 4-hour playlist of albums – or a 60-minute playlist of songs?  Now we’re no longer talking about loading a single entry to a list.

The previous (and still existent) optimal method for doing this would have been to create a new playlist and select it as the working list – or perhaps to load the first entry to the zone, then select the resulting list as the working list.  This doesn’t always work well if you’re working with albums, as the system isn’t guaranteed to create a linked list for a single album depending on how your prefs are set.  But supposing that it’s set appropriately, either of these methods would get you pointed in the correct direction.

Then, you could drag/drop additional entries to the list – or use a pulldown, or a checkmark,  or whatever other method you liked.  But the point is that you’d want to select the list that ended up getting linked to the zone of interest.  Or, if you manually created the list, then you’d select this list as the one that you will eventually load to the zone of interest.

With this new method, the only thing you need to know is what zone you want to work with.  You could have an entirely different list selected, or no list at all.  The list is not important – only the zone.  So the new sequence of events becomes: drag/drop an entry to the zone, return to your browse results, and drag/drop more entries to the zone.  The backend will take those additional entries and add them to the list associated with the zone.

You can see that this method offers clear benefits.  Again, there’s no need to work with or even know which list is linked to the zone.  This is especially useful if your current working list was used as part of the criteria in your current search.  Changing your working list to become the linked list would alter your search results, which may make it difficult to select more entries to add to the working list.

But most crucially, you get to take advantage of the increased efficiency that we discovered previously.  Yes, you could already drag/drop entries onto your working list – ie, the same efficiency that drag/drop onto a zone offers (better efficiency in fact, since there’s even less dynamic loading going on) but again, this only factors in if you select the linked list as your working list.  Now, even without selecting the relevant linked list, you can drag/drop and end up at the same place.

So ya, that’s cool.  I did some initial work in the backend to allow the user to drop a search result onto a zone as well.  I don’t have  draggable defined for this, but once I define one then it should Just Work(tm).  Truthfully it would also be nice to be able to drag/drop multiple items at once.   This may be straightforward for the backend to handle, but I imagine the frontend would need some serious work.  I’ll hold off on getting that going, but I suppose it is a project to look forward to.

From a technical point of view, I will say that getting this to work took a few days, but the hooks were mostly present to make it all go.  The stuff that I added amounted to handling a new breed of popups, which are non-modal and presented more as a menu anchored by an element on the page.  This comes with the need to define a relationship to that anchor, manage timers (which close the menu appropriately), clean up everything when a drop occurs or a drag is cancelled, and defined special “action” elements to overcome z-index issues.  The action elements – “actionables”, as I call them – were already necessary for regular drag/drop operations (again, due to z-index issues) but needed to be extended to work with menu-ish popups.

C’est tout.