metalcrowe's Journal http://use.perl.org/~metalcrowe/journal/ metalcrowe's use Perl Journal en-us use Perl; is Copyright 1998-2006, Chris Nandor. Stories, comments, journals, and other submissions posted on use Perl; are Copyright their respective owners. 2012-01-25T02:37:57+00:00 pudge pudge@perl.org Technology hourly 1 1970-01-01T00:00+00:00 metalcrowe's Journal http://use.perl.org/images/topics/useperl.gif http://use.perl.org/~metalcrowe/journal/ A new verb for refactoring? http://use.perl.org/~metalcrowe/journal/30311?from=rss <p>It occured to me (during a random AIM conversation with a friend) that you could take the two terms SPOT and DRY and combine them into a new term that is easily <a href="http://www-personal.umich.edu/~jlawler/aue/verbing.html">verbed</a>. So then you could say things like "I'm <em>spot drying</em> this module to help stamp out bugs."</p> metalcrowe 2006-07-17T08:38:41+00:00 journal A couple one-liners http://use.perl.org/~metalcrowe/journal/28515?from=rss <p>These are probably stupid-simple-obvious, but I find them useful enough that they made it into little scripts in <tt>~/bin</tt>.</p><dl> <dt> <tt>unique</tt> </dt><dd> <p> <code>perl -ne'print unless $lines{$_}++'</code> </p><p>Only print the first occurance of a line. This one came about recently when I wanted to find out which of my ripped albums were 128kbps mp3s (so I could re-rip them!):</p><p> <code>mp3find ~/cds -bitrate 128 -printf '%b' | unique</code> </p></dd><dt> <tt>qm</tt> </dt><dd> <p> <code>perl -pe'chomp;$_=quotemeta($_)."\n"'</code> </p><p>This one comes in handy when using <tt>xargs</tt> to pipe a bunch of mp3 filenames with spaces in them to something like <tt>madplay</tt> or <a href="http://bmp.beep-media-player.org/index.php/BMP_Homepage">BMP</a>.</p></dd><dt> <tt>nocomment</tt> </dt><dd> <p> <code>perl -pe's/(^|\s)#.*//;'</code> </p><p>Dumb comment stripper. Again useful for piping M3U lists to <tt>madplay</tt>:</p><p> <code>nocomment ilyaimy.m3u | qm | xargs madplay</code> </p></dd></dl> metalcrowe 2006-01-30T08:37:30+00:00 journal Sharing resume/cv/etc. information http://use.perl.org/~metalcrowe/journal/24166?from=rss <p>I had similar thoughts about <a href="http://use.perl.org/~schwern/journal/24156">information sharing</a> last fall when I was filling out grad school applications. All the forms were online, but I had to type in the same information (contact, academic history, etc, etc) on six slightly different web forms. And, maddeningly, even for the schools that had their application forms hosted by the same third party, there was no way to share my information between the different forms!</p><p>The first thing I thought of was "there should be a central clearinghouse of some sort, where I could fill out this once and have it shared between whatever schools I specify." But then (in a more free software inspired moment) I realized there already <em>was</em> a clearinghouse for all this information: me. Why shouldn't I be able to collect all this information into some standard (dare I say XML?) file format, post said file on the web, and then just hand people the URL when they needed that info.</p><p>There is <a href="http://xmlresume.sourceforge.net/">XML R&eacute;sum&eacute;</a>. I had a look, and it looks simple enough. But as schwern <a href="http://use.perl.org/comments.pl?sid=26013&amp;cid=39645">pointed out</a>, where's the Perl library<nobr> <wbr></nobr>;-) And the other (more pressing) question is, is anyone using this as an exchange format?</p> metalcrowe 2005-04-13T14:30:24+00:00 journal