Archive for the 'GPL' Category

Extracting files from a directory tree

Saturday, October 6th, 2007

Mr. Ben Polito has recently beating his drum to the tune that I am a repressed mechanical engineer who needs to release his inner software engineer.

Normally, I am too busy with preparations for the arrival of the Hard Times to spend time busting the myths spread by a sailor in the dark, but a recent problem I ran into at work gave me pause. The first version of our corporate wiki, a tweaked version of mediawiki, left a hierarchy of a few hundred directories sprinkled with around 1600 files. These files were attachments to the old wiki, and while most of them were transferred to the new wiki, some were not.

I thought to myself, “Ah! I bet I could write a little Python function that recursed through the directories, copying out the files and calling itself for each subsequent subdirectory!” This was Friday night around 10, after a day spent writing PLC code for work. It was at this moment that I thought, “Perhaps Mr. Polito has a point.”

To that end, I present Pylito.

Deval Patrick appoints Microsoft lobbyist to technology working group

Tuesday, December 5th, 2006

I voted for Deval Patrick for governor of the fine commonwealth, er, state that I live in; I was disappointed to see that he appointed the Microsoft Regional Director for Public Affairs, Brian Burke, to his technology working group. It’s disappointing because Mr. Burke will likely attempt to overturn a great technology decision made by requiring that the state adopt OpenDocument format (recently published as an ISO standard) as its preferred format by January 1, 2007. This would mean that my government would no longer be paying so much for Microsoft Office when cheaper alternatives, such as OpenOffice, exist. It’s true that OpenOffice has its flaws, but as a daily user of Microsoft’s lovely office suite, I can verify that Microsoft Office does as well. (Why, for example, when I search Outlook’s inbox, does it return results from my oldest email first?)
The working group has a public meeting at 7 pm on Monday, December 11, 2006.

The GPL is not viral

Sunday, February 5th, 2006

I was listening to a recording of Chris Messina talking about building infrastructure for the open source community at BarCamp Dallas; in the middle of the recording, a discussion started about the new version of the GNU General Public License.

Someone in the crowd claims the GPL is a “viral” license. This is a claim that has been repeated for years; unfortunately, it’s a ridiculous metaphor. The GPL says that if you download code under the GPL, change the source code, and release a new version, you have to release your changes to the source as well.

A virus, on the other hand is something that infects you, despite your best efforts to avoid it. The measles virus, for example, is passed through airborne particles. Nobody gets the measles on purpose.

The GPL may seem viral—if you include GPL’d code in your proprietary program, then you have to release your entire program under the GPL. The misleading part is that while you might contract the measles despite your best efforts to avoid it, it is unreasonable to say that you will inadvertently introduce GPL code into your program.

“Oh, I accidentally went to Sourceforge, downloaded a tarball, opened it, and copied code with the exact functionality I was looking for into the correct part of my program! Oh no! Help! I’m infected with the GPL virus!”

Tormented by Mike Goelzer

Sunday, February 5th, 2006

A recent exchange with Mike that he has posted on my blog against my will:

From: Mike Goelzer
To: Brandon Stafford
Date: Jan 31, 2006 11:27 PM
Subject: State of the Union

What do you make of the fact that tonight’s State of the Union speech did not address the recent controversy over GPL v3? This is an issue that has divided the open source community, with Linus and Stallman practically at each other’s throats, and the president did not even mention it! Instead, he talked about issues like health care, which are only of interest to a small number of sick people who are probably still using the 0.11 kernel anyway.

This just goes to show how out of touch our politicians are with mainstream America. It’s outrageous and it disgusts me.

Mike W. Goelzer

P.S. This message is protected under the “GPL v2 or later.” In other words, if you have read this far, you need to send me all of your private signing keys. Please send me your blog password as well.

From: Brandon Stafford
To: Mike Goelzer
Date: Feb 1, 2006 7:10 AM
Subject: Re: State of the Union

For the love of Gahweb (GHWB), will you please stop over-simplifying the situation. You know damn well that Linus and Stallman are not at each other’s throats!

