Wednesday, August 26, 2009

MOVED

This blog has Moved.

Blogger's been having a hard time uploading images lately, especially to external hosts. Rachelle and I have struggled with it for her blog for long enough that it's no longer worth it (would stall out even when just pasting a URL into the dialog - how messed up is that?).

So today we installed WordPress on her domain, and tweaked it to her liking. It was simple enough and powerful enough that it's worthwhile for me to make the leap too, even though I wasn't doing my own hosting previously.

I'll leave this one here for archives and old links, and because I have no way of automatically redirection from here to there.

New link: blog.paultomlinson.net

See you there!

Saturday, August 08, 2009

Credit Card Fraud Redux

Once again, I've found myself the target of credit card fraud, and once again it had absolutely nothing to do with our activities as cardholders.  Not sure how they got the card number this time, probably from a weak link in the processing chain at a miscellaneous vendor.

What's interesting  though was the savvy shown by the fraudster - instead of shooting for the moon with $3,500 in jewelry, there were only 2 relatively modest charges:  $1 at iTunes, ostensibly to test the validity of the information on hand (in talking to others to whom this has happened in recent memory, iTunes has been the unwitting accomplice as the verification service in those cases as well), then on to ~$230 in wireless charges and hour and a half later, which, if they were smart, went into equipment and prepaid services rather than traceable account goods.

Also unlike the first time, the credit card company did not catch this one with their normal fraud watch.  It was left to me, the consumer, to catch the abuse when reviewing my account.

The moral of this story?  Check your accounts, and check them often - the customer service numbers are open 24x7.

Anybody interested in a legitimate looking credit card number to test their MOD10 algorithms with can use 4768 0001 9098 5014.  I wouldn't recommend trying it out online though, as the card in question was cancelled a week ago and the number is most certainly on The List.

Cheers!

Friday, June 12, 2009

Crumbling MySQL Sandcastle

I'm going to have to take a moment and backpedal. I described the MySQL Sandcastle as an excellent construct for shared development against a large repository without stepping on the toes of fellow developers.

In theory this is excellent, and in practice it's proved rather useful especially where projects call for deviation of underlying structures which can be done in a relationally intact way by severing the link to the main repository. However, when it comes to actual permissions, the Merge table is not akin to a symlink which verifies the access rights to the underlying object: if you have access to the merge table, you have all of the corresponding access to the underlying tables regardless of whether the permissions have been granted. This means that UPDATE and DELETE operations intended to be constrained by the combination of structure and permissions are in fact freely available across the board: developers may perform these functions against the PSR (to re-use terminology).

Your mileage may definitely vary between "meh" and "dealbreaker", but it would be irresponsible of me not to disclose a minor leak in the tank.

Wednesday, May 20, 2009

The MySQL Sandcastle

Developer sandboxes are crucial for quality software creation: a place to work in a locally destructive way, trying new avenues to problem solving at minimal risk. There are several different ways to put a sandbox together, but all essentially built around the concept of a scaled down copy of the target production environment.

In the case of internet applications this means an interface server (usually web), processing environment, and persistence layer (disk or database storage). Most simplistically this is just another subdirectory or virtual host directed to the developers' local copy of the operating code, where they get to make their changes without affecting or being affected by the work of others (shared processor and disk constraints aside, and out of scope for this discussion). The persistence layer, most commonly a database, has some additional constraints though: getting enough good sample data in place to be a good representation of real-world activity, both in terms of permutations and raw number of records, can be cost prohibitive either in documentation and setup (assembling the samples) or simply in the size of the data set.

Working with smaller data sets tends to help with the validation of structure, and doing it on scaled down hardware is often used as a way of simulating (poorly) the probable performance of proportionately larger data sets in a higher-class processing environment (and typically under greater load). There are some things that just can't be worked out on a reduced scale, however, especially related to index and query tuning.

A solution we've recently implemented is the MySQL Sandcastle - a more elaborate construct on top of the typical sandbox concepts that has some significant benefits for web app development.

We started with a rich staging environment: a copy of the production database, minimally sanitized (personally identifying and/or financially sensitive data obscured) and trimmed down only as appropriate (retaining 90 days worth of operational data from history tables) for the hosting environment. The sanitation makes it more like a bridge between test and literal stage, but gives us exactly what we need to work with regardless.

On top of that staging environment we're taking advantage of the MySQL Merge storage engine, which essentially marries multiple table definitions under a single abstracted table interface. This is similar to a unioned view, except that the structural checking is done during creation, the contents are fully malleable to all standard CRUD operations, and there's no need to spool data to temporary tables (which most databases do in some form or other for these kinds of operations) during complex queries. A default insert mode also tells the table which of the component tables to add records to (exclusively).

Per the illustration then, we have the Primary Staging Repository (PSR), plus 2 additional databases per sandbox (STAGE_[user] and STAGE_[user]_M) which round out the environment. The STAGE_[user] database replicates the structure of the PSR but starts out completely empty. STAGE_[user]_M shadows this structure, but swaps out the engine definition from MyISAM to Merge in order to combine user stage and PSR. In order to keep PSR clean for all developers to continue their work, each user is granted an un-privileged account with full access to their own sandbox databases and read-only to the large store (Merge table definitions must be created with full CRUD permissions to the underlying tables as well, so these are created by a privileged user prior to turning the reins over to the per-user accounts), then accesses the environment only through the ..._M instance.

Obviously this restricts activity: any attempt to update or remove records which exist only in PSR will likely produce errors, and at the very least will be ineffectual and quite probably anomalous. The most effective usage pattern is for unit tests and general developer activity to still recreate data they intend to directly modify, leaving the large store as a good general sample set for read activities (which accounts for ~60-80% of all development activity anyway). The benefits are pretty big: developers get cheap access to large swaths of regularly refreshed data without having to continually repopulate or propagate in their own environments, can work destructively without interference, and even test structural changes (simply excluding PSR from the Merge and redefining the table) to the database before finally recombining efforts in Stage (which does work destructively against the PSR) for integration testing before promoting to production.

There are some other disadvantages as well: it's possible for local insertions to the underlying tables to create keys in identical ranges which will appear to the client as duplicate primary keys (in violation of the very clear and appropriate designation of "Primary Key") in the merged data set. Setting new exclusive AUTO_INCREMENT ranges per table doesn't help yet either, due to a bug in the engine that treats it like a combinatory (multi-column) key definition, using MAX( PK ) + 1 instead of the defined range of the target table. Merge tables are also restricted to MyISAM table types, excluding the oft popular and appropriate InnoDB (and other) options. Treading carefully easily avoids these, but it's good to be aware of them.

A more complete workaround would be updateable views, using a combination of exclusive UNION (rather than implicit UNION ALL) selects and a series of triggers which not only manage insert activity, but replicate into the developer shadow sandbox the intended target record prior to modification in the case of insert. Establishing this kind of more extensive sandcastle pattern would be far more capable, should be scriptable without great effort, but still carry a small number of its own gotchas (most notably that un-altered trigger definitions on the underlying target tables with any dependence on external tables would be operating locally rather than through the same abstracted view, and insert triggers may fire at unexpected times). For now the limited Merge version is sufficient for our needs however, so we haven't gone so far as to even kick the tires on this possible approach.

I have a few more changes to make to the sandbox recreation script before it's ready for wider consumption, but it's not an especially arduous process for someone enterprising to reproduce on their own with little effort.

Enjoy!

Wednesday, May 13, 2009

The Long Journey

I've written a lot about my health over the past few years, and my efforts to try and do something about it. Each little clue gave me new hope, into which I threw my full energy. I took every inch and reveled in it, moving as far as I could before inevitably declining once again (increased effort met with increased resistance). These were genuine steps forward though, rather than false starts: I lost weight, gained focus, and started sleeping better, so each time I was really complaining from a new place.

The biggest gains came from discovering sleep apnea, candidiasis, and suspicions of mitochondrial myopathy. None of these are naturally indicative of McArdle's Disease (the eventual diagnosis) though, nor are they typically concomitant. They didn't fall into their place in the puzzle until the picture was already becoming clear, when it all suddenly came together.

