Archive for July, 2005

Mice visits the recent Internet Past

Saturday, July 30th, 2005

About 2000 my roommate The Dogg came running into my room and told me I just had to check out this guy “Mahir”. Mahir was one of the earliest WWW celebrities. His page, in a broken language approxmating English, invited ladies the world over to his home in Izmir where dancing, conversation, and joviality would be assured.

An archived history of Mahir can be found, uhm, here.

Mice, intrepid internaut, has done a favor for our studied Smyrnian man-about-town, he has re-edited his page to communicate the beauty within Mahir that may not have been immediately evident from his original sentence use.

Mahir unbound, uhm, here.

A happy day to us, my Bretheren

Friday, July 29th, 2005

Ladies and Gentlemen of the Guild:

Hooray for us! It’s SysAdmin Day.

Whether you be a Unix admin with fleet fingers stringing together pipes and greps with a smattering of sed for spice….

Be you an NT admin, breaking the mouse’s right button….

Be you a VAX admin, lost in some ancient legacy system….

Be you a PBX admin with uppity people telling you how important their voice mail is….

Be you a calendaring admin of a crappy, non-scaling, legacy application (m**eland….

Today is a day to know that we all know the same trials and tribulations: the uppity user who knows mare about your job than you do (apparently), the uppity admin who wants you to know that her use of application X is more important than everyone else’s use of application X and you should fix it for her first, the uppity PHB who suggests that using Java makes more sense here….

For all of us, today is the day to book out early and say “Suck It, (l)users!”

Aw, hell, there goes the pager.

In the unix / linux world ( and thus, by extension the Mac OS X universe as well ) there is much to-do made about the choice of text editors.

Why Does It Matter

Much of the configuration of these various systems is centered around the generation / manipulation of text-based configuration files.

For example, if you’re on windows and you want to change your timezone you must go to Start Button / Control Panel / Time and Date / Timezone. On Unix / Linux / Mac OSX you simply edit a text file, change the word from PST to CDT ( or what have you ) save the file and you’re done. More keyboard, less mouse, quick, elegant, easy to find. Done. Thus from a pure system maintenance point of view, a tool that helps you edit text files is vitally important.

Why does it matter to developers, in particular

If you develop software on these platforms, the question of your editor becomes even more important. For source code, which is in turn compiled ( or interpreted ) to make programs, is nothing but text. A text editing environment that helps the programmer most efficiently wrangle (or mangle) text, that doesn’t “get in the way” and “helps out” in the wrangling process is to be loved, cherished, and extolled.

What do I mean by “help out”. For example, say I define a function called

listen_to_network_for_traffic()

Now, on the one hand, if I need to know what this function does, its long-ish name is very instructive: it listens to the network. On the other hand, if I want to use that function name:

  • I can type listen_to_network_for_traffic over and over again. This would lose charm very rapidly
  • I could find the original use of listen_to_network_for_traffic, copy it, and paste it where needed. In so doing I would lose my place in the code ( say i’m writing at line 50, I defined this at line 900, that’s a lot of page-up and page-down ).

In some editors typing the word listen and then hitting some key-stroke would “auto-suggest” the remaining _to_network_for_traffic() - see the editor is helping me produce the text faster.

Naturally there are many other optimizations that increase the prestige or love of one editor over another. Auto-suggest, plugins, syntax correction, etc. It is on the strengths and merits of these augmentations to the “flat” text editing process that developers find themselves comparing the superiority of editor A to editor B.

What does this means from the perspective on a non-technical reader, a real-world example

A non-technical reader, may think “Well what’s wrong with using Word to edit text and using find and replace?” Well, first Word runs on Windows in a graphics heavy framework and, as we mentioned, the software we’re developing is not for windows. Secondly, let’s say you, in Word, wanted to change all occurrences of “Steven” to “Steve” in a text file in word you would do Edit / Find / Steven / Steve / Find next / replace-yes replace-no / repeat.

In the vim text editor you would simply type:

<ESC>:%s/Steven/Steve/gc (enter)

This translates to: Escape, to enter command mode ( the place where we do operations to the text, not the mode where we enter text itself ), %=in this whole file, substitute Steven for Steve, in all global occurrences on a given line, and then check with me if you want to do it.

After running this command, you would confirm changes with Y or N and violà you’re done! That’s a lot less mousing and clicking, no? If you’re in the business of mangling code for a living, the ability to change all variables called foo to bar in a dozen keystrokes is a literal difference of hours in the life of a coding project.

The Holy War

The pragmatic introduction complete, let us return to the point of this post. There is a my-dad-can-beat-up-your-dad holy war between the adherents of ‘emacs’ and the adherents of ‘vim’. ‘Vim’ users value the elegance of their command set: “<ESC>5dd” means “turn off text entry mode and go to ‘command mode’ and delete five lines and store it to a temporary buffer I can paste from”.

Listen to the rustle of the ferns in the ancient forest, the trickle of water down rocks, this is the Zen elegance of vi. The Tao is cryptic, but quickly one comes to accept its power.

Emacs users see this as silly and think: why not Control-U 5 Control-K (do the Control-K operation, cut one line, 5 times), what’s up with that “change modes” thing?

MIT brand of thinking says: Define a function for a ‘universal’ n-many operator ( Control-U ), pass that an iteration count integer, have that perform the pre-defined global kill-line-of-text operation ( Control-K ). It’s rational, it builds from atomic concepts like the Tractatus Logico-Philosophicus.

As I say elsewhere, I’m Switzerland in this battle. I used emacs from 2001 - 2005 and have been using vim for about 18 months now. The reason I switched was because emacs is built around key combinations and they were getting to irritate my fingers ( even with my Dvorak + swap-keys keyboard layout ). And lo, the repetitive stress issue is much lower with vim.

Yet I still feel the power of emacs and know that it has mas mojo and here’s why. Emacs is not just a text editor, it has the power of one of the most powerful programming languages conceived running inside of it: LISP. The crucial take-away is that every Emacs action is actually an eLisp function: the simple act of hitting Backspace maps to a function called “delete-backwards-character”.

For the non-technical, suppose that I told you that by writing a certain “spell” on a piece of paper and saying “evaluate” you could change variables that define the behavior of reality instantly. That’s right, you could utter:

“Evaluate pull_of_gravity = 31.0m/s/s”!

And instantly some very bad things would start to happen to reality.

Now let’s try saying instead of “reality” you’re working in emacs, and instead of using the word “evaluate” you use a built-in emacs function called “eval”. You can do the same thing. You can, in effect, edit the rules and physics of the emacs environment, by saying to emacs “hey emacs, read this lisp file I wrote”.

Emacs is an amusing program written in a self-expanding, recursive language that is used to model AI. Earlier I mentioned that Backspace was bonded to “delete-backwards-char”. Say you were doing to be doing a lot of ‘delete three words’ operations. You could “modify your text editing reality” and tell emacs to bond your freshly written “delete_three_words” function to backspace. It would comply( much like your re-configuring gravity example earlier ).

Yet ‘delete_three_words’, handy as it may be, is absolutely trivial. The power of LISP is staggering, it’s so staggering in its complexity, beauty, and power that many programmers never even scratch the surface of its implications. With LISP, and emacs, you can re-build your universe from the fundamental concepts. delete_three_words is silly, why not parse a database hierarchy, insert the name of every column, capitalize it, insert a number in front of each, and wrap it in the HTML code for an unordered list and bond that to Control-X Control-D”. With emacs, this is trivial as well! Why not tell emacs “instead of looking at files, look at activity on such-and-such network port”. A few other functions later you’ve turned your text editor into an AOL IM client.

Emacs, a text editor underneath a Holodeck, or a flexible reality framework

Perhaps now you might realize that emacs isn’t truly a text editor, although it acquits itself nicely in this regard, but it’s a flexible environment for modifying how it handles data you give it. It’s effectively an operating system masquerading as a text-editor that is written in a stunningly powerful programming language. As one uses Emacs / learns to edit eLisp, it becomes apparent that you’re meddling with the powers of the Gods. You become aware, over time, that you’re messing with the powers that could create amazing web applications or make SkyNet.

The more you edit, the more you become aware of this power and the more convinced you become that emacs is the ‘true way’. And honestly, once you taste the waters from this fountain, you become intoxicated, amazed, addicted; and I know, it is intoxicating.

Vim responds…

The vim user would reply: we can do plugins, we can do extensions too! We have our own meta-syntax which will allow us to change what’s under the hood.

“Ah yes, grasshoppers”, could opine the Lisp guru using emacs, “but you have not understood, your plugin language can emulate and produce much, but it lacks the ability to do the truly amazing that emacs Lisp possesses, in part owing to the blub paradox.”

The love of lisp, the root of “Emacs v. Vi”

And so this love of Lisp produces emacs fans knowing the secrets of the recursive magic of Lisp being inured to criticism of the actual editing function of emacs. For what criticism could possibly assail a world in which you have the full power of rewriting your universe at your disposal ( as a refutation to the vim camp emacs actually has a mode, written in eLisp, which emulates the command set of vim )?

The vim users will counter, “But why must you work and agitate so hard with the editor ( they are mistaken, as we have discussed, it’s not “an editor” )? Why can’t it be simple, expressive, and uniform, with minimal gyration?” And most emacs users will admit, without their custom modifications to the emacs reality ( aka a user’s .emacs file ) emacs doesn’t work like they like it to, or like they expect, it’s much less portable.

And thus the holy war can never be resolved because the discussion isn’t really about editors at all. Emacs users argue, waxing poetic, in a LISP-intoxication of their editor’s merits when they should be proselytizing LISP while the vim community is discussing editors in themselves.

Personal Stance

So what do I use? It depends on the job. Perl = vi. Lisp = emacs. Anything on my Mac: TextMate.

Recently at my first meeting of the Silicon Valley Cocoaheads another attendee was talking about the excellence of the OSX editor TextMate and how it can be used to spit out a lot of code quickly. I believe that he said its macros were unsurpassed by any other editor. I saw my neighbor’s countenance get the unmistakable cloud of “yeah right” and I knew him for an emacs user on sight. He had apparently touched that same mystical heart that lurks within emacs ( there was even an mp3 a few years back called “God wrote the world in Lisp” ).

The speaker, when engaged on this point, then countered that the interface for generating such intelligence in TextMate was more accessible and I suppose that, in this, he isn’t wrong … but it’s not LISP ;) .

