This is a page of some of the technical stuff that I've written using various
programming languages. Click on the links to learn more about the projects or
to see the source code.
Note: Feel free to copy, steal, modify, destroy what you will...
%java Regression 130 650 99 150 , 186 699 132 272 X Data = [ 130.0 650.0 99.0 150.0 ] Y Data = [ 186.0 699.0 132.0 272.0 ] N = 4 Beta0 = 72.6905030780361 Beta1 = 0.9701049443030667 rSquared = 2212.504697673689
I made a few modifications to it that I find useful. I think it's really easy to copy the script and create new polls with relative ease. I think it is even easier, if the script is organized a little differently, with just the things that need changed each time all grouped in one place. I have it so I only ever need to modify four variables each time I copy the script over to do a new poll. I always use the same defaults, and only the questions/answers differ.
My poll files are always named similarly, such as: color_poll.shtml, color_poll.cgi, color_polldata.txt. So I just set a variable that can be modified and will handle the filenames in the script without you having to touch them, such as: my $NAME="color";
I think it makes things quicker and easier to create a new poll from an existing one. I haven't changed the script, just moved around the options for greater ease. It works for me, but YMMV.
Here's my reorganized SurveySays script************************************** Date: Sat, 3 Feb 2001 20:09:48 -0500 From: "Jon Smith" <jes1234@rit.edu> Subject: updated use cases Writing attachments/seproj/SRS.doc ************************************** ************************************** Date: Fri, 23 Mar 2001 20:50:50 -0500 From: "Tom Mac" <tmac@clients.com> Subject: source safe and editor options Warning: Content-Type: multipart/related; Warning: no filename given Writing attachments/seproj/noname.bin **************************************
I also modified the script so it would not only extract attachments from multipart/mixed (most common) content types, but also for multipart/related, which is common for embedded attachments, like images in an HTML file for instance. I didn't want those clogging up my mailboxes unneccessarily either.
I also fixed a few bugs that I found in the program, such as not searching case-insensitively for the Content-Type.
I changed it so when it saves an attachment that already exists it appends a count to it that is unique for THAT filename alone. Initially it would extract filenames such as:
foo.txt blah.txt foo-1.txt blah-2.txt foo-3.txt
foo.txt blah.txt foo-1.txt blah-1.txt foo-2.txt
I also modified the script to handle some MS attachments which use fsck-ed up boundary IDs like:
#--Boundary_(ID_xFvCIQ+W7Uv1WgYKklIeDA)--Those parens and plus signs need escaped to properly work in the script:
#--Boundary_\(ID_xFvCIQ\+W7Uv1WgYKklIeDA\)--Here's my modified mimeStrip.pl