Friday, August 29, 2014

frameworks are waterfall-ish

Geek time! Thinking about how I so strongly prefer libraries, where you call the code, to frameworks, where their code calls you. (More or less.)

Looking at the trouble I've had lately with frameworks, it seems like there's always some mismatch between the end result we're trying to produce, and what the framework does naturally - and the hacks to get from point A to B are UGLY. To that extent, I realize frameworks are inherently "Waterfall"-ish, because you have to have a good idea what you're coding from the very outset. Libraries tend to be more swappable, and you're less beholden to the clever Frameworks makers having pre-guessed your requirements.

Don't get me wrong; Agile always gets messy. But I think the messiness that results from keeping things simple is easier to cope with than the messiness of hacking around something complex.

coping skills: monitoring DOM changes

Debugging other people's code is tough, especially when there's heavy use of frameworks.

In this case some other code was changing the contents of a DataTable cell, and I didn't know how to track down what code was making the change.

Turns out Chrome and Firefox have pretty good facilities for adding breakpoints based on DOM changes! In Chrome's Elements tab, right click on an element, and there is a convenient "Break on..." menu, with a few convenient options for the type of change you're worried about.

I've worked with so many primitive environments that I'm sometimes a bit more adept with log-based / println style debugging, but my debugger mojo has grown reasonably strong as of late. (The nice thing about log-based debugging is it really forces you to think about the assumptions you're making, and you're less likely to get swamped by a flood of information.)

More Information at Stackoverflow (as usual).

Tuesday, August 26, 2014

wheel library

Gábor Berkesi sent me an interactive version of the hooptime information disply I posted the other day. It uses his wheelnavjs library, working to make it easier to make little dial and circle based navigation widgets -- good use of SVG!

Monday, August 18, 2014

piece on frameworks

I don't agree with all of it, but this Opinionated Rundown of JS Frameworks echoes many of my concerns about some of the popular systems out there, especially Angular.

Also, Why Libraries are better than Frameworks -- I guess a lot of what I think has been argued under the terms libraries vs frameworks, sometimes described as "if I call the code from my code, it's a library, if their code calls my code, it's a framework". I really think libraries lead to much easier to debug things!

Friday, August 15, 2014

the ux of time, the ui of p5.js! (hooptime)

Over the past few years I've realized that I use an idiosyncratic visualization for certain kinds of time; I see the cyclic nature of the twelve months of a year and the seven days of a week in the form of a circle, both going counter-clockwise. I spent some time today generating images reflecting this view. Here's a reflection of what a week is like for me:
I guess the specific rotation and counter-clockwise direction reflects a dash of synesthesia, and also how important physical layout is to my sense of recall -- if I'm trying to do a week-based day calculation, I'll often use my hand to as an arrow to mark my place in the week, in the same way I'll still unconsciously shape an "L" with my left hand to recall which direction is which. 

I'm less certain why I place the weekend down. My best guess is see that as the start and stop of a week, and is either "heavier" or "where the week meets the road" (to stretch the physical metaphor, since I view myself as moving in the fixed week-wheel rather than it moving to accommodate me.) The counter-clockwise motion then springs from that - I read left-to-right, so the Saturday-Sunday "start" to the week is in that "forward" direction, and thus drives the rest of the loop. 

Years are even more strongly laid out in my mind's eye: 

Here the calendar starts at the top, as one might expect, but I think that's because I view a year as progressing from school year to school year, with the loveliness of summer vacation anchoring as the base (though a separate desire to have the numeric transition be straight up tilts the thing a bit.) 

Neither visual is strongly color-coded for me, but week vs weekend and the various seasons have a different ephemeral feel, here color-coded for grins. 

As a side note, I used a new technology for this, p5.js -- the same processing.js I've used for years, but now as pure javascript, rather than going through some weird java-to-js convertor. Highly recommended! You can check out the working page and source code if so inclined.

(Incidentally, I looked into doing this with CSS trickery, but man, the CSS shapes page uses such crazy, inflexible hacks... relying on how if the div is tiny and the border is REALLY wide, then one side of the border looks like a triangle, and messing with border radius makes circles, and then you can get :before and :after going for extra stuff... bleh, it's a mess that breaks quickly when you try to adjust it.)

Tuesday, August 5, 2014

snapshotting music and video from streaming

I have a strong preference for paying for music. (Though I'm spoiled, and am less inclined to pay for whole albums.) I looked everywhere (err, meaning iTunes, Amazon, and general Google) but could not find an MP3 for Novel's Peach (a slightly raunchy hophop slow jam)

I tried the OSX app "Grappler", but it has been failing me lately. However a friend pointed me to a kind of metasite with links to various "grab file from streaming" services. was able to make an MP3 from the video, and then was able to grab a different youtube movie that I had previously uploaded, but that the OSX app Grappler was choking on. (Grappler wasn't able to do the Peach MP3 because "video not available on mobile").

Again, I pay for music (albeit, in a entitled way) whenever I can, and hope people dig on supporting artists as well.

Friday, August 1, 2014

PROTIP: Use OSX "Preview" to trivially fix janky iOS Photo EXIF issues

iPhone 5 macro mode isn't half bad. Although the lens isn't up to my Canon's quality, the touchscreen helps...

But more importantly I have a good-enough fix for my iOS EXIF workflow I was ranting about the other day.... I realized the easiest (Apple-centric) way for me to correct EXIF rotation on iOS photos is to open the image in OSX Preview and hit cmd-Save... then I can drag it straight into my dropzone.js powered webpage, and I'm set. (Sometimes I think I should just use tumblr so I can participate in the sharing, but I would lose the "what did I post on this date in previous years" ability.)