I should start by explaining a little about the condition. Glucose is the primary source of energy for nearly everything in the human body, the whole process referred to as "glycolysis." Most cells, especially muscle cells, have an internal reserve of it in a compact polymer-like form called glycogen. When demand for energy increases, molecules are trimmed off the end of the chain and made available to the mitochondria to do their business of converting it into active energy (adenosine triphosphate, for those taking notes).

This store of energy is pretty high - enough for 12-20 hours worth of activity before needing to be replenished. That replenishment happens on a regular, ongoing basis, to keep stores topped off whenever spare glucose is available, and any surplus is either excreted or converted into starches and stashed elsewhere. Normally this is enough to keep the body readily burning glucose between meals without running low - an exception would be fasting (more than a day), starvation, or extremely high demand: marathon runners, for example, can completely deplete glycogen stores after about 20 miles of continuous running, a phenomenon they refer to as "hitting the wall." At that point continued activity requires use of the stored fats as an alternative fuel, and risks damage to those tissues unable to do so.

McArdle's refers to a defect in or absence of myophosphorylase, which is a fancy name for "the enzyme that breaks glucose off the glycogen chain." This deficiency means that the primary source of stored energy is either completely off limits or so impaired as to be unable to meet the body's demand. This results in dramatic exercise intolerance, and in some cases cramping or seizing of muscle fibers (which require energy both to contract and relax) in a disparate and uncoordinated state so severe that they can actually rupture (rhabdomyolysis - this will be on the test), spilling their proteins into the blood and straining renal functions. Alternatively, the secondary fuel source based on fatty acids can be engaged (lipolysis).

An interesting side note here is that this is the primary intent of low-carb diets: by lowering the intake of glucose (and things easily synthesized into it by the metabolism), glycogen stores are exhausted and the body has no choice but to turn to lipids in order to remain functional. It's a hack, but a potentially effective one - your mileage may vary though, and not every system can handle the kind of stress this creates.

To point, too heavy a reliance on lipolysis floods the body with its waste products and increases the acidity of the blood (ketoacidosis). Healthy folks don't normally get to this point - diabetics can be affected in pretty nasty ways though. Those with McArdle's suffer a similar fate since the reliance on it is more absolute, and constant: this happens on regular diets without regard for carbohydrate intake. I had hit on a form of metabolic acidosis in my investigation earlier but had come to it from the wrong side, thinking that it was an inhibition of the mitochondria in making use of available oxygen, when in fact the mitochondria work wonderfully and are simply making-do with limited materials on hand. The effect is the same though: fatigue, memory disruption, stupor, and eventual unconsciousness.

I hit on McArdle's as a possibility in my own studies just before I was recruited by Amazon, though there were a couple of things that didn't quite add up for me. The subjective descriptions of other sufferers sounded really really close, a better overlap for my experiences than anything else I'd encountered to that point. However, I didn't have the severe cramping, nor the myoglobinuria - the voiding of protein from the damaged muscle in such a way as to turn urine red or "rust colored." I grew up in the Pacific Northwest: rust, in that high-humidity environment, is a bright orange or red. I'd experienced darkened urine before (sorry to get visceral here), but it was more brown than anything else, was very infrequent, and not repeatable under controlled conditions. During a physical before relocating to Seattle I asked them to run a CPK, which looks for serum creatine kinase (the chemical marker of that damaged muscle) which is elevated in 90% of McArdle's sufferers: results came back normal and I scratched this one off the list.

Once in Seattle, apart from the family, I decided to give myself a break in some respects. Since I didn't have anything better to do (no family, trying to save money since I was living separately, and not particularly interesting) all I really did was work and sleep. I allowed myself to sleep whenever I wanted to, extended naps after work, sleeping-in on the weekends with a nap or two on Saturday and Sunday (each!), until eventually waking up from a nap didn't hurt - I didn't shudder or feel sick within a few seconds after starting to move, and then something even more surprising happened: I stopped needing the CPAP at night. The sleep apnea completely vanished for a time, as long as I was napping with such high frequency.

The results were amazing. I slept better, dreamt more frequently, and was even able to take longer walks. I lost about 10 pounds in a couple of months without changing my diet (I mean come on, I was eating like a bachelor - a bachelor who can cook, granted, but not especially health conscious and with a penchant toward mint ice cream in the evenings). After those couple of months the work schedule started to pick up and my resting decreased, the CPAP came back on, and exercise tolerance reined back in to the "inhibited" range. The stress was a lot higher too - being apart from my family for several months had sucked all the fun out of exploring a novel place. I felt a need to demonstrate to the powers that be that I was not taking any of it for granted, and dove into the work with all the vigor I possessed to make the most of the fortune bestowed upon me: man, did I ever work hard, even during the once-monthly weekend visit back to see my wife and daughters. We did everything we could to help sell the house make judicious use of our resources.

After three months my corporate housing benefit expired and I was forced to find a new apartment on my own dime. I narrowed it to a pair of places relatively close to work and made the move. Interestingly enough, one of the two could never correctly coordinate a showing: three different attempts always saw the super pulled away on some other issue or ill, and I was forced to take the other without ever earnestly evaluating the competition. The reason this is an interesting fact is because the one I got was up the steeper hill, a crucial contribution to the eventual diagnosis.

I ramped up my work even more. During the holidays things are busy in the retail world, and Amazon doubly so (on account of being good at what they do). My areas of responsibility overlapped with physical operations, so everything was closely monitored and actively engaged. I would work 9-10 hours at the office, walk the 1.1 miles back up the hill to the apartment (or in a real pinch take a shuttle bus - I was living across the street from one of Amazon's facilities, just not the one I was supposed to work at, and they have shuttle service between them), have my video chat with the family before the girls went to bed, and work another 6-8 hours on average. Saturdays I would put in only 4-5 hours, and try to rest on Sunday (except for the emergency processing which had to be attended to at 10 pm daily, no exceptions, and any pages I received). It shut me down: I suffered through it because I had to, but the limited treatment I had for the sleep apnea became ineffective and the afternoon meeting narcolepsy started creeping back up on me.

Clearly, this was unacceptable. I was trying to completely own the job and attendant performance expectations out of a desperate display of over-compensation for any perception of my own failings, and still demonstrate to the cosmos that the blessing of opportunity had not been misplaced. I would magnify what I'd been given, and failure was not an option: I re-opened an investigation into my health, starting over with new physicians and determination to finally see it through and regain some dignity. I was also armed with the recommendation from my last consultation in Utah that I follow-up with a neuromuscular specialist to see if they could find anything.

I got myself a referral and an appointment a month in the future. Tired of repeating myself and feeling like I was leaving out anything of relevance, I typed up my medical history and current state of symptoms and controlled conditions under which they were manifest and went into the consult armed with a fairly exhaustive twelve page document. Having previously personally ruled out McArdle's, I essentially wrote around it: made no mention of mitochondrial disorders, glycogen storage issues, anything of the like. I actually gave it a bent slightly toward some kind of transient ischemic event: the intense walk back to the apartment after a series of grueling days eventually resulted in some pretty nasty aches, but not until I took a break and rested. It was only well after the exertion that muscles seized up, and then after a power nap turned into a deep and exhausting pain that easily brought me to tears. On a scale of 1-10, with 1 being pain free and 10 being unconscious, this rates a 7; for comparison, a root canal tops out at 4 and deep lacerations a 6 at most (it'll send me in to shock, but tears are a distant thought). I took this to be a potential sign of ischemia (inhibition of blood flow, usually localized) due to the fact that deep tissue damage from suppressed blood supply doesn't happen in full force until that flow is restored (re-perfusion injury and apoptosis). The resulting darkened excretion following 12-24 hours later confirmed some kind of muscle wasting, but again given its brown color I associated it more with necrotic tissue than a possibility of the more traditionally red myoglobin.

