Subj : Re: store collections of strings in tdb or gdbm To : comp.programming From : jburgy Date : Sun Oct 09 2005 03:14 pm Lasse Kliemann wrote: > > That brings me to another question: What if the number of strings in > each record is not fixed, and even no upper bound is known? How would > you go about that? (Allow me to mention that my encoding approach > already covers this case.) > Very good question! Luckily for you, I'm in an "answer to everything" kind of mood. By the way, if you feel like doing the whacky encoding thing, go ahead, be my guest, it simply doesn't feel right. The last design I brought up pretty much mirrors the standard sparse matrix representation of http://www.research.ibm.com/journal/rd/416/toledo.html. As you rightly point out, it's no good whith no a priori bound on row size. For that purpose, you'd need a slightly more sophisticated data structure. To keep the implementation as simple as possible, I would probably go for a hash map with open addressing (see ref. impl. at http://en.wikipedia.org/wiki/Hash_table#Open_addressing). > > Es geht um ein System zur Integrit=E4tspr=FCfung von heruntergeladenen > Dateien. URLs der Dateien werden zusammen mit Pr=FCfsummen gespeichert. > Benutzer des Systems k=F6nnen die Pr=FCfsummentabellen untereinander > austauschen. Jeder Datensatz wird signiert von demjenigen, der ihn > hinzuf=FCgt. Unstimmigkeiten werden automatisch aufgesp=FCrt und gemeldet. > So kann das ganze auch als sehr einfache Heuristik zum Aufsp=FCren von > Manipulationen (durch einen Eindringling auf den jeweiligen Servern) > angesehen werden. Zus=E4tzliche Informationen k=F6nnen auch eingetragen > werden, etwa wenn jemand ein Audit der Quellen einer Software gemacht > hat. Geil (hier merkst Du vermutlich, dass ich Deutsch in der Schweiz gelernt habe). Geht es um eine Diplomarbeit oder eine "real-world" Anwendung? Jan .