<< >>
justin = { main feed , music , code , askjf , pubkey };recent comments
search
[ present ... 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 ... past ]
December 20, 2010
Music
hello broadway


December 19, 2010
Joy, from Perl

I've recently started using Perl for text wrangling instead of PHP -- it started after much of my PHP included a lot of preg_replace and preg_match calls, which got me wondering...

There's a certain satisfaction I get from perl that I don't really get from other languages. There's something about the density that makes it quite readable, at least for the author. Here's a script I wrote to automatically add a new build configuration, based on an existing build configuration, with some modifications, to a given .dsp (VC6 project file):

    
    #!/usr/bin/perl
    $sp = "Win32 Release";
    $np = "Win32 Nitpicker";
    $spd="Release";
    $npd="Nitpicker";
    $spdir="/Release/";
    $npdir="/Nitpicker/";
    $libfile = "../../nitpicker/libcmt_nitpick.lib";
    while (<>)
    {
      chomp;
      s/\r$//;
      s/\n$//;
       
    
      print $_ . "\r\n";
      if (/^!ELSEIF .*$sp".*$/ || /^!IF .*$sp".*$/)
      {
        s/^!IF/!ELSEIF/;
        s/$sp/$np/;
        @nc = ($_);
        while (<>)
        {
          chomp;
          s/\r$//;
          s/\n$//;
          if (/^!/)
          {
            my $tmp=$_;
            foreach (@nc)
            {
    	  s/$spd/$npd/g;
    	  s/$spdir/$npdir/g;
    	  if (/^# ADD BASE CPP/)
    	  {
    	    s/\/Z\S *//;
    	    s/\/YX *//;
    	    s/\/FR *//;
    	    s/\/FD *//;
    	    s/$/ \/FR \/FD \/Zi/;
    	  }
              if (/^# ADD CPP/)
    	  {
    	    s/\/Z\S *//;
    	    s/\/M\S *//;
    	    s/\/O\S *//;
    	    s/\/FR *//;
    	    s/\/FD *//;
    	    s/$/ \/FR \/FD \/Zi \/MT \/Ot \/Og \/D "DEBUG_TIGHT_ALLOC"/;
    	  }
    	  if (/^# ADD LINK32/)
    	  {
    	    s/^# ADD LINK32 /# ADD LINK32 $libfile /;
    	    s/\/debug *//;
    	    s/\/out:/\/nodefaultlib:"LIBCMT" \/out:/;
    	    s/$/ \/debug/;
    	  }
    	  if (/^# ADD BASE LINK32/)
    	  {
    	    s/\/debug *//;
    	    s/\/map *//;
    	    s/\/dll /\/dll \/debug /;
    	    s/$/ \/fixed:no/;
    	  }
              print $_ . "\r\n";
            }
            print $tmp;
            last;
          }
          print $_ . "\r\n";
          push(@nc,$_);
        }
      }
      if (/^!MESSAGE.*$sp".*$/ || /^# Name ".*$sp" *$/)
      {
        s/$sp/$np/;
        print $_ . "\r\n";
      }
    }
    
In case anybody is interested, Nitpicker is something we've been working on that is similar to Electric Fence or other memory debuggers, but better suited for our workflow/design/etc. We'll probably GPL it once it matures.

6 Comments


December 13, 2010
Watching this



2 Comments


December 7, 2010
Music
freeform jam with brennewt


December 4, 2010
Music
freeform jam with newtchrtodd


December 3, 2010
Music
freeform jam with chr


December 1, 2010
Music
freeform jam with brennewt


November 30, 2010
Note to self

If you want to make PNG files bigger (and thus compress better in solid bzip2/lzma 7z/installers):

for a in `find . -name \*.png` ; do pngcrush -f 0 -m 1 -l 0 -force $a $a.tmp ; mv $a.tmp $a ; echo $a ; done


1 Comment


November 19, 2010
A video from last night:

I had a wonderful time.


Apologies for the lousy video quality, and the rough audio mix.

6 Comments


November 18, 2010
So excited...

(and here is the video for a song I mentioned in a previous post):


4 Comments


November 5, 2010
Missing England

They do train stations right. Bleh.

1 Comment


October 31, 2010
these days, disk is fast

Just made a synthetic test to generate 128 .WAV files (large, to avoid staying in cache) that when summed, produce a nice clean sine wave, and when any are missing, produce noise. REAPER seems to have no problem playing them all at once, at least on my fast laptop or desktop, with Win7 x64. Mmmm. It's only 18MB/sec, even.

Comment...


October 31, 2010
An incredible bargain!



3 Comments


October 31, 2010
Emotions

Happy


Sad*



* but feeling good?

P.S. I love you, allpress.



2 Comments


October 29, 2010
music is good

Riding the tube listening to 'tame impala - half full glass of wine', and I can't imagine that any of the other people who are listening to their headphones are enjoying themselves more than this. Not possible.

2 Comments


October 28, 2010
reinventing the wheel

making a fun little vector format because parsing SVG (and comparing renders of it in different programs) makes me sad.

Comment...


October 16, 2010
A day of Deerhoof, fatseal, and Dungen... is a good day.



3 Comments


September 29, 2010
Music
freeform jam with newtcrappydrums


September 24, 2010
Music
brenchradara - 1 -- [74:01]
brenchradara - 2 -- [6:32]


September 16, 2010
Music
freeform jam with chrvideo


September 15, 2010
A Wagonfull



1 Comment


September 15, 2010
A Nice View...

...on a nice warm day in the recent past.

1 Comment


September 15, 2010
Music
freeform jam with bren
freeform jam with chrvideopoo


September 13, 2010
Music
freeform jam with chrvideo


September 8, 2010
Music
freeform jam with brennewtjoshnoj


August 24, 2010
Music
hot as balls


August 18, 2010
Music
freeform jam with brennewt


August 17, 2010
I am drinking kool-aid

This is a good video for anybody who does software development:

Some people I know don't like Linus when they've watch this, but I think he's awesome, even though he called me stupid and ugly. He was right, I guess.

Using SVN was a great thing for me, as I'd constantly diff my work to make sure it was what I wanted. It also (obviously) enables collaboration.

Git, however, is utterly awesome, an order of magnitude more useful. Branches in SVN were a huge pain, we rarely used them. In Git, you can actually use them, effectively and without having to deal with nonsense, it is fantastic.

It is fast, efficient at storing data, easy to synchronize and automate backups, I love it.

The only downside I see is that TortoiseSVN doesn't exist for it, TortoiseGit is getting there, from what I hear, but I've just been using the command line thus far.

Anyway, I'm just giddy with it. I would say life changing, but that would be overdramatic. It is work-changing, I guess.

4 Comments


[ present ... 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 ... past ]
search : rss : recent comments : Copyright © 2019 Justin Frankel