The reality is that Linus was at Stallman’s throat, Stallman was after Eben Moglen, and it was Moglen who was at the throat of Mr. Torvalds. Ooh, and there is Simon Phipps! Phipps drops the hammer on Moglen while the diminutive Red Sea pedestrian is laying into Helsinki’s finest. Out in the hallway, it’s Bob Sutor with Chris diBona in a headlock! Wait, is that Chris diBona? No, it’s Darl McBride wearing a Chris diBona mask! This could get ugly! Oh no, it’s William Leibzon mixing it up with Vixie! What are they doing here? The NANOG conference isn’t until April! Leibzon’s got a gun! Noooooooooo!!!! Vixie is dead.

Alright, I have to go eat breakfast. Damn you.

Brndn McBride

From: Mike Goelzer
To: Brandon Stafford
Date: Feb 1, 2006 11:32 PM
Subject: Re: State of the Union

How can you mention Darl McBride in the same digital breath as those other open source luminaries? McBride is like their antithesis; he is a black hole that absorbs the light emitted by the luminaries, thus paradoxically rendering them invisible. Have you ever wondered why it’s so hard to see Richard Stallman clearly, even in broad daylight? It’s because all he emits is Hawking radiation accounting for less than 1 x 10^-100 of his total luminosity.

(Notice how I put one over Googol there. Suckers!)

Seriously, though, remind me never again to challenge you on your own turf — “your stuff,” as some call it. I thought I was such an open source sophisticate because I knew that Linus had raised some objections to v3, but then you go and write back with a message listing a bunch of open source guys so fancy-pants that I’ve never even heard of them. I mean, Vixie, ok, fine, everyone knows that his name is on the crontab man page, but as for the rest of them… well, I guess I should stick to exchange-traded funds.

Mike

From: Brandon Stafford
To: Mike Goelzer
Date: Feb 2, 2006 7:58 AM
Subject: Re: State of the Union

OK, fine, have it your way, dude, but here’s my point. McBride was wearing a Chris diBona mask, suggesting that he was using subterfuge to infiltrate an open source cultists’ event. You know of subterfuge, no? Misdirection? Michael Milken? Hello?

I didn’t get your googol joke the first time I read it, as I had been set to evaluate all expressions, and my registers roll at 10^-64. Fortunately, it was flagged, and I got an SMS to my cello phane warning me of the error. Then I reread the joke, parsing it with evaluation turned off. Gahweb, that was a hilarious joke. I laughed all over the place. I Laughed Out Loud. Then I Read The Fucking Manual. Did I mention that I Am Not A Lawyer?

Brndn

From: Mike Goelzer
To: Brandon Stafford
Date: Feb 4, 2006 12:09 AM
Subject: Re: State of the Union

Oh, Mike Milken! Now I get it. You should have just used metaphors I can understand the first time around.

Also, nice one with the registers. I think this whole Googol joke thing is shaping up to be one of the funniest exchanges we’ve ever had. I may publish it; can you send me the admin password for your blog so I can get all the proper legal paperwork squared away to secure the copyrights? Thanks.

Mike

GPLv3

Monday, January 16th, 2006

I attended a version of BarCamp for old lawyers today– the launch of the first draft of GPLv3, put on by the Free Software Foundation at MIT. Eben Moglen, Richard Stallman, Bruce Perens, Andrew Tridgell, Larry Rosen, Bob Sutor– all the stars were out in Cambridge, laptops shined up and beeping accessories a-dangle!

Richard Stallman is far more amusing than he gets credit for– more details in the Wikinews article I started.

GPLv3 conference coverage for Wikinews

Friday, January 13th, 2006

Any BarCamp folks going to the GPLv3 launch conference at MIT on Monday? I’m planning on covering it for Wikinews, and I could use some help.

Gnubuntu

Sunday, November 27th, 2005

Mark Shuttleworth mentioned a few days ago on the Ubuntu mailing list that the Ubuntu folks were interested in developing a version of Ubuntu that contains only software deemed by the Free Software Foundation to be “free.” Shuttleworth mentions that they might collaborate with Ututo, an Argentinian Linux distribution that includes only free software (English description of project).

I was curious about how much non-free software was included in Ubuntu, so I installed the virtual Richard M. Stallman, or vrms (which sounds like a joke, but is not):

sudo apt-get install vrms

vrms took the liberty of not only installing, but also adding itself as a monthly cron job– reminds me of the real RMS: irritating but right.

