Thursday, December 23, 2010

Pro Tip: Ask for a 999 Cut

Hello CtJ Nation!

A short post to wish readers a splendid holiday season and a happy New Year. Thanks for staying with me through 2010. It has been a hectic year, and I've been unusually quiet.

As a light-hearted thank you, I'm sharing some links from the Strange Passions sessions at the recent Strange Loop 2010 conference.

I once thought I was an interesting person, but after seeing these talks, one is humbled and entertained at the same time. Wonderful, wonderful stuff.

My favourites are Entering Without Breaking (it inspired the title of this post) by Galen Collins and The Science of Musical Counterpoint and Illusion by Daniel Spiewak. (If it matters, GC's talk is rated-R for occasional language.)

All of the videos are available here.

Be safe, and be joyous.

Tuesday, November 30, 2010

Language Panel

Here is a must-see video from Strange Loop 2010. It features a panel of icons and rock-stars, with another as guest host. The topic is the future of programming languages. It was a true treat to be there.

Some quick thoughts on the video:

Introductions part 1

Notice how the panelists didn't feel the need to list the languages they've worked with. Relative to their achievements, their intros are brief.

There is a calm confidence in brevity. I first noticed this when Dave Thomas introduced himself on the NFJS tour with: "I'm a programmer".

This separates the amateurs from the pros. Pros don't introduce themselves with the number of languages they know (a pet peeve of mine). It is assumed that everyone has worked with a dozen or more. It is true, no matter how impossible, that for every person in the room, there is someone else who has seen more languages.

Introductions part 2

Kudos to Alex Payne for paying respect. It struck me as sincere.

Introductions part 3

Guy Steele is one classy guy. Note his emphasis: he likes all languages. Each one has value and its own charming quirks. We get the sense that Guy is more interested in solving problems than the current fashion of the industry. He has an air that inspires me to take the high road, and stay above the language wars.

Language Wars

Alas, Guy's angelic aura only lasts for so long. The unvarnished truth is that I'm weak, and I can't resist language wars. Though the gang were rough on Perl, Crockford's irreverent non-comment on Parrot, near the 30:00 mark is priceless.

My Non Question

I nearly asked a question about escaping the surly bonds of ASCII in future programming languages. Unfortunately, I became distracted by my inner voice:

  • Is this a dumb question?
  • Am I asking this to impress the panel? To impress the audience?
  • Didn't Guy Steele, in a keynote, have a Unicode symbol in Fortress? Why wasn't I paying closer attention?
  • How could I travel 1800 miles for a conference and not have prepared a few questions?
And so on. In the end, I played it safe and sat on my hands. Though I may have avoided an embarrassing moment, I also passed up a chance at potential insight.

Lesson learned: brevity rocks; reticence sucks.

Friday, November 12, 2010

https download with Internet Explorer

I strive to link to posts that have saved my team's bacon, as a modest payback. It might help search engines, and will certainly help me remember the experience, in the event I encounter it again.

The problem: Internet Explorer won't download a document (e.g. an Excel report) via https.

The cause: probably cache-prevention in the headers, per Eric Law's post.

The bonus: Eric mentions Fiddler. That tool might be very useful in general, though I haven't tried it.

Keynote to 2-up PDF

This post is simply grateful linkage to a useful post by Alex Miller.

For a conference or business presentation, you may be asked for a 2-up B&W PDF. If you are like me, the first question is: "what is 2-up?" That question is answered here.

Easy. The next question is: how do I do that in Keynote? Alex's post gives the steps.

Sunday, November 7, 2010

JavaScript and Expense Reports

This is a loosely-connected collection of thoughts stemming from the recent Strange Loop conference and a book purchase.

Background

For years now, I've known that thoughtful developers:

  • separate the JavaScript language from the DOM and wretched browsers
  • appreciate JavaScript as a lovely language inspired by (surprise!) Lisp
So, I thought I "got it". Aside from the usual web development, I've even written significant production code in ActionScript in 2003-4.

But I didn't truly learn the language.

It fell into the dreaded Multi-Month Void of Cognitive Decay (MMVCD).

Here's what I mean: I only faced JavaScript every 3-6 months or so. When it did show up, the situation was urgent, and I felt as though I had to re-learn the basics. Previous 'lessons learned' were quickly lost in the fog of war. I gradually associated the frustration of re-learning with the topic itself.

In this sense, poor JavaScript joined CSS and expense reporting software, falling into the dreaded MMVCD, a random window of cerebral entropy lasting between 3 and 18 months.

(However, even in its worst hour, JavaScript was certainly better than either expense reports or CSS, both of which occupy the darkest corners of MMVCD)

Motivation

Many friends have been interested in JavaScript (some in a career-altering way, no less). Many recommend Douglas Crockford's JavaScript: the Good Parts. It is mentioned frequently at conferences and user groups.

The tipping point was this review by Witek Radomski:

I used JavaScript as a garnish for web development... I was afraid of it. I knew I needed to confront the language and learn it properly.
Yow. This person saw into my soul. In fact, that review led to my recognition of the MMVCD.

JavaScript: the Good Parts

This isn't a book review, but: the book is a delight. Minus the appendices, the book is 100 pages in 10 chapters. That is an object lesson for authors and publishers alike! (I would love to know if Crockford faced pressure to add pages.)

What's more, the premise is a winner: a language can contain a beautiful, subset within a complex, (at times) unappealing landscape.

Random Thought #1: Chained Dictionaries

On SE-Radio, someone once joked that Lisp is nothing more than an abstract syntax tree. Funny stuff, and not entirely fair (I believe it is a comic reduction of an earnest point by Paul Graham, though I have no link to support that). Yet there is certainly a grain of truth in it.

My mental model of JavaScript: it has collections of properties. JavaScript does not call them dictionaries; I will. Dictionaries can be chained. A property may be a function. That's it: simple, elegant. Though this is neither fair nor accurate, that idea leaps to mind frequently.

Random Thought #2: Inheritance is an Interface

Scott Bale gave an excellent talk at Strange Loop 2010, based on Crockford's book. During the talk, it struck me: when we learn that a language offers inheritance, it is a fallacy (and audaciously Java-centric) to assume the existence of classes. Classes are merely one implementation of inheritance.

To wit, inheritance is an interface. It is a conceptual contract.

As most will already know, JavaScript offers prototype-based inheritance. This is a different ballgame, but must be understood, if we are to comprehend JavaScript. Crockford banishes the pseudo-class-based inheritance of JavaScript out of the Garden of Good Parts.

(As an aside, Crockford uses the terms 'prototypal' and 'classical'. I think this is a poor choice. To me, 'classical' has connotations of timelessness or an ideal. It took me a long time to realize Crockford doesn't mean to imply that.)

The Upshot

If, like me, you find JavaScript to be in the Multi-Month Void of Cognitive Decay, Crockford's book is a gem. I'll be working through it.

I realize there is now a book on HTML and CSS, but I don't think I have the stomach for it. Ping me when Expense Reports: the Good Parts is available.

Postscript

Be sure to check out the comments for interesting links on JavaScript material by Lambda Loungers.

Sunday, October 17, 2010

Strange Loop and Campus Memories

I've returned from Strange Loop 2010 in Saint Louis.

For photos, presentation materials, and other reviews, check out the Twitter feed.

This year, I'm not writing a full review or even my usual "random walk" through the conference. This is a quick, lyrical appreciation of the vibe. Future posts may include personal insights, one at a time. This is to serve my readers, who (correctly) point out the declining frequency of posts on here.

First Days on Campus

Recall your first days on a university campus, or imagine them from a Hollywood film.

It is a brilliant autumn afternoon. The crisp bite of the morning chill is gone, and the trees display their fiery leaves in the sun.

Everywhere, there is energy. Outside, people hustle and bustle from one building to another. Along the paths and roads, the chatter is constant. Some are merely coordinating the next stop. Where is it? When is it?

But most are sharing ideas. The ideas initially come from respected professors, who set student minds ablaze. Then new thoughts arrive via inspiration; others are borne through rigorous debate. Somehow, they culminate in a virtuous cycle of intelligence and enthusiasm. Like the morning chill, cynicism and defeat cannot exist in this environment. The energy burns them off.

In a season of change, humanity and nature join in a triumphant, zen sense of here and now.

Strange Loop 2010

The 2-day conference brought me back to my first days on campus at grad school.

That was the vibe. In my mind, there is no higher praise.

Postscript

For those not on Twitter, a final shout-out to all my tech friends in Saint Louis and beyond. It was terrific to catch up, and I only wish I had more time to chat. See you again soon.

Reviews

For details, my friends Weiqi Gao and Mario Aquino have posted excellent reviews.

Saturday, September 25, 2010

Moving Details

Background

In case this helps anyone, Here are details about my recent international move. This is definitely a niche topic: no worries on skipping it. I wish I had this info when I started, and want to contribute back to the hive-mind.

Disclaimer

This is a journal of my experience, and not advice. I hope this opens eyes to topics of research, but ultimately, you are on your own.

Although the experience was a lot of research, with seemingly unending paperwork, this post is not intended as criticism toward Canada or the USA. Any comments disparaging either country will be deleted.

Executive Summary

I am a Canadian who returned after working for several years in the USA (legally, on TN Visas). I have no dependents and didn't own a house.

I found that there were three areas of concern:

  • stuff
  • finances
  • car
My stuff was straight-forward. My finances were difficult. My car was surprising.

My Stuff

I went with professional movers for my furniture and books. I packed important things (e.g. guitars) into my car and drove separately.

Following instructions from Canada Border Services, I prepared a manifest that enumerated each box / item, with an estimated value for each. Per instructions, it isn't necessary to list "each pair of socks". My approach was to generalize clothes and books per box, but to list electronic equipment and guitars separately.

The list has two sections: stuff in my car and stuff "to follow" (that is, on the moving truck).

I arrived at the border before the truck, and showed the Canadian border guards the list. I paid duty on the vehicle (see below), but IIRC, I was exempt from duty on my belongings, given (a) everything was older than 6 months and (b) I was granted credit for every year that I was away.

Despite having a delivery window of 3 weeks, the movers arrived 6 weeks later. I met them at an airport, which served as a port of entry / customs. I presented my manifest list and also the paperwork I had signed at the border.

The downside of pro movers is the expense and the high likelihood of delayed arrival. I had considered U-Haul but that approach has its own issues, which are obvious.

My Finances

I'm not going into gory details here. My main lesson is that I was wise to check with financial institutions about becoming a non-resident. First, it will be an extremely good test of a brokerage's customer service: it is an exotic question.

From what I can tell, a US resident can certainly have holdings with a financial institution, but upon leaving, there are restrictions on activity. e.g. One cannot make transactions. It was never clear to me if one could simply leave the account open, without doing further trading. Most of my moving research was spent on this question.

Another option is to liquidate. Depending on market conditions, this could be suicidal. For 401K accounts, it is definitely painful and drastic.

A final option, for residents of Canada and the USA, is a cross-border brokerage. They are typically licensed to trade in both countries. However, these brokerages have a niche, affluent market and have the leverage to charge steep fees.

Note that I haven't mentioned taxes. For me, that research lays ahead, due to the timing of my move.

My Car

First, a car is not automatically welcome in another country. e.g. Canada does not accept all US cars. I checked mine against the list at the Registrar of Imported Vehicles (RIV). Thankfully, it is welcome (as most are).

For the Canadian side, I did the following:
  • Before moving, get a letter from your local dealer that any recall work has been performed on the car, or that it is clear of recalls.
  • Estimate the value of your car in the destination of your move. This will be used to calculate duty at the border.
  • After crossing the border, within 30-45 days (check documentation), the car must undergo a federal inspection. The paperwork is faxed to the RIV. The RIV will mail a sticker that affirms the car is formally a Canadian vehicle.
  • The car must also undergo the typical provincial inspection and registration.
That's some work, but wait, there's more!

There is an American aspect to vehicles: one must contact the American border (at the point of departure), 3 days in advance, to alert them that you are leaving the country. They want VIN, title, etc, faxed to their office.

I discovered this about a week before my departure. Be sure to verify that they received the information. Vehicle titles are a challenge for a fax machine. There is no charge on the American side. (This is probably a procedure to curb theft.)

Summary

I've already blogged about my personal decision and my admiration for both countries. This post is sheer logistics, without the sentiment.

If I were to do it again, I would consider selling my car before the move, paring down my belongings to an absolute minimum, and choosing U-Haul.

I would also be very careful about investing in a country without a long-term plan (e.g. for retirement).

The ultimate lesson is to do homework, and find professionals that you can trust. Just as you need a doctor and a dentist in life, in this arena, you need a cross-border accountant, an immigration attorney, and a financial planner.