10 Dec 2001 (updated 11 Dec 2001 at 00:19 UTC)
»
School
Whee, didn't sleep getting my
Econ homework done. We'll have to see how it turns out. Four
days until the paper is due, and I'm about 1K words short.
Fun. I don't remember if I mentioned that my advisor got
tenure, but she did. I'm absolutely thrilled -- it couldn't
have happened to a better person, and Macalester couldn't
have made a better investment in the future.
trs80, you've run
into one of
my rather annoying quirks -- I've been fairly good at school
all my life, and expect myself to get a minimum of 90% on
any given assignment or test. Sometimes it happens,
sometimes it doesn't, but it frustrates me when it doesn't.
I study enough that I usuallly come through, so it makes me
even more frustrated when it doesn't. The real reason I was
torqued at myself was because it happened in Multivariable
Calc, which is more or less my "fun" class for the semester.
*shrug* Pay no attention to the neurosis behind the
curtain.
Hacking
So I really shouldn't have
been, but I decided to look up scsh after seeing a
pointer
to it on the ll1-discuss list. And of course, as fond of
Scheme as I am, I just had to try it out, and the following
script resulted.
#!/usr/local/bin/scsh -s
!#
;; Copy the mp3s in the cwd over to /home/olandgre/iso/burn/
(for-each
(lambda (arg)
(& (cp ,arg "/home/olandgre/iso/burn/")))
(glob "*.mp3"))
;; Turn the mp3s in /home/olandgre/iso/burn into the
;; equivalent .wav files.
(for-each
(lambda (file)
(let (
(wavname (replace-extension file ".wav")))
(begin
(run
(mpg123 -q -v -w ,wavname ,file))
(delete-file file))))
(glob "/home/olandgre/iso/burn/*.mp3"))
;; Check if it was fed the -n or --normalize switch,
;; currently the only switch it has. Change this to a
;; for-each through a cond on the arglist in the future?
(let ((flag (car command-line-arguments)))
(if (or
(equal? "-n" flag)
(equal? "--normalize" flag))
(for-each
(lambda (arg)
(run
(normalize -m ,arg )))
(glob "/home/olandgre/iso/burn/*.wav"))))
I should probably be ashamed of it, but it works
quite nicely at doing what I want it to, and is much more
aesthetically pleasing than the version I had in
bash. I need to figure out exactly when I should be using
run, &, and exec-epf, but I suspect that's just a
matter of
playing around with it. I love being able to iterate over
the contents of something with for-each -- I know it's
basically the same as iterating over using for i in *.mp3 do
<blah> done, but it's just the way I think, I
guess.
Life
Having malts with someone at the
Broiler is a lot of fun. Don't analyze, just
accept.