Hi! Please consider following me on twitter: @hanekomu.

Current git branch in the bash prompt

You can use git branch to see the branch you're currently in, but it's easy to forget and to commit something into the wrong branch.

I wanted to have a constant reminder, so I chose to display the current branch on the bash prompt.

function parse_git_branch {
   ref=$(git symbolic-ref HEAD 2> /dev/null) || return
   printf " (${ref#refs/heads/})"
}

export PS1="\$(parse_git_branch) \$ "

The first backslash in PS1 is important so the function gets evaluated for every new bash prompt. If you're not inside a git repository, nothing will be printed. Let's see this in action.

 $ git init
Initialized empty Git repository in /path/to/repo/.git/
 (master) $ git checkout -b newbranch
Switched to a new branch 'newbranch'
 (newbranch) $ git checkout master
Switched to branch 'master'
 (master) $ cd ~
 $ 

This is just a bare shell prompt and actually I have a rather "baroque" PS1 setting, but that's for another blog post.

Write a comment | Bookmark and Share

posted at: 18:41 | path: /misc | permalink | 1 comment | 0 trackbacks

The CPAN Leaderboard as an arcade game High Score screen

The CPAN Leaderboard shows CPAN authors ranked by the number of modules — but use this with care as it doesn't say anything about the quality of one author's distribution.

If CPAN was an arcade game, its high score screen might look a bit like this:

CPAN Leaderboard as arcade game High Score screen

Write a comment | Bookmark and Share

posted at: 15:13 | path: /misc | permalink | 4 comments | 0 trackbacks

Text::Pipe trademark controversy

There has been a series of curious emails from a software developer in Australia who argues that one of my Perl module distributions on CPAN infringe on his trademark. He has a Windows product called "TextPipe Pro" and thinks that my Perl module called Text::Pipe dilutes his desired search results.

