Uncategorized


20
Oct 10

The Format of Babel or In Text We Trust

Over the past several days I’ve been wrangling with text of various forms and formats. More specifically I’ve been trying to get various references and documentation into Emacs (more on that some other day). As I was going through all the various sizes and shapes that text came in, I could only marvel at the number of seemingly interchangeable yet arbitrarily unique ways text is molded into one form or another.


Take this “eBook” revolution on our hands. The Epub format used by iPads and Kindles are essentially XHtml wrapped up in a zip file conveniently named “epub”. I’m sure that if this was the 1990s or Adobe had its way, it would be in some kind of a proprietary binary format (like a compiled program) that sends corporate headquarters your device ID and GPS location, ready to transmit your name to the authorities or disable your device on the slightest infringement. I think it’s mostly thanks to the disaster that is PDF and the lucky circumstance that no one company still has the lock down on digital publishing that we were able to adopt a relatively decent format like epub (compared to say PDF).

Yet the road to get here is littered with many forgotten and esoteric standards among some well known. Some of the formats I encountered these past several days range from Latex, HTML, xhtml, txt, rtf, SGML, texi, LyX, rhtml, markdown, and textile, and chm. All of them are formats used to document source code, generated from commenting templates for some of the more well-known open-source projects. All of the formats are used in some capacity by prominent branches of software. For example texi files are used by GNU open source projects after they are compiled into “info” files that can easily be ready by Emacs. All the formats are based on either plain text with modest formatting or HTML. Some of the newer projects use their own templating engine with HTML output for easy publishing to websites (to provide search engine fodder for api documentation). The good thing is that most of the markup is lightweight and it’s essentially text. They are usually designed to make navigation easy by stipulating headers or other standards for cross-linking within the document so you could jump from an index to the relevant documentation quickly.

The problem is each of these formats scratch someones itch and none of them are completely interchangeable. Usually there’s some kind of intermediary format that converts into the final form. PDF is a prominent option but once you transform it into PDF, heaven help you if you misplace the original.

Looking around at some of the more recent HTML based varieties had me thinking. While these documents are decent as HTML documents with minimal, clean design and just enough javascript to make navigation easy, it doesn’t beat having the text in a malleable form at your fingertips. It just can’t compete.

We live in a world where we are surrounded by text, trade in text, yet for the most important pieces we are still too scared to completely let go and resign ourselves to the free flow of ideas and words. We are still coming to terms with the way we are willing to trade text.

One thing I’m glad to see with epub is the resurgence of formats like latex. The problem with pdf, postscript, and any of the Microsoft Office formats (that have opened up quite a bit) is that they try to mix up presentation and content. A lot of us are probably old enough to remember how buggy Microsoft Word used to be. It was like the Wild West where you always had to keep one hand on your gun (the save button) before that pesky Microsoft bandit pissed away your days work with “Word has crashed what would you like to do? [Exit] [Cancel]”. Of course, we all know that pressing [Cancel] takes you right back to the dialog. If you’re lucky you might find a garbled up file with fragments of what you thought you typed amidst what could only look like communication from alien life forms. All you did was type a few words.

Before Microsoft, standards like Latex kept the raw content separate from the presentation. You could add content to your heart’s content and then adjust the format when you’re done. You never have to deal with mind-boggling situations like you get with Microsoft Word where shifting a diagram one pixel to the right suddenly turns the preceding paragraph into a 15pt bold headline in bright blue.

Somewhere deep down inside, people are trying to come back to simplicity as seen with the resurgence of “writing programs” that essentially strip away all the bells and whistles to give us a full screen of nothing but our own text so that we can focus on writing.


15
Oct 10

Dirty Rotten Scoundrels

Dirty Rotten Scoundrels is a delightful comedy starring Michael Caine as a con artist with aristocratic leanings preying on wealthy women. Steve Martin is a petty con scouring Europe for easy marks. When the two cross paths, Caine makes life harder for Martin with an assortment of obstacles when Martin finally snaps and proposes a bet to see who can out con the other.


