Monday, 24 December 2007 @ 12:41pm • ecma
I've been working hard on RKelly lately. RKelly is a ruby implementation of Kelly. Kelly is a fictional project that I made up so that I could name my project RKelly. Anyway, RKelly is a javascript parser, and will be an interpreter someday. Today I was able to get RKelly to parse and produce a parse tree of prototype.js. I couldn't get GraphViz to export the file, but you can download the dot file here.
Here is a parse tree of a function that calculates the fibonacci sequence:

Here is the javascript code:
function f(n) {
var s = 0;
if(n == 0) return(s);
if(n == 1) {
s += 1;
return(s);
} else {
return(f(n - 1) + f(n - 2));
}
}
And the ruby code that produced that graph:
require 'rkelly'
parser = RKelly::Parser.new
puts parser.parse(File.read(ARGV[0])).to_dots
I need a new computer..... It took 2 minutes to render the prototype graph! Ugh!
Posted by Aaron Patterson •
Permalink •
Comments (5) •
Leave your Comment »
Sunday, 9 December 2007 @ 10:56pm • computadora, mechanize
I've been refactoring Mechanize for an 0.7.0 release. Basically I'm trying to clean the code up and there are a few features that I think are unnecessary, but I would like to ask people first.
- REXML as a parser.
I want to remove support for REXML. I don't use it. Hpricot seems to do everything I need.
- 1.8.2 thru 1.8.4 support
I've got a bunch of monkey patches for 1.8.2 thru 1.8.4. I'd like to remove these because I think most people are on 1.8.5 or up.
- WWW::Mechanize::Page#watch_for_set
I am going to remove this method. It made sense when REXML was the main parser, since REXML was so slow. I think that Hpricot is fast enough that this method is not so useful.
I'm going to make 0.7.0 lazily build up form and link objects, which should give everyone a slight speed increase but makes watchforset obsolete (sort of).
I'm changing around the class names to be better organized, but they should all have the same methods. Also, if there are any feature requests, let me know!
Posted by Aaron Patterson •
Permalink •
Comments (4) •
Leave your Comment »
Friday, 7 December 2007 @ 12:09pm • life
I need to post something because it seems like I'm only posting release announcements to my blog......
Today is my sister's birthday, so I woke her up at 8 this morning to wish her a happy birthday. I wanted to make sure that I was the first person to congratulate her on her special day. Is it OK to say "congratulations" for a birthday? I know Pam doesn't like to throw around that word without some sort of accomplishment occurring. For example, getting engaged. Should you really congratulate someone on getting engaged since they just made a decision? They didn't really overcome any obstacles or adversity, they just decided to get married. Anyway, I think that surviving another year is worth congratulating someone.
We will be rollerskating for my birthday, and Pam sent out an evite with this image:

今週日本語のクラスで私とパムさんは「何々つもりだ」と「何々なる」を習いました。私は「パムは茸が好きになる」と言っていました。でも、パムさんは意地悪になりました。Oh well.
Posted by Aaron Patterson •
Permalink •
Comments (0) •
Leave your Comment »
Thursday, 6 December 2007 @ 8:29pm • life
CSSpool (pronounced "cesspool") is a validating SAC parser for CSS. The parser
calls methods on a document handler depending on what it has found. CSSPool
currently only supports CSS 2.1. CSSPool will not yield invalid properties or
selectors.
Changes:
## 0.2.4
Posted by Aaron Patterson •
Permalink •
Comments (0) •
Leave your Comment »
Wednesday, 5 December 2007 @ 9:48am • life
CSSpool (pronounced "cesspool") is a validating SAC parser for CSS. The parser
calls methods on a document handler depending on what it has found. CSSPool
currently only supports CSS 2.1. CSSPool will not yield invalid properties or
selectors.
Changes:
## 0.2.3
Posted by Aaron Patterson •
Permalink •
Comments (0) •
Leave your Comment »
Tuesday, 4 December 2007 @ 9:01pm • life
CSSpool (pronounced "cesspool") is a validating SAC parser for CSS. The parser
calls methods on a document handler depending on what it has found. CSSPool
currently only supports CSS 2.1. CSSPool will not yield invalid properties or
selectors.
Changes:
## 0.2.2
Posted by Aaron Patterson •
Permalink •
Comments (0) •
Leave your Comment »
Tuesday, 4 December 2007 @ 8:25pm • life
The Mechanize library is used for automating interaction with websites.
Mechanize automatically stores and sends cookies, follows redirects,
can follow links, and submit forms. Form fields can be populated and
submitted. Mechanize also keeps track of the sites that you have visited as
a history.
Changes:
# Mechanize CHANGELOG
## 0.6.11
Posted by Aaron Patterson •
Permalink •
Comments (0) •
Leave your Comment »
Monday, 3 December 2007 @ 10:45am • computadora
I was put in charge of nerd meeting this week.
So, I made a special terminal theme for this week. You can get it here.
Posted by Aaron Patterson •
Permalink •
Comments (1) •
Leave your Comment »
Saturday, 1 December 2007 @ 1:13pm • computadora, csspool
日本語を練習していました。日本語のドキュメンテーションにCSSPoolを書くと思います。でも、日本語を書くのは難しで私は遅い!www!
Posted by Aaron Patterson •
Permalink •
Comments (0) •
Leave your Comment »
Saturday, 1 December 2007 @ 12:45pm • life
CSSpool (pronounced "cesspool") is a validating SAC parser for CSS. The parser
calls methods on a document handler depending on what it has found. CSSPool
currently only supports CSS 2.1. CSSPool will not yield invalid properties or
selectors.
Changes:
## 0.2.1
Posted by Aaron Patterson •
Permalink •
Comments (2) •
Leave your Comment »