It turns out that my Ubuntu server is pure– free software only– but my desktop machine has the Sun JDK, Opera, RAR, and XMame. The first three I don’t actually use, but with regards to XMame, I will confess that I like Zaxxon. In my defense, by the time I was old enough to have quarters, Zaxxon had been replaced by NBA Jams, or some other irritating business.

I suspect that vrms is not as particular as the real RMS, as I have installed the w32 codecs and the gstreamer mp3 decoder on my desktop machine. I *thought* those are both non-free. Maybe the iPodLinux people will get ogg working on generation 4 ipods soon. It’s believed to be possible, as the gen 4 has the faster PortalPlayer 5020 processor.

Microsoft plans to submit Office 12 formats to ECMA

Monday, November 21st, 2005

According to a report at PC World, Microsoft is planning to submit the XML formats it will use in Office 12 to the European Computer Manufacturer’s Association (ECMA) for approval. PCWorld mentions tha Massachusetts ODF controversy and quotes Alan Yates of Microsoft: “We have a few barriers [with government contracts],” says Alan Yates, general manager for Microsoft Office. “It will give governments more long-term confidence.” Yates was the man who wrote Microsoft’s initial response to Massachusetts’ new policy.

The Financial Times has an article that frames the move as a response to a “concern raised by the European Union executive body.” The article, by Maija Palmer, does not cite any sources for its information.

Microsoft now has a press release up.

Andy Updegrove has a quick summary and brief analysis up at Consortiuminfo.org. The interesting question that he asks is: “[I]f Microsoft is willing to open its formats and to come up with the necessary converters to allow old documents to be upgraded, why not just support ODF?”

I suspect that the answer is that Microsoft will not actually go all the way without adding a restriction that prevents programs like OpenOffice from using their formats. They have already said that they will release the formats under the same liberal license as their Office 2003 Reference Schema; they just don’t allow sublicensing of the royalty-free license that they grant, which excludes any GPL program from using the formats.

If nothing else, it will be entertaining to see how they pull this off. As Andy Updegrove points out, both Microsoft and the ODF folks are claiming the support of Apple and Intel now.

Nothing from the Between The Lines blog at ZDNet yet.

What is Microsoft up to?

Saturday, November 12th, 2005

Microsoft has claimed that their Open XML formats for Office 12 will be released under the same “open” license as their Office 2003 Reference Schemas, as I mentioned a few days ago. At the time, I couldn’t figure out why Microsoft would adopt such a liberal license without going all the way. All of their competitors in the proprietary software world (Corel with WordPerfect or Apple with iWork, for example) will finally be able to write import filters for Microsoft documents that aren’t reverse engineered. That will go a long way toward allowing people using different packages to collaborate.

At the same time that Microsoft is opening their formats, they’re including a restriction that prevents their use in GPL’d software. To me, the forbidding of sublicensing seems like a strange restriction– it prevents the sharing of code between parties writing software to read the format, but allows the writing of the code in the first place. In the framework of Stallman’s four freedoms, it allows the first three– the freedom to run, study, and redistribute the code– but it forbids the last, the freedom to improve the code. I wonder whether Microsoft is trying make itself look as much like a free and open collaborator as it can while still defending itself against the open source juggernaut.

UsefulProg 0.1

Monday, March 14th, 2005

As a documentation enthusiast, I find myself needing to change documents from one silly format to another on regular basis. Usually, I end up writing stupid Perl scripts to convert from one format to another, but I can never remember Perl syntax between efforts. I swear I’ve written the same text parsing code 4 times, and it hasn’t gotten easier.

In an effort to end this depressing cycle, I spent some time this afternoon learning a little wxPython to make what I call UsefulProg. UsefulProg reads in a text file. You enter some regular expressions, and then it filters the file with those expressions. When you screw up (like I always do), you hit the reset button, and it erases your mistakes. When you get the filters working the way you want, you cut and paste the result into wherever you need it.

Here’s the code under a GPL license. It’s based on an example from the wxPython documentation.

from wxPython.wx import *
import os
import re