Closing

So that’s how an editor debate is really a ‘how do you conceive your world’. Do you want to have the keys to reality and build whatever you want? Or do you just want a low-footprint fast, uniform editor? Do you want your editor to fold and mutate into whatever you want, or do you want the reliability of your editor being mostly the same everywhere on every machine? Is Kant right, that there is a noumenal world beyond perception by sense data, or is the world Hegellian and full only of phenomena? Is it Great Taste or Less Filling?

The great thing about the world of ideas is that we can all explore all of them and find the one that works best for us.

Update: 1/21/07: Substantial update for MEW readers: Hi!

Mythos

Sunday, July 24th, 2005

“There is something about this land (Iraq) which invites mythical storytelling.”

“The disturbing material in ‘Grand Theft Auto’ and other games like it is stealing the innocence of our children.” —Hillary Clinton

See, Hillary that’s silly. What is a kid is doing playing an “M”-rated game in the first place? Whether or not they can get to the explicit scenes “hidden” in the game really need not even enter the picture.

Thinking like this is better from the mouths of Republicans:

Santorum Equates Gay Sex with ?Man-On-Dog?

Now that’s priceless.

I continued unpacking. I finished getting everything just-so in my bedroom. I bought the totally sweet bed from foamorder.com but was chagrinned when one if my nightstands had its finish slivered.

