Archive for the ‘Technology and Computers’ Category

Lone Star Ruby Conference

Wednesday, July 9th, 2008

Wow, has Austinite Jim Freeze et. al. really outdone themselves this year. They have organized the second Lone Star Ruby Conference. This year none other than Matsumoto-san, creator of Ruby itself, will be presenting! Talk about a coup!

The presentation will even be at the terribly-convenient intersection of Anderson and Burnet but a mere 4 miles from my home. I hope opportunity shall be found to introduce the intrepid father of Ruby for a Hunger Buster at the DQ up the street.

This also means that the closest and best bar in the area will be Ginny’s Little Longhorn. I can totally see Dale Watson and Matz rocking a “Heartbreak Hotel” cover.

You can also take an chock-full day long training session for a mere 125 on top of the incredibly reasonable 250. My ticket, all told was less than 500 dollars. Hotel costs at most conferences are more than that.

If you’re doing Ruby, come on down to Austin in September and say hello. Being September it may be a pleasantly cool fall or the final month of the boil-‘em-‘til-they-say-uncle crucible. No promises on that one.

New Internet Jargon: Banality Inertia

Wednesday, July 2nd, 2008

It’s a familiar way of structuring an idea on the internet, especially as presented in blogs:

The world seems to have some condition

Now, portion the first are pro-SKUB, but portion the second people are anti-SKUB.

pro-SKUB arguments are lain anti-SKUB arguments are lain

Now a commenter comes along and, being a fair-minded type, can only come to the conclusion that surely some Hegellian synthesis of the two camps is sensible.

He begins typing this out and then thinks: “By Odin’s Raven, this is clearly the most banal thing I’ve ever written: everyone knows that pro-SKUB is sensible in some ways and anti-SKUB carries the day in others”.

And then you just hit the cancel button.

Macbook Keyboard + Vim

Thursday, June 12th, 2008

I’ve been away a while because I’ve been working very hard on migrating my legacy application. After hours and hours of punching a way in Vim, Perl, M4(!), and making screencasts the last thing I wanted to do was come home and type some more.

The interesting thing is that some of the work that I have done is able to be discussed in a public forum, so I’ll actually be able to show not just tell.

In all this typing of late, I’ve been using the vim editor for many, many hours. Given that the MacBook Pro seems to be the de rigeur tool for the modern hacker, has anyone come up with a solution on how to avoid this problem:

When using vim I always hit F1 when I move to strike the Escape key. After a few hours of typing it dawns on me “Hey, why is my screen so dark?”.

Macbook Pro keyboard

Sorry, that poorly-rendered text says “Danger Zone between ESC and Screen Dim

Some people, when reviewing for Latin finals pull out a legal pad and a few sharp pencils and then happily go about their day.

Others write a LaTeX guide to:

And post them on the internet…

I mean, GOSH, how anyone study without these charts being beautifully typeset via LaTeX? Lauren remarked that she didn’t know my Latin class had a LaTeX-formatting component.

Eep.

When you work in the UNIX / CLI-environment a simple fact of your work environment is that you simply must have a high-powered text editor to edit configuration files, write code, or write email in a non-GUI mail tool. You have your choice of consumer-targeted editors (=pico=), but the two that battle for the power user demographic are vi and emacs.

I’m conversant in both and have even written an encomium to the power of emacs on this very site. But I should like to dwell on an interesting aspect of the vi/emacs approaches to doing things.

I had occasion to reflect on vi/emacs as writing tools when I was giving my exceedingly patient girlfriend a bit of a demo of how to use vi ( being knee-deep in drupal, it is something she’s considering needing to know more about ).

Teaching the Command Mode / Insert Mode Bifurcation

My first topic was the difference in modalities in vim. This was something that I thought would be particularly hard to communicate. Given a world where most grow up with the WYSIWYG experience of textual editing ( MS Word, chiefly ) people are used to combining three activities which need not necessarily be defined within the same context. Here’s how I believe the Unix modality considers the activity of producing a “fine document”, as opposed to the default “type, edit, and print it from Word” assumption.

  1. Writing:
  2. Editing
  3. Layout

