Clarifications: posted March 29, 2016 | 0 Comments

Romantic Heart


December 2010

Romantic Heart: posted November 20, 2014 | 0 Comments

More Apples


Found in the phone backups -- December 2010

More Apples: posted November 18, 2014 | 0 Comments


Third Almost to Minna

Third St Almost to Minna

It’s been a while since I’ve written about the web tech of botzilla or random photo gear issues. No time like the present.

First off I’ve been slowly updating all of botzilla to use more modern web frameworks, which happily work well with the ratchety old Moveable Type backend. The blog portions were easy to complete, the older Powershot & Streetphoto archive bits will come soon enough. I’m also rearranging some of the tag bins, mostly to reflect the changes in botzilla intent since the original charter.

Given the general growth of the blogosphere since botzilla’s early day, I doubt that anyone other than myself will really notices these changes.

On the camera front, my Canons are being retired, along with my TLRs and Bronica rangefinder (one TLR, the Bronica, a 5D body and a couple of lenses are still for sale!). I initially intended to replace them with the latest Leicasonic LX (LX-7) and later a Fuji X100s… to my surprise the littler of these little cameras was dominant for a while, though over time and practice I’ve come to use the X100s more and more, eventually supplanting it with an X-T1 which is terrific and provdes a second career for my Contax lenses, but the X100s is still doing the bulk of my shooting as of September 2014.

Like everyone, I’m also shooting a lot with my phone, occasionally with a tablet, and intermittently with Google Glass. More entries to come on all of these technologies as I stumbled along ahead.

Upgrades: posted September 10, 2014 | 0 Comments

JavaScript: The Bad Parts

Web Geek Warning

Last night I headed over to the Paypal/EBay offices to see a presentation by Douglas Crockford, titled Programming Styles and Your Brain

I'll admit that I was a little bit skeptical about coming away with much useful information (a general rule: be cautious around tech companies that have had near-zero evolution since, oh, 1995), but in fact the debugging bits were pretty illuminating. Here are some sketchy notes:

Your Brain