I left a VM for them and hope they’re able to help.

I made a movie of the damage for their returns department and sent it in.

Isn’t that totally cool that they’re working with me to use internet technology to make their customer responsiveness better? I’m pretty sure this is why there will always be startups that use technology, in this way, to make their customers like them better than the big boys.

I’m also going to tell them that their shipping partner really should be taught some of the basics of customer service. This isn’t strictly their problem, they just need to be told their partner is not meeting expectations.

Anyway, once the bedroom is done and the mattress arrives (today!) I’ll take some pics. I love the look of their stuff.

Other than that I got the boxes and bags out of the bathroom, filled one closet, returned the kitchen to usable, arranged my bedroom closet, and am now only awaityng my new mattress and a few hours to get everything pretty-much OK.


UPDATE (July 6, 05): Talked to the staff at foamorder.com and they see the damage and are going to work with the vendor to work out an exchange. I’m very pleased.

I also removed the video link as it’s big and clunky and has served its purpose.

Summer Insomnia

Wednesday, July 6th, 2005

I don’t know what it is about the summer that seems to bring on insomnia for me, but it’s been brought-ed.

Do you know what was a great toy back in my day? The Etch-a-Sketch Animator. Peep:

animator.jpg

Here’s the setup.

  • Big plastic (white) box with knobs per the E-a-S design motif.
  • LCD 40x30 screen in which you can either set the pixel to active or inactive
  • 8 big, soft, mushy buttons at the bottom: a pen-up, pen-down, a save, clear screen, recall last screen, reverse black to white / white to black toggle, erase, and the magic button: animate

