28 April 2008

FSF Meeting in Boston (Part One)

Much after the fact, here are a few notes about my trip to Boston last month for the Free Software Foundation’s 2008 annual associate member meeting. This is part one. Maybe I’ll get part two up before another 6 weeks go by.

I like to travel, but I guess mainly with my wife. I didn’t like leaving her and our little baby girl behind. So while the outbound trip was pleasantly uneventful and I made it there with plenty of time to see the city, I felt a bit lonely walking around Boston Friday afternoon. I took some pictures which I’ll be posting here in the days/weeks/months ahead.

Stopped in at the FSF offices at 51 Franklin Street. One of my ears was plugged from the flight, making me feel like a deep sea diver in one of those old metal helmets. It was hard to hear others or myself. I felt awkwardly conspicuous. More conspicuous than I already may have felt from just popping in on these people during their working day. I consider myself a sociable person, but often feel awkward in new situations, around new people. But Matt Lee was there and introduced me around so that I didn’t feel like a total heel.

I had exchanged some emails with Mako about getting together that evening. He was having a party at his place in Somerville, which is a few stops up the Red Line from my hotel. I debated internally whether or not to go. I’d had a long day of traveling and walking around. I wouldn’t know anyone at the party, including Mako. I wondered how safe the subway going there and back in the evening would be. But in the end, I decided I should be brave and go. I was there in Boston to meet free software people, and there would be free software people at the party.

So I went. I happened to meet up with Mako and a few others outside his place near Davis Square. They were just arriving, and he conscripted me in to going with Daf (sp?) to get some vegetables (for sushi!) and beer. Returning, I felt out of place, but not for long. People were quite friendly.

I met a couple of folks from Wikimedia, and was presented with my very own cast-iron star anchor. Kind of a physical barnstar. Thanks, Kat! (Amazingly, it went through security on the way home without question.) There were FSF people there, someone from the Software Freedom Law Center, and several others with whom I enjoyed talking about free software, free culture, and etcetera. I wasn’t the only one who knew virtually no one there; it was just a nice mix of interesting people. The sushi was delicious. Having been awake since very early to catch my flight, and in general being an early riser, I didn’t stay very long. Subway trip back to the hotel was completely mugging-free, so all in all it was a great evening.

Benjamin Mako Hill is a star in the free software and free culture sky. Check out his web page to read about some of his contributions. He is behind the awesome “Unhappy Birthday” web site, which:

…tries to educate the public and encourage folks to snitch on their friends for singing the (copyrighted!) Happy Birthday song in public places [and] is perhaps the most widely read thing I’ve ever written. It’s been seen by millions and I continue to get hate mail several times a week.

copyrighteous

You can listen to a highly entertaining in-character interview with the nationally broadcast CBC radio show WireTap about unhappybirthday.com, on the unofficial WireTap podcast. (His bit starts 10 minutes in.)

And that was Friday, and that’s enough for this post.

by Scott Carpenter on 28 April 2008 at 7:53 pm
Permalink | Comments (0) | filed under community, fsf
| bookmark with del.icio.us

14 April 2008

Steven Levy = Awesome Writer

Hackers

'Hackers', by Steven Levy

Many years ago I read Hackers for the first time and thoroughly enjoyed it. Levy takes exhaustive research and interviews and weaves them in to a great tale. I like reading about the people behind technology and how they came to do what they do (or did what they did), and this book is full of characters and their stories: “The Heroes of the Computer Revolution.” Starting with the origins of hacker culture at MIT in the Tech Model Railroad Club, I felt transported back in time and was absorbed by the story.

Crypto

'Crypto', by Steven Levy

A month ago, I saw a reference to Levy’s Crypto, and I immediately ordered a used copy from Amazon. This is a story about how we finally got good crypto outside of the NSA. Having just started it, I’m finally learning something about those Diffie and Hellman guys, and more about the Rivest, Shamir, and Adleman in RSA. All nicely placed in the context of the times.

One sign that it’s a good book is that I’ve read through 100 pages out of 350 in just a few days. For my usual pace on paper books these days, that’s very fast. Again Levy takes all this information and creates a compelling tale. Since there isn’t a lot of action in these books, I can only credit it to the author’s skill that I want to keep turning pages.

I’m guessing many readers of this blog are familiar with Hackers and maybe Crypto also. But if you haven’t heard or given them a chance yet, I highly recommend both books if you want to get some history of the people behind the “computer revolution” and public key cryptography. (And Crypto really is about the people, thankfully, and not the mathematical nuts and bolts which are way beyond me.)