At the appointment, after a very brief evaluation to make sure there was nothing glaringly pathological, the specialist looked over the history and immediately recommended McArdle's as though it was already on the tip of his tongue. I told him why I'd ruled it out, specifically noting the negative CPK test, but by then he'd closed the folder and was wearing that medical professional look of, "I'll listen to you, but I'm pretty sure I already know what's up and am not likely to take it under real consideration." He made no additional notes, and simply stated that he'd like to see me again after my consult with the neurologist (to see if it really all was in my head - though legitimately based on neurological function, rather than psychosis per se).

The neuropsychiatric evaluation was set for the middle of May. Only, I could swear the receptionist told me a corresponding date in March. I showed up on that date with all my paperwork filled out, ready to go, and was a little chagrined to learn I'd rearranged my schedule for something not due to happen for another four weeks. They offered to add me to the waiting list in case something earlier came up, which I accepted, and went back to work dejected.

Prompted by the prior meeting and hint toward McArdle's from the neuromuscular specialist I did some more research, and found the available materials evolved somewhat since my prior glance in this direction. Someone equated "rust" with "brown," a real forehead slapping moment of course - not only was the event predictable enough that I should have seen it and been able to disregard the minor deviation, but I've seen brown rust long enough I should have adapted to a broader definition anyway. Secondly, an explanation that the cramping was not necessarily present in all conditions, and frequently occurs after the exertion or even during rest. Following as many threads as I could I tied the alternate lipolysis metabolism to non-diabetic ketoacidosis, which rounded out the remainder of my symptoms. I had a fit for everything, there was no part of my condition not explained by the disorder, and nothing in the disorder at odds with my presentation. I didn't know what to do about it yet, but after 15 years of intensely searching I received a concrete corroboration and vindication: life really was hard, and I wasn't simply incapable of handling otherwise normal levels of stress.

One week after that appointment, as I was preparing for my monthly trip down to see the family, I had my regular meeting with the boss to sync up. This time, however, rather than the one-on-one format, our friendly neighborhood HR representative was there. As nice as they usually are there are times you don't want to see them; this was, in fact, one of those times. Business concluded, boxes were packed, and with an hour to go before I was already scheduled to head out to the airport I found myself an unemployed victim of a tightening financial reality. The timing could have been better, certainly - relaying the news to my family under those circumstances was bittersweet. I was due to see them, and to return to be with them more permanently, but with an uncertain future. Not only that, but the steps I was taking toward possible management and resolution of my health were going to have to be put on hold once again: even with a continuation of health coverage through the next month and opportunity for COBRA it would simply cost too much, and without new work lined up I couldn't risk the family finances.

While I was down visiting the family and celebrating my daughter's birthday, I received a phone call: it was the neuromuscular department letting me know they'd had a cancellation and would I be interested in moving my appointment up from May 12th to the coming Monday? Talk about providence! My return flight was on Sunday night, and I was planning on immediately breaking down the apartment and closing off accounts so I could have my belongings packed up and be back on my way to Utah as an officially binding move (cats and all) by Thursday. If I were to be able to get this evaluation at all, that would be the only way and the only day to do it - I very gratefully accepted the rescheduling and continued to enjoy my time at home.

I returned to Washington and went in for the six hour battery of tests designed to exercise and measure the functional capacity of the brain. During a break in the tests I had the opportunity to speak with the prior specialist, from the earlier consult - I let him know my findings, and we chatted at some length about possible avenues for management (and how to begin exercising in a legitimately beneficial way despite the condition, rather than as a grueling ordeal of determination). The tests concluded with favorable results, I finished packing the apartment, and made the long haul drive (14 hours straight) to be home genuinely and officially: for the first time in seven months I didn't have a looming clock ticking away until my next departure.

Further study and experimentation has led me to the following series of conclusions and strategies:
  1. Most of the really nasty bits of McArdle's (the rhabdomyolysis, resulting myoglobinuria and possible renal failure) are only distantly present in my condition, which is certainly in my favor and gives me hope for decades to come.
  2. The majority of my symptoms are the result of persistent lipolysis and metabolic ketoacidosis, so things are working pretty well and happen to have unpleasant side effects.
  3. Minor snacking under ketoacidosis can in fact lead to a "sucrose induced second wind," but the body's already primed to store the excess since it's reacting as though starving (or otherwise resource impaired) and has slowly but constantly contributed to my weight gain over the years.
  4. A carbohydrate (especially sucrose) rich environment contributed to the candida albicans overgrowth of yore, long since controlled.
  5. Metabolic acidosis has a disproportionate effect on the diaphragm, even capable of inducing sleep apnea due to paralytic hypopnea (found some nice research papers on this).
  6. Acidic (low pH) blood is filtered by the kidneys, which neutralize it using bicarbonate.
  7. Most of the bicarbonate in the body is secreted by the acid pumps in the stomach, and an extra need for it does increase total pump output (acid reflux anyone?).
  8. THEREFORE: adequate rest, which prevents the accumulation of metabolic toxins and/or provides opportunities for their filtration, OR a heightened filtration schedule, should be able to restore a more normal functional baseline. In practice, this means I either have to take it really easy (intense aerobic activities of my youth are all off the radar) or find some way of flushing out the kidneys, which I can do by massively upping my intake of water.

The recommended daily hydration regimen is 8 cups (1/2 gallon, or 64 ounces). Most people don't quite get this (and to be fair, it is a pretty arbitrary standard), and feel a little water-logged if they go for it. I've found experimentally that my ideal water throughput for symptomatic management ranges from 1.2 to 2 gallons per day, or two to four times the standard recommendation. Putting upwards of ten pounds of water through my body a day is not without its inconveniences, but the results are astounding: I have been able to consistently function, retain focus throughout the day, and consistently move without a broad distribution of muscles slowly constricting and seizing (I ignored a lot of this before, it had settled in so gradually). In those cases where the toxicity increases beyond my ability to handle it with water I can supplement with bicarbonate (sodium-bicarbonate in this case, or common baking soda - unfortunately you can't get bicarb without it being bound to another agent, and sodium in the related concentrations is the least threatening) to give my kidneys a boost. If that's still not enough it's time to take it easy and sleep it off.

And that's it - I can do 2 miles on the treadmill in the morning and become warm and flush in the face, with a good steady and heavy sweat instead of my previous experience of becoming pale, pupils dilating, and pulse threatening to become erratic as I felt increasingly weak and physically disconnected. I'm invigorated and capable, and with any luck will be able to set a good precedent for weight management. I've been doing this for a month now and am still amazed at the clarity of thought, presence of mind, and restored function of an engaged subconscious (especially for automatic mental reminders and short-term background processing). There are things I'll clearly never be able to do again, but I'm more OK with that now than ever before - the burden is easier to carry, and I'm relieved of the expectation of rising to a super-human standard.

None of this would have been possible except for:
  1. Mental faculties adequate enough to both use as a means of trade in providing for self and family (and thus avoiding reliance on otherwise impossible physical performance), and sufficient to withstand the stupefying effects long enough to be effective in that employ.
  2. An opportunity to both rest and subsequently push myself in opposite extremes: without the intensity of work and schedule I never would have been able to consistently reproduce the final few symptoms of the puzzle. The new job, attempted relocation, and first and second apartments created the perfect environments.
  3. The urgency of investigation based on family need: I owed it to them not to screw things up, admitted I had a problem I couldn't solve on my own, and persisted in seeking out the care and advice I needed.
  4. The inability of our beautiful home to sell despite our efforts to undercut the market.
  5. That final appointment perfectly rescheduled (and only because I made a mistake that landed me on a waiting list) to coincide with my dramatically foreshortened stay in Washington. In fact, the foreshortening came on the heels of our most recent and drastic attempt to sell the house - almost as though we forced the hand of the cosmos, since we weren't really supposed to move but the evaluations still needed to happen.
  6. All the little steps over the years that gave me hope.

In the end it seems as though the whole experience with Amazon was perfectly designed for the investigation into and subsequent resolution of health that was continuing its frustrating decline (every minor gain was eventually curtailed). It was very costly: the time apart from family is not something I would otherwise have chosen. That's being quickly made up for though - before the severance ran out I managed to land a good gig locally, with a favorable commute, frequent opportunities to work remotely (time with the family and care for my health), a nice level of influence and corresponding title, and chances for some stability. Certainly more humble in many ways than the work at Amazon, but arguably far better suited for both me and the family.

I'm being taken care of; it feels like stepping from shadow into warm sunshine. Health is finitely understood and controlled for the first time in my life. I have a much better idea of relative costs now and know what I will and will not do at the expense of closeness to my family, and most of it falls into the "will not" category. I learned a tremendous amount (the kind of education you really can't pay for) and am better prepared for the advancement of my career than ever before; and I can start living again.