class Form1(wxPanel):
    def __init__(self, parent, id):
        wxPanel.__init__(self, parent, id)

        self.logger = wxTextCtrl(self,5, \"\",wxPoint(250,20), wxSize(250,100),wxTE_MULTILINE | wxTE_READONLY)

        #The input file display
        self.inputlbl = wxStaticText(self,-1, \"Input file\",wxPoint(20,5))
        f = open(\"/home/brandon/Python Experiments/dd_tpb.txt\", \"rb\")
        self.inputfield = wxTextCtrl(self,6,f.read(),wxPoint(20,20), wxSize(200,700),wxTE_MULTILINE | wxTE_READONLY)

        #The output file display
        self.outputlbl = wxStaticText(self,-1, \"Output file\",wxPoint(550,5))
        self.outputfield = wxTextCtrl(self,6,\"\",wxPoint(550,20), wxSize(500,700),wxTE_MULTILINE | wxTE_READONLY)
        self.outputfield.write(self.inputfield.GetValue())

        # The filter button
        self.button =wxButton(self, 11, \"Filter\", wxPoint(300, 200))
        EVT_BUTTON(self, 11, self.EvtFilterButton)

        # The reset button
        self.button =wxButton(self, 12, \"Reset\", wxPoint(300, 240))
        EVT_BUTTON(self, 12, self.EvtResetButton)

        # the edit control - one line version.
        self.regexsample = wxStaticText(self,-1, \"Useful: [D|d]*? is non greedy match anything\",wxPoint(250,320))
        self.lblname1 = wxStaticText(self, -1, \"Removal string 1 :\",wxPoint(250,380))
        self.filter1 = wxTextCtrl(self, 20, \"(Rate[D|d]*?mments:n\", wxPoint(400, 380), wxSize(140,-1))

        self.lblname2 = wxStaticText(self, -1, \"Removal string 2 :\",wxPoint(250,480))
        self.filter2 = wxTextCtrl(self, 20, \" *pixel\", wxPoint(400, 480), wxSize(140,-1))

        self.lblname3 = wxStaticText(self, -1, \"Removal string 3 :\",wxPoint(250,580))
        self.filter3 = wxTextCtrl(self, 20, \"d+?. 	nt\", wxPoint(400, 580), wxSize(140,-1))

        self.filtlblA = wxStaticText(self, -1, \"Removal string 4 :\",wxPoint(250,680))
        self.filterA = wxTextCtrl(self, 20, \"nDare\", wxPoint(400, 680), wxSize(140,-1))
        self.replblA = wxStaticText(self, -1, \"Replacement string 4 :\",wxPoint(250,730))
        self.newtextA = wxTextCtrl(self, 20, \"nnDare\", wxPoint(400, 730), wxSize(140,-1))

    def OnClick(self,event):
        self.logger.AppendText(\" Click on object with Id %dn\" %event.GetId())
    def EvtText(self, event):
       self.logger.AppendText(\"\") #('EvtText: %sn' % event.GetString())
    def EvtChar(self, event):
        self.logger.AppendText(\"\")
        event.Skip()
    def EvtFilterButton(self, event):
        text = self.outputfield.GetValue()

        filter = self.filter1.GetValue()
        text, reps = re.subn(filter,\"\",text)
        self.outputfield.Clear()
        self.outputfield.write(text)
        self.logger.AppendText(\"%d removals made with filter 1n\" % reps)

        filter = self.filter2.GetValue()
        text, reps = re.subn(filter,\"\",text)
        self.outputfield.Clear()
        self.outputfield.write(text)
        self.logger.AppendText(\"%d removals made with filter 2n\" % reps)

        filter = self.filter3.GetValue()
        text, reps = re.subn(filter,\"\",text)
        self.outputfield.Clear()
        self.outputfield.write(text)
        self.logger.AppendText(\"%d removals made with filter 3n\" % reps)

        filter = self.filterA.GetValue()
        newtext = self.newtextA.GetValue()
        text, reps = re.subn(filter,newtext,text)
        self.outputfield.Clear()
        self.outputfield.write(text)
        self.logger.AppendText(\"%d replacements made with filter An\" % reps)        

    def EvtResetButton(self, event):
        self.outputfield.Clear()
        self.outputfield.write(self.inputfield.GetValue())

app = wxPySimpleApp()
frame = wxFrame(None, -1,\" UsefulProgPRO\",(100,100),(1100,800))
Form1(frame,-1)
frame.Show(1)
app.MainLoop()