Writing

Writing is: typing in a serial fashion, verging on ‘stream of consciousness’. When the “flow” ends, change modes. Vi notes this “shift” in gear by a stroke of the escape key, that is changing modes from insert to command. Emacs does not observe this modality change.

Editing

Editing is fixing typographical errors, re-arranging text, reading, cutting, pasting, doing formatting changes, and iterative edits. By in large one is not “writing” here - one is clarifying and largely reading. Where one sees the opportunity for an edit it is, generally, small ( replace ‘r’ with ‘R’ )

Layout

Layout in the Unix mentality is done by LaTeX. That is, after writing text, one edits the content and wraps the content in LaTeX markup. Having done this, one processes the content through a LaTeX editor and then can view the typeset materials.

Nota Bene: Neither vi nor emacs are in the business of layout. When writing in a text editor you are free to think about writing or editing but do not have to worry about, are explicitly prevented from, thinking about layout. It’s writer’s bliss to focus on expression, not bold.

Non-Unix Workflow: Word

Now let’s proceed from Word. Word starts with conflated editing, writing, and layout. My girlfriend, a professional writer, immediately needed no convincing on the wisdom of ditching the layout to focus on the content. Her process is very ‘layout comes later’ intensive. Our conversation then turned to the difference in should editing and writing be conjoined (emacs) or should they have a modal difference. This is a philosophical difference between the two ne’er the twain shall meet.

Most people coming from Word are conditioned to anticipating the instantaneous response that emacs gives. While the commands might be a bit different (Control-b for “move cursor left”), and the mouse absent, the idea is not a departure from the generally conditioned experience.

But the modality shift between the command and insert modes of vi - that presented a bit of a conceptual hurdle. Not to be misunderstood, my lady fair most certainly understood the value of separating the activities, and certainly understood that ‘i’ or ‘a’ could be used to enter insert mode and escape was used to exit it, but she had the concern that her work-flow would be interrupted.

She also suggested that the multiplier+command core feature of vi - something which I use to great effect - seemed to require an amount of ‘pre-thought’ before the editing.

She’s absolutely right. You see, vi was written by Bill Joy on a slow connection. While he waited for his 300 baud command to be received and worked upon he could look at the screen and say: “Hm, I need to go three sentences ahead and delete 3 words, and then go to the end of the paragraph and insert a period”. This translates to

  1. 3)
  2. 3dw
  3. }
  4. A.

MIT had much speedier connections and thus Emacs was written from the instantaneous response perspective.

In some ways I think vi is like Kendo or Latin. You have to churn the mental gears before you act, but when you do act, you act decisively, cleanly, with a minimal amount of effort; but great power, and great conciseness.

Emacs is more like an interpretive dance: I go this way, I go that way, I change this, no I change that, etc.

I’m not sure if I have convinced her one way or the other.

Which is better

In many ways I feel like vi is the winner for writing text and email. It’s fast, light, and encourages more prethought, more editing, and more post-thought. A great many email writers (and bloggers…) would benefit from that. Somehow the mode change seems to engender a more reflective attitude to writing, and this is a very fine thing indeed.

But what about code?

Hm, it’s tough. I want to say emacs is because code is not like writing and then editing, it’s a much more “oh crap i forgot a ;” or “where’s the closing brace”. There’s less forethought, and more experimentation. If what I say above be true, then emacs should win hands down.

…but….

The keystrokes from emacs and holding their configuration wears on my fingers: Stroke after stroke of the Control+letter commands makes my carpals act up. And, on the other hand, perhaps a bit more thinking before typing the code is warranted: the moment to reflect on whether a pattern might be appropriate, a second to consider where iteration is called for and building the abstract iterator before passing the commands.

So for code, I think I’ll have to call it a draw.

