Braindump NYC - Algorithms

Tonight was the third meeting of the Braindump NYC meetup physically hosted by Hunch and logistically hosted and sponsored by my friends at Hackruiter. Each meeting has a technical theme and those present are invited to give very short presentations along the theme.

Tonight’s theme was “algorithms” with a wide variety of types being presented.

The first short talk I gave was on An Envy Free Cake Division Protocol, as given by the paper of the same name (PDF) and the fantastic book Cooking For Geeks. I cheated because a protocol is strictly speaking not an algorithm, but is still procedural. Nevertheless, the main criticism of the talk was that I didn’t actually bring any cake. I was happy to spread the sheer awe that I experienced when I found out there is a whole section of science devoted to optimal ways to cut a cake.

I also gave an abridged short talk on the Linux O(1) and CFS scheduling algorithms by Ingo Molnar. The O(1) algorithm is special for me because its debut during the 2.5 series got me interested in kernel development for its sheer simplicity and mantra that working code speaks louder that words.

I’m really excited by this event series. I’ve learned interesting practical and theoretical knowledge both times I’ve went and have really enjoyed the people who attend.

comments

still alive

I’m still alive. I have an itch to write about lots of technical things and rant about a few others. I started an awesome new job in February that has taken up most of my time since.

I’m still alive and life is good.

comments

TLC Rules for Taxicab Drivers

I was reading through the TLC Rules for Taxicab Drivers (pdf) to satisfy some curiosity after reading through several posts from the entertaining blog Cabs Are For Kissing, written by a cabbie about stories from the job. I found these amusing sections:

§ 2-42 Courteous.

(a) A driver shall be courteous to passengers.

It turns out that from § 2-86 a violation of this section is a $150 fine.

§ 2-44 Luggage and Property.

(b) A driver shall not transport for hire any property, except blood or vital human organs, unless such property is in the possession of a passenger.

I find it funny that this exception exists. Is it normal for hospitals to give these items to cabbies for transport alone?

comments

Oh Snap -- You Just Got PEW PEW PEWed!

pew pew pew

(via geekology)

I’ve never quite been able to get it out of my mind since I first saw this, driving me slowly insane. Plus, I love animated gifs.

comments

Ricky Gervais on atheism in the Wall Street Journal

Ricky Gervais presented a well-written piece on why he is an atheist last month in the Wall Street Journal. He also responded to some questions and his response to the question “How do you plan on celebrating Christmas?” was striking to me:

Eating and drinking too much with friends and family. Celebrating life and remembering those that did, but can no longer.

They are not looking down on me but they live in my mind and heart more than they ever did probably. Some, I was lucky enough to bump into on this planet of six billion people. Others shared much of my genetic material. One selflessly did her best for me all my life. That’s what mums do though. They do it for no other reason than love. Not for reward. Not for recognition. They create you. From nothing. Miracle? They do those every day. No big deal. They are not worshiped. They would give their life without the promise of heaven. They teach you everything they know yet they are not declared prophets. And you only have one.

I am crying as I write this.

He goes on in that answer with a touching anecdote about his mother that is worth reading.

comments

Justice Stewart in New York Times v U.S.

Emphasis mine:

In the absence of the governmental checks and balances present in other areas of our national life, the only effective restraint upon executive policy and power in the areas of national defense and international affairs may lie in an enlightened citizenry – in an informed and critical public opinion which alone can here protect the values of democratic government. For this reason, it is perhaps here that a press that is alert, aware, and free most vitally serves the basic purpose of the First Amendment. For, without an informed and free press, there cannot be an enlightened people.

Potter Stewart, Justice of the United States Supreme Court, in his concurring opinion in New York Times v. United States, where the government asked the court to issue prior restraint against the New York Times to prevent it from publishing the Pentagon Papers. The court ruled 6-3 in favor of the Times.

The rest of the opinion, only a few other paragraphs, is worth the read.

comments

Replaced reliant robin

A few weekends ago, I was poking around my site statistics and found that I had a huge number of hits and was using a much larger percentage of my bandwidth than I’d expect with a silly, personal text- and image-only weblog:

weekly hit report for ericgar.com

So I took a look at my referrers:

referrer report for ericgar.com

And sure enough someone is hotlinking one of my images at http://forums.vwvortex.com. It turns out it’s my from my post about Buying a Reliant Robin:

forum post for ugliest car

Which they found because I’m the first hit in Google Image Search for “Reliant Robin”:

google image for reliant robin

So I replaced it with this:

reliant robin in camo
comments

Amazon pulls WikiLeaks, I pull my account

Earlier this week, Amazon terminated the Amazon Web Services account that WikiLeaks was using to host the site, possibly caving to political pressure from the office of Senator Joe Lieberman. Lieberman subsequently issued a statement calling for all companies to censor WikiLeaks. Daniel Ellsberg, the figurehead behind the Pentagon Papers, published an open letter to Amazon condemning this decision, closed his Amazon account, and encouraged others to do the same.

