Spark OS X

Building a Webpage Builder

For reasons that will be revealed later... I am currently making a set of php libraries which build (x)html compliant webpages, correctly indented, etc.

Here's a taste of things to come:

php goes in:

$webpage = new webpage('xhtml10_strict', 'Website Title',
                       'text/html; charset=utf-8');
$webpage->add_style_sheet('Default', 'style.css');
$webpage->print_webpage();

webpage comes out:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>
      Website Title
    </title>
    <meta http-equiv="Content-Type"
          content="text/html; charset=utf-8"/>
    <link rel="stylesheet"
          type="text/css"
          title="Default"
          href="style.css"/>
  </head>
  <body>
  </body>
</html>

Beautiful Code

Anybody into regex?

function isValidEmail(email) {
    return email.match(/^(([\w]+\.?)*[\w])?@
                       ([\w]([\-\w]*[\w])?\.)+
                       [a-zA-Z]+$/) !== null;
}

(although I guess javascript doesn't actually let me use those line breaks in the middle of a regex definition)


Good Morning

Notes to self

php compile with pear:
./compile ... --with-pear

pear package installation:
sudo pear install -o Mail
sudo pear install -o Net_SMTP

What these are for:

During this past summer, I used Moodle for my Intro to Java course website. Right from the get-go, there were problems with confirmation emails from the system either landing in email spamboxes or just being killed on site by hasty email providers. Why? Moodle uses php's built-in mail sending functions. I was running an smtp server on my computer to send confirmation emails, so emails were originating from my computer.

Apparently my IP address is not trusted by many email providers. This doesn't come as any surprise, as my IP address is dynamically assigned periodically and pretty much every one I've been assigned has probably been in use by major spam bots at some point in the past. Hence why most email providers would just kill the messages on arrival.

So there's an extension library called PEAR which allows me to send mail through an actual email account. It takes a little muscle to get working. PHP needs to be built and installed with it explicitly enabled at compile-time. Then, you have to use the pear command-line tool to get and install the particular extensions that are needed, Mail and Net_SMTP in this case (the instructions above are notes on how to accomplish these tasks).

Seems a little sluggish, but it may just be gmail's smtp servers. Some messages take a long time, others are sent and delivered nice and quick. I'll have to take a deeper look into why this is later.


Evals!
  • Download evals template... check.
  • Make a template from the template in Apple Pages... check.
  • Fill in all of the recurring information (teacher name, credit, etc)... check.
  • Copy/paste 23x for AM, 17x for PM... check.
  • Fill in student-specific data (name, grade, category grades, etc)... check.
  • Write small Java program to analyze data and generate evaluations... check
  • Transfer evaluations into the Pages document... check
  • Convert Pages doc to Word format, and send on its way... check
  • Win!
Also coming up...
  • 8/19: driving back to LA
  • 8/25: Democratic National Convention
  • 8/26: Brandon Li recommendation letter deadline
  • 9/18: CSULA classes begin
  • 9/22: Heroes!
  • 10/10: BlizzCon '08

My Account
Spark
Admin
Other Accounts
Kass
User
Vinesh
User
Lloyd
User
Dev
User
Aaron
User
Calendar
August 2008
Sun Mon Tue Wed Thu Fri Sat
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            
Archives
Search
XHTML 1.1, CSS3.