Feb 28, 2015

Debugging Javascript with DebugJS

I'm obsessed with creating the world's most awesome web development environment. Part of what I'm aiming for is resident in tributary.io, which I blogged about here. Now another piece in the puzzle that I'm trying to put together is this project: https://github.com/amasad/debugjs.

DebugJS uses a clever hack on the feature called "generators" that's in the new version of Javascript (ES6).

You probably don't care about this, but if you did, here's more than you'd ever want to know about generators, and how to build a VM using them. And here's the payoff: a Bret-Victor-style example using debugjs.

Of course I'm still waiting for Bret to open source the great technology he's used.



If I did that it would mean...

People often interpret other people's behavior by applying this rule: "If I had done that, it would mean <this thing.> Therefore, <this thing> is what it means."

No, sorry. Sometimes true. Often not.

Example: for years Bobbi would ask me "What are you thinking about?" And it would annoy me. At the same time, it bothered her that I never asked her what she was thinking about. Eventually decoded our behavior: for her, asking what I was thinking was a gesture of interest, caring and respect. For me, it was an intrusion. For me, not asking her was a gesture of respect. For her, it showed lack of caring.

Our kids call up and tell us what's going on in their lives, and rarely ask us what we're doing. Bobbi says it means that they're not interested in us. I say: "That's what it would mean if you did that. They're showing that they care about us by sharing their lives with us. They don't do that with people they don't care about. And when I have something that I want to share with them, I share it. They don't need to ask."

I have a friend who gets annoyed at people who promise to call him and then don't call. "Did they use the word 'promise?'" I ask. "No," he admits, "they didn't use that word. But that does not matter. When I say I'm going to do something it's a commitment. A promise. I take promises seriously and someone breaks their promises it is a sign of disrespect."

That's what it would mean if he did that. What it means for someone else may be the same, or it may be quite different. For most people saying "I'll call you," does not mean "I'll call you."

In fact, it can mean the opposite. The cliche for not wanting to talk to someone is: "Don't call me, I'll call you." So in this case, "I'll call you" means: "I don't want you to call me, and I'm not going to call you, but I reserve the right to change my mind."

"Don't call me, I'll call you" might be rude, but it is more welcoming than "Don't call me. Period." And it's less welcoming than "I'll call you in a week," which might mean "I'm very busy but I won't be busy in a week, and I'll call you in a week;" or it might mean "I've talked to you enough for now. Maybe I'll want to talk more in a week. Probably not before then, so don't bother calling until at least a week has passed."

So when people say "I'll call you," they don't necessarily mean "I'll call you," and they generally don't mean anything close to "I promise to call you."

"I'll call you," is a social convention, and nicely ambiguous, which is one of its virtues. It means something like: "I intend to call you," which means "I have some degree of intention to call you," which may mean "I have enough intention that I am highly likely to pick up the phone and call," or "I have some intention to call you, but my life being what it is, there's a good chance that I will find something that I will find more important," or "I have a miniscule, yet non-zero, amount of intention to call you, and that makes it unlikely that I call, but I don't want to point that out."

Yes, it's ambiguous, but it's a social norm, and most people understand that it could mean any of these things.

Many interactions are coded ambiguously. We don't say things like: "Because I care about you, I'd like to know what you're thinking." And certainly we don't say things like "Because I care about you, I'm not going to ask what you're thinking." WTF? Really?

We assume that people understand the intentions behind our acts, but we're not always right. And that can lead to trouble.

Before being offended because "If I did that, I would be showing disrespect," say: "If I did that, it would mean I was showing disrespect. Is that why you are doing it." You may be surprised at the answer.

Feb 27, 2015

I Get Lucky (I Love YouTube Search)

Today Mira sent me a song that she's been obsessing over, and I wouldn't be the music-obsessed father and contributor of her music-obsessing gene if I didn't send her back one in turn. Only I couldn't remember the name of the song. What to do?

I knew I'd listened to the song on YouTube, so I started by going through my YouTube history, searching on the word "music" but I've listened to too much music. Or maybe YouTube had started sending me random shit to listen to, because some of the things that came up in history I didn't remember and others I can't even imagine myself listening to. What to do?

After a bit I remembered that the guy who did the cover that I was in love with was named George. George who? George B-something. Well it turns out that that's all you need to tell YouTube. Because I type "George b" and it pops up "george barrett get lucky," which is just what I wanted.

<3

What George does is sing lead, harmony and backing vocals. Drum set, bass, lead guitar, electronic keyboard, piano, tambourine, cowbell, and a few other percussion instruments, all stuff I'd like to do. And with passion and energy that I don't think that I can duplicate. But jeez, I'd love to.

And now, for those interested, here's the video:



Feb 14, 2015

Valentine's day book review: "The Martian"