Glenn Greenwald has an excellent piece on how Joe Lieberman Emulates Chinese Dictators.

I just requested that my account be cancelled. You can too. I used to use Amazon as a convenient one-stop shop for pretty much everything, so yes, my life will get a little bit more inconvenient without said account.

Thomas Jefferson, 1791:

I would rather be exposed to the inconveniences attending too much liberty than to those attending too small a degree of it.

comments

Reinforcing a republic

With today’s historic WikiLeaks release (which has been undergoing a DDOS of unknown origin; so here’s the NYT coverage), I couldn’t help but think of the closing of The Hacker’s Manifesto:

This is our world now… the world of the electron and the switch, the beauty of the baud. We make use of a service already existing without paying for what could be dirt-cheap if it wasn’t run by profiteering gluttons, and you call us criminals. We explore… and you call us criminals. We seek after knowledge… and you call us criminals. We exist without skin color, without nationality, without religious bias… and you call us criminals. You build atomic bombs, you wage wars, you murder, cheat, and lie to us and try to make us believe it’s for our own good, yet we’re the criminals.

Yes, I am a criminal. My crime is that of curiosity. My crime is that of judging people by what they say and think, not what they look like. My crime is that of outsmarting you, something that you will never forgive me for.

I support today’s release. Democracy was never intended to be conducted behind closed doors. A government is responsible to its people – not the other way around – and both would do well to remember that: history shows that governments are expendible, but the citizenry is not.

comments

Open ports on megabus to Boston

The following is nmap output over Megabus-provided wifi (en route to Boston) showing the proxied ports.

