discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Purpose of the Contacts.app (Was: Re: Postal address layouts?)


From: Pascal J . Bourguignon
Subject: Purpose of the Contacts.app (Was: Re: Postal address layouts?)
Date: Sat, 6 Sep 2003 15:32:06 +0200


Stefan Urbanek writes:
> Hi all,
> 
> I have a simple question: What is the purpose of Contacts.app? Is it
> a personal address book or an address database for commercial or
> other bulk mailing purposes? What amount of addresses is it supposed
> to manage, 10s, 100s or 100 000s?
> 
> I support Dirk's idea of using single field for whole address. Try
> to ask another questions: do I need to know parts of an address? For
> what? AFAIR, i have never wanted to search for 'all friends at
> Sesame street' or 'all business partners which house number is 10'
> or 'family members with zip code beginning with 8'. I think you get
> the idea. For searching purposes, there is (or will) still option
> for searching in the whole 'address' field. Even with 1000 contats
> the time cost should be fair.
> 
> Rather than complicating application with different address formats
> and wasting time on bundles for address formating, there are plenty
> of other useful features that can be implemented in address book i
> think.
> 
> What do you think?

Exactly!  In the golden age of the Macintosh, when there was literally
tens of  database application  for Macintosh (it  was not  even called
MacOS at  that time), I got the  surprise one day to  see a commercial
manage his  address book in  a plain text  file. In effect,  even with
thousands of addresses  it fitted in RAM easily  (there was no virtual
memory implemented in  MacOS at that time!), and  it got instantaneous
responses when searching whatever  with the plain text search function
of the editor.  With a database, he would have had to select the field
to be searched (hopping that the database application had indexed this
field), then he would  have had to wait for the data  base to seek the
floppy, reading the file again and again at each request, etc.

Nowadays, RAM  are no  more measured in  hundreds of kilobytes  but in
gigabytes, but our address books  still contain at most a few thousand
addresses.  So,  until you plan  to add hi-res pictures,  movie clips,
speach records  and DNA prints of  your friends in  your contact file,
you can easily  load it in memory and to  sequencial textual search in
memory for each request.  Ok, if you want to have a little more fun as
a  programmer, you  may  add some  in  memory indexing,  but a  1.2GHz
processor takes only  91 ms to scan 512k of text  (more than enough to
store data bout a 1000 friends).

[14]>  (defun scan (size n) 
           (let ((string (make-string size
                                      :initial-element (character "X")))) 
               (time (dotimes (i n)
                        (dotimes (c size)
                            (char= (aref string c) (character "Y")))))))
SCAN
[15]> (compile 'scan)  ;; it's clisp which inteprets, or byte-compiles!
SCAN ;
NIL ;
NIL
[19]> (scan (* 512 1024) 100)
Real time: 9.107659 sec.
Run time: 7.77 sec.
Space: 0 Bytes
NIL



My own address books has 142  entries and takes only 18300 bytes, that
is a nice 128 bytes per entry.

address@hidden ghost-in-the-shell]$ wc ~/private/info/personnes.txt
    142    1353   18300 /home/pascal/private/info/personnes.txt


-- 
__Pascal_Bourguignon__                   http://www.informatimago.com/
----------------------------------------------------------------------
Do not adjust your mind, there is a fault in reality.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]