Useful, or crammed?

New article on Piper’s Pages:

Something was bothering me with my fancy-shmancy AJAX/DHTML popups in the Home Audio interface.

It manifested itself mostly when adjusting track BPMs for a new album.  Basically, one has the ability to browse on an album’s tracks, then get the track popup for any particular track and – using forward/back navigation in the popup – move around the browse entries via the track popup.

This is cool in practice.  You can see more detailed deets for browse entries (as well as options like track suggestions) and quickly compare between tracks by clicking prev/next.  No need to display the popup, close it, then display the popup for another track in the results.  Same goes for albums, of course.

So when BPM’ing an album, I had two options: 1) use the quick-edit links so that I could get the edit popup straight from the browse results, or (2) display track details and use the edit link from the popup which then loaded the edit popup.

It was kinda nice using the second option, because sometimes you don’t need to edit the BPM and you can just next-next-next through the entire list – no need to scroll the list, figure out which track you’re working on, then click to get the details popup or the edit popup.

BUT… sometimes you’re not sure if the BPM that’s in the DBMS is correct, you want to use the edit popup so that you can tap out the beats and see if it’s a match.  If it’s a match, you close the edit popup – but the entry doesn’t highlight since you didn’t change anything, so you lose visual reference as to where you are in the list.

You could use the details popup, then go to the edit popup, but same problem – once you closed the edit popup you were back to a list of tracks with no visual reference as to what you last looked at.

And this underlined a more general problem – with all these dynamic popups, what happens if you want to go back one popup?  What happens if you want to display the details popup, then the edit popup, but then go back to the details popup so you can “next” to the next entry?

One way to do this is to keep a history in the backend of popups you’ve looked at.  Problem is – and this has cropped up before – the application is purposely free-flowing, and you can have multiple windows/tabs open all using the same session (sharing the same search history, context, etc.)  If you’ve got popups going in two windows, the history will be intermingled and thus useless.

So I took a different approach.  Instead of a popup yielding more popups, I decided that additional popups could be dynamically loaded into the first popup.  So for example, you get track details in a popup, then click to edit BPMs and the edit dialog is loaded into the current popup rather than appearing as a new popup.  Submit your changes and the main popup remains.

Works a treat.

The only problem is that the popup is meant to be somewhat small relative to the main interface, and when we start dynamically inserting some of these other popups – ie, the zone selector – the popup gets to be a little large and looks a little “crammed” – hence the title of this article.  But I think that’s a small price to pay for the increased usefulness (again, linking back to the title of this article), and I can probably make it more palatable with careful application of visual styling elements (via CSS).

Yup, so that’s that yo.

I also added the ability to start a new search using a popup – not just a saved search as before, but actually specifying search conditions.  Not all of the fields are displayed in the popup as they are when you actually navigate over to the search page, but in concert with dynamic search fields it offers a handy way of firing off a quick search.

Werd up.

Harmonizing the national language, one netbook at a time

I picked up an Acer Aspire One 10.1″ netbook a couple of months back, to replace my Dell Inspiron 4000 – which ultimately decided that it didn’t like staying powered on.  Full details in a Piper’s Pages post, do the search.

Anyhoo, the short of the netbook purchase is that I wanted a small device running a full OS, since it became clear to me that portability was becoming increasingly important over sheer computing muscle.  A screen size of 10″ was the minimum I was willing to tolerate, and the keyboard had to resemble a full keyboard as much as possible.

So I picked up the Acer on sale and was generally happy, but I have to admit that I deliberated for about 60 minutes in the store; the keyboard had a few characters in the wrong place, and green French characters adorned about 40% of the keys and was a distracting eye-sore.  I had done my due diligence before visiting the store and OK’d the keyboard layout I saw online, but here it was in the store that the keyboard was different.  I Google’d the situation on my phone and found out that laptops/netbooks gracing Canadian shelves often have a combined English/French layout in order to comply with Canadian language laws.

<sigh>

So that’s the background.  A few weeks back I found a US keyboard on eBay for the earth-shattering price of $15, free shipping from Hong Kong, so I pushed the “Buy Now” button and prepared myself for the customs fees.

Long story short – keyboard came, I popped it in thanks to a handy how-to video on YouTube, and I can now say that I’ve done my part to fall in line with French-ignorant Canadians in the Great White North.

IE sucks… HARD.

Oh, did I say that?

Readers of Piper’s Pages will be well aware of my complete disregard for all things Internet Explorer.  I completely decided to ignore the piece of %!#! for my home automation interface.

And now here it is, after a day of planning and a few hours of coding, the d@mn thing is falling on its @ss with a simple scrolling tables implementation while… yup, Firefox, Chrome, Safari, Opera all behave like good little school children.