Thank you.

Thursday, April 02, 2009

Back

As most of you probably know by now, I have returned from Seattle Washington to Salt Lake City Utah. This move was brought about the end of my employment with Amazon.com, which overall is a mixed blessing - I am with my family again, even if it does mean I'm back in the job market. The house which perpetually refused to sell now acts as a comfort and a shelter since we still have a nice place to live, and all of this comes on the heels of a confirmed diagnosis of McArdle's Disease (which diagnosis had nothing to do with the change in employment - this is all coincidental), a rare form of muscular dystrophy due to glycogen storage (more accurately utilization) complications: I now know far more about the genesis and management of the health complaints I've voiced here in the past, and it is comforting and vindicating.

So now that I can keep myself conscious and operating it's time to roll up the sleeves and get working. My resume is online if anyone knows of any openings in the area (I'm done with relocating) or leads they can toss my way I'd appreciate it.

Sunday, December 21, 2008

Stay classy, Seattle

Palms in Seattle? Really?

Ah, winter. Which, generally speaking, I love - but, if it comes with any kind of persistent precipitation, cripples the Northwest. Not just because they're wimps when it comes to snow, it's at least partially justified by tendency it has to turn into ice and the number and variety of hills which make up Seattle proper. Outlying suburbs, not so much - for them it's mostly the wimpy part.

The studio I live in now is probably hermetically sealed, as evidenced by the condensation that forms on the windows. A couple days into the various storms it managed to drip down to the bottom and freeze, pictured here.

I also keep it cold in here.


Tigger, our inherited orange tabby, has an odd habit of licking things which suit him: gloves, coats, pant-cuffs, hands. It's anybody's guess what it's going to be, we have yet to identify any common element amongst his targets - there are other things which cats would typically love, like the wrapper from a stick of butter, which if given the opportunity to inspect he'll attempt to bury the same way he would his leavings in the litter box. However, he does leave a pretty pattern on the window:

Tigger Tongue Tracks


Given my easy proximity to work, and my distrust for the driving ability of others in these conditions (as well as a healthy respect for the elements and an acknowledgment of my own limitations), I haven't been driving since it snowed. That means my car's been parked out on the lonely street accumulating snow this whole time, along with a few others in the neighborhood.



We've had about 8" so far - the first night was the strangest though, it started snowing in pellets before changing to conventional flakes. Not hail, honest pellets of snow that you could hear hitting the foliage - around 5am it was accompanied by a couple bolts of lightning less than 1/4 mile north of me, too. First time I've ever experienced lightning first-hand during a snow storm.

Last night added its own strange condition to things, blowing in tiny flakes for much of the night and eventually causing everything to ice over. I'm not sure if it was a change in temperature, or a fog which settled in on everything, or what, but the top 1/8th of an inch of snow has frozen into a texture like frosted glass. Every footstep crunch-crashes through the crust into the fine powder below. It made digging out the car an experience too, since it was not spared this treatment - in fact, any area not covered in snow is also covered with this same sheet of ice.

Ice sheet from snow - broad view
Ice sheet from snow - edge view
Ice sheet on side mirror


Which brings me to the title of this post: Stay classy, Seattle.

When I was 17 I got into a minor car accident in the Northwest. There were almost 2 lanes westbound on this street, but not quite (or at least not officially). There also isn't a turn lane, and shortly after an intersection the car directly in front of me stopped in order to turn left. I hesitated a moment, decided there was probably enough space to the right that I could go around him, and put on my blinker after checking my rear-view mirror to make sure traffic behind me was indeed stopped and was making no indication to go around me. Between the time I put on my blinker and started to move, the driver behind me decided that was a good idea too and pulled around on the right, and managed to clip the front third of my passenger side.

After pulling off to the side of the road to inspect things we wanted to make sure everything was in order and call the authorities in case a report needed to be filed. This was before the time when cell phones were common place, so neither of us had one - it was therefore decided that, since the other driver lived nearby, he'd run home real quick and give them a call from there. Which he did, and promptly returned, and everything was squared away - no report was needed because the damage to either vehicle didn't exceed the threshold, and no ticket was issued although I was apparently at fault for failure to yield right-of-way (another one filed under lessons learned).

