NEW: For a prettier blog interface, see the Wordpress version!

Priorities - A: high, B: medium, C: low; Status - _: unfinished, X: finished, C: cancelled, P: pending, o: in progress, >: delegated. Covey quadrants - Q1 & Q3: urgent, Q1 & Q2: important
A1XReview the minutes (E-Mail from Maria Assunta C. Cuyegkeng)
A2XSend the Synchronicity people the things they're looking for (E-Mail from Sacha Chua <[email protected]>)
A3XMake Game Na Ba Yan project (../../News/drafts/drafts/212)
A4XMake BuyAndSellApplet - JApplet version (../../News/drafts/drafts/212)
A5XStripslashes (/su:[email protected]:[email protected]110.xml)

1. Perl script to suck courses files : 12:50

Categories: None -- Permalink
Back when I didn't have a Download as Archive in the courses system, I used this script to suck all the files.
use English;

open INDEX, "curl -b PHPSESSID=$SESSIONID '$ARGV[1]' |";

while (($s = <INDEX>) && ($s !~ /select name="login"/)) { }

my @logins;
my @lnames;
my @fnames;
my $i = 0;

while (<INDEX> =~ /option value="(\w+)"> (.+?), (.+?)</)
    $logins[$i] = $1;
    $lnames[$i] = $2;
    $fnames[$i] = $3;

while (($s = <INDEX>) && ($s !~ /smaller/))

my $login; my $timestamp;
while ($s = <INDEX>)
    if ($s =~ /<td valign=top>(\w+?)</)
	$login = $1;
	<INDEX>;   # skip name
	<INDEX>;   # skip email
	<INDEX>;   # skip first part;
	if (<INDEX> =~ /^\s*(.+?)\s*$/)
	    $timestamp = $1;
	<INDEX>;   # skip </td>
	<INDEX>;   # skip </tr>
	<INDEX>;   # skip <tr>
    elsif ($s =~ /nbsp/)
	# $s nbsp;
	<INDEX>;  # td valign = top
	<INDEX>;  # files
	while (($s = <INDEX>) && ($s =~ /index\.php\?project_id=(\d+)\&login=(\w+)\&file=(.+?)\"/))
	    mkdir $1;
	    mkdir "$1/$2";
	    system "curl -b PHPSESSID=$SESSIONID '$1&login=$2&file=$3' -o $1/$2/$3";
    elsif ($s =~ /html/)
	close INDEX;

2. Hello world, school, teaching, games --- blast from the past : 12:57

Categories: None -- Permalink
From my 2002.06.20 entry:
12:52 AM on a schoolday that starts at 10:30 AM is probably not the best time to write an S-Files, but what the heck. I haven't been writing. Stories have backed up, and the resulting chaos in my mind appears to have edged out important details like the names of people I'm supposed to know and the details of where I'm supposed to be.

Time to defrag.

I am all the more unusually loquacious because I have just finished writing a lab exercise for the introductory computer science course for which I am a teaching assistant. My pitiful effort at making "Hello, World!" fun and exciting can be found at , with no guarantee that it'll actually even be used in today's CS session. I'm banking on the fact that Dr. Sarmenta probably hasn't prepared materials as detailed as this, as I haven't seen anything like it from, well, any of my CS teachers. I'm _hoping_ that he'll let me deliver the class, which is a far-out possibility but still worth considering. I also hope I'll be awake enough to do so with wit and style.

I love the project submission system I wrote last semester. After editing the postgresql start script so that the postmaster would accept TCP connections, I simply had to set up the database and run a script that obligingly extracted and included all the students in the student data files that the department forwarded to me. All 222 students of CS21A in 9 sections have been set up. How nice.

Teaching. Hmm. I had dinner with Mario Carreon (an old friend from high school competitions) the other night. He teaches at UP and is considering moving to the industry because of the pay. We talked about teaching, mainly, and in the course of our conversation I found myself declaring that yes, this is it - I cannot imagine myself in any other profession except teaching. Especially college level introductory computer science. That's it.

Naturally teaching doesn't stand on its own - I must be teaching _something_, and teaching also offers ample time for research. Enter wearable computing. I'll be getting my gear on the 23rd, if all goes well. Expect lots of files going on and on about how cool it all is.

3. More past entries : 13:08

Categories: None -- Permalink
- 2002.06.20 - 2002.06.25 - 2003.02.02 - 2003.01.12 - 2003.01.13 - 2003.12.27

4. Code for inserting student code : 13:36

Categories: None -- Permalink
(defvar sacha/project-base-path nil "*The path to the project files, excluding the ending /")
(defun sacha/insert-student-files (id)
  (interactive "MID: ")
  (if (file-directory-p (concat sacha/project-base-path "/" id))
        (cd (concat sacha/project-base-path "/" id))
        (mapcar (lambda (item)
                  (print item)
                  (insert "--------------------------------------------------------------------\n")
                  (insert "Your code: " item "\n")
                  (insert "--------------------------------------------------------------------\n")
                  (let ((retval (cadr (insert-file-contents item))))
                    (goto-char (+ (point) retval))
                    (insert "\n")))
                (file-expand-wildcards "*")))
     (insert "***********************************************************\n"
             "You have not yet submitted any files.\n"

5. Composing messages in Gnus with elisp --- emacs : 13:41

Categories: None -- Permalink
(require 'gnus-msg)
(defun dxr-group-mail (To Subject)
  "Start composing a mail."
  (gnus-setup-message 'message
  (message-mail To Subject)))
Previous day | Next day

I'd love to hear about any questions, comments, suggestions or links that you might have. Your comments will not be posted on this website immediately, but will be e-mailed to me first. You can use this form to get in touch with me, or e-mail me at [email protected] .

Page: 2003.09.30
Updated: 2004-11-2106:44:1306:44:13-0500
NOTE: ANTI-SPAM MEASURE NOW IN PLACE. Please answer the following question with the right number in order to send me your comment.
What is two minus one? (hint: one ;) )