You could save 12 “frames” of animation and then push the ANIMATE button and…viol?. Pushing ANIMATE a couple of times more could speed up the replay.

The animation had this odd eek-yyy-uurk-eeek-ee sound that went with animated frames. As I recall the frame flow was not evenly metered and some frames would drag a bit but the illusion of animation was still there - just like a flip book.

The instruction book came with 12 basic tasks for you to learn with and one enterprising netizen has made animated .gifs for you to look at to get the feel.

The down sides were that the frames were stored in RAM. Knock a battery loose - goodbye. Obviously this made working on more than one project impossible as well.

This limitation wasn’t too painful, I was 10 (or so).

Funny to think that the difference between this and a Game Boy was only more pixels, more memory, and different inputs. Heck, it’s the same principle as what was in mass market spinach-screen cell phones (those still exist, right?).

As I recall my animator started “flipping out” towards my growing out of it. I noticed the box in my closet back at my Dad’s house … maybe next time I’m there I’ll dust it off and see what I can do.

But really — shouldn’t there be an emulator for OS X for this?

Maybe this is my task to learn a new aspect of Cocoa…

Watching some noir this long weekend

Monday, July 4th, 2005
Harry Lime: Don’t be so gloomy. After all it’s not that awful. Like the fella says, in Italy for 30 years under the Borgias they had warfare, terror, murder, and bloodshed, but they produced Michelangelo, Leonardo da Vinci, and the Renaissance. In Switzerland they had brotherly love - they had 500 years of democracy and peace, and what did that produce? The cuckoo clock. So long Holly.



This weekend I caught the famous noir thriller “The Third Man”. What a great movie! I really enjoyed the plot. It had all the usual, post-war amorality, a stunning European dame, Yankee idealism, European cynicism, and the question of what can we say for ourselves, as a race, when The Judgment comes.

I was on a bit of an Orson Welles kick. His geist seems to be in the air wtith War of the Xenu, er Ritalin, er Worlds running and with his mention in the recently-viewed-by-me “Ed Wood.” Welles is just one of those stunning talents that I don’t think that any actor of today could even hope to rival in scope (and no, I’m not talking about his weight problem).

I got the Criterion collection version so it had some great extra bits provided by Peter Bogdanovich. If you see the film, I think this is definitely the DVD version to make sure you get.