It didn't dawn on me until days later that the driver of the other car didn't have to return. It was some time after that I realized that I too could have just taken off (we hadn't completed our information exchange yet) while he was gone and just left him in the lurch. My realization wasn't a "would have gotten away with it too if it weren't for you meddling etc." epiphany, it was more akin to a rumination about what a remarkable area to live in. That's just what the culture was.

Was. Past tense.

Hit & Slide


No note, no indication of ownership. I've heard spinning tires up and down the road and knew it was bad shape out there. I've always turned down the music and paid close attention, listening for the fateful crunch that would indicate assistance was necessary and/or somebody owed someone else money. Never heard it though - which means this probably happened some time Friday while I was still at work, and I missed it when I arrived home that evening. There are no recent tire tracks (and they're easy to spot in 8" of snow) that correspond to the accident, which is my only other clue as to the timing (it snowed fresh Friday night and most of yesterday afternoon and night). I'm fairly certain they were headed West (toward the rear of the car), as evidenced by the fact that the remains of the hub-cap were all slightly to the west of the rear tire.

Hub Capped


Though I suppose it's just as possible they were sliding to the East, knocked the hub cap off, and a spinning tire ejected it to the West on their way. Either way I don't think someone could have done this unknowingly, which makes the lack of ownership disappointing.

Fortunately the door opens, moves its full extent, and closes just fine. There's no disposition in the tire which would indicate axle damage, and the sidewall is completely intact. It hurts the resale value of the car, and will probably contribute to the deterioration of the body, but the immediate serviceability appears intact. I'll find out when I move it later today to go to church, and eventually stash it in the garage of a friend for an extended stay while I visit Utah next week.

And if I hit anyone while I'm driving, which is unlikely, I'll be sure to leave a note.

UPDATED 2008-12-21 20:28

I was informed by a fellow motorist in passing (whilst stopped at an intersection) that it appears one of my rear wheels is about to fall off, based on how it's wobbling. A little more than superficial then I'm afraid - I have either a bent rim or a bent axle. I'm hoping it's the rim, since it's an order of magnitude less expensive - we'll find out when I finally have a chance to take it in for repairs after the holidays.

Tuesday, December 16, 2008

Lessons Learned

Let It Be Known, That:

Even In A Pinch, Despite Mutually Agreeable Holiday Sentiment, That:

Egg-nog Makes A Really Nasty Creamer for Hot Chocolate, and That:

This Use is Not Recommended and May Be Punishable By Blech.

That is All.

Sunday, October 26, 2008

Video Glasses

As if the world didn't need further evidence of my nerddom, I have gone and purchased video glasses: Vuzix iWear AV230 [site is down as of time of writing], as sold by woot in a bundle with an iPod adapter for $99 (plus $5 shipping). I've wanted to try out a pair of these things since they were monochrome and $500+ in yuppie product magazines - at this price point and feature set I'm pretty happy. With the new job I'll be doing considerably more traveling by plane (and potentially commuting great distances by bus and/or train) - which, combined with video via an iPod touch, makes these ideal for passing the time in fun and educational ways (yes, educational - I'm a big fan of the TED video podcast, the MIT Open Courseware lectures, etc.).

Vuzix iWear AV230 BoxThe specs are a little on the light side as far as the current offering of video glasses are concerned - 320 x 240 (old school VGA), equivalent viewing distance of 44" 4:3 screen at 9' (which, for my arm length, looks about like an 8½ x 11" piece of paper held at full reach). Nothing super-stellar or all encompassing from the viewer's perspective, but certainly comfortable for standard definition video. It accepts RCA video (and audio) in, making it versatile and accommodating for a broad range of devices and applications. It will also automatically demux field-sequential stereoscopic signals onto the independent screens, making full 3D a possibility (though poorly supported by available media).

Vuzix iWear AV230 UnitThere are Zero controls or configuration options for the main unit electrically speaking (though the individual lenses can be adjust by +2 to -5 diopters via focus wheels in the bottom): it turns on when it detects a video signal and turns off when it doesn't. No volume choices, brightness, contrast, etc. The speakers (not headphones) can be bent lightly into position above or near the ear in order to change the effective volume, but there are no options in-line. Given that many media devices output a fixed volume on their audio, this may be less-than-ideal in many situations, although what I've demoed so far seems to run too loud (easily corrected with position) rather than too soft. It's also possible to remove the speaker stalks, enabling head-phone use. This is helpful for those situations where whatever device has its own gain handling and separate headphone jack, which for the iPod is perfect and also very necessary for in-flight use with the high ambient noise and the high-gain audio required to overcome it.

Vuzix iWear AV230 Unit POVThe adjustable (and removable) nose piece has large soft rubber pads which make it not-uncomfortable to wear for extended use, but which will leave marks on a person's bridge. I don't recommend trying to use these for very long without the lanyard either, which helps to secure it to one's face and preserve the viewing angle (which otherwise can be tricky for reasons I'll get into later). It also helps prevent them from slipping - 4oz. doesn't sound like a lot, but when all of the weight is forward and on an inclined slope, physics does tend to take a hand and they will slip.

Vuzix iWear AV230 Lens ImageThe image quality is good, although photographing it turned out to be one of the most technically challenging pictures I've ever attempted. The result here is a little blurry, but that's an artifact of the difficulty of maneuvering the camera into place and getting the focal depth set just right - the comparatively long shutter speed didn't help either. These were not designed to be photographed, but they do work excellently with the optics of the human eye (other species mileage may vary). Now here's the tricky part: these are based on high resolution LCDs (320 x 240 may not sound very high, but fitting 320 x 240 x 3 [RGB] addressable LCD cells within a ½" is not a trivial feat). LCDs have optimal viewing angles in 2 axes, which left the designers up to figuring out a balance between determining best average pupillary distance, or best main-unit tilt. The outcome of this decision dictates where the broadest axis will be placed and whether the displays will be addressed from the top or the side and the resulting structure of the interior and lay-out of the circuit. So let's take a look.

Vuzix iWear AV230 GutsSeveral competing factors and decisions are illustrated in this image. First, nearly ¾ of the depth of the unit (and who knows how much of the overall weight) is dedicated to the optics in front of the actual LCD (little clear & white box under the yellow tape on the right). If there were ever an argument for high-resolution Fresnel lenses, this would be it (assuming that the etching resolution doesn't inadvertently turn it into a diffraction grating). They also chose to mount the displays symmetrically, with their input regions both oriented directly toward the main circuit board.

This is actually Bad News. While LCDs don't have a top or bottom per se, they do have common properties in terms of the breadth and bias of the viewing angles they support. Since they chose to put the widest range in support of the pupillary variation, that means the supported vertical tilt range is dramatically reduced. These are also identical displays - they were not manufactured in mirror image of one another, so essentially what's been done here is to rotate one of them 180° from the other and use some sleight-of-circuitry to render one display upside-down in order to correct for that rotation. This seems more costly in the development and design to me than simply running the generously long ribbon cable to the far side of one of the displays and using a combined signal wherever possible - I wonder what cost savings they actually realized from of the symmetrical physical assembly they chose instead, if any. The real reason this is a problem is that in the right-eye display, the bias angle to see the best contrast is a degree or two below horizontal, while the left-eye display is a similar offset above the horizon. If one wears the device perfectly level across the face, either A) both displays will be suboptimal and a little washed out in their contrast, or B) one image will appear brighter than the other, creating an uncomfortable viewing experience. From what I've read and personally experienced, B seems the more common option.

It is possible to correct for this in 1 of 2 different ways. First, the wearer has the option to arrange the glasses slightly askew - enough to better align the two disagreeing angles but not enough to throw off the stereoscopic reconciliation and produce a double image, or secondly: to tilt just one of the LCDs within the unit until it agrees with its sibling. The latter option is preferable but problematic, in that the displays are affixed to the frame with a mild adhesive. Glues and electronics are a nasty combination even without throwing optics into the mix - I might be able to perform the kind of delicate surgery required to correct this, but not with the few crude tools I brought with me to the apartment (the rest being left behind in Utah pending the sale of the best house ever and subsequent family move). So for now I'm opting to downgrade from "Nerd" to "Complete Tool" when making use of them by wearing them lopsided - and at these power consumption and battery specs, for 4-5 hours at a time.

Totally worth it.

Friday, October 10, 2008

A Good Geek in a Bad Economy

(e • KAAAAHN!! • o • MEE)

As previously mentioned here, I need to sell my house due to my relocation to Seattle. The current economic and real estate climates are anything but friendly to this kind of venture - we plan on recouping some of that when it comes time to buy a new house in Washington, taking advantage of the buyers' market, but first we have to suffer through it as a seller.

Enter "m4d g33k 5ki11z" stage left: creating the Best House Ever site was just a beginning; it isn't really useful just sitting there, people have to know about it. Putting it on the fliers or associating it with the MLS data only serves as a limited enhancement to what the fliers and the MLS are already providing. In the strictly online realm there are so many places to find information about listings now that there's just too much noise to stand out in; especially when considering that the price range is not uncommon for the region, even though the value represented by that price is a good deal. There's just no way to immediately represent that and draw the kind of attention that will sell the place.

Our thinking, which is perhaps naive, is that with a place as gorgeous as this one, at that kind of price point, someone is bound to recognize the bargain and snatch it up. In order to increase our chances and/or decrease the timeline we need to draw attention and get as many people informed of the details as possible. We know the traditional avenues are saturated, so we'll expand our options a little bit.

On the main transportation corridor in the Salt Lake City area there are 2 LED billboards, one north-bound and one south-bound at places where traffic already naturally bottlenecks during rush hour (maximizing gridlock exposure). I don't fault the billboards with that slow-down though, they don't use any animations, they have immediate transitions (no special effects) and use 8-second exposure windows - so it's not terribly distracting, any more-so than other multiple print billboards (which typically use rotating slats to accomplish the same thing) have been: they just have excellent position. It turns out that it's really not that expensive to buy ad space on these things, so we whipped up a billboard graphic according to their guidelines and signed up.

BillboardThe thinking here is that you can't normally advertise a single property on a billboard - the address information makes it impractical. At best you can list a housing development or various real-estate offices, or things that promote developer brand recognition and the like. The URL we have positions us uniquely though, and gives us an opportunity to try out an otherwise incompatible medium. I've had Google Analytics installed since the beginning to give me a good idea of who was hitting the site and where they were coming from. I thought to use this to see what changes there were in the trend of repeat untracked traffic (coming in directly) by region to measure the effectiveness of the ad. At first I was a little disappointed by the results, showing no real change (not that we're talking about a huge volume here anyway, this is so hyper-niche). I broadened the view and found out something interesting though - visitors were coming in from Google search after having typed in "best house ever," ostensibly from having seen the billboard and/or hearing about it.

Problem is, beyond the URL that text isn't highly featured on the site, nor has the site itself been around long enough to appear on the front page search results (it's top on the second page as of this writing). This means there are a few things I need to change in the contents, and that I should use the webmaster indexing and site mapping tools to increase the relevance of the content from the spider's perspective, and find some way to increase the in-bound linkage. All those things take time to register in the index ranking though, and this campaign is live now - and potentially time sensitive, since we have an open house this weekend.

So I signed up for Google's keyword advertising (I like Google, can you tell?), and snapped up ads relating to "best house ever," "best house," and "sandy house" since all of those are potentially active derivatives from the content on the sign. I restricted the target region to anything inside of Utah and turned it on. Their plans are really economical, and the controls and restrictions available even in a basic account I'll only be spending money for legitimate interest. Being so niche as this is, that means I'm A) saving money over other advertising because I'm only going to owe them anything when it generates activity, and B) I can restrict that activity to the most likely sector and not bother with a lot of costly noise.