But I especially love ‘vi’ for editing. The enfolding blackness of the command line and the hollow green of the text says “low fi” which is exactly why I find it so easy to do creative writing in vi versus any other editor.

That said, most of the time on my Mac I tend to use Textmate which is, essentially, a much better emacs minus the emacs religion + some of the power of a flexible IDE.

Misuse of JavaScript annoys me

Saturday, March 29th, 2008

IMDB’s image provider has implemented the classic way of preventing image stealing: return false for the right-click or contextMenu event.

This annoys me so much.

Here, try right-clicking (or any clicking) on this link.

Ohhhh man, aren’t I clever and devious. I’ve told that link, via the evil JavaScript pseudo-protocol definition in the HTML <a> element to ‘trap’ your click events and do nothing with them.

And it’s so trivially easy to subvert, it just irritates me that this qualifies as security and / or is demanded by clients. A demonstration should suffice. In these examples, IMDB tries to prevent me from grabbing images out of their pictures tool. Sigh. Must it be so?

Or…

So, please, stop. Just stop. Because you don’t stop the slightly-enlightened from getting the goodies:

madeline_kahn

No, I will not be using Facebook

Monday, January 14th, 2008

No, Marvin K. Mooney I will not Facebook
I will not use it to meet a cook
I would rather go to a bar
I would rather drive in my car
I’d rather return things at Fry’s than
read others’ ego-lies.

Please do not search for me there
for it I simply give no care.

More About Facebook’s Invasive Terms of Service

  1. Examine the Unicode standard’s code page collection for “Latin small letter a with macron”.

  2. Nets U0100.pdf

  3. “Latin small letter a with macron” appears on chart as 0101. This is a hexidemial number which points to U+0101 as its code point. Converting 0101 to decimal gets you 257, this is the same as the HTML entity code. Thus one can enter either &#257; or &amp#x0101; and get the right glyph [ā|ā]

  4. Put ā character into a view via Rails that is back-ended by a PostGres database.

  5. Using script/console, write the collection of models that contain this accented character to a YAML file.

  6. “Latin small letter a with macron” is stored in a YAML dump of accented charcters as: \xC4\x81

  7. Hm, OK that’s a start. Somehow 0101 or 257 is linked to C4 81. How? I know, BTW, the database that holds that entry is in UTF-8 as psql -l shows this.

  8. C4: 196

  9. 81: 129

  10. 196+129=325 != 0101. Hm, look at documentation.

  11. Be stumped.

  12. Send mail to mailing lists for help.


In the immortal words of Sid Meier’s “Civilization”: “Time Passes…”


  1. \xC4\x81 is the UTF-8 encoding for the Unicode code point U+0101.

  2. [Q:] Which table does U+0101 fall into?

    [A:] “So the first 128 characters (US-ASCII) need one byte. The next 1920 characters need two bytes to encode. This includes Latin alphabet characters with diacritics, Greek, Cyrillic, Coptic, Armenian, Hebrew, and Arabic characters. The rest of the BMP characters use three bytes, and additional characters are encoded in four bytes.”

  3. OK this means that the code point will be of the form: “110yyyyy 10zzzzzz

  4. We will now work to fill in the “y” and “z” values:

  5. Hexidecimal “U+0101” converts to binary: “100000001

  6. There are 5 y’s and 6 z’s. So let’s split the above number to match that form: “[00]100-000001”. Note, we moved from the right. Where the leading 0’s were required to turn 100 into 00100, they were pre-pended.

  7. Integrate and produce: “110” + “00100” : “10” + “000001” => 11000100 : 10000001

  8. Take THESE numbers and convert them back to hex => c4 81

  9. String notation for this is \xc4\x81 - violá!

  10. Figuring this out letter by letter is a major pain in the keester. A good URL resource is: Fileformat.info or, handily a URI of the form:

http://www.fileformat.info/info/unicode/char/<unicode char value>/index.htm

Special Thanks to: Michael Flester