It all started in December 2008; I've lost his original mail — I don't keep every bit of rubbish some random people send me — but here is my reply from that time (I've deleted his last name and all email addresses and other contact details):

From: Marcel Grünauer
Sent: Tuesday, 16 December 2008 9:42 AM
To: Simon
Subject: Re: Text-Pipe
Importance: High

Hi Simon,

On Dec 15, 2008, at 10:49 PM, Simon wrote:

> I would greatly appreciate it if you could rename your Text-Pipe  
> package to avoid confusion and to prevent dilution of the keywords I  
> use to earn an income.

Sorry, I won't rename my Perl distributions. "Text-Pipe" and its  
related distributions are only found on CPAN and on github and are  
Perl-specific. There are also people who use this package and I don't  
want to inconvenience them by renaming my packages.

It would also be a major undertaking for me as I would have to think  
of a new name, replace the names, create a new repository and import  
the whole history from the old one (you can't rename a repository on  
github), re-uploading all the distributions (there are several related  
ones), notifying everyone and so on.

Also, neither the word "text" nor the word "pipe" express particularly  
novel concepts in software, nor does the combination of the two.  
Regarding keywords: googling for "textpipe", "text pipe" and "text- 
pipe" lists your software as the top hits, so I don't think you have  
to fear anything from my set of perl modules. Further, I could also  
object that your description "A Swiss Army knife for fixing text"  
dilutes keywords normally referring to Perl.

"Text::Pipe" is not a trademark, nor does it challenge yours.

[...]

Marcel Grünauer

After that, I didn't hear any more from him for nine months, so I forgot all about it. Until the 17th September 2009, when Simon saw fit to bring up the topic again:

From: Simon
Subject: RE: Text-Pipe
Date: September 17, 2009 5:29:03 AM GMT+02:00
To: Marcel Grünauer

Hi Marcel,

TextPipe forms my entire income, and supports my wife, our 4 kids, and my
house mortgage.

TextPipe is a registered trademark (in Australia), but yes, I'd probably
have to register it in every country on the planet.

I've been using that name to describe it for over 10 years.

I am simply asking if you could please change your Perl module name to
Text::Filter, Text::Adaptor or something else.

Please reconsider.

Regards,

Simon

I considered. However, a few hours later, he made the questionable move of contacting my bosses at work about this matter:

Subject: Infringment of trademark TextPipe by Marcel Grünauer
Date: Thu, 17 Sep 2009 12:38:50 +1000
From: Simon
Organisation: DataMystic
To: Marcel's Boss

[...]

I see this growing into a commercial vs free, trademarked vs 'I can do
whatever I like and you can't stop me because I work for a University'
type-war.

I would like you to get Marcel to change the name of his package to
something that does not conflict.

Failing that, I'd like you to mediate, or appoint a mediator from your
department who has worked for a software company, to help resolve this
matter in the best interests of all.

[...]

Now he was beginning to piss me off. I explained to my boss that I developed this module in my spare time and that we don't even use it at work, and my boss is cool, so he wrote that back to the guy. I also replied to the guy:

Subject: Re: Text-Pipe
From: Marcel Grünauer
Date: September 17, 2009 2:40:46 PM GMT+02:00
To: Simon

Hi Simon,

[...]

Text-Pipe is a Perl module distribution which I have developed purely in my
private time and it has nothing to do with work; it's not even used in any code
at work. As such I see you writing to my boss(es) as highly inappropriate. It
is also a sure way to get me to not consider any changes.

My boss has spoken to the company's lawyers - basically you don't stand a legal
chance to force me to change it. The lawyers see my original arguments (not
novel concepts, more general terms etc.) as valid as well; they also explicitly
stated that trademark law is not applicable in this particular case. Besides I
don't want to set a precedent for this kind of behavior - there would be no end
to it.

I am pleased to hear that your software financially supports you, your wife,
four children and a mortgage. Therefore let me repeat my original offer (from
nine months ago): If you would like to contract me to make any changes you
like, I can send you my rate card.

Regards,

Marcel Grünauer

At the time of writing this blog entry, the Google link Simon wrote about in his email would show mostly his software; my module came in third position on both the first and second page of search results. Maybe he just has a SEO problem, who knows.

The reason I'm writing about this at length is that it raises a potential problem. There are CPAN mirrors in many countries and I guess it would be next to impossible to make sure that no module name resembles any trademarked name in every country. So I ask the perl community to discuss this aspect.

Then something else happened which shows why it is a bad idea to piss off geeks who run the infrastructure. I discussed the whole matter with the fine folks on the #london.pm IRC channel when, after it had been noted that text-pipe.com was still available, Ash Berlin registered the domain without further ado and made it to point to the CPAN distribution.

It is possible that because of this, the ratio of Google search results for TextPipe Pro and Text::Pipe is going to change. I wonder if Simon is familiar with the term Streisand effect.

Note that I have no intention of infringing on anyone's trademark and I have no desire to take away business from TextPipe Pro. Anyone who is looking for a Windows text manipulation application will, upon landing on the CPAN web pages, quickly realize that this isn't what they were looking for and look at other search results. That being said, I don't take kindly to threats — however politely they may be phrased — and pestering my boss about it is a certain way to not get on my good side.

I've also put a link to the TextPipe Pro product web site in the SEE ALSO section of all modules of Text-Pipe 0.09, so maybe that'll be ok.

Anyway, like I wrote, this is a potential concern for the Perl community, so a discussion about it is welcome.

Update: He sent me another mail asking me to remove the links to his site again because "this is going to make the current situation worse, not better". So I did and uploaded version 0.10

Write a comment | Bookmark and Share

posted at: 17:37 | path: /misc | permalink | 19 comments | 0 trackbacks

Perl modules past their sell-by date

Audrey wrote about _why's disappearance and although I have honestly never heard about _why up until the recent excitement (must not have been popular in my cave). But there was a quote from _why in her blog post that made me think:

programming is rather thankless. u see your works become replaced by superior ones in a year. unable to run at all in a few more.

That is very true. I have written and uploaded to CPAN quite a number of Perl module distributions. I obviously found them useful at the time I wrote them, but the Perl world moves on (rather fast as of late), and most of my distributions have fallen out of favor.

So I ask myself why I leave my deprecated distributions on CPAN. I don't need them anymore, and I certainly don't want to maintain them. I also don't care about having a three-digit number of CPAN distributions for the sake of some useless ranking. The modules will turn up as search results, and someone else might find them useful, but if other people asked me about the module in question I would probably refer them to some more modern code.

Just deleting them is proabably not a good idea either because someone might have the modules in use, though I don't flatter myself — I'm probably the only user of most of my code.

Is there some drop-off account where you can leave unloved modules?

Write a comment | Bookmark and Share

posted at: 11:23 | path: /misc | permalink | 10 comments | 0 trackbacks

First names in the Perl community

There are some names that don't really need further qualifying; the first name is enough. "Larry", "Audrey", "Damian" — I think that even outside the Perl world, a lot of people will know who is meant. "Miyagawa" is an exception, but then in Japan the first name is generally de-emphasized and instead the given name is used even among colleagues.

Write a comment | Bookmark and Share

posted at: 10:15 | path: /misc | permalink | 4 comments | 0 trackbacks

Signals from Audrey

Blog replies, blog posts, github activity and tweets — there have been quite a few signals from Audrey Tang lately. I'm glad Audrey is gradually coming back; I remember being inspired and awe-struck by her (back then, "his") brilliance at an Austrian Perl Workshop.

Write a comment | Bookmark and Share

posted at: 19:04 | path: /misc | permalink | 0 comments | 0 trackbacks

Vote to add Perl support to the Android Scripting Environment!

The O'Reilly Radar reports about the Android Scripting Environment:

Google is bringing scripts to Android. The Android Scripting Environment (ASE) will make development accessible and easy for devs who don't want to build a full-fledge application. [...] Scripts can be run interactively in a terminal, started as a long running service, or started via Locale. Python, Lua and BeanShell are currently supported, and we're planning to add Ruby and JavaScript support, as well.

That's nice, but where's the Perl support?

An issue to add Perl support to ASE has been opened on Google Code. Please add your vote by clicking the star to the left of the issue header.

Vote for Perl support on the Android Scripting
Environment!

Update:

18:25 hanekomu has joined (n=hanekomu@chello212186070159.1.14.univie.teleweb.at)
18:25 Topic: YAPC::Asia 2009 - Sometime this fall - http://twitter.com/yapcasia
18:25 lestrrat set the topic at: 2009/06/03 00:38
18:25 Mode: +sn
18:25 Created at: 2006/11/26 07:42
19:12 a3r0: Perl on Android  http://code.google.com/p/android-scripting/issues/detail?id=32 is accepted. :)
19:18 hanekomu: our information-spreading machinery is efficient :)
19:19 hanekomu: a3r0: thanks for spotting the issue
19:19 a3r0: No problem :)
19:26 a3r0 has left IRC ("ChatZilla 0.9.84 [Firefox 3.0.10/2009042316]")

