Ralph dropped a note regarding the post Sending lots of Email:
I would just have used “mailmerge” from MS Word: drop the list of
addresses into an Excel file, write your text in Word, Select “Tools
-> Letters and Mailings -> Mailmerge” and follow the steps. No
programming required (Ok, I don’t know whether your supervisor used
Word, though.)
On a *nix box I used a little (bash) script to do the same job: this
script contains one foreach loop, picking the address from a file and
mailing the content of another file, Â also rather simple.
Hm. Valid solutions, I suppose, EXCEPT THEY DON’T USE SCHEME! This makes them inferior.
In this particular case, a plain-text file was involved, so mailmerge wasn’t an option—also, I’d be afraid of some kind of HTML monstrosity being generated. A bash script, however, could have been done, although I must admit I’m more confident in my memory of Scheme syntax than my memory of bash syntax. Point made, though.
I continue to poke and experiment with OpenLaszlo. I’ll do a more in-depth treatment of the blogroll at right later; for the moment, I thought I’d just point to it, and see how many people want to shower me with thousands of dollars to provide one for them as well…
Right. Well. That didn’t take long. Anyway, it’s fifty lines of code, and what’s nice is that the three categories are maintained in separate files on the server. In particular, each of the three categories comes from local.xml, kenyon.xml, and outthere.xml, which are simple little XML files sitting on this server. The contents of those XML files are parsed every time the widget is loaded, meaning I don’t need to touch the source for the widget at all to maintain my nifty/whizzy blogroll. Not that I really “maintain” my blogroll or anything; perhaps I’ll find a way to tie something like this into de.licio.us tags or something…
I just thought it was kinda fun; I may poke at it more, or remove it. Drop a note if you’re really keen to know how it’s done, and I’ll write it up.
My supervisor had a message she needed to send to a lot of people today. Given a list of email addresses, and a message, how do you send the message to everyone?
The address file should contain one email address per line.
I must admit, read-file-to-los could be more functional, and perhaps more concise… but that’s not what I did today. Eh.
I don’t claim there is anything about this piece of code that is interesting, or exciting, or otherwise “good”. It was just nice that I was able to write it in 10 minutes and save someone else an hour or so when they would have otherwise engaged in a tedious, repetitive task better suited for a language in the LISP family.
I have switched to PLT Scheme for so many of my scripting and programming tasks that these kinds of things simply become non-issues for me. I wonder what people who don’t know Scheme do? I guess they program in Python, or *shudder* Perl.
I know this is old news and old hat to lots of people, but I was so busy using things like mutation in JavaScript that I forgot how functional the language was.
var fact = function (n , k) {
if (n == 0) {
return k(1);
} else {
return fact((n - 1) , function (v) { return k((n * v)); });
}}
fact(5 , function(x) { return x; });
The CPSed version of fact, in JavaScript.
Duh. Silly me.
I hope I’m not reinventing the wheel; I need a small Scheme to JavaScript translator, and if I push my Scheme through a CPS conversion (using closures to capture the state), then I can go through registerization and end up with something that plays well recursively in JavaScript.
Before I go any further, of course, I should go back and read up on ParentheC; JavaScript is a less-inhospitable host than C, and therefore I might be able to leverage ParentheC to get this done more quickly (or, as the case may be, more cleanly).
I’ve had a rather miserable day, so I decided to spend the evening programming in Scheme. It makes me feel better.
This makes noise, but not too much. If you don’t have audio, you’re missing half the fun.
I didn’t actually put together this little tabbed photoviewer with narration because I wanted a little tabbed photoviewer; I wanted a tool for quickly creating on-line tutorials or “training videos,” and this is what I came out with.
The little flipbook above took 15 minutes to make. That’s cool.
I’m going to go rot my brain on Battlestar Galactica now.
I still haven’t managed to get through to the iTunes Music Store to get my $10 back, or get files that aren’t flawed. However, two people did drop a note my way with a hint that is
Illegal under the DMCA, and
Should be unnecessary in the first place.
Both Allison (who was several years ahead of me at my high school and college, and is a Chaser besides!) and Rick (a friend here at Kent) pointed me to jHymn. This free application decrypts the files you buy from Apple so you can listen to them on any computer or MP3 player, as opposed to only computers you have licensed or registered.
Yes, this solves the problem… until Apple switches to some new form of DRM or copy protection. The problem is that I purchased the content, but am at the seller’s mercy as to where and when I can listen to it. If I purchase the CD, I can dub it to cassette for listening to in the car, or rip it to MP3 for listening to on my music player (if I had one; I washed my iPod Shuffle). Digital Rights Management is just another way of saying Death to Fair Use.
I’d like to point out that on-line music stores like Magnatune are a start in the right direction. When you buy a CD from them, you can download it in a host of formats (a variety of MP3 and other compressed formats, as well as full CD quality WAVs). Additionally, half of the purchase price of each CD purchased from Magnatune goes directly to the artist. This is a huge improvement over the pennies (if anything) artists receive through traditional CD sales. I was very pleased with my purchase of the Bach cello suites.
And, you can listen to your purchase on-line before buying, if you want.
I grow tired of applications written for the Mac that think they can create files and directories anywhere they want.
Application developers should put all their crap in one place only:
~/Library/Application Support/
Not in my Documents folder. Certainly not in my home directory. Bury your poo in the backyard, where I don’t have to see it. Not in my workspace—keep your application’s big, steaming turds out of my sight.
The most recent application I encountered that did this was Dave Winer’s OPML editor; it dropped an “OPML” directory into my home directory. That is my space, not his. His application’s content belongs in the Library folder, under “Application Support.”
Mercy. Just because Windows users only have one folder they know about—”My Documents”—does not mean that Mac users have to put up with this kind of behavior. I decided I didn’t want the folder more than I wanted the app, so I nuked it for now.
PS. For what its worth, Microsoft Office, Roxio’s Toast, iChat, Konfabulator (now Yahoo! Widgets), Palm Desktop, and the iInstaller for TeX all exhibit this same behavior, so at least Dave is in some big company, if not good company.