Crockford’s lecture had about five introductory minutes of broad speculation (he's earned the right!) mixed with notes cribbed from Daniel Kahneman

  • Computer programs are the most complicated things humans make
  • Humans suck at making such things
  • They make mistakes
  • They confuse “hardly ever happens” with “never happens”
  • They confuse reading two threads on a jquery forum with an education
  • They write in C++ when the language is not C++ (or Java, HLSL, python, Mel, Fortran…)
  • They mistake complex obscurantist “cool” with professional “clear” coding
  • The human is almost always the limiting factor in software
  • Being consistent in style is the easiest way to avoid common errors (especially forms that are difficult to distinguish rom errors, which in JS are many)
  • Anyone can program, few can debug


This was the expected real bulk of the presentation, a longer not-veiled pitch for JSLint and his book “Javascript: the Good Parts” -- especially about how to avoid the bad parts:

  • Auto-semicolon closure. This burns people so, so, much, and is one reason where it really does make a difference (for polyglot programmers) to get in the habit of putting the curly open-brace to the right of the if() clause on the same line, rather than on the line below – just like K&R intended.
  • Stupid multi-line strings that use “\” at line breaks because the parsers don’t recognize trailing spaces and the editors don’t show them.
  • Mistaking the scope of “var” to be block scope (like C, python, etc) – it’s function scope, so avoid declaration-inside-the-block constructions like for (var i=0;…) { … } because it won’t get declared where you think it is. I know I make this error a fair bit.
  • Make global variables REALLY_OBVIOUS. Since there are no macros in JS, THIS_IN_ONE_WAY (clearer than, say, Hungarian). In general avoid globals, except that you can’t because that’s how modules link (no linker).
  • If using immediate-invocation functions, put the final () inside the encapsulating () parens – e.g. (function() {…}()); not (function() { })(); – the latter wrong construction he called “dangling dog balls style.”
  • Avoid “==” because it does type conversion and different interpreters convert differently! Is (‘’==0) true or false? Use “===” instead, for a direct comparison.
  • Avoid the “switch” statement or at least be obsessively diligent about having break statement in every clause -- and having a default case.
  • Avoid the “with” construct. Consider: with (o) { foo=koda; }
    does it mean:
    • foo=koda;
    • = koda;
    • foo = o.koda;
    • = o.koda;
    ??? Different interpreters DO give different results!
  • var a = b = 0; in JS is the same as /*global */ b = 0; /*local */ var a = b; -- NOT like C.
  • Not only are “var” declarations hoisted to the top of the function scope, so are function declarations. So beware dependencies that are not resolved! NO ERROR WILL PRINT. Better to just put the var and function declarations at the top of the enclosing function
  • Avoid the “new” pseudo-class construct, not because it doesn’t work but because people often forget to write “new” and then they may accidentally trash that global class-like definition and you are hosed. Just use simple {objects}
  • If you have constructor functions indicate them “LikeThis()” to distinguish them from “all_other_functions()”
  • Avoid “++” which is a leftover from pointer arithmetic days. Just use “+=1” it’s just one more character to type, using “++” doesn’t make you more efficient, it makes you sloppy (especially when few people remember that i+=1; is not i++ -- it’s ++i;)

The Bad Parts?

So how does the Javascript on Botzilla stack up? Let's just say, it's an ongoing learning process!

In scanning the scripts here (and at Trion), there appear to really only be a couple of idoms that I need to stamp out from my code to make the analyzer happy. What's yet to be determined is if Javascript's scoping rules will ever really make sense...

JavaScript: The Bad Parts: posted June 22, 2012 | 0 Comments


Fluid is the new Black goes the saying of the day, but for Botzilla the main message is: get over it.

By that, I mean that if the site needs to work on all possible screen sizes, for future-friendly leanings, then: the pictures are just going to have to be small. And there's the rub for a photo site -- when the pictures are reduced to being upgraded versions of the thumbnails, not the other way 'round. This is tough, and frankly I won't give up without a fight for getting the best possible photographic presentation into place.

At the moment, I'm getting cozy with this little bit of CSS:

img { max-width: 100%; }

Which is a trick to ensure that images are resized downwards as their containers shrink.

The obstacle on a site like Botzilla is that most photo <IMG> tags have both WIDTH and HEIGHT properties specified, so that when displayed on a small screen, "max-width" alone doesn't get you very far -- the images don't scale uniformly down, but instead simply compress horizontally, untill they're long tall sticks.

JQuery to the Rescue!

Including this as the first line in my ready() function does the trick:

Black: posted June 06, 2012 | 0 Comments

All Minds Think Alike

I'm a bit annoyed at the realization that my most-recent post on fiddling with HTML5 canvas in Moveable Type looks and behaves in a way that's terribly similar to the page header on the official Google blog. I must have seen that before... we rarely know where our ideas and parts of ideas come from! Or is it merely "parallel evolution"? Still, it's not as if I'm launching a product, and hardly expect Google's IP lawyers to appear on Botzilla any time soon (hi guys).

And I like their "version" of the interactivity -- ONLY let the mouse have an effect when moving. Will have to check that out on a tablet.... of course, when they're creating a brand presence for a company with.. what, 30,000 employees? you would only expect that they'd take a little more time on polishing than my slice-of-a-Saturday attempt. Pat on the back, lads.

While not posting for a few days, I've been scraping at Botzilla's underlying CSS structure, so that I can rebuild it once more with CSS that will allow a fairly seamless multi-screen experience -- PC web or mobile phone/tablet. This has meant I've already had to update (internally) my use of jquery to use jquery-mobile, have started playing with Modernizr for those stodgy users who insist on running IE, and trying to make peace with myself over the idea that photos that I felt barely look okay 800+ pixels across will just have to be acceptable at mobile-phone sizes.

More to come as this gels.

All Minds Think Alike: posted May 21, 2012 | 0 Comments


One more for a Saturday -- see if you can push all the balls off-screen at once! (and no, it won't try to sell you car insurance)

Everything here, on the JS side, is set up using a shared array of initializer functions, just like the previous entry on that topic.

Next step might be to re-cast it as SVG... amazing that SVG seems really powerful, but compared to <canvas>, theres' almost no really good documentation...

791: posted May 05, 2012 | 0 Comments

HTML5 (& JQuery) vs Moveable Type, Part 2

Following up on the previous post, here are the details on a simple way to add multiple dynamic scripts to a Moveable Type index page.

Like the previous post, try using your mouse on this one! Can you slow down the particles?

Basically, we just need to add an (initially empty) array of function references to the page templates, which we'll use to capture each blog entry's unique scripts (rather than letting them launch themselves), and then iterate on that array for the entire page, once it's loaded and ready.

I'm using jquery, so I declare the array and my $(document).ready() function like so:

var gRActions = new Array(); // initially empty array of functions...

$(document).ready(function() {
  for (var a=0; a<gRActions.length; a++) {

Then in each blog entry, I write the same anonymous javascript function as I might write for $(document).ready(), but instead I just push it into gRActions:

gRActions.push(function() {

Now the page, regardless of how many blog entries it might contain, will include all of them in its page initialization. Remember also to make sure that any "global" javascript values (including function names!) in this entry, and all HTML elements like <canvas>, have unique names so that they won't collide with other blog entries, should they for some reason both be presented on the same HTML index page someday.

Also, as we've learned from the previous post: put some human-readbale text into the post before the scripting portion of the post, otherwise Facebook becomes confused.

HTML5 (& JQuery) vs Moveable Type, Part 2: posted May 04, 2012 | 0 Comments

HTML5 Canvas vs Moveable Type

With a little fiddling it's easy enough to use <CANVAS> (and jquery) in tandem with Botzilla's somewhat elderly (and modified) installation of Moveable Type.

Minor tricks:

  • Remember to suppress Text Formatting -- no automatic <P> tags
  • Between different blog entries, don't reuse variable names, or element names, if you think you might ever need to have multiple canvases on the same page (say, in index or search pages). You will disappear into the fourth circle of scoping hell.
  • Likewise, if you think that multiple canvases per page is a real possibility, then put each canvas's prep and render code into a distinct function, so that you can move your onload() or $(document.ready() functions into the header template, not the body of the entry itself. In the header, declare an initially-empty array of functions, and have your ready() function iterate through them.
    Then in each scripted entry, add your entry-specific render function(s) to that array. This way, the ready() function can just know what's needing to be set up for the specific page, regardless of which entries are being displayed and the # of visible canvases (A perusal of the initial state of this entry will show that I don't always follow my own advice. But adding that feature to Botzilla is one of my next steps). Be sure to put that array and calling function into all of your index and entry templates!
  • Linked sites like Facebook won't show <Canvas> or other animating elements, so if you want a good thumbnail, try adding a hidden image like so: <IMG SRC="/photo/journal//may03e-15.jpg" STYLE="display: none;" />
  • MT's preview page doesn't have all this extra js etc built-in. I suppose you can add it, and I probably will over time -- but as a quick workaround, to get a preview, I save my entry, press "Publish," then immediately look at the front index page -- if there's anything wrong, immediately change the entry state back to "Draft" and save again. This will remove the entry from the front page and the RSS feed, but: the "permalink" actual page file (in this case, "/blog/archives/000738.html") will still be there on the server! Download it and debug locally, then transport your changes back into MT. A bit of a shuffle but it's a workflow that can get you from points A to B.
  • Beware trying to test-post to Facebook, changing the contents of the blog entry (even for typos) and trying to post it to FB again -- FB caches everything the first time, so... if you want a change that will appear there, you need to make a new copy of your entire post, publish that, and hide the old one (how do I know this?).
  • Google+ is smart enough to recognize the difference between javascript blocks and actual human-readable body text. Facebook is not, and may just insert blocks of random code onto any FB link you create pointing to your entry. Maybe they will learn.

HTML5 Canvas vs Moveable Type: posted May 04, 2012 | 0 Comments

Playing All Sides


Despite my belief that Facebook has been a large-than-deserved time sink for myself, I've finally managed to add proper "like" buttons to these pages. Took a little reminding myself how javascript worked, but now every entry has its own "like" button so that, well, so that Facebook can sell more ads.

I've also been poking at Google Currents as a distribution mechanism for mobile devices, in addition to puzzling over how to make botzilla itself tablet-friendly and how to best reduce all photos to 400 pixels (to bend the old saw about cameras, "the best photo gallery is the one in your hand"?).

What's a bit of a puzzle to me is how to best incorporate either of these with some of the other aspects of botzilla that I'm looking to enhance, especially heavier use of <canvas> tags using animation and where possible WebGL. Given that Facebook looks for static images to grab as thumbnails, and that Currents runs off of RSS, how to best show-off fun animation and interactive imaging experiments?

Playing All Sides: posted May 02, 2012 | 0 Comments


Dogs and Lunches, etc

If It Has a Ringtone, It's Not a Camera. Panasonic Lumix's advertising slogan didn't last long -- not, I think, because there would soon enough be a Lumix-branded mobile phone, but because it's a slogan that can easily be interpreted either way: that a celphone is less than a camera, or (oops) that a camera is potentially rather less than a cameraphone.

It's also less than a "camera-puter," which is an aspect that is neither camera nor phone.

In the simplest sense, the camputer is a portal for images direct from your hand to the internet. But what about pictures before they ever leave the phone? If they ever leave the phone?

The utilitarian camera-as-scratchpad notion that's been spreading since the advent of home video (even, for a few, on Super 8) is now something that almost everyone takes for granted. End a meeting with a whiteboard full of scribbles that might be useful later? No time to copy them in a notepad? Use the camera phone. Want to keep a snap of the good-for-once haircut? Want to remember that the car is parked on Level 4 Blue zone? Easy and the photos just as easily cast off when they're done.

Camphone as agent of political change? The jury's out on its genuine effectiveness, but certainly it's had a huge and unpredictable effect on the relations of people, governments, politicians, and the media between them.

Beyond these "useful" applications, though, and beyond the camphone's replacement of point and shoots for a quick facebook-upload fix -- are there new ideas that might be useful creatively? The rapid spread of programs like Hipstamatic and Vignette (or even CamScanner) provide a hint to one other direction, closer to usual photographic practice -- the collapse/reversal of the traditional photo workflow. Sure, you could already take a digital photo and then push it through Photoshop to alter the character of the color and contrast, emulating the look of a particular film stock. The patterns were still the same: capture, process, and (potentially) presentation.

The advent of processing tricks in the camera application collapse the first two steps into one. Just set the camera on "Velvia" and go find some fall foliage. Heck, put the processing and border-generating on "shuffle."

Or even shoot with a different camera and import the images into your phone, rather than spend $500 on Photoshop: which is just what is happening here -- cited by Leica, no less. Established commercial photographer Laura Rossignol shooting on a D-Lux 5 (aka Lumix LX5), and then (after doing selects in Lightroom) "I like to take the post processing one step further and I will email a finished version to myself so I can open it in the Picture Show iPhone app. It allows you to add interesting effects and frames."

(Addendum: Adobe's John Nack made a similar post to this one, wondering: why would you edit on a mobile device?, just a few days ago....)

I used to think that the transparency or negative was the canonical object. As Ansel Adams wrote about it, the negative was like a musical score, to be interpreted by a darkroom performance for each new print. Throw that idea away. Immediate darkroom-ish styling on the fly: whether you think they're insanely great or sentimentally godawful, they're as fundamental a part of the New Beast's nature as is the thickness of oil paint or a trumpet's high notes. Get used to it, this is still just an early wave.

Camputer: posted February 02, 2011 | 0 Comments

Flashy Foods

What I Ate: 28 Jan 2011

The flash diet doesn't require using flash, and it isn't really a diet per se, but an alternative to keeping a food diary -- photograph everything you eat. A side benefit is that it gives you an excuse to make at least a few photographs every day.

For entertainment value I've given myself a little rubric:
    • Celphone only: twee "FX" apps okay
    • "One bullet": c'mon, it's time to eat
    • Context: ingredients, locations, companions

Here is a great thing about celphone cameras: they're not Hasselblads. They're more like a real "pencil of nature," in that a pencil has incredible range -- you can use the same pencil to jot down the grocery list or to draw a masterwork. The Hasselblad is more like oil paints -- wonderful for what it does, but too grand and technically involved for casual muddling.

Flashy Foods: posted January 28, 2011 | 1 Comments

eReading, 2011 Edition


The pictures show a recent bargain toy -- a 7-inch Pandigital Novel eReader (aka "PDN," or "WPDN" to specify the white variant), re-flashed to expose its Android underpinnings and updated to Android 2.1 "Eclair." I managed to pick this one up during a recent clearance at the nearby chain store Kohl's for a tidy $59 (apparently, a few folks even managed to get a $20-off deal -- an Android tablet for $40!). Even at the more-usual price of $199 the Novel is no iPad, but at that price you could by three or four of them (or at the discount, a dozen or more!) for the price of a single iPad (Addendum: Apparently they sold 440,000 PDN's in 2010). So here's a quick review of my experience thus far:

Pandigital are known as much for their digital picture frames as for their e-Readers, and the Novel kind of feels less like a slowed-down computer and more like a turbocharged picture frame. This suits its designated purpose: as a full-color eReader. Not a game machine, or a media center, though in fact it's quite capable of playing YouTube videos or being a music player if the mood should strike you to use it that way. But really the CPU wasn't designed for rapid-fire screen updates. It's a device built around a slower, simpler, long-attention-span sort of experience.

I've got several different devices on hand for comparison, including current iPhone, iPad, a couple of new and old Android phones, and various other small computers, MIDs, readers, and so forth. Given this environment, these are the things that stand out about the Novel:

Resistive Screen
A good resistive screen, but it works best with the back-of-the-fingernail strokes rather than just the finger tips used on capacitive screens like the Nexus One or iPhone. This can throw you when moving back and forth between different devices.
Mentioned this before, but: it's okay. What I don't try to do is cram every possible use case into this device -- I am not expecting tons of animated bells and whistles or HD television or anything of that sort from it. This is one device among several, so I can let it just focus on what it does well. For my uses (more later), it's fine.
No Bluetooth
No Camera
No Phone or 3G/4G Connection
If I thought it was really important for me to record my face and location while typing my Engadget responses from the beach, I suppose these omissions would be truly upsetting. Happily, the simple wi-fi connection covers any of the locations where I'm actually likely to be using the PDN, and I can always turn on tethering from my phone if I'm desperate to update my apps while tooling along through traffic on US 101.
No Pentalobular Screws
Easy open, and easy tweak, too -- I doubled the internal memory by simply sliding open the case and swapping a hidden microSD card.
Long Battery Life
I've accidentally left mine on all day and it's still solid later on. It's a charge-daily device, though, unlike, say a Sony E-Ink reader (which can last for many days -- again, designed for intermittent bursts of activity, rather than continuous on-screen spinning and sparkling).
Standard SD Card Slot
The PDN can accept SD cards up to 32GB, though I haven't yet filled the free 4GB card I picked up at MicroCenter (There's also the hidden internal slot mentioned above, for microSD).
USB Port
The device has one, but it's really only useful for communication with other computers via ADB (Android Debug Bridge)
The Case
Not many choices compared to iPad, but I found this book-style folder at Bed Bath and Beyond, also on sale (The PDN is very much not the sort of device you'll find in usual computer stores -- everything has come from the Housewares Dept so far!).
Having the case makes a huge difference in the comfort level (one of the pix above shows it without the case for comparison). It's much easier to hold and I don't worry about banging-up the screen. This cover compares somewhat to the base cover for the smaller and lighter (but less capable & monochrome) Sony PRS-300 E-Ink reader.
The PDN is smaller and thicker than an iPad (which makes it feel heavy and dense, even though overall it's a bit lighter). I prefer this size, it suits my hand better, without being too small to read at a comfortable distance while reclining on the sofa (unlike the Sony, which needs the font size cranked up at that distance).

So what's it good for?

Principally, it's good for its chartered design tasks: reading eBooks and light web browsing. For these, it's excellent. By stripping-away the default Pandigital/Barnes&Noble skin (re-flashing doesn't delete these features, but simply makes them companion apps within the Android Home screen), the full range of Android apps can be seen and tried. I've found that the combination of wi-fi and Google books, Aldiko, & Kindle apps, along with Google Reader and the Skyfire browser, makes it more capable that any other reader save high-end tablets like the iPad or Galaxy Tab.

eReading, 2011 Edition: posted January 24, 2011 | 0 Comments

Less Net

Key Largo, 2010

I hear that and perhaps even flickr may go away soon. The new joke around the valley is: "if the US really wanted to kill Wikileaks, they'd have Yahoo acquire it."

In the mean time, you might like this.

Less Net: posted December 17, 2010 | 0 Comments


All content on is ©1994-2017 by Kevin Bjorke. All Rights Reserved.

Older Entries