Psst…

(Buy the books through the Amazon links and I’ll make a few pennies!)

by Scott Carpenter on 14 April 2008 at 9:21 pm
Permalink | Comments (0) | filed under books, crypto, reviews
| bookmark with del.icio.us

1 April 2008

Regex Walk-Through: Match filename base and extension

'Mastering Regular Expressions', by Jeffrey Friedl

This post is a rather lengthy analysis of a short regular expression:

(.+?)(\.[^.]*$|$)

I’m continuing to enjoy and learn a lot from Jeffrey Friedl’s Mastering Regular Expressions. One of the things that works well for me is the way he walks through examples and iteratively builds a more robust pattern for a particular task. It helps to develop logical ways of thinking about these things.

While you may not need to accomplish the particular task described in this article, I hope you might benefit by following along with the explanation. (Although it’s probably not as clear and concise as the ones in MRE!)

So! I recently wanted to modify a filename by inserting some text before the extension and was pleased with the regular expression I built for the task. Here it is again in all its glory:

(.+?)(\.[^.]*$|$)

The two capturing groups here will collect (with an exception explained below):

  1. Everything up to but not including the last dot in a filename (the filename base).
  2. From the last dot to the end of the filename (the extension).

But why not use ____ instead?

Before proceeding, we might ask: Why use a regex instead of something like Python’s os.path.splitext('test.txt')? It returns exactly what I described above, e.g. for test.txt: ('test', '.txt'). Well, I’m learning a lot about regular expressions right now, so I tend to think of possible regex solutions for string parsing challenges. (Filename nail, meet Regex hammer.) I was interested in the challenge of crafting a good pattern and had fun figuring it out. And I didn’t know about splitext offhand at the time I was doing this. So, yes, I might have used the easier method had I known better, but this way I gained some good regexperience.

Read the rest of this entry »

by Scott Carpenter on 1 April 2008 at 8:24 pm
Permalink | Comments (2) | filed under regex
| bookmark with del.icio.us

30 March 2008

Power of Example (and the Long View)

Benjamin Franklin

Martin Sexton

Power of example
My mama said it and I heard
She says one ounce of action
Beats a ton of words.

Martin Sexton, “Hallelujah”

Richard Stallman

[…] I didn’t write a whole free operating system, either. I wrote some pieces and invited other people to join me by writing other pieces. So I set an example. I said, “I’m going in this direction. Join me and we’ll get there.” And enough people joined in that we got there. So if you think in terms of, how am I going to get this whole gigantic job done, it can be daunting. So the point is, don’t look at it that way. Think in terms of taking a step and realizing that after you’ve taken a step, other people will take more steps and, together, it will get the job done eventually.

Assuming that humanity doesn’t wipe itself out, the work we do today to produce the free educational infrastructure, the free learning resource for the world, will be useful for as long as humanity exists. If it takes 20 years to get it done, so what? So don’t think in terms of the size of the whole job; think in terms of the piece that you’re going to do. That will show people it can be done, so others will do other pieces.

Richard Stallman, Free Software, Free Society, p153 (155 in PDF)
   ”Copyright and Globalization in the Age of Computer Networks”
   19 April 2001 speech and Q&A at MIT

Richard Feynman

“We are at the very beginning of time for the human race. It is not unreasonable that we grapple with problems. But there are tens of thousands of years in the future. Our responsibility is to do what we can, learn what we can, improve the solutions, and pass them on.”

Richard Feynman

The Long Way Home

Taking the longer view of humanity’s future, it seems obvious that we should be pursuing free software development and sharing knowledge freely. With proprietary software, we’re always going to have this exclusionary scab over everything that can’t be picked. (Although that’s not a good metaphor because a scab is actually a good thing.) People will spend a lot of time recreating things that aren’t available for free use, instead of taking what’s already there and improving it.

With free software, the solutions are available for everyone to improve.

How much better if we collaboratively build things from which everybody can benefit, immediately. Because even if all things eventually pass in to the public domain, they won’t be available for free use and sharing when it really matters. Sure, many things that enter the public domain (a long, long, long time from now) will still be valuable, but much will be lost, and much software technology will be moot.

We’ve had a long time to learn how to deal with a world of scarce goods, and that’s what most people understand. Scarcity. But I think our solutions will come more slowly until it’s widely understood that we shouldn’t try to create artificial scarcity for information (including software), knowledge, and ideas.