Michael Caine does a brilliant job as a gentleman and a con who is bound by misplaced notions of honor. Martin is a rather boorish con artist with low standards but plays for much lower stakes. The war of the cons heightens the comedy as they get caught up playing cons within a con to outwit the other and secure their turf. Although the plot is simple there are enough twists and turns to carry it and the performances are masterful to say the least.


15
Oct 10

Grown Ups

Grown Ups is a feel-good Adam Sandler movie about best friends from junior high coming together for their coach’s funeral. The boyhood friends were part of the only championship winning team from their school and the ones their coach was the proudest of. Despite the coach admonishing them to “live every moment like the final buzzer is about to go off”, only Sandler’s character is a resounding success (as a multi-millionaire Hollywood agent). All the kids are caught up in modern life, playing video games and texting their nannies. Adults are caught up in their own lives not really enjoying or appreciating what they have.


Sandler rents out a lakeside house, the same place they celebrated the championship as a kid, where they show their own kids how to enjoy life old-school style. In the course of their adventures, each of the characters rediscover an appreciation for each other and their loved ones. Kids become kids again. Adam Sandler and his high-powered fashion designer wife unwind.

The movie was family-friendly and good-natured though Sandler likes to haze his cast of regulars with some physical gags. There weren’t any terribly hysterical moments or heavy preaching. It had a good balance of comedic and heart-warming moments.


15
Oct 10

Wanderlust and Emacs for Your Gmail Needs

Wanderlust is quite a nice IMAP client for Emacs. It’s pretty fast and does a great job of handling email. Unfortunately there isn’t much documentation and some of it is in Japanese. To get started you need to install Wanderlust and its dependent libraries. You’ll probably also need this version of ssl.el for sending email. For a mirror of the latest sources go here. Follow the instructions to install those in order.

Once you have those in place, checkout this sample setting for some defaults to get it working with gmail. Also, wanderlust will not show all your folders by default. You need a ”.folders” file to tell it what folders to show. The good thing about this is you can fine-tune the labels/folders you want to display and even create virtual folders (think saved search). Here’s a sample folder file. Notice that the ”%” denotes IMAP folders and ”!” are used for negative conditions.

You might want to study key bindings to get used to them (since they are not the typical ones you expect) or remap them.