Really, even if IE had a DOM browser I’d be happier.  And JS errors that made sense.  But here it is, it’s quite adept at deleting a node from the DOM but adding nodes???  Ya, if you can craft a song that adheres to IE’s rhyme and reason I’ll be quite impressed.

And because there’s no DOM browser I have no idea if the stupid things made their appearance elsewhere in the DOM . Ya, I could slap on an ID, do a getElementById() and see what happens, but then what?  The results will just drive me even more crazy.

I have a son now.  I don’t have time for this @#!^.

Eat my shorts! AJAX drag-and-drop baby!

New article on Piper’s Pages:

In my neverending quest to learn (everything?) AJAX, I decided to dip my fingertips into the pond that is drag-and-drop.

Probably the most famous of AJAX techniques, it allows you to grab something on a page and move it somewhere else – either because you like to assert your creativity, or because you want to Do Something(tm) (like add an item to shopping cart).

Well ladies and gents, we’ve taken our implementation of drag-and-drop to a Whole New Level(tm).

You may recall that we’ve had AJAX popups for ages now (ages <= 1 year) and you could grab those popups and move ’em around, just cause they might be covering stuff you want to see. Cool, but… that didn’t DO anything really.

So here’s what I envisioned.

I envisioned an interface with multiple panes – one for browsing, one may contain a zone, and another may contain a list. It would be wicked and wild if you could drag an album on your list or onto the zone to queue that album.

This obviously requires more kung-fu than just moving popups around the screen.

So…. if I’m not mistaken I’ve been using Scriptaculous for the popup dragging, and after trying to bake my own more-advanced solution I realized that Scriptaculous could do what I wanted (and it was even using the same terminology I was using – “draggables” and “droppables”).

So the first crack at this yielded the ability to drag stuff from the browse view onto the link that indicates your working list. That causes the album/song to be added (or removed) from said list, which also happens to flick the checkmark for that item (this happens as a result of existing code).

Okay, so that’s cool I guess, but said checkmark could simply be clicked to achieve the same results. Nothing really new here folks, so move along!

My pleasure. My next effort was to enable drag-and-drop table reordering. Currently, in list view, you’ve got teeny weeny icons that you can use to move a row up or down, one at a time. Sure, you can select a bunch of rows and move them all up or down at once, but again they’ll move one at a time.

With these handy dandy scrolling tables, it sure would be nice to grab a row by the scruff of its neck and manhandle it into a new position, right?

Yes, it would. And while Scriptaculous provides an easy breezy way to get this done, fact is that my implementation of dynamic tables is slightly incompatible with Scriptaculous. If I had to actually take time to explain why, I would say that it has to do with my padding process – which means that in any given table, some of the rows have actual data and some do not. I use different DOM ID prefixes to track this, but even if I used a seperate array to do the same thing I’m pretty sure we’d run into context issues: does it make sense to reorder a row that hasn’t been filled in yet?

Sure, the way I’m registering draggable items means those rows wouldn’t be considered draggable by Scriptaculous until they were force-fed useable data by backend, but… why are you trying to convince me to use Scriptaculous for this??? Look, the fact is I wanted to keep my DOM ID convention, and I don’t like the way Scriptaculous reports the new ordering to the backend. When you’ve got a table that can contain, oh, 30000 rows the last thing you want to do is iterate through a serialized list of row IDs and tell a DBMS to reorder based on that list. Ugh.

So I baked my own solution, which was based on the work I did (and partially abandoned) for effort 1.

And… it works!

At least in Firefox. It looks like it wants to work in Chrome and Opera, but I’ve got stoopid text selection issues to overcome still. But at least the concept works, and admittedly it’s quite handy.

So ya – drag-and-drop/table-reordering with backend updates. Funky fresh.

Michael Jackson: Healing the World

Just wanted to provide a link to this article I posted on Piper’s Pages back in Feb 2003 (log in as guest).

Excerpted below.

Let me be perfectly clear: I DO believe that Michael Jackson is a little “off”.

BUT – I do NOT think that he’s crazy, and I do believe that his convictions are strong and he stands by his beliefs.

Central to the controversy surrounding Michael Jackson are two issues: One, his cosmetic surgery (and the reasons for it). Two, his relationship with children, including his own.

I’ll admit – there are things about Jackson’s life and the decisions that have shaped his life that I don’t understand; or, just as importantly, I wouldn’t make myself. What comes to mind are the Berlin hotel incident, the parental obligation to his kids, and his insistence of having unrelated kids spend so much time with him. But, hearing him talk about these same incidents, I have to believe that the man simply sees life from a different perspective than I do. A different perspective, in fact, than most people.