Write a comment | Bookmark and Share

posted at: 17:14 | path: /misc | permalink | 1 comment | 0 trackbacks

Perlbal article

As spotted by Korean Perl hacker @saillinux, there is an article called "The Juggler: Scaling your website with the Perlbal web server" about the reverse proxy load balancer and web server Perlbal in PDF format; it was published by Linux Magazine in November 2007.

Tags: .

Write a comment | Bookmark and Share

posted at: 17:21 | path: /misc | permalink | 0 comments | 0 trackbacks

MacBook HDD crash

Last weekend my MacBook's hard disk drive crashed to the point where the MacBook didn't recognize it on startup. Thankfully I had backups, although they were based on rsync of most of my home directory, not on Mac OS X's own Time Machine. So after buying a new and bigger (320 GB) HDD, I had to reinstall all applications. The whole process of getting everything back as it was only took half a day, so it wasn't too bad. It was also good to start from a clean system, since a lot of unnecessary things had accumulated over the years.

For example, I don't use a package manager such as Fink or MacPorts anymore; so far I was able to either compile everything myself or use installers. I also took the opportunity to finally switch to perl 5.10 as my main perl. Now I'm also using Time Machine, as several people have recommended it because of its painless backup and restore process. I backup to a 2.5" 500 GB USB HDD, but I also still use rsync to back up parts of my home directory to two other Macs that are in two different locations.

The MacBook seems more quiet now and feels faster, and it's certainly nice to have the extra space. And it's good to know that dealing with a HDD crash isn't as traumatic as I had thought it would be.

Write a comment | Bookmark and Share

posted at: 11:12 | path: /misc | permalink | 0 comments | 0 trackbacks

I left use.perl

I have decided not to post, or even cross-post, to use.perl anymore. You can read my reasons for that in my last journal post over there.

Write a comment | Bookmark and Share

posted at: 23:04 | path: /misc | permalink | 0 comments | 0 trackbacks