Tuesday, February 28, 2017

It can run on MacOS; play is part of sox which you can get via brew:/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"to install brew, thenbrew install sox

Monday, February 20, 2017

A friend of mine, Ken Bernstein, caught me at the end of the "Science and Spirituality" reading and discussion group we share and mentioned this idea to me, and was wondering if I could help him figure out if if i was useful or not. It involves binary numbers.

That's some extremely loose and crappy code. For one thing I wasn't smart enough to write a "decimal to weirdbinary" converter directly, but I could go the other way, so I start by generating all the decimal values for a lot of binary counting and storing the result, keyed on the decimal value.

Then I could plot the bit ordering, if you're just doing decimal counting, what do the bits look like... and I got this:

The red column on the right is regular binary, the blue is weirdbinary. Regular binary has a nice pattern, once you know what to look for... the ones place toggles every line, the twos place toggles every other line, the fours place toggles every four lines, etc. Weirdbinary... I guess it's about the same, but the rows are kind of offset?

After that, I tried seeing how different translations from weirdbinary to regular binary looked, using regular binary as the "standard" for calculating the y position:

Ok, so for that, the diagonal red line is the trivial case: binary 000001 = 1 pixel up, binary 0000010 = 2 pixels up, 00000011 = 3 pixels up, etc. The blue is where I take the decimal values (1,2,3 etc), get the "weirdbinary" bits for it, and then plot those bits as if they were an ordinary binary number. (So every value there is positive, since I'm not using a regular binary notation that can do negatives)

I then added the green by going the other way around: I take the counting decimal values, convert to binary, then see what those bits represent if we read them as weirdbinary. This forms a complementary pattern, which makes some intuitive sense.

So, getting back to Ken's question, is this useful for anything? Well, it might be kind of nice that you can represent negative numbers without using two's complement (which requires a fixed number of binary digits to work). I don't know if there's an "easy" way to count in weirdbinary, or to do basic addition and subtraction.

Any thoughts?

FOLLOWUP: I have some smart friends on Facebook! Jeremy pointed out that this "weirdbinary" system can be explained as being "Base Negative Two"... Wikipedia even mentions a polish computer that used it. I guess the term is "negabinary".Scott pointed out Gray Code, another binary encoding system which has a lovely property that subsequent numbers only vary by one bit - clearly a win for making signal more robust and less prone to big error.

A zero length is a zero length of px, em, cm, or whatever, but for some reason some Lint-heads decide that a since a zero "CAN be an unlabeled" it "SHOULD be unlabeled" (which then gets parlayed into "MUST be unalabled", if your company enforces linting rules for builds.) This page tries to justify it as "saving bytes", which is a pretty weaksauce argument in a world minification and what not.

The other argument is "consistency", but actually I think it makes things more inconcistent: if you have a bunch of "px" values, but one of them happens to be zero, it's not allowed that it be a "0px" measure like its siblings.

In the chat though my department lead came down on the side of not establishing a mechanism for the group to vote down irksome lint-rules. I think it's less that this particular rule is defensible, and more that they want to avoid the quagmire of long debates about other rules that developers find pointless or excessively pedantic.

Monday, February 13, 2017

I'm a member of BABAM!, the "Boston Area Brigade of Activist Musicians", a loose affiliation of folks across various pre-existing HONK! groups.

In the past I've made up some stretchable tuba covers (pretty good custom site for them, there) that identifies the group I'm marching with - it's a convenient place to put a billboard, even though I don't like how it obscures some of the goofy Seuss-ian beauty of the Sousaphone.

Here's the new design:

I wanted to outline what the acronym stood for without nerdily just writing it out in big block letters. I also wanted to keep a bit of a homespun, lowkey look. My solution was to use a special tool in the iPad program "Sketch Club" that lets you draw with words, so to speak. I had to adjust and paint with " ACTIVIST MUSICIANS BOSTON AREA BRIGADE " so that the lines were more clear, and start with leading spaces because of quirks in the line angle, but overall I'm happy with how it came out.

Tuesday, February 7, 2017

At work we got to talking about craigslist as a site that has kept the same basic design for a long time. (And as such, is a frequent sample project for student designers who would propose revamps of it.)

It got me thinking about a blog entry that has stuck with me (now only available by the Wayback Machine) In it a designer (who comes across as rather pompous, to be frank) talks about an interview at what was probably "X10", the folks who graced the web with the innovation"pop-under" ad (now mercifully not much of a problem) in the 90s, with a bunch of scummy "put networked cameras all over the house! or your attractive neighbors - wink wink " ads.

The designer writes:

[The interviewer] said, verbatim, “You’ve probably seen our website, and as you can see, it looks pretty shitty. That’s pretty much how it’s going to stay.”

and

His explanation was that they were a direct marketing company who just wanted to push products [...] out the door. His description of the target customer was, “Men from around age 30-40 with a little extra money who like buying gadgets and aren’t too concerned if it doesn’t work too well.”

Thursday, February 2, 2017

One paradigm that I think makes sense, but goes against some of the same feelings of "self-evident good" shibboleths as "triple equals" - personally I'd rather be allowed to say

if(something) doOneThing();

as long as that was one line, it's like a single thought. Or even

if(something) doOneThing();else doAnother();

Most of the arguments that insist on the curly brace frame arguments like "well what if you put in another command, and expected it to be conditional, but it wasn't?" but that would only apply if someone was doing

if(something) doOneThing();

which to me is clearly wrong.

But people prefer the simplicity of the "always use brackets" rule, so that two liner example above will be 5 or 6 (depending on if you can "} else {" on one line, and it's not THAT big a loss, but still.

It's the principle of over-simplified linting rules that get to wear the cloak of "this is obviously better, you cave man graybeard" that bugs me a little -- again ala "triple equals is ALWAYS better" even for edge cases where it's demonstrably not.

(The fellow coder said he had been burnt by this after using the "to me clearly wrong" example of putting the conditional'd action on the next line line without braces, just indenting... so maybe we should just stick to braces everywhere, sigh.)