[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[sc-users] SuperCollider sends email
- To: sc-users <sc-users@xxxxxxxxxxxxxxxx>
- Subject: [sc-users] SuperCollider sends email
- From: James Harkins <jamshark70@xxxxxxxxx>
- Date: Fri, 28 Dec 2012 16:04:09 +0800
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:date:message-id:subject:from:to:content-type; bh=A7mp80yOQLYnddHsNJqSWcvSeLRIJPwNeF0krZhLcXQ=; b=SGjgwsgyZaQElDIc/WIZxFYLCGkpcqJUPFBiqWkB8XznWJHP+cVwGBw4zLoSbB9omY o5w3pLuEUBhVBB59SeqWhUo8GDsUxPqcsMPdo6O+LJhrtS7goEs2CkeliQgr+FLN1DGk FD7PjbVNlu0MJA0FnxG31OdjweluyJA5fBiz5KELGlsE4IR9zngcjPHXvqsHNPdNlvCm 6sN+CYmW6mfJWCzG+g7ofzZxe0CH5n1K1ilgkb3DPFNfHTd1lUmMPMuqDb7gcObFe+AC oE1PS5r0GA4BXSobbvv2oeC0ccQ9s21Uq2cAH3z7VGPJifJ5imIHGUNGnOujqhO+X8kG wcNA==
- List-id: SuperCollider users mailing list <sc-users.create.ucsb.edu>
- Reply-to: sc-users@xxxxxxxxxxxxxxxx
- Sender: owner-sc-users@xxxxxxxxxxxxxxxx
Just marveling again at how much SuperCollider can do... I just
finished probably one of the more peculiar hacks attempted with SC,
namely:
- Parse comments on students' homework, stored in a specific list
format using org-mode in Emacs, and lay them out in a multilevel
identity dictionary.
- Link this to a table of students' IDs, names, e-mail addresses and grades.
- Using the trick at [1], send e-mail to each student containing a
form-letter preface, their numbers and the comments on each
assignment.
And I get a whole stream of:
trying 201110078: Zhao Yue... RESULT = 0
Sent mail successfully to Zhao Yue
trying 201110079: Li Sijie... RESULT = 0
Sent mail successfully to Li Sijie
trying 201110080: Zeng Xinyi... RESULT = 0
Sent mail successfully to Zeng Xinyi
p.sendStudentEmail = { |id, overrideAddress|
var address, tempPath, tempFile, cond = Condition.new, return;
if(thisThread.isKindOf(Routine).not) { Error("Must call
sendStudentEmail in a routine").throw };
if(~students[id].notNil) {
address = overrideAddress ?? { ~students[id][\email] };
tempPath = Platform.defaultTempDir +/+ "%.txt".format(id);
tempFile = File(tempPath, "w");
if(tempFile.isOpen) {
protect {
p.commentsForStudent(id, tempFile);
} { tempFile.close };
"mail -s \"%\" % <%".format(~subject, address, tempPath.escapeChar($ ))
.unixCmd({ |exit| return = exit; cond.unhang });
cond.hang;
File.delete(tempPath);
if(return != 0) { Error("'mail' quit with exit code " ++ return).throw } {
"Sent mail successfully to % <%>\n".format(~students[id][\name],
address).postln;
0
};
} {
Error("Could not open temp file " ++ tempPath).throw;
};
} { Error("No student with id %\n".format(id)).throw };
};
Blows my mind.
Thanks to all devs for making SC do more than just music!
hjh
--
James Harkins /// dewdrop world
jamshark70@xxxxxxxxxxxxxxxxx
http://www.dewdrop-world.net
"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal." -- Whitman
blog: http://www.dewdrop-world.net/words
audio clips: http://www.dewdrop-world.net/audio
more audio: http://soundcloud.com/dewdrop_world/tracks
_______________________________________________
sc-users mailing list
info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/