the hypothetical maximum data transmission rate of a telecommunications medium

Posted by dlandgren on 2012-01-25

Reading an article today in the New York Times regarding the end of semi-skilled jobs, I came across the following gem:

[…] Annie Lowrey of Slate wrote about a start-up called “E la Carte” that is out to shrink the need for waiters and waitresses: The company “has produced a kind of souped-up iPad that lets you order and pay right at your table. The brainchild of a bunch of M.I.T. engineers, the nifty invention, known as the Presto, might be found at a restaurant near you soon. … You select what you want to eat and add items to a cart. Depending on the restaurant’s preferences, the console could show you nutritional information, ingredients lists and photographs. You can make special requests, like ‘dressing on the side’ or ‘quintuple bacon.’ When you’re done, the order zings over to the kitchen, and the Presto tells you how long it will take for your items to come out. … Bored with your companions? Play games on the machine. When you’re through with your meal, you pay on the console, splitting the bill item by item if you wish and paying however you want. And you can have your receipt e-mailed to you. […]

That is so wrong, in so many ways. Who gives a flying fuck about nutritional information? If you had doubts, you shouldn’t have been here in the first place. And “bored with your companion”? What on earth possessed you to go to a restaurant with someone if you didn’t want to spend any time talking to them.? Being an autist playing on your console and ignoring them, I’m sure they will really appreciate your company. On the up side, I doubt you’ll dine with them ever again.

Then I went back to find out who wrote this drivel. Thomas Friedman. I might have known.



Posted in current-events | Tagged: , , | Leave a Comment »

Subversion – how many times has a file been modified?

Posted by dlandgren on 2011-06-08

Someone asked me the other day at work, which file in a project has undergone the most changes. The idea being to look at which files are “hot”, as in frequently touched, and which files are “cold”, rarely edited.

This information is not available directly, but can be assembled from the commit history.

The first step is to produce the list of files changed in each commit since the beginning of time:

svn log -qvr 1:HEAD

which will produce a rather verbose description of what files were changed in each revision:

r382 | david | 2011-04-07 15:32:57 +0200 (Thu, 07 Apr 2011)
Changed paths:
   M /trunk/Assemble.pm
   M /trunk/Changes
   M /trunk/MANIFEST
   M /trunk/README
   M /trunk/t/03_str.t
   M /trunk/t/09_debug.t
   A /trunk/t/10_perl514.t
r387 | david | 2011-04-17 16:29:59 +0200 (Sun, 17 Apr 2011)
Changed paths:
   M /trunk
   M /trunk/MANIFEST
   M /trunk/t/03_str.t
   M /trunk/t/09_debug.t
   D /trunk/t/10_perl514.t

What we want to do is throw away all the fluff in each revision stanza, and retain the file paths. A quick Perl one-liner will do that for us, by printing out only the lines between “Changed paths” and a line of dashes. Since this will also include the delimiting lines, the line is also tested to ensure it starts with a space. This is probably overkill, but offers a slightly improved guarantee against surprises.

perl -nle 'print if /^Changed paths:/ ... /^-+$/ and /^\s/'

If the svn log output it piped through this, we obtain

   M /trunk/Assemble.pm
   M /trunk/Changes
   M /trunk/MANIFEST
   M /trunk/README
   M /trunk/t/03_str.t
   M /trunk/t/09_debug.t
   A /trunk/t/10_perl514.t
   M /trunk
   M /trunk/MANIFEST
   M /trunk/t/03_str.t
   M /trunk/t/09_debug.t
   D /trunk/t/10_perl514.t

The next step is to throw away the Subversion action code, and discard any paths not under /trunk (such as /branches or /tags). To do this, we’ll attempt a substitution that eliminates the leading space, some non-space characters and a space, and then capture a path that begins with /trunk. If this succeeds, then print the line:

perl -nle '/^Changed paths:/ ... /^-+$/ and s/^\s+\S+\s+(\/trunk)/$1/ and print'

Now we’re down to:


Now it’s a simple matter to either grep for the file we want to look for, or count how many times each file occurs, and sort the files by the number of times they appear. The latter is done trivially with the Unix toolkit: sort, count unique occurrences, and sort by count:

sort | uniq -c | sort -n

Which results in

  40    M /trunk/t/00_basic.t
  58    M /trunk/Changes
  59    M /trunk/t/03_str.t
 109    M /trunk/Assemble.pm

So putting it altogether, the magic command is

svn log -qvr 1:HEAD|perl -nle 'print if /^Changed paths:/ ... /^-+$/ and /^\s/' \
    | sort | uniq -c | sort -n

And the deed is done.

Posted in perl, programming | Tagged: , | 1 Comment »

Delicious e-mail

Posted by dlandgren on 2011-04-28

del.icio.us logoSo, Youtube founders have bought del.icio.us from Yahoo!. (I hope they bring back the old domain name, delicious.com makes you wonder if they were hoping to bring AOL users on board).

I opted in to have my bookmarks (3000+, although god knows how many are 404s these days) transferred over to Avos. They wanted my first and last name, which annoying. The original owners never saw the need.

For my troubles, I received the following message in my inbox:

Hi david,

Hooray! Your data can now be moved along with Delicious.


Originating IP address:

It’s the last bit that I have doubts about. One more reason to not believe everything you read on the net.

Posted in day to day | Tagged: , | Leave a Comment »

New perpetual motion breakthrough discovered!

Posted by dlandgren on 2011-03-17

In an article published on The Australian website, Roger asks “Why cant the pressure of the ocean be used too drive the salt water thru a filter and down a man made tunnel creating freash water and driving turbines too create endless power.”

Now I wonder why nobody ever thought of that before.

I’ve been trying find something to say about this, but in the face of such cluelessness I admit defeat.

source: DigitalGlobe-Imagery

Aside: I went looking for a photo to illustrate this entry on Flickr. And by a strange coincidence, The Australian used the same one. They attribute it to AFP, whom I assume paid DG-I for the privilege of using it in a commercial context?

Posted in current-events | Tagged: , | Leave a Comment »

The destruction of the Jardin des Éléphants

Posted by dlandgren on 2011-02-18

The Forum des Halles redevelopment project finally got around to sending in the bulldozers, the chainsaws and the jack-hammers to tear apart the Jardin Lalanne. In its place will be a glorious entrance to the underground shopping mall, thereby satisfying a long-standing complaint the tenants of the western wing have had with the owners. Due to the fact that there is no entrance on one side of the mall (apart from an emergency exit which is always locked), there is less foot traffic and so sales are lower. People are not consuming enough. This must be fixed.

So the garden got chopped. We demonstrated with the children a couple of years ago when the plans were made public, to try and save the garden. Hundreds attended the rallies but to no avail. The town planners had their way. It is true that the building surrounding the Forum are an eyesore, and no-one will shed a tear when they are demolished. But surely there could have been some alternative plan that would have retained the garden as it was. There’s certainly a soulless playground with next to the jardin that could have got the axe.

What is really sad is seeing what has replaced it, out in front of Saint Eustache. And when you look at it you see that the children there are not having fun, not really. It’s too boring and safe. There’s no adventure, no call to the imagination.

TODO: I have some more photos taken from a couple of years ago during the demonstrations, that show what the garden used to look like (because if you never saw the Jardin des éléphants in its heyday, this post probably doesn’t make a lot of sense). I’ll dig them out and add them here next week.

Posted in paris | Tagged: | Leave a Comment »

Reflections on the Perl6 logo

Posted by dlandgren on 2009-09-26

She: Oh… uh, isn’t that new?
He: Yes it is. Do you like it?
She: Well… what is it?
He: Uh… “New Young American Primitive”.
She: I have a new young American sister. She’s only three and her stuff is really primitive.

—Joan Chandler and John Dall, Rope (Alfred Hitchcock)

It would appear that Larry Wall has (his heart) settled on a logo for Perl6, and he’s been thinking about it for quite some time.

I would also like to make it clear that I’m a just a little tired of these “rounds”; more importantly, that I’ve been mulling over this particular issue for many years.

Which brings us to:

Does the flap of a butterfly's wings set off a tornado?

Does the flap of a butterfly's wings set off a tornado?

Woah, my eyes, talk about Angry Fruit Salad. Of course, this comes from the man who considers chartreuse to be a suitable background colour for a web page…

There is a textual representation of the logo as well, and in fact, it’s only after seeing the text version that the above makes any sense at all:


Or if you have Unicode and decent typesetting software:

typographical perl6 logo

Now the meaning becomes clear, it’s meant to be a riff on Perl6’s hyper-operators. Well, fair enough, but really, those bug eyes, that crooked smile, the P and 6 in the wings, that’s supposed to be what? And what will that look like to a colour-blind person? Is this a peculiarly American need, to have a mascot? I’m baffled.

But seriously. In the 10th State of the Onion, Larry suggested that Perl 4 was a pre-teen, and Perl 5 was an adolescent. Perl 6 is when Perl grows up and becomes an adult. And the language is coming along nicely. There are lots of lovely features going into that is going to make it a fascinating language to work in over the next couple of decades. And now this curiously infantile regression.

The biggest problem is that I would have a hard time advocating the language without people snickering at me. I am reminded of Jamie Zawinskie, when he announced his resignation from Netscape, some months after the company was bought out by AOL.

…someone from the New York Times asked me what it would be like working for AOL, given that they represent (in her words) “all that is cheesy and mainstream about the net.” She asked if AOL had lost that stigma. I disengaged my brain and answered,

I think AOL still has all the stigma that it always has, as far as image goes. My friends keep saying jwz@aol.com and then laughing uncontrollably…

I envisage a conversation at work when I would suggest that Perl6 would be a secret weapon that would boost programmer productivity and give us the edge that allows us to roll out new applications faster and better, and the other people in my team rolling their eyes and laughing. “Hey guys, let’s break out the acrylic paints and do some fingerpainting!”

The language scene is a lot more crowded these days. Perl is going to find the going a lot harder this time around. Not to mention the rise of worse is better and the likes of PHP.

I can’t see how this is going to help matters.

I just can’t take any of you seriously
Fire up the batmobile, ’cause I gotta get outta here …

—Liz Phair, (Fire Up The) Batmobile

So please, anyone, anywhere, come up with a better one, before it’s too late, ok?

Posted in perl | Tagged: | 9 Comments »