Let’s not kid ourselves people. “Society” is as much a bane as it is a blessing. We have a world filled with rape and murder, greed and adultery, and any number of heinous things. We’ve created a society that’s supposed to benefit most people most of the time – but we all know that no one thing can truly benefit all of the people all of the time. We have differences in opinions regarding the utopian society – democratic, socialistic, communist, dictorial – such that, though we’re all human, we can still disagree on what’s what and we’re willing to bear arms in defiance.

The notion that Michael Jackson’s thinking goes against the grain, really, isn’t a cardinal sin.

Martin Bashir, the man who interviewed Michael Jackson in ABC’s 90 minute special “Life with Michael Jackson”, focused incessantly on the two things I alluded to earlier; but mostly on the issue dealing with Jackson and children. And at one point he (Bashir) said something that I had to agree with – initially. He put himself in the position of Michael Jackson and said, with an allowable degree of certainty, that no person he knows would be comfortable with the idea of him having somebody else’s kids sleeping in his bedroom.

Now let’s be honest people. Perhaps my opinion is skewed because Carribean culture is different than North American culture, but amongst a peoples who routinely make aunts and uncles of those who have no blood relation, I have to think that the line isn’t as clear as Bashir makes it. If trust weren’t a issue (and keep in mind, please, that ideally trust should NOT be an issue) then I would trust my really good, long-time friends (who would also be parents) in addition to my family with matters relating to my children – including sleeping in the same room with them. And for some people, assuming that trust weren’t an issue, even the same bed.

And that’s the crux of it: Trust. Jackson made the statement that it’s not like Jack the Ripper is in the room. All he’s seeking to do is provide an atmosphere of love and caring that this world sorely misses. And I have to agree that the world – indeed, society – isn’t the noble, just and honourable cause that Bashir seemed ready to defend. All you have to do, again, is realize that the human race still hasn’t agreed on what the best version of society is, and within societies people still clamour for certain rights (eg, gay rights), seek to aboloish certain rights (think KKK), or seek to define what’s acceptable and what isn’t in child-rearing (think of the cases involving spanking, as justified by religious beliefs).

The case that Bashir made – the wall on which he was leaning – was a shaky wall indeed.

Michael has done some wierd things, but I believe that the man is honourable, and I believe that he’s being more forward about what he honestly believes in than the vast majority of people in this world.

I also think that he’s astonishingly immature – but what is maturity? If the heart is big enough, does it matter that the brain isn’t so mature?

Really, what’s the answer?

I’m not going to talk about his cosmetic surgery, because I believe that that’s his personal choice and he doesn’t have to justify those choices to anybody but himself. Not sure why he’s lying about it (and I say that because it seems blatantly obvious to me that he’s done more than tweaked his nose a couple of times). But really, there’s nothing worthwhile there; either he’s done it or he hasn’t. Big deal.

In other matters – the ones I touched on – the man is obviously trying, and he’s leading his life by example. And it’s a shame that Trust (always) has to be an issue.

What the HECK is this Whole Home Audio thing?

Glad you asked.

For the past x years I’ve been toiling away on a combination of software and hardware at home that allows me and the wifey to play selections from my vast collection of music to various rooms around the house (and beyond).

If you visit Piper’s Pages, you’ll find a post (login as guest) that begins the record of how this endeavour began.  Yes, it began 4 years ago.

And it’s still going strong.

Browse interface

Browse interface

The project, in today’s form, uses a web interface to browse/search the collection.  The search options are quite powerful (confusingly so?) and can be saved for frequent use, you can create playlists of songs and albums, you can have the system suggest similar music.  There are statistics – including scoring and ranking – and metadata pulled from external sources.  We’ve even got BPM info.

music_zoneThere are a slew of maintenance scripts that power this thing, and no less than three disparate “servers” that go into making it all happen. Currently we’ve got two physical zone – family room and basement – and another four virtual zones for streaming.

So that’s the short intro.  For more you’ll have to visit Piper’s Pages and check out the DP’s Corner database.

My First Post!

Hey all,

This is my first WordPress post, but all of those “in the know” will be aware of Piper’s Pages over at http://www.pipenet.org/people/piperd/.  So while I may be using official blog software now, it’s not to say that I haven’t been blogging for quite… some… time……..

I’m somewhat torn on whether to continue posting to the other site, or perhaps to post here and link here from the other site.  Truthfully I just don’t have the time/inclination to update the backend code that drives Piper’s Pages, so I suppose it makes sense that future posts occur here.  If I permalink from Piper’s Pages, then I’ll lose search functionality on that site but…

I think I’ll just post to both sites, and provide the permalink at the start of Piper’s Pages posts.

Problem solved.  Not that you cared, but one thing you’ll soon learn my friend is that my online sense of entitlement is rather startling.  So that’s that then – let’s blog!