1998Q3/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: [MUD&#45;Dev] Re: let's call it a spellcraft -->
<!--X-From-R13: Qnyvona Fverfvnf Rnexybpx <pnyvonaNqnexybpx.pbz> -->
<!--X-Date: Wed, 23 Sep 1998 23:24:57 &#45;0700 -->
<!--X-Message-Id: 199809240624.AAA07030#darklock,com -->
<!--X-Content-Type: text/plain -->
<!--X-Reference: 19980923004201.B18928#flagstaff,Princeton.EDU -->
<!--X-Reference: 36086740.A278771E#freehold,crocodile.org -->
<!--X-Reference: 199809240523.AAA14210@dfw&#45;ix10.ix.netcom.com -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, [MUD-Dev] Re: let's call it a spellcraft</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:caliban#darklock,com">
</head>
<body background="/backgrounds/paperback.gif" bgcolor="#ffffff"
      text="#000000" link="#0000FF" alink="#FF0000" vlink="#006000">

  <font size="+4" color="#804040">
    <strong><em>MUD-Dev<br>mailing list archive</em></strong>
  </font>
      
<br>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
<br clear=all><hr>
<!--X-Body-Begin-->
<!--X-User-Header-->
<!--X-User-Header-End-->
<!--X-TopPNI-->

Date:&nbsp;
[&nbsp;<a href="msg01184.html">Previous</a>
&nbsp;|&nbsp;<a href="msg01186.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg01195.html">Previous</a>
&nbsp;|&nbsp;<a href="msg01216.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#01185">Author</A>
&nbsp;|&nbsp;<A HREF="#01185">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#01185">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>[MUD-Dev] Re: let's call it a spellcraft</H1>
<HR>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->
<UL>
<LI><em>To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI>
<LI><em>Subject</em>: [MUD-Dev] Re: let's call it a spellcraft</LI>
<LI><em>From</em>: Caliban Tiresias Darklock &lt;<A HREF="mailto:caliban#darklock,com">caliban#darklock,com</A>&gt;</LI>
<LI><em>Date</em>: Wed, 23 Sep 1998 23:22:39 -0700</LI>
<LI><em>Reply-To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>
On 01:23 AM 9/24/98 +00-05, I personally witnessed Jon A. Lambert jumping
up to say:
&gt;
&gt;It begs the question, "Is the fixed dimensional array evil?"

Only when the dimension of the array is an integral part of the object's
type, as in Pascal -- where an array of three integers cannot be assigned
to an array of five integers, because an array of three is not an array of
five and therefore the types don't match so the assignment is impossible.

I'm building something at the moment, a simple database which stores and
retrieves data in compressed pages of 4096 bytes, which is sort of similar.
It's sort of like the old DOS FAT file system, in a way; at the top of the
file, there is page 0, which has 4096 bytes in it and is considered
"special" in that it bitmaps all the blocks that are used and unused. Since
it has 4096 bytes, it holds 32767 useful bits (the first bit is
self-referential and thus wasted). So the database, with that one index
page, can hold 128MB-4KB of data (32768 * 4096, - 4096 for the index) which
in turn is compressed with an LZ77 implementation and generally manages to
squeeze it down to about 40% of the original size (low entropy data
values). So it ends up meaning "you can store about 256 MB of data here,"
after you account for average cluster overhead and average object size.

Well, you may have more than 256MB of data. So something has to be done to
fix this. What I'm doing is adding a second database just like the first on
the end -- at page 4096, there is another index. Likewise at 8192, etc. So
looking up block X is a simple matter of looking up page X&gt;&gt;15, reading it
in, checking to see if block X is taken
(pagedata[(X&gt;&gt;3)&amp;0xFFF]&amp;(1&lt;&lt;(7-(X&amp;3)))), and then seeking to location
(blocknum&lt;&lt;12) in the file to read in the 4096 bytes. The first four bytes
then point to the next block in the chain, until you get to the final block
which is tagged with a 0. Once you reassemble, you pass the conjoined data
stream into the decompression chamber, where it gets verified (MD5) and
decompressed. Then you have your data. Deletion is simple; just
pagedata[(X&gt;&gt;3)&amp;0xFFF]&amp;=~(1&lt;&lt;(7-(X&amp;3))) for each block.

At its heart, this is still a fixed size array, but it's actually a
variable size array of fixed size arrays of variable sized arrays of fixed
size arrays. 

And yes, I'm aware that making the index page into a real FAT -- storing
the next data block info in the index, which allows chaining and
chain-length detection without seeking all over the file -- would certainly
increase performance. I'm considering it. But with the data at the
beginning of each block, a corrupt index is not necessarily the death of
the database; it can be regenerated dynamically to at least some degree.
Maybe doing both would be good.

-----------------------------------------------------------------------
Caliban Tiresias Darklock &lt;caliban#darklock,com&gt;   | "I'm not sorry or 
Darklock Communications &lt;<A  HREF="http://www.darklock.com/">http://www.darklock.com/</A>&gt; |  ashamed of who I 
PGP Key AD21EE50 at &lt;<A  HREF="http://pgp5.ai.mit.edu/~bal/">http://pgp5.ai.mit.edu/~bal/</A>&gt; |  really am."      
FREE KEVIN MITNICK! &lt;<A  HREF="http://www.kevinmitnick.com/">http://www.kevinmitnick.com/</A>&gt; |  - Charles Manson 


</PRE>

<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<HR>
<ul compact><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><A NAME="01216" HREF="msg01216.html">[MUD-Dev] Let's talk about numbers.</A></strong>
<ul compact><li><em>From:</em> "Jon A. Lambert" &lt;jlsysinc#ix,netcom.com&gt;</li></ul>
</UL></LI></UL>
<!--X-Follow-Ups-End-->
<!--X-References-->
<UL><LI><STRONG>References</STRONG>:
<UL>
<LI><STRONG><A NAME="01124" HREF="msg01124.html">[MUD-Dev] Re: let's call it a spellcraft</A></STRONG>
<UL><LI><EM>From:</EM> "Adam J. Thornton" &lt;adam#phoenix,Princeton.EDU&gt;</LI></UL></LI>
<LI><STRONG><A NAME="01120" HREF="msg01120.html">[MUD-Dev] Re: let's call it a spellcraft</A></STRONG>
<UL><LI><EM>From:</EM> Vadim Tkachenko &lt;vt#freehold,crocodile.org&gt;</LI></UL></LI>
<LI><STRONG><A NAME="01177" HREF="msg01177.html">[MUD-Dev] Re: let's call it a spellcraft</A></STRONG>
<UL><LI><EM>From:</EM> "Jon A. Lambert" &lt;jlsysinc#ix,netcom.com&gt;</LI></UL></LI>
</UL></LI></UL>
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg01184.html">[MUD-Dev] META: Web posting from list archives</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg01186.html">[MUD-Dev] Re: let's call it a spellcraft</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg01195.html">[MUD-Dev] Re: let's call it a spellcraft</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg01216.html">[MUD-Dev] Let's talk about numbers.</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#01185"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#01185"><STRONG>Thread</STRONG></A></LI>
</UL>
</LI>
</UL>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
<ul><li>Thread context:
<BLOCKQUOTE><UL>
<LI><STRONG>[MUD-Dev] Re: let's call it a spellcraft</STRONG>, <EM>(continued)</EM>
<ul compact>
<ul compact>
<ul compact>
<LI><strong><A NAME="01124" HREF="msg01124.html">[MUD-Dev] Re: let's call it a spellcraft</A></strong>, 
Adam J. Thornton <a href="mailto:adam#phoenix,Princeton.EDU">adam#phoenix,Princeton.EDU</a>, Wed 23 Sep 1998, 04:43 GMT
<UL>
<LI><strong><A NAME="01177" HREF="msg01177.html">[MUD-Dev] Re: let's call it a spellcraft</A></strong>, 
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Thu 24 Sep 1998, 05:23 GMT
<UL>
<LI><strong><A NAME="01183" HREF="msg01183.html">[MUD-Dev] Re: let's call it a spellcraft</A></strong>, 
Vadim Tkachenko <a href="mailto:vt#freehold,crocodile.org">vt#freehold,crocodile.org</a>, Thu 24 Sep 1998, 05:55 GMT
<UL>
<LI><strong><A NAME="01195" HREF="msg01195.html">[MUD-Dev] Re: let's call it a spellcraft</A></strong>, 
Adam Wiggins <a href="mailto:adam#angel,com">adam#angel,com</a>, Thu 24 Sep 1998, 18:22 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="01185" HREF="msg01185.html">[MUD-Dev] Re: let's call it a spellcraft</A></strong>, 
Caliban Tiresias Darklock <a href="mailto:caliban#darklock,com">caliban#darklock,com</a>, Thu 24 Sep 1998, 06:24 GMT
<UL>
<LI><strong><A NAME="01216" HREF="msg01216.html">[MUD-Dev] Let's talk about numbers.</A></strong>, 
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Fri 25 Sep 1998, 06:00 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="01186" HREF="msg01186.html">[MUD-Dev] Re: let's call it a spellcraft</A></strong>, 
Marc Hernandez <a href="mailto:marc#jb,com">marc#jb,com</a>, Thu 24 Sep 1998, 06:41 GMT
<UL>
<LI><strong><A NAME="01212" HREF="msg01212.html">[MUD-Dev] Let's talk about numbers.</A></strong>, 
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Fri 25 Sep 1998, 05:59 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="01192" HREF="msg01192.html">[MUD-Dev] Re: let's call it a spellcraft</A></strong>, 
T. Alexander Popiel <a href="mailto:popiel#snugharbor,com">popiel#snugharbor,com</a>, Thu 24 Sep 1998, 15:15 GMT
</LI>
</UL>
</LI>
</UL>
</LI>
</ul>
</ul>
</ul>
</LI>
</UL></BLOCKQUOTE>

</ul>
<hr>
<center>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
</center>
<hr>
</body>
</html>