For Valentine's day, Bobbi got me a copy of a book called "The Martian." She didn't buy it for me. She's way too clever for that. She took out of the library. That way I didn't have to figure out what book to throw out to make space for it if I liked it, and she didn't have to regret buying it if I didn't.

Win!

I finished it in one day. Could not get to sleep without reading it to the end.

The book had me at the first line. Here it is:
I'm pretty much fucked*.
That may not be your idea of great literature, but if you put "Call me Ishmael," one of the official best opening lines of all time up against "I'm pretty much fucked," "I'm pretty much fucked" wins 99 times out of a hundred.

And the hundredth time is a tie.


How about  "It was the best of times, it was the worst of times..." 

Nope. "I'm pretty much fucked" wins.

Those are the best opening lines from memory. But you know me (or maybe you don't). Research is my middle name.  I looked up "100 Best First Lines from Novels".

I'm not through the whole list, and I gotta say there are some contenders, but "I'm pretty much fucked." is still tops for me.

Some books start out great, and go down from there. And you'd think that with an opening like "I'm pretty much fucked," that you'd have no place to go but down. But no. The rest of the book does not disappoint.

You can get "The Martian" at Amazon. Or you can do what Bobbi did, and get it at the Blue Hill Public Library.

* Wikipedia has a page for fuck. Of course they would.

Feb 12, 2015

Sous vide, pour moi

I ordered the ANOVA Sous Vide cooker on the date of this post. It arrived a few days later and a few days after that I got Amazon's recommended sous vide container and cover. I chopped a hole in the top with an electric saw (jig, not circular) and mounted the cooker. Then I cooked my first Sous Vide meal: some cheap stack that turned out pretty delicious.

I'd gotten a vacuum sealer, so I put four pieces of steak in vacuum, and cooked them up at 62°C after presearing.

Two went in the freezer, one went in the fridge to be consumed the following night, and one went in my mouth.


Yum.

I used this as my guide.

I also worked out the logistics of cooking sous vide steak for several people.

Once you hit the target temperature the steak does not get weller done; it just gets more tender. So cook the well-done steaks first. Then lower the temperature to medium and cook them (the well-done steaks can stay in the cooker). Then lower to the rare, and the rarest and keep it there until it's time to serve.  At serving time you can re-sear the steaks to make them sizzle a bit.

Feb 9, 2015

I love Google: Labeling or labelling, which is it?

In a previous post, I said:

Note: PLP is Post Labeling Paralysis and FLT is Fuck Labeling Paralysis in the United States. In Canada and the rest of the English speaking world PLP is Post Labelling Paralysis, and FLT is Fuck Labelling Therapy, with two l's in case you didn't notice. One more example of American Exceptionalism.   Spelling reference here. Ridiculously obsessive follow-up post on spelling, here.
That last 'here' is this post, wherein I present the evidence to back up the assertion, courtesy of Google. Google can grovel over its collection of scanned and otherwise electronified books and tells us the relative use of the alternative spellings.

Labeling and Labelling, American Style
Labeling and Labelling, UK style


So, you see, American books do choose one 'l' by a vast margin, and Brits choose two 'l's, to a smaller, but still very significant degree.

To see and play with the data, click on the image or caption. Trust me, it's cool.

Feb 8, 2015

Post Labelling Paralysis

I've found myself unable to post regularly for all sorts of stupid reasons. One of the stupidest I'll call Post Labeling* Paralysis. In this post, I'll explain the condition, what I did initially to transcend it, and what I'm doing now.

First, the condition. A diagnosis of Post Labeling Paralysis indicated when a one has written a new post, is about to publish it, can't figure out what to label it, and becomes paralyzed. PLP occurs when writers consider labeling a post to be vitally important. If a post is labeled, they reason, it lets readers easily find similar posts to one they found interesting, thus improving their blog-reading experience. Therefore, posts should always be labeled.

PLP's behavioral effects can be mitigated by instructing the PLP-sufferer to say: "Fuck labeling this post. I'm publishing it anyway," and then to hit the Publish button. This is known as Fuck Labeling Therapy, or FLT, and has been shown to be an effective intervention.

After sufficient FLT, a PLP sufferer may enter the post PLP stage, or PPLP. During the PPLP stage one no longer has to apply FLT techniques to publish a post. As one former sufferer says: "You don't think about labeling any more. You just push the fucking button."

Ultimately the PPLP phase may result in a series of Post Labeling Epiphanies (PLEs) during which the proper post label naturally suggests itself and is applied without hesitation. For example, metablogging for this one.

Reversion to PLP, if it does occur, can be handled by further application of FLT.

Note: PLP is Post Labeling Paralysis and FLT is Fuck Labeling Paralysis in the United States only. In Canada and the rest of the English speaking world PLP is Post Labelling Paralysis, and FLT is Fuck Labelling Therapy, with two l's in case you didn't notice. One more example of American Exceptionalism.   Spelling reference here. Ridiculously obsessive follow-up post on spelling, here.


Pages