Exercise 4: ParsingJuly 30, 2008
SummaryWrite a simple parser to parse input consisting of one or more lines according to the following grammar. The parser should then update the
brain instance accordingly.
Define an entity:
Define a relationship:
| {entity1} {relation} {entity1} |
|
Specify a value assignment:
{entity1}.{entity2} = {entity3} {entity1}.{entity2}.{entity3} = {entity4} etc. |
|
Test casesClick hereSolutionClick hereWeb UIClick here
danielbigham.ca now supports rssJuly 29, 2008
After long last, I set up
rss for my website. Each blog topic represents its own 'feed' which can be subscribed to with any modern browser or RSS reader.
I don't use rss much myself because most of the website that I check on a daily basis are such that I want to see the stories surrounded by the layout of the website, and they are updated frequently enough that I don't want to be notified each time something new is posted.
I guess where I should use rss is to keep tabs on sites that only update once every few days and I want a notification to go look for the new content.
has_a: Properties VS possessionsJuly 29, 2008
As I was working on an implementation for exercise 3 tonight, I realized that there is a difference between
has_a in the sense of a property VS
has_a in terms of a "possession".
Example of a
property:
Example of a
possession:
Where this difference comes into play is in the implementation of the
HasA function, and can be highlighted by the following:
Test case 1:
Daniel has_a human_body human_body has_a human_head human_head has_a nose |
|
The property
Daniel.nose makes sense because each of the above
has_a relationships describe
properties, or parts.
Test case 2:
Daniel has_a dog dog has_a tail |
|
The property
Daniel.tail doesn't make sense because the relationship
Daniel has_a dog is describing
dog as a possession of
Daniel, rather than as a
property.
older >>