2010年5月11日星期二

What is an Examplet?


What is the meaning of an examplet? As described by Markus Grabert & Derek Bridge, examplet consists of two parts: the snippet of source code, and a statement of goal in free text. Moreover, a statement of goal usually associated with application notes. An "example", on the other hand, can be regarded as incomplete "Examplet", either the "snippet" is incompleted or without a statement of goal.

The purpose of setting up the Examplet Center is to provide a place for keeping examplets and examples that I have written for different purposes.

The Specification of Examplet Class

  1. The Examplet Class should have the following objects (properties)
    • - Examplet's ID (Long Integer)
    • - Examplet's Snippet (Text containing source code)
    • - Examplet's Namespace (A Urn notation)
    • - Examplet's Statement of Goal (text for describing the goal)
    • - Examplet's Application Notes (text for describing how to apply the snippet)
    • - Related Examplet (urn for similar exmamplet)
  2. The Examplet Class should generate RDF format
  3. The Examplet Class should have the database connectivity
  4. The Examplet Class can be displayed as an independent web page.

 

Moving Content from old domain

I was thinking of upgrading the services from the current Web Hosting company which has been hosting the w0ng.hk domain for 4 years. So, it is the time thinking about the reallocating the content from the w0ng.hk to some other domains that I owned.

Another reason for move content from cloudgent.w0ng.hk to examplet.buss.hk is that I want to keep cloudgen.w0ng.hk as a domain name for my personal blog.

As I am doing experiment about the Search Engine Page Rank with dual website (Website with double web address) , I don't want to place the HTTP 301 or HTTP 302 redirect to every page I created. Furthermore, for the domain server of w0ng.hk, I don't have the right to add CNAME. I don't want to make a pure copy of source code from one domain to the other, which create the difficulties in updating codes in both website.

It's the time to use something which is similar to Path Forward Proxy which I have described in App Engine Guide. Since the original source code files from cloudgen.w0ng.hk are mainly in PHP, I have to convert the script from Python into PHP.

To retrieve the source code from other server, we can use the urlfetch object in Python. In PHP, there is a similar object called curl. However, the syntax from urlfetch is quite different to curl.

After some experiments, I have completed a simple PHP script for path forward proxy and I have applied most of the pages in the cloudgen.w0ng.hk.

By the way, moving the content from one domain to another domain is a big topic. Page rank of a web page is the accumulation effect of links pointing to that page together with the geographical factors, domain name factors and the keywords appeared in the content of the web page.

This transition provides a good opportunity in observing the how those factors affecting web pages with same content but different domain name. By adjusting the links pointing to the website, I can have a full picture of degree of page ranks offered by different links in different website.

Observing the transition of page rank from one domain to other domain is a kind of fun :P

Happy Programming
Cloudgen