topics:  main-page   everything   99things   things-to-do   software   space   future   exercise & health   faith  
  thought   web   movies+TV   music   mymusic   food   curiosity   tidbits   I remember   wishlist   misc   links


Exercise 3: is_a and has_a
July 29, 2008

Summary

Implement an IsA function for the Entity class which will perform a depth-first search on is_a relationships to determine whether an entity has a direct or indirect is_a relationship with another entity.
Implement a HasA function for the Entity class which will perform a depth-first search on the is_a relationship followed by a depth of one search of has_a.
Throw an exception from Entity.Get as well as Entity.Set if the requested property does not exist.

Test case:

Click here

Solution

Click here


Exercise 2: Entities, Relationships, and Values
July 27, 2008

Summary

Design an Entity class
An entity can have an id
Implement Set method which allows a property of an entity to be given a value. For the time being, implement words as entities whos IDs are surrounded by single quotes. ex. 'Daniel'
Implement a Get method which returns the value of a entity's property
Implement an AddRelationship method
Design a Relationship class as a subclass of Entity
Design a Brain class which allows entities to be created via CreateEntity and relationships to be created using CreateEntity. Make the Entity and Relationship classes internal to this class and expose their functionality with the interfaces IEntity and IRelationship.
Enforce entity IDs, if specified, to be unique.
Pass the following test case:
[Test]
public void Test1()
{
   IEntity is_a = Brain.CreateEntity("is_a");
   IEntity has_a = Brain.CreateEntity("has_a");

   IEntity Daniel = Brain.CreateEntity("Daniel");
   IEntity person = Brain.CreateEntity("person");
   Brain.CreateRelationship(Daniel, is_a, person);
   IEntity first_name = Brain.CreateEntity("first_name");
   Brain.CreateRelationship(person, has_a, first_name);
   IEntity wDaniel = Brain.CreateEntity("'Daniel'");
   Daniel.Set(first_name, wDaniel);

   Assert.AreEqual("'Daniel'", Daniel.Get(first_name).Id);
}}

Solution

Click here


Exercise 1: Publishing an ASP.NET website
July 27, 2008

Summary

Create an ASP.NET website with Visual Studio and publish it to the web.

Solution

Unfortunately, netfirms.ca would charge me an extra $10/month for ASP.NET hosting
Registered domain name http://platoai.com for $11/year
Signed up with http://webhostforasp.net for $4.50/month


older >>