Re: Storing data and code in a Db with LISP-like interface

From: paul c <toledobythesea_at_oohay.ac>
Date: Fri, 28 Apr 2006 02:10:12 GMT
Message-ID: <8Qe4g.81254$7a.26641_at_pd7tw1no>


JOG wrote:
> ...
> Often because they work well on paper, and we are still traditionally
> tied to these constraints.
>
> Family trees for instance. Hardly hierarchical but construed as such
> due to the conventions of paper. For instance the Queen and Prince
> Phillip have common ancestors, although this is (conveniently)
> unobtainable information from the official royal 'hierarchy'.
> ...

some of the tree conventions seem archaic, like the right-to-left horizontal trees that are popular. once worked for a notorious gov't agency on a small mostly English-speaking island. they had about 45 million 'cases' involving families, some of so-called royal lineage, all stored with IMS which i was to make an interface for, targeting a product whose only programming interface was a notion of 'tables'. various security levels, eg. 'nationally sensitive', 'locally sensitive'. facilities were straight out of a Carry-On movie with characters to match. we used to evacuate about once a week for bomb threats. anyway, all previous attempts to use the new s/w product had failed to do this with less than three dedicated mainframes so i told them i needed to profile the segments, ie. get their frequencies and so forth. they gave me their simulation system which duplicated the production structure and segment volumes and supposedly dummied all the personal stuff with random garbage. they gave me a cpu and restored the dummy data. after two days of very detailed measurements they suddenly kicked me off because they needed the machine back. when i asked: "aren't you going to restore the production version?", they told me i had been looking at it all along. it was gobbledygook all right - i reckoned the 6,000 unionized case workers liked it that way - operators had just lent me one of their production cpus without bothering to do the security stuff.

here's a question i have for the sql people (heck, just for laughs, even the MV people or the IMS people if there are any left of the latter): given a table or relvar if you prefer P{P,C} where P stands for one parent and C is one child (note some children might have only one row/tuple), produce another table or view C(C1,C2) where C1 and C2 are cousins. it would be nice if C had other attributes such as whether the cousin pair are once removed and in which direction or whether they are first, second, et cetera cousins. i'd like to use this for my little family website that is limited to mysql. this may sound lazy and if no one responds, i'll have to figure it out myself but i'd rather spend my time figuring out neater support for same in my little in-memory db engine, which i'll open-source one of these days.

here's a snip from wikipedia on cousins:

(full text at: http://en.wikipedia.org/wiki/Cousin )

The family relationship between two individuals a and b, where Ga and Gb respectively are the number of generations between each individual and their nearest common ancestor, can be calculated by the following:

     x = min (Ga,Gb)
     y = |Ga-Gb|

     * If x=0 and y=0 then they are the same person.
     * If x=0 and y=1 then they are parent and child.
     * If x=0 and y=2 then they are grandparent and grandchild.
     * If x=0 and y>2 then they are great ... great-grandparent and 
great ... great-grandchild, with y−2 greats.
  • If x=1 and y=0 then they are siblings (brothers or sisters).
  • If x=1 and y=1 then they are uncle/aunt and nephew/niece.
  • If x=1 and y>1 then they are great ... great uncle/aunt and great ... great nephew/niece, with y−1 greats.
  • If x>1 and y=0 then they are (x−1)th cousins.
  • If x>1 and y>0 then they are (x−1)th cousins y times removed.

So two people sharing a pair of grandparents have x=2 and y=0 and are described as being first cousins.

pc Received on Fri Apr 28 2006 - 04:10:12 CEST

Original text of this message