Starting Nmap 5.00 ( http://nmap.org ) at 2010-11-02 19:39 EDT
Interesting ports on dagny.detechnis.com (173.255.227.97):
Not shown: 987 filtered ports
PORT     STATE  SERVICE
53/tcp   open   domain
80/tcp   closed http
110/tcp  closed pop3
143/tcp  closed imap
443/tcp  closed https
465/tcp  closed smtps
587/tcp  closed submission
993/tcp  closed imaps
995/tcp  closed pop3s
1863/tcp closed msnp
5190/tcp closed aol
5222/tcp closed unknown
8080/tcp closed http-proxy

Nmap done: 1 IP address (1 host up) scanned in 30.28 seconds

What’s sort of annoying is that:

  1. Port 22 (ssh) is blocked.
  2. ICMP Time Exceeded messages are blocked (not shown), making tracepath unusable.

I will be attending the Linux Plumbers Conference and the Beer Advocate Belgian BeerFest in the coming days. More on those as they happen.

comments

Recommended Reading

I present two recommended reads. Oddly enough, both are written by Microsoft employees.

  • On Designing and Deploying Internet-Scale Services” (PDF link) by James Hamilton is essentially an end-to-end checklist for making an application work, scale, and be manageable. The paper, presented at LISA ‘07, is 12 pages of bullet points of recommendations from the author and various other employees of large application teams within Microsoft, focused around ten themes:

    • overall service design
    • designing for automation and provisioning
    • dependency management
    • release cycle and testing
    • hardware selection and standardization
    • operations and capacity planning
    • auditing monitoring and alerting
    • graceful degradation and admission control
    • customer and press communications plan
    • customer self-provisioning and self-help.

    It is definitely a concise way to make sure you’ve thought of how your services works, acts, and operates, and where you can improve it.

comments

On Converting to Jekyll

I wrote that I spent some time recently to convert my Wordpress-based weblog to Jekyll. As partially mentioned in that post, Jekyll is a “blog-aware” static content generator written in Ruby that uses a lot of existing components, like Maruku for Markdown formatting and Liquid for templating.

The documentation for each of these components is at times a bit sparse and strangely arranged. The following pages I just found but I should have read them earlier:

Between those three, they do a good job of discussing what Jekyll is and where it succeeds and fails. I’ll just comment on my process.

Looking over and stealing the structure of existing sites, including mine is recommended. Of course, be sure to respect the original author’s copyright for content and code (mine is Creative Commons and BSD, respectively). I borrowed Tate Johnson’s, who recently redesigned his site to explicitly mimic Latex output with CSS3 and HTML5.

The conversion process was both easy and painful: it was easy to get started and get all of the information in place, but was painful to import all 220 existing posts. Exporting the posts were painless: the provided Wordpress migration tool worked like a charm. I did have to tweak it a bit to get topic name → file name conversion just right, and to pull down the few drafts of unfinished content in the database.

Converting the posts to valid Markdown pages would have been a Herculean task, but I decided that I at least wanted to convert them to a format that Maruku would parse and export to valid HTML. Maruku is particular about where raw HTML can appear, namely approximately in its own block. A lot of time was spent wrapping things in <span>s to get Maruku to stop complaining. I wrote some shell aliases to help me with the edit-debug-commit cycle. For a large portion of the attention-required posts, I just converted to valid Markdown.

Wordpress has a nice feature that I started using liberally: if a media URL appears in the body of a post and is not contained in a tag, it uses the oEmbed standard to convert the media to an HTML representation. This meant that I had to revise all of my YouTube and Flickr references to be valid HTML or Markdown. I was half way done writing a Jekyll plugin that would support oEmbed, but then decided this defeats the purpose of having a simple, static conversion process.

The rest of the stuff was easy. I wrote an RSS 2.0 feed and heavily modified someone’s existing Atom one (both of which you should steal from me). I used Yahoo’s YUI 2 Reset-Base-Font and Grids CSS as I hate dealing with browser-specific CSS differences. I used W3C’s validator constantly. I wrote a Perl-based unit test to make it easy and integrated in my Rakefile.

I’ve so far decided against having comments, but I do have a trivial topic branch that integrates Disqus comments. I’ll probably merge it some day soon.

My next rainy day task will be categorizing or tagging posts, which Jekyll supports strangely, so a million different people have reimplemented it in different ways.

This work was worth it to uncomplicate managing this simple weblog. I can compose in Vim, write in a decent markup language, have Makefile-like automation for testing and deployment, maintain revision history and have sane branching with Git, and not have to deal with security upgrades and unnecessary slowness.

comments

Redesigned ericgar.com

I decided that managing Wordpress on my web host was not interesting any longer. I wanted to host my simple blog in git, to compose using vim, and to not have to manage a database or the insecurities of a web application. Not to mention that the RSS feed was slightly broken and the pages were not standards compliant.

Consequently, I redesigned this site using Jekyll, a Ruby-based “blog-aware” publishing tool that is the backend behind GitHub pages. Instead of dynamically generating content, it transforms all the content to static HTML files. It uses Markdown for its markup language, so composing directly in cumbersome HTML continues to not be necessary. I now have both a suite of unit tests that are run prior to deployment, as well as a QA site to test changes before going production with them.

The unfortunate side effect was that your feed reader probably went a little crazy and marked-as-new a bunch of old posts. Apologies for this: it wasn’t worth keeping the same timestamps. Also, there was a late-breaking bug in the RSS feed (but the recommended Atom feed was fine).

The source for this blog is available on GitHub. Let me know if anything is broken.1


  1. Admittedly, I haven’t taken the time to make all posts prior to those on the front page XHTML Strict compliant as it would take too much time.

comments

An armchair economic analysis of moving walkways

Walking in the Charlotte Airport inspired me to do some research into the economics of moving walkways. I’m currently sitting (in a wooden rocking chair!) in front of one, which clearly illustrates a common thought: why do people stand on moving walkways?

Often being positioned in areas designed to get you from one place to another (say, transportation hubs), I think it should be obvious that moving walkways do not exist to present an opportunity of leisure and rest, but to propel us faster toward our ultimate destination.

The paper “An Armchair View of Escalators and Moving Walkways” (pdf link) by Roger W. Garrison presents a neoclassical microeconomic analysis of exactly the trade-offs involved in deciding to stand or walk, and is an enjoyable, short read.

I’ll spoil the ending by giving this quote:

The only downside to exposing students to this armchair view of escalators and moving walkways is that they may never again be able to pass through an airport without thinking of indifference-curve analysis.

(Perhaps I will now attempt to collect empirical data on moving walkway usage).

comments

Things I'm looking forward to.

  • Giving a talk to my colleagues in Asia (via teleconference, sadly) about Git, how it works, and why it is super-concentrated awesome.

  • Visiting my best friend and his lovely wife in Charlottesville, VA and attending the Top of the Hops beer festival. (Which sadly means I may miss this weekend’s Ubuntu Kernel Bug Triage Summit. Ah choices and obligations…)

  • Giving a talk sometime in the next few months for NY.pm’s Perl Seminar group on some facet of Moose. All details TBD.

  • Posing as a real Linux kernel developer and attending the Linux Plumber's Conference in Boston. I don’t feel bad posing because:

    1. I believe that to be good at anything, you need to know as much about the level above and below the piece of the stack you’re most interested in. If you don’t have this knowledge, you don’t have a good picture on what you’re actually doing.
    2. I’ve spent a good deal of my time, both on the job and off the job, poking around the kernel and drivers to explain emergent behavior or error conditions.
    3. I really want to be a real kernel developer soon.
  • Attending the BeerAdvocate Belgian Beer Fest (which happily is the same week as the LPC and in Boston).

  • Trying out the non-permanent, non-furniture-like whiteboard on my wall. I love whiteboards and really love brainstorming with them. There is something less restraining with a whiteboard than dumping my mind onto a piece of paper. It’s a serious bummer that the whiteboards at work suck.

comments
Original work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License | © Eric Garrido