Recent Changes - Search:

Home Pages Pidgin   Azarennya (S|N) Mac Thesaurus Reference ToDo Colino Food Local

Blogs: BadIdea Rachel RIAA Cult: Clambake Infidels Fi: Arda StarTrek Trek/Wars Film: IMDB D Harry Jabootu Kyle Fun: Agony ICanHas? ObSkills Snopes Lang: ZBB Vreleksá AwkWords Omniglot Scriptorium More... Local: Maps Map MyWeb Metro (map) FC Weather GoWhere? GGWash DC Arlington Reston Beyond Bacon Pix: Deviant Places Renderosity Blender Artists Pol: Anchoress Lizards Lucianne Strata WAwakes Sci: SmallThings Darwin AntiEvo Skeptics EvC BAUT Physics /.Sci Junk Panda Pharyngula Mags AmSci NatG Space X86: OSX86 ArsTech OSNews TUAW Dev PowWeb PHP Webmaster Coding Walkers Prog: PHP JS Toolbox Unobt Compress RegExp (test) Lint SQL Cocoa Builder Dev Apple BBS Userland Faqin

Science/Tech: Engadget Thunderbolts Icecap Centauri NewSci Gizmodo co2sci ClimateDebate SciDaily Nrich NatGeog Math CreatClaims GoodBadMath

CurrentEvents: OrigSig Flamingo FlopAces ImmigProf ~J~ MyVRWC NewsGroper Pal2Pal Sanity Simon TCS Toldjah Blogs...

Tools: Calculator AsciiArt XMLVal

FunStuff: Pictures: Photobucket (eg Dubai) Videos: YouTube Subtitler

InterestingThings: LibraryThing FlashCards GoogleDocs Wowio Bubbl.us Colemak Audible PodioBooks WonderfulInfo BooksOnline AboutUs.org

Polly

"Polly" is my name for a note program I want to write using Euphoria and EDS (Euphoria Database System files). I chose Polly because I can't seem to come up with a more appropriate name that doesn't sound lame, so I went for whimsy and chose a girl's name that sounded like the name of a quiet librarian.

Why EDS instead of text?

Short answer: Because an EDS file can hold any kind of data (not just text), because its format is open and explorable, and because it has the structures needed for building indexes and other features I might want.

EDS features

  • A file can be shared among DOS, Windows, and Linux users
  • A file can hold any number of tables
  • Each table is identifiable by name
  • A table can hold any number of records
  • Each record has one key and one data value
  • Each record is identifiable by key (only one record per table can have a given key) or by record number
  • Records in a table are always sorted by key (and can therefore be found via binary search)
  • Each key (and each data value) can be anything containable in a Euphoria atom or sequence

Why EDS is attractive

  • Because Euphoria comes with functions already written and debugged (in database.e) for creating, opening, exploring, and modifying EDS files.
  • Because indexes and other special structures would be easy to build and implement using the automatically sorted tables in an EDS file.
  • Because creating a reasonable file format for notes becomes trivial.

Drawbacks of EDS

  • EDS is not a universal data format; text is, which is why I'd been thinking in terms of keeping notes in text files. (So make it easy to backup data to text files. And provide a general EDS explorer tool so the user can view the file himself.)
  • EDS files can be corrupted in a way that text files cannot be. (Store records with checksums, run code that examines files for problems, write backup copies of files.)

Verdict

At the moment (2006-12-28), I am convinced that the benefits of EDS outweigh the drawbacks, particularly since the drawbacks have workarounds.

Proposed features

Each note is stored as a record (in the "notes" table), with the creation date as its key. Thus notes are naturally sorted by age.

Indexes: Each note can have one or more keywords, and each keyword is a key (in the "keywords" table) to a list of note IDs (creation dates, i.e., keys to records in the "notes" table).

File tables

  • pollyNotes - uses a note's creation date and time as the key (and the note's ID); the data is the text of the note.
  • pollyKeys - each keyword is a key; the data is a list of IDs of notes that have the keyword assigned.
  • pollyFilters - uses a filter's name as the key; the data is the search criteria used to identify a note as belonging to a group.

Diversion: Why have both keyword and filter indexes?

Keywords and filters seem to serve the same function. Can these be combined?

The idea behind a keyword is to create an index for all notes with that keyword. Searches for multiple words will involve the intersection of two or more such indexes, which should be very fast.

The idea behind a filter is to search for all notes with specific criteria [-] not only keywords but also text. A filter can search notes for patterns, not just exact string matches.

Views

In a view, a summary of a note is the first line of text in the note.

  • Calendar view. Notes could be listed on a display that looks like a monthly calendar, and of course you could flip between pages (months).

Filters

A filter is essentially a set of search criteria. A filter is applied to produce a list of only those notes that match the search criteria. These could be stored in a "filters" table.

Sharing a file with other applications

Any EDS file can, in theory, contain Polly tables, so Polly can open any file that looks like an EDS file.

Code

Create a database file

Open a database file

Load the pollyNotes table from a database file

Load a note, with keywords

Save changes to a note, including keywords

Manage two or more open databases

Add criterion to a filter

Apply filter (search file for notes that match the criteria)

This is code.

More code.
Edit - History - Print - Recent Changes - Search
Page last modified on December 29, 2006, at 08:29 AM