For some reason the default sort order is ascending order. Use this setting for the usual (although you need to sort folders again after fetching with “S !Date”.

(add-to-list 'wl-summary-sort-specs 'rdate)

Here are some of the better articles on setting things up to help you out:

Customising Wanderlust

My Wanderlust setup

E-mail with Wanderlust

wanderlust tips and tricks

wanderlust iii

Once you get it set up and working, it’s quite snappy after the initial download and the saved searches aka virtual folders are really nice because you get easy access to things such as “unread messages in an inbox meeting X conditions” or whatever you can dream of. After, you get yourself authenticated run the code below to store authentication credentials. You can flush them anytime.

M-x elmo-passwd-alist-save

Hope that’s enough to get you started.


13
Oct 10

Hurt Locker

There are a lot of stressful jobs in this world. Stock broker on a New York trading floor, emergency room surgeon, or a bomb squad in Iraq. Hurt Locker follows three soldiers in a explosives disposal unit. Sergeant James is the team leader flown in to replace Sergeant Thompson after he got blown to bits by a bomb detonated with a cell phone held by a terrorist disguised as a meat vendor. Sergeant Sanborn is a tough veteran and Specialist Eldridge is the youngest of the team and provides support to the other two.

Thompson sets the tone early by ripping off the plywood, designed to keep mortars out, from the windows of his barracks because “wants sunlight”. Plus, it wouldn’t be much help if mortars come in from the roof he notes. James has a different notion of danger that is fearless and pragmatic. He also has trouble falling in with standard procedure.

It’s against this backdrop that the movie progresses as it tracks the days left in their tour. The movie isn’t plot-driven but more a collection of gruesome scenes of suspense in the desert heat. It captures the futility of a war without clear enemies as these soldiers go from crisis to crisis against bombs and locals harboring hostility thinly veiled with apathy. It’s a frightening world where bombs assembled with explosives and Radio Shack parts can be planted anywhere and detonated with a cheap cell phone.

James has a taste for danger that’s borderline reckless as he faces down one bomb after another with steady nerves but it grates on Sanborn who simply wants to play it by the book and get out with minimal damage. Eldridge is the young guy torn up inside as he struggles with the ordeal of war and watching people die before his very eyes, leaving him with guilt. James betrays a sensitive and deeply patriotic side of himself despite his appearance as a weary maverick. He’s a natural leader that doesn’t feel alive unless he’s looking into death’s eyes.

The portrayals of the soldiers are gripping because the soldiers themselves are almost caricatures of your stereotypical soldier yet each actor gives their character a raw but multi-layered depth. While the scenes are surreal they do a great job of keeping suspense and tension at a peak. It’s definitely one to watch.


13
Oct 10

Superman Returns

Superman Returns definitely got the short end of the stick in the super hero comics reboot extravaganza sweepstakes. It’s a shame really, though understandable. Brandon Routh does an eery job of recapturing Christopher Reeves likeness and carrying on the legacy but that’s probably the greatest flaw of this movie, that it tried to carry on the legacy too much. Rumor has it that Warner Bros. wants to reboot it yet again with more darkness because hey it worked for Batman like a charm, so why not Superman right? Well, Batman was always dark. Even when he was wearing purple briefs and molesting Robin behind the scenes you can’t argue that the premise of losing your parents to violent crime as a child and re-inventing yourself to become a vigillante while living a double life isn’t potent with all kinds of issues.

Superman on the otherhand flew in from another planet, with super human powers. Although he lost his parents and the planet he was on, he was raised by loving parents. Superman represents a wholesome America hell-bent on doing good no matter what extremes he has to go through. Sure, he battles villains but he also spends a lot of time fishing people out of their own messes or brushes with bad luck. He’s a well-adjusted guy with a pure heart.

In Superman Returns, we literally find Superman returning after paying what was left of his planet a visit wandering the galaxy much like how a burnt out high-powered executive might backpack around the world. He goes back to the Daily Planet to claim his unremarkable job only to find that the love of his life, Lois Lane, has moved on to a new love and even has a child. To add insult to injury she won a Pullitzer Prize for an article telling the world why they didn’t need Superman.

Lex Luthor is out of jail and up to no good and the world is in chaos as usual. As Superman struggles with his still strong feelings with Lois Lane, he must carry on saving the world and face Lex Luthor. I thought the movie was well done. Nothing really amazing but not badly written. The Daily Planet is a tough sell in this age when all newspapers are struggling and Clark Kent transforming into Superman in broad daylight is hard to swallow when there are so many cameras around us. Also, the 9/11 attacks change the backdrop of New York so fundamentally and with all the terrorism and minor conflicts in the world, it makes you wonder how many Supermans the world needs.

So, I think the main problem with this movie is with framing the Superman universe in a way that’s relevant to the current audience and making Superman human without sacrificing his wholesomeness. I still struggle to understand Warner Bros. reasons for shelving the Superman franchise. I guess the Darknight success had them expecting big bucks but a $400 million box office on a $200 million budget is nothing to sneeze at and full of potential.


13
Oct 10

The Informant

Matt Damon is a fine actor. He always adds subtle touches to his portrayals. The Informant is no different. He let himself go physically to play a middle-aged executive that decides to blow the whistle on his company. Everything seems to be going well until the so-called “informant” gets caught up in his own web of deceit. It was a somewhat dark comedy but at the same time light-hearted. Matt was pretty funny and convincing as Mark Whitacre. The only failing of this movie is that it lacked punch. There weren’t any comedic highs, just an amusing portrayal of a corrupt company bureaucracy versus a federal bureaucracy. I thought the pacing was a bit off as well since a lot of the climax and twists happened near the end but there wasn’t enough suspense to expect anything like that during the first three quarters of the movie. Still, I found it entertaining and well-written. It’s a shame that subtle movies are simply under-appreciated because both the director and actors were on top of their craft.


11
Oct 10

Your Brain and Cardiovascular Exercise

It turns out that cardiovascular exercise is really good for your brain. I’ve been getting enough regular cardiovascular exercise to the point that I seriously need my daily kick. I’m not sure if strength exercise has the same kind of effect, probably much less so but even then after a day of thinking and mental exhaustion from battling with the computer. I’ve come home dead tired wanting to do nothing but lie down and die. Usually, I’d obey my so-called instinct only to wake up the next day feeling more tired than when I went to sleep. The funny thing about exercise is that after the first few minutes I feel more refreshed and all the fatigue vanishes. The same goes for anxiety situations. I never quite noticed this before for whatever reason but it’s something I’ve gotten addicted to lately. I can actually feel an endorphin kick setting in after the first 10 minutes of exercise.

The brain responds to cardiovascular exercise quite well, boosting neuron regeneration and releasing endorphins. Some schools are experimenting with making it mandatory to use the treadmill for a session before classes. As a result, attendance is up and so are grades. It makes you wonderer how we’ve managed to stray from something so fundamental.


9
Oct 10

From Vim to Emacs

The other day pretty much out of the blue I decided to switch my main editor from Vim to Emacs. Well, it wasn’t totally random as these things are. I’ve had to write more Japanese lately and Vim just wasn’t cutting it.

I’ve been using Vim for several years now. Originally I started using Vim out of necessity. I was about to change jobs and would no longer be able to use Textmate as my main editor. I didn’t really know much about using editors back then. I started with Ruby on Rails and that pretty much sold me on using Macs and Textmate. I barely used Textmate for anything fancy other than the odd tab-completion and some odd snippets. I suppose that using whatever basic memo pad editor that comes with the computer wouldn’t have made much of a difference.

However, this being Japan and the chance of using a Mac for programming being quite slim I decided to switch to Vim. The idea was that I wouldn’t be bound to any platform and not have to relearn the use of an editor. At that point the choice came down to Vim or Emacs. Neither of them really appealed to me. I’ve had terrifying brushes with both and tried to stay away from them. With Vim I could get in but not get out. How do I enter something? How do I even quit this thing? With Emacs the key combinations looked like alien code that I couldn’t decipher. In the end I decided on Vim because once I figured out that I needed to be aware of the mode I was in (either navigation or input) then I could stumble with the rest.

Learning an editor like Vim didn’t really make me a better programmer. I did become proficient with keyboard navigation but I still wasn’t using all the features. I did love the fact that I had one setup that I could take with me everywhere. All you have to do is clone your settings directory with all your plug-ins and you could setup shop in a matter of days.

One thing that bothered me about Vim was the fact that inputting Japanese was simply not feasible at least for me. Basically, Vim and Japanese input are modal in nature. When you type Japanese you put in the spelling and then you convert it to the proper Chinese characters. So with Vim you have to go into input mode and then switch to Japanese input mode, convert it to the proper characters, switch out of it and exit input mode. Essentially I stopped writing Japanese.

Another thing was the setup. Although there are now good packages for using Vim out of the box like MacVim, getting the command line version to compile was a chore when setting up the proper ruby and Perl bindings, some things that certain features depended on. I definitely put in too many plug-ins trying to cover all the Textmate features it was missing. In order to extend Vim’s features you could learn an esoteric shell language exclusively written to extend Vim called Vimscript. It’s kind of like Bash but a bit worse. Some people wrote their plug-ins in ruby or Perl and added the bare basic wrappers in Vimscript. I kept a safe distance from it all.

Naturally, with all the plug-ins, including many of a dubious nature, my setup became a bit of a nightmare. Load was a bit slow and plug-ins that did complicated things like matching parentheses and indenting code didn’t quite work sometimes and just got in your way.

Having said that, navigation was quite a breeze and actually quite fun. I could stay on the home row and jump around a file with ease through a combination of letters and numbers. If I was to set things up today, I’m sure I would have less plug-ins and a more stable setup. However, it still wouldn’t make it easier to write Japanese with it. Even the best plug-ins would be limited in what they could do.

Emacs on the other hand doesn’t switch modes. You navigate and manipulate text with an assortment of finger-twisting commands that even gangstas in LA would have trouble performing. Have you ever tried pressing down control and the letter “v” at once? Or how about “ctrl x meta m” or something like that? To get anything done, you essentially press these crazy combinations all day. Of course, this isn’t as hard as it seems when you get used to it. In fact, it starts to become natural just like you go up and down in Vim with “j” and “k”. The only reason I was able to make the transition was by enabling sticky keys though. I press ctrl, meta and alphabets separately aside from the really easy to press ones.

The good thing is that I can navigate and execute commands without first catching myself on whether I’m in Japanese or English. I can do everything I do in English that I do with Japanese. I always wondered why a lot of the respected hackers in Japan used Emacs.

The amazing thing about Emacs is that it basically adopts a programming language Elisp at its core to extend functionality. It has its own Lisp language and interpreter built in! Once you start delving into Emacs, the things you can do are nothing short of astounding. You can surf the Internet, manage your calendar, read email, chat, irc, blog, twitter, gtd, and whatever crazy thing you can dream of. There’s an amazing group of elite hackers developing plug ins and even enhancing Emacs. After all these decades the core is still in active development even though the interface is essentially text.

I can say that after a couple weeks of tinkering with it, I’m constantly amazed at the things I can do with it. Even with a ton of plug ins loaded up it’s very responsive. Start up is slightly slower than Vim but not that noticeable, especially once your extensions are compiled (yes, you can compile extensions through Emacs). I’ve got everything from on the fly spell checking, indentation, intellisense like auto-complete, dictionary look ups, among a truckload of other things working for me like a charm.

Everything I need is right here. Even manuals are easily accessed and looking up functions are easy. It’s like a self-contained distraction-free text universe at your fingertips. The downside is that you could lose yourself for days twiddling with things and adding yet more features. The GTD system called “Org Mode” is probably the world’s most powerful yet flexible system with crazy integration. It takes a while to get to a point where you feel settled once you start discovering all this amazing features and messing with settings. I never thought I’d touch Elisp but I was writing some functions in a matter of days and pouring over code to get a feature just right or tracking down conflicts. That was an unexpected bonus.


6
Sep 10

One Year Without Alcohol

I went one year without drinking. There were three separate occasions I more or less got pressured into pretend sipping or an aperitif but otherwise I was sober the whole time and didn’t really obsess about it. It took a while for friends and people around me to realize I was dead serious about not drinking but once I established the fact, people left me alone. I ended up having a shot of tequila about one week after the anniversary. That seriously messed my head up. The alcohol felt like it got injected into my veins and took me a while to ground myself. For about a week after the tequila kept popping into my head.


Now I know why alcoholics and drug addicts need to stop cold turkey. It’s crazy but you spend all this time avoiding it and you don’t realize how much your commitment and reinforcement of values are doing behind the scene. One one level, you’re freed from all the baggage of keeping your “streak” going. On the other hand, you need to make sure all hell doesn’t break loose and wait for it to pass. I was never a heavy drinker though I always had a tendency to binge. When I stopped drinking my propensity to drink was getting more and more frequent. I abstained from alcohol a couple months before. This time I was slowly getting fed up with myself at how easily I’d go for a beer or two after work to relax, rather than just let the stress go, and then the tipping point came when I had too many drinks and totally embarrassed myself. Something inside me told me that I had to hit the “reset” button. So, I said to myself, “I’m not drinking for at least six months”.


What happens when you don’t drink alcohol? This is what happened with me.


  1. Slept way better.
  2. Felt way better.
  3. Went out less.
  4. Never stayed until the morning train at a party (this being Japan).
  5. People around you drink less.
  6. You manage to socialize with people at parties anyway (you just need to get used to it at first, if you’re shy and use alcohol to loosen up)

I know that recent studies claim heavy drinkers still live longer than people who don’t drink. These studies contradict each other every other month but I wouldn’t doubt the social component of drinking leads to better health. Still, I can’t really deny that I feel a lot better not drinking because the quality of life is way better when there’s no alcohol from last night in your system even without hangovers. It’s a lifestyle choice. Although that tequila shot puts me back on a new journey, I’d rather not go back to drinking although I’m not going to be fanatic about it. Just go with the flow and right now I’m not feeling alcohol.