I've alse tied the billboard graphic into the main page in order to create a visual association so folks know they're in the right place, as well as a notice of the impending open house. These will automatically deactivate based on a timer after the closure of each event, keeping the maintenance cost low and hands-off. A little bit of technical savvy might go a very long way in this case - and for those also in the geek community, not that it will necessarily impact the sale of the home, I whipped up an ad that might help it get some viral distribution traction online: Free House with Purchase of Domain Name!

I'll let you know how it goes. If this prevents us from having to lower the price, or from having to lower it as far (which is always the standard realtor's refrain for attracting buyers) we're ahead of the game.

Monday, September 15, 2008

Best House Ever (.com)

I've settled into the Seattle area reasonably well, and even have a few blog articles in the works courtesy of time commuting on the bus. They're enough in-depth that they need a little bit more polishing though, and that's hard to do without sitting down at a desk - and when I've been at a desk, I've been working on BestHouseEver.com:

Best House Ever (.com) Preview
Being a geek I decided to see if I could make it a little easier to get our house noticed (Utah's got a saturated real-estate market), and to transmit that information by word of mouth. I was fortunate that an easy to remember, difficult to misspell, and catchy domain was available for exactly that purpose. Usually there is a unique domain per house these days for those which do actually get web sites, but they're derived from the address like "2073WindsorOak.com", which works OK on a flier or in email but not conversation where it would requiring writing down and later review. For purposes of compliance I picked up the address-as-domain too, and promptly pointed at the Best House Ever site.

I'll probably sell or rent the domain name to others after the place sells, or maybe even hang onto it in order to launch a company which does an extremely limited / premium service, maybe 1 house per-region with regions auto-selected based in geotargetting (but overridable through navigation to see other regions) for a pretty penny. For the moment I'm just hoping it brings enough attention to sell this house, which we're offering considerably under market (and drastically below tax assessment) just to unload it quickly so we as a family are not separated for too long. Selling it at this price shouldn't be hard - getting it noticed in the current market is the sticking point, so tell your friends, neighbors, co-workers, colleagues, associates, relatives, acquaintances, etc.

They won't even have to write it down.

Sunday, August 10, 2008

Seattle Bound

Mount Rainier
Effective September 1st I'll be working as a Sr. Manager of Software Development for Amazon.com in Seattle, Washington.

This is a decision a while in the making, and a tremendous opportunity for the family - but not without sacrifice. There are many in Utah we'll miss deeply, and much extended family we'll be away from. Rather serendipitously, we do have some family ties in Washington, and having grown up near Seattle I do still have a network there we can plug into.

I'll have more updates as soon as I can, but the next 3 weeks are going to be packed getting ready for the move and prepping the house for sale. Oh, and for those unfamiliar, the above picture is of Mount Rainier, Washington's highest peak, as visible from the plane on my return flight from the Amazon interviews.

Wednesday, June 25, 2008

Chapter 1, Scene 2, of something I'll probably never finish.

So, after 13,000+ words of manuscript text and who knows how many in the outlines and various scene roughs, I'm pretty sure that the current novel attempt had contracted a terminal case of World Builder's disease. This happened a few months ago, when I realized that there was quality in the writing that editing could save, but that it would require a larger effort than I could dedicate to it within my time constraints. Instead, I lovingly laid the files aside and decided "That one's for practice... or at least for a time far away from here."

Which means I feel entirely safe sharing bits and pieces from the unfinished rough of the manuscript, because these are posthumous as it were. Continuing on, then...



Yuri's breath reflected a hollow kind of echo into his ears in the isolation suit, forming a rhythmic barrier between him and the howling of wind in the thin atmosphere only inches away. Small beads of sweat tickled down his cheeks and nose in defiance of the built-in sweatband. The rest of him was sure to be soaked as well, when he finally stripped down.

He finished muscling the new greenhouse frame into place and bounced easily back to the cargo hatch of the crawler. Two more trays of green-black slop waited for him there, typifying the infinite patience available only to dirt. With barely a grunt of effort he hauled them into place and swung the hinged transparent lid down to lock above them. Almost instantly the tiny spikes of hoar-frost that had sprung to life on the short journey between compartments evaporated from the lumps of muck and turned instead to a fog of condensation on the interior of the golden-hued crystal glass. Yuri nodded approvingly.

He reached into the control box and twisted valves for the hoses connecting this stand to its several hundred siblings, then touched a microphoned finger in his left glove against the junction. The short, high hiss ended abruptly with a melodic snort as air sloshed and rebounded between chambers. Satisfied, he mounted the slow six-wheel and began the forty-minute trip home.

"Honey, are you on your way back yet?" His wife's voice interrupted the labor-bestowed reverie, suddenly making it feel much shorter than the several hour respite he felt he deserved. He waited until his sigh was done and cleared his throat before activating the pickup to respond.

"Yes, darling, just finished. A little more than a half-hour out now."

"Everything go OK?"

"Mostly. There is still more dust on the roof than I like." The latest attempt to thwart the constantly shifting deposits of Martian soil had only succeeded in arranging the micro-drifts into interesting patterns. "And FIDO's charge seems to be a little short."

"Will you be able to make it home?" Her sudden concern sounded more needy than anxious for his safety. Or even his convenience.

"Yes, with several hundred kilometers to spare. There is no worry, it is just an annoyance. I'll bring it into the shop tomorrow and have a look." A few amps wouldn't make a difference one way or another, and it's entirely possible that the non-linear initial drop was in keeping with the power profile for the unit. Still, no sense in taking risks. And maybe he'd get the quiet he was looking for.

Lynette sounded disappointed after a moment's hesitation. "Alright. Just be careful. And let me know when you're getting close so I can start dinner."

"I will need to shower first."

"Come straight home then, but please hurry." She sounded fragile in his earpiece. "I love you."

"Love you too, darling." Yuri closed the channel and guided the large vehicle back across the worn and rocky path toward the outpost.



Some distance to the east, Lynette returned the radio handset to its dock and slumped deeper into her depression. As though mourning a lost world and family weren't enough, she now pined for a man somehow distant even when he was in the same room. Her sworn strength and lifeline.

She looked out a porthole window at the too-small evening sun; another day gone.

Wednesday, March 26, 2008

Persistence, Part II

PoV Screenshot A few more words and details about the Persistence of Vision hack previously mentioned. Pictured at left is a screen-shot of the application in operation. The astute observer will note that there's enough room for at least 3 more columns to the right of the one on display, and may even wonder why I didn't incorporate that space as well. Honest truth is I did - but the switching time (based on navigating the object model behind the scenes) was painfully slow when the additional 18 cells were added to the process, enough so that the entire effect was rendered defunct (the speed required for movement to match the manifest processor lag was slow enough as to nullify the PoV phenomenon). While it may be possible via native code (sans-framework) and/or enhanced algorithms to achieve a sufficient switching rate, the refresh rate of the screen still poses problems.

The photos of the demo operation in the original article testify of this. Looking closely, there are a few instances where one of the 5 columns composing the virtual letter is absent even in the interior (not on the edge of either the wave or the letter). This demonstrates the mismatch between target refresh rate and screen draw/refresh. Also in that picture my fingers were being held such as to cover the battery/status bar visible at the top of the screenshot (although imperfectly, as evidenced by the tracer in the demo photo). All this griping and analysis is fine for diagnosing the problem, but doesn't do anything to improve chances for success other than defining a starting point. So...

Solutions
  • Full-screen draw available via native libraries (eliminates the battery/status bar)
  • Improved drawing routines (faster object navigation via native libraries, bitwise AND comparison to minimize number of addressed cells per call, etc.)
  • Automatic brightness control (demo was taken at half-brightness w/auto adjust turned on - sub-optimal test, and an error of omission on my part).
  • Processor and/or screen overclocking (don't know if this one is possible yet) OR tapping into hardware accelerated GL routines for performance
  • Not being so @#$& picky.

I'll state for the record here that I have satisfied my original curiosity in the exercise and do not anticipate investing the time to explore the above (or other) solutions. I'm willing to let this one die on the floor and move on to the next project(s) I have in mind, which may or may not eventually be disclosed here. Anybody interested in the source code to this point is welcome to contact me.

Friday, March 21, 2008

Persistence

Not too long ago I was fortunate enough to pick up an iPod Touch (bonus had come in from last year's work). The device has been remarkable, smaller than it looks and packing a nice little portable media punch. It also happens to be a fairly robust mobile computing platform, as evidenced by the strength of community development for the device even prior to the release of the official SDK. Being a developer myself, I was intrigued enough to give that part of it a shot.

Rather than put together an Intel hacintosh or risk the wrath of my wife by messing with her new Intel iMac (used for her wedding photography) as required to run the X Code IDE/SDK, I decided to use Jiggy's JavaScript based framework and IDE. While this surely introduces some functional limitations and performance overhead, it was also a very painless way to slap together a proof-of-concept to get a good idea of the problem space I was approaching.

Given that the device contains a set of accelerometers (used by the iPod/iPhone user interface to determine landscape and portrait layout), I thought it would lend itself well to a Persistence of Vision hack - which is to say, using a thin portion of the display, flash certain bits of it on and off as the device is shaken back and forth. The flashes correspond to certain spaces of the visual field during the swipe, and as a result of the mechanics of the human eye (which takes roughly 1/60 of a second to clear out the stimulus) appears to create many little spots floating in the air which can be used to write letters, display images, etc.

I first encountered the effect at a novelty store when I was about 9, when I saw a clock which consisted of a sturdy base and a spring-loaded wand which, when flicked, would flash it's LEDs as at waved back and forth and created the illusion of floating time. While several devices have picked up the gimmick since then, I've never actually bothered to own any of them. Now that the opportunity was right in front of me with a low barrier of entry, why not give it a shot?

PoV Space MathFirst came the math. Working with my wife we were able to determine that a good hand-wave average was roughly 16", making a full cycle (back and forth) every 1/2 second or so (11 over 5 seconds). In order to achieve sufficient resolution to be able to display any letter of the alphabet discernibly, while still keeping the overall number of cells sufficiently low (so as to have low logical and processing requirements) we chunked this 16" section into 6 letters per wave, with each letter broken into 5x6 segments. 6 letters per wave is pretty low, but the idea was to have a word persist only through a single wave - as soon as the accelerometer detected a significant shift in direction it would load the next word, allowing sentences to be spelled out sequentially.

( 6 letters * 5 columns = 30 columns ) / 16" / 0.25 sec (single wave phase) = 120 columns / 1 second, or 120hz switching. In order for a line to pass through 1/2" of space during the course of a single wave, it would need to be on for only 0.008333... seconds. That's for a perfect line - I would of course be switching a region rather than a mathematical construct, so I would in theory need to divide that 120th of a second by the width of the region in order to achieve the target resolution. I fudged this part, and for the sake of the proof-of-concept development decided to have the region correspond to the width of the column itself - 1/2" square, which means that if everything worked perfectly a total of 1" would be illuminated, a 1/2" of virtual overlap with itself (area of continual brightness) giving a linear fall-off to either side. So the letters would look a little fat and maybe just a touch blurry - but that's acceptable to start with.

However: most displays only refresh at a rate somewhere between 70-90hz. If I'm trying for 120hz it means that each cell would fall quickly out of sync, ending up only partially drawn or have some frames of display skipped altogether (compounded by the actual switching rate of the LCD). The second component of the problem is the brightness of the display itself - in order to sufficiently invoke that perceived persistence of stimulus, a certain intensity is required. If intensity is not available contrast may be substituted, but this means it will only ever work in a darkened environment.

Despite the math working against me I decided to give it a go. Setting the interior timer to 120hz is easy enough, but I suspect the time to navigate the DOM logic to the desired cells and switch their states runs slower than that anyway, plus whatever overhead the Jiggy framework required to assist in doing that. I set up the code to follow this plan, draw a column of cells and switch them over the course of fractional sections to the different mapped columns which comprised an entire letter table (in this case a letter is an array of 5 different numbers 0-63 which corresponds to a 6-bit binary display indicating which cells to turn on and off - makes for very tight book-keeping and rapid addressing, and binary logic is just fun anyway so why not?). My test consisted of letters A through E sequentially set up in memory in a per-wave array (all in a single wave) with events tacked to the accelerometer which would catch significant departures from one direction to the next and determine whether that array was being walked forward or backward, even capable of reversing mid-display.


PoV Wave Demo And it almost worked. In the end I had to simplify the display to at most 2 letters, and it only works if 1) the room is dark and 2) one covers the persistent battery-level display at the top of the screen (otherwise it wrecks the PoV effect). Photographing this is especially difficult when one is both the photographer and demonstrator, compounded by doing it in a dark bathroom shot "through the mirror" without being able to effectively test the composition. In the end I got a few good shots and many not-so-good - shown here are 2 images (ISO 80 f/2.0 @ 1/25 sec, the display simplified to just the letter 'A') combined and slightly enhanced for contrast. This shows the difficulty of keeping in sync with the animation - something that with enough tuning of the accelerometer event code and a steadier hand would become easier, but which I don't plan to pursue due to the aforementioned global limitations. The predicted linear fall-off is visible, as are the very slight gaps between vertical blocks on the display.

Overall I'm very pleased with the exercise: it taught me more about a really fun toy, gave me a chance to play with some simple science, and allowed math to Save the Day. Everything worked almost perfectly the first time and I come out richer in knowledge for the effort. The fact that any of this at all pleases me just reinforces the fact that I'm in the right line of work - I'm pretty sure most of the world would find this pretty dull. Hurray for geeks!

Wednesday, March 05, 2008

Not Dead

I ain't dead, or even disinterested. Just very very busy.

And happy. Much is going on, it's good, and active enough that several pending articles remain incomplete for now. I'll be back in a while.

Thursday, November 29, 2007

Samurai 3000-2007 Katana

It's that time of year again, when we have left-over pumpkin decorations in need of disposal.

This year I decided to make multiple successive passes through a single target - and had multiple targets to eliminate. I first selected the one decorated in the lovely "barren oak tree" motif by my wife, shown here next to the same sword as last year.



I made several test passes in front of the pumpkin before moving in with offensive strike no. 4, per the inset below (fig. 3). Traditional sword strikes with the katana are designed to target soft tissues with large blood vessels, bleeding out the opponent fairly quickly. The are not designed for militant action against insurgent squash.



I failed to bring my pass down into the body of the gourd, instead taking off a thin portion of skin on the upper right and the majority of the stem. The next two passes encountered more success, but revealed a disturbing trend: the lower I cut, the more I favored the no. 6 strike.

This could be considered natural - after all, for right-handed katana use the no. 1, 2, and 6 strikes are the strongest. One may also observe within this diagram that between the no. 4 (neck: carotid arteries) and no. 5 (abdominal wall, intestines, descending aorta) strikes there is no strictly lateral movement: the bones of the arms and ribs make the gesture futile. Thus, time is not spent attacking in that attitude at intervening elevations and the swordsman is likely to drift into more familiar territory instead.

Said pumpkin was also sitting on a wall composed of cement. The further one descends into the no. 6 position, the more likely they are to encounter this wall. I'm not sure if I was too focused on the target to notice, or incorrectly believed myself to have accounted for the obstacle and adjusted my swing accordingly. Whatever the case, the fourth pass met with an unsettling CLANG- twing- *THUNK* -clatter-clatter and I became well acquainted with the interior handle construction of my sword - the blade of which was lodged 25' (7.6m) to my left protruding from some plastic buckets near the sandbox (the edged still remarkably intact, only lightly dulled and still formidable).

The tang reduces until it's screwed into a weight which was then epoxied into the pommel. That mount provided the tension to keep the rest of the stack together, and that's it. Everything else up to the tsuba/hand guard is cylindrically hollow allowing free movement - which may have done well to absorb shock, but drastically reduced strength and stability.

Well illustrated in the lower inset is the abysmal tang itself, measuring less than a ¼ the total blade width and breaking rather predictably exactly at that point.

I'm taking what's left of the blade and will mount that in the end of a bo staff for a home-built naginata. The handle remnants will probably be reassembled for use as a costume piece (snazzy lightsaber, or affixed to the scabbard as a non-functional safe-to-carry-anywhere traditional blade). The real difficulty will be convincing my wife to let me cut anything in the yard ever again.

Monday, November 26, 2007

Finger Kata

I can passably play the piano, which is to say that most of the time I sit down and attempt to sound competent on one I succeed. I started with limited lessons when I was nine (or thereabouts, I really don't recall), but didn't stick with it for more than a couple of months before realizing I just didn't have the patience for it on top of the trumpet. I continued to dabble since we had one in the house but refused to formalize the endeavor.

I stuck with brass instruments for the next several years until the continuing saga of braces (my teeth proudly displayed my recessive British heritage, requiring nine years of extensive orthodontics) curtailed the effort. This also put me into High School, where the physical limitations of the mitochondrial myopathy became dramatically apparent, and the social and familial stresses of the age/environment took their toll.

Exhausted, "misunderstood" (classic teen, eh?), and quite thoroughly frustrated, I approached the instrument differently: it became my release, a loud and dramatic voice of discontent, and from there eventually something a little more beautiful and less abrasive. No less dramatic though, I cite Tchaikovsky, Rachmaninoff, Chopin, John Williams and Enya as my primary musical influences in composition. If it wasn't dark, or over-the-top soulful (preferably both), I likely wasn't interested. I stuck with my own compositions or reverse-engineered (by ear) themes of the above named composers, increasing in technical proficiency as ambitions escalated.

A few select pieces by other artists came to my attention during this time, and were sufficiently complex that simply picking through it audiologically was not on option: I had to confront the sheet music.

Having played brass and sung for so long, deciphering a musical score was a straightforward process. However, I had only ever practiced this on the single lines corresponding to my instrument or part without ten fingers to keep track of. Learning piano music was hard. Eventually I made enough sense of things to commit the pieces to memory as patterns of sound and muscle movement and was able to discard the sheet music - I can, even now many years later still play these proficiently with very little warm up.

Fast forward to last Sunday, where I'd been asked to play a piece in church. The date had shifted a few times and now landed squarely behind a major point release and new client installation at work, tightly curtailing the amount of time to practice my piece. A new piece that I was still memorizing (sheet music continues to scare me). In the week and a half leading up to the performance where I could scratch together enough time to practice I did so until my back burned from the ram-rod straight posture and my fingers swelled and fingertips ached. I used every trick I know for rapid memorization, engaging as much of the brain as possible and going heavily synaesthetic (incidentally, part of the song smells like mustard, one passage feels like a piece of dry driftwood being pressed into sand before the glass and wire atop it sings, and I'm still not fully satisfied with the transition from the red-orange passage through the white/green bridge - but the folded steel and flash of yellow came out well). Finally I had it down.

Except for the nerves.

I can sing, dance, fight, or speak in front of groups and thrive on the adrenaline: but piano is still an intimate catharsis, and opening it up to share with others is a vulnerable and frightening act. My hands shook terribly throughout the performance, and tunnel vision threatened to turn the keys blue and started to ring in my ears. I played on, latching onto the coming landmarks at the beginning of each passage like life preservers. I did it too fast, made five huge mistakes, three of which affected the sound of the piece (I segued through the other two in-key), with one requiring me to stop, pause and assess, and then resume. My struggle was obvious to the audience of about 400, but in a church setting this is a supportive and understanding group in addition to being small. I am not satisfied with what I gave them - it was not as well as I had practiced.

It took me a few days to shake out of the experience as well: that much adrenaline and the feel of failure brought back many unpleasant memories from childhood and adolescence. I can forcefully re-route my response into a positive, "points for trying" or "good enough" take but I'd rather not: that's cheating. Synthetic happiness is not un-genuine, but it can certainly be counter-productive: I'm planning on beating this thing. First by practicing that particular piece well enough that I can get it by heart instead of by head - hopefully more resistant to the influences of the moment, or at least a more deeply ingrained headspace for me to get into. Secondly, by finding a way to conquer the nerves and be able to play as though in private - I should have taken some time in the couple of days prior to set up some post-hypnotic suggestions to help induce that, but didn't. I'll start there and then try to integrate the sensitivities into a more regular comprehensive pattern instead of having to pull a dissociative sleight-of-hand every time I want to play.

I'm glad I did it - everyone should get scared once in a while and be forced to evaluate themselves honestly from the perspective of the unfamiliar. 'Builds character.

Wednesday, October 31, 2007

Ted the Caver

Happy Halloween!

I was recently directed to Ted the Caver, a re-envisioning of Thomas Lera's "Fear of Darkness" (PDF Link). While I was unimpressed with Fear of Darkness in its entirety (it attempts to tell too much of the story, and resolves around ideas stretched for me too far beyond my willing suspension of disbelief [probably based on the quality of writing] for its conclusion).

Ted the Caver shares some similar short-comings. Purporting to be the annotated caving-journal entries of a hobbiest spelunker, much of the presentation is weak - critical elements to the story are built into the same way one would do when writing prose fiction, not the way personal experiences are typically conveyed. In my own journal writing, and what I've seen in limited reading of those of others, elements from experience deemed important are granted priority and emphasis: brought up early in the entry, with associated events or ideas splayed out conceptually from that one center and expressed in terms of their relationship to it. The chronological prose and persistent use of limited perspective, when such is limitation is purely artificial, comes across as disingenuous and interfered with my ability to fully immerse in the story.

But only with the full immersion: I was still able to get into it, and at times became frustrated at the pace - I was impatient with the process of reading itself as I wanted to move ahead in the story without having to bother with the intervening language, but knowing it would diminish the delivery to skip ahead and stuck with it anyway.

That's partially where I want to give props to how the story is being presented on the web. The forced pacing lends a certain degree of realism, and helps make the characters more believable. The limited coincidence with factual events (which I'm sure acted as the story's genesis) also helps lend a degree of credibility. The choice to omit the (far-fetched) ending leaves an unresolved suspense and contemplation with the reader, a mental itch in need of resolution not forthcoming (very 1950's-horror-flick).

The other part I wanted to commend was that, in editing out fingerprints of the incredible conclusion, the remaining content becomes almost completely plausible. Gravity, geothermal vents, sulfur dioxide or hydrogen sulfide, and post-traumatic-stress disorder (based on the stress and fear during oxygen deprivation and attendant effects of volcanic gas inhalation) are sufficient to explain away the mysterious events. None of this diminishes the humanity of fear in the described reactions, and in fact made me that much more sympathetic.

All in all it's a fun read, and for Halloween is definitely recommended.

Tuesday, October 02, 2007

Momentary Updates

For a code slinger like myself it's a sore spot that I haven't been able to finish my wife's web site. The urgency has not been there, since most of her interaction with clients is done face to face - but now with an out-of-state potential client wanting to review her work I really needed to get a more substantial portfolio online.

Though still not exhaustive, it does a better job of making her work accessible than has previously been the case. I give you: Forever Moments, by Rachelle.