We’ll get there. A growing number of people understand. We’re slowly building up the free world. It’s great advice to not get overwhelmed by the job ahead, but just take steps toward the goal. Set that example. Improve those solutions.

And please share your solutions freely!

by Scott Carpenter on 30 March 2008 at 9:01 pm
Permalink | Comments (2) | filed under cooperation, free software, quotes
| bookmark with del.icio.us

29 March 2008

Python: Regex Test Function

'Learning Python', by Mark Lutz 'Mastering Regular Expressions', by Jeffrey Friedl

More fun with Python and regular expressions. Following up on a previous post, I wanted to share a little test regex function I wrote in Python to help me as I work through the regular expression book.

I’m mostly working at the interactive prompt and had been running commands from Python re (the regex module) as I experimented with different regular expressions. This was good as I spent time in help(re) and built up some muscle memory for Python regex functions, but it was becoming repetitious to keep typing the commands for analyzing the results of a match. Once I started learning about writing functions in Python, I realized it was time to enhance my regex learning experience with a simple Python function.

I know there are sophisticated regex tools out there and probably simple functions that do more than this, but it was fun to cobble the function together and learn more about Python in order to learn more about Regex. So far it’s proven helpful in understanding how regular expressions work. I hope it may be of use to you also.

Function Definition

The function will print whether there is a match or not, starting and ending positions along with the matched part of the string for each match, captured strings (groups), and then finally will do a global search and replace on the string and print the result.

match(pattern, string[, repl])

(I would have preferred putting repl before string to match the re.sub parameter order, but I switched them to make it an optional last argument.) I put the function in a file named imisc.py (interactive miscellaneous) that I import into an interactive session to make regex experimentation more convenient.

Keep reading below the fold for examples and the actual function!

Read the rest of this entry »

by Scott Carpenter on 29 March 2008 at 10:34 am
Permalink | Comments (2) | filed under code, python, regex
| bookmark with del.icio.us

27 March 2008

3rd time not quite a charm: Upgrading to Ubuntu 7.10 (Gutsy Gibbon)

The other night, sort of kind of on a whim, but not really, I upgraded my main machine from Ubuntu 7.04 to 7.10. There were some problems, but in the end, not very serious. No need for panic.

I’d upgraded my laptop when 7.10 was released, and that went fine. The plan for my other machines is to keep current, but to wait until the end of the six month release cycles, hoping that things will be more stable by then. After realizing that 8.04 will be coming out before long, I decided to upgrade my system76 box over the weekend, and that went pretty well. (My second upgrade on that one: 6.10 » 7.04 » 7.10.)

I was more apprehensive about upgrading Zodiac, however, since I’ve installed so much more stuff and there would be more opportunities for things to break. This would be my first OS upgrade on my primary machine since switching full-time to GNU/Linux back in June 2007. On Tuesday I just decided to go for it, without doing anything to prepare up front. (The same plan I had used for my other upgrades.)

The install process went very smoothly, and much the same as it had for the other machines. There were occasional prompts to keep or replace various config files, but for the most part everything hummed along. And then finally, a restart, and as text started scrolling up…

An error related to the VirtualBox driver, and…

Some error, something like: “Can’t display this video mode,” with the GUI not starting up and the screen flashing between text and blank screen. Oh, crap. I had a sinking feeling, but I tried to remain calm. I got in to recovery mode from the GRUB menu, and then I remembered from previous experience that deleting xorg.conf will usually get you back to some kind of usable GUI mode. (Backing it up first, of course!) I did that and got in to X, which was reassuring: Things probably weren’t that hosed.

And then I realized why I was being punished: I had installed the proprietary nvidia display drivers in order to get my dual monitors working with less fuss last summer when I made the big switch. That had to be it. From there it didn’t take long to reinstall and get dual monitors back after some fiddling and finally restoring an old xorg.conf file. (Yeah, yeah, I’ll eventually work on free video drivers also.) I was impressed with how well the nvidia installer works. It lets me be a dummy about that whole part of the system.

Other than that, the upgrade was pleasantly uneventful, with just a few minor wrinkles. Phew! Should be good to go for another six months.

by Scott Carpenter on 27 March 2008 at 10:38 pm
Permalink | Comments (0) | filed under ubuntu
| bookmark with del.icio.us

« Previous Entries