Who Owes Me Three Dollars?

December 21, 2005

I’m thinking, I’m thinking! But in the mean time,…

Filed under: Uncategorized — ineedsheetmusic @ 4:16 am

I’m thinking, I’m thinking!

But in the mean time, here is a contest: a signed print of any photo from our collection to the first person who can identify what this piece of code (which I wrote and run daily at home) does. (Second prize is two photos)

flac_fns = Array.new
wav_fns = Array.new
d.each {|x|
if x =~ /\.flac/
elsif x=~ /\.wav/

high_num = flac_fns.length

wav_fns.each {|i|
high_num = high_num + 1
`move \”#{i}\” \”#{i.sub(/\d+/,high_num.to_s)}\”`

To be eligible for this contest, you have to be someone other than a male whose last name is Settergren or someone younger than 25 or older than 36.

You don’t have to be baptized as an infant to be eligible.

BTW I am seriously considering finding a different (better) free blog service. This thing can’t even handle leading spaces – which makes the code even harder to read. Any suggestions for a better blog service?



  1. You can edit the raw HTML, so you should be able to do anything! The “pre” (for PREformatted) appears to be what you want. Blogger won’t let me demonstrate raw HTML within this comment box, but try clicking on “son1” up there.

    Comment by son1http://www.htmldog.com/reference/htmltags/pre/ — December 21, 2005 @ 3:46 pm

  2. Another suggestion: you could build a custom Perl (or Ruby) script to convert raw text (code) to equivalent HTML, but the same functionality basically exists as part of POD (Plain Old Documentation):

    Paste your text (indentations and all — make sure all lines are indented by at least one space) into an empty text document, say pod.txt. Prepend with some POD keywords (with extra blank lines):




    And then run “pod2html.pl pod.txt > pod.html” (pod2html.pl is part of your Perl install)

    Comment by son1 — December 21, 2005 @ 3:56 pm

  3. I know what it doesn’t do. It’s not the algorithm you use to make your weekly football picks. šŸ™‚

    Comment by out of thin air — December 21, 2005 @ 7:15 pm

  4. You use it to search for new music files (.wav and .flac) and move them into a new directory.

    Comment by out of thin air — December 22, 2005 @ 6:10 am

  5. Do you really want an autographed photo? The fact is you are in the right ball park but you are missing the real gist and it is because you are tripping over the ‘move’ command.

    I will give the Settergren boys a shot and if they don’t get it by COB tomorrow, you can have the first prize based on effort. (Do we need to get you a charge number for this?)

    On Saturday, I will come out with the line by line comments.

    Comment by Bruce S — December 22, 2005 @ 6:38 am

  6. If this was thin air stuff I would have figured it out by now. Ok, one last guess. You’re using it to play the music.

    Comment by out of thin air — December 22, 2005 @ 3:21 pm

  7. It looks to me like you have .flac files (what’s a .flac file? Is it an audio recording of a yelling duck?) and .wav files. The .wav files, and presumably also the .flac files, have numbers in their names, but you don’t want to reuse the numbers, so you rename all of the .wavs. But if you get one more .flac, that messes up the whole scheme, so this will rename (renumber) the .wav filenames with numbers starting where the .flacs leave off.

    Comment by son1 — December 22, 2005 @ 3:59 pm

  8. I have to give it to the Settergren boy.The key word is the move command is really a rename command and it gives the .wav files the numbers starting from where the .flac files left off.

    Why I am doing this is another question entirely.

    Comment by Bruce S — December 22, 2005 @ 4:28 pm

  9. You could try Typepad, although it’s not free – though they do have some cheap plans. It’s a WYSIWYG version of Movable Type, which is what I used for a long time after my move from Blogger/Blogspot and before my most recent move to WordPress.

    Comment by LN — December 22, 2005 @ 6:10 pm

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: