Re: Advice sought on design of a db of linked lists of linked lists of bitmaps?

2003-07-11 Thread alexrousseau_jta
"Jeremy Neal Kelly" <[EMAIL PROTECTED]> wrote:
> "alexrousseau_jta" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> 
> > I forgot to ask: When you say "marginally slower", is it
> > still fast enough to load a 2-bit-depth 160x160 bitmap
> > in 250ms or less?
> 
> I'm glad to be of service! As for the 'slowness', my (rough)
> understanding is that it has to do with the write protection
> affecting the storage area; database operations need to account
> for this, whereas operations on the dynamic heap do not. (Perhaps
> there is other upkeep associated with databases -- someone else
> could better answer that.) Anyway, this upkeep occurs at the
> record level, and once it is accomplished, read and write
> operations take place (I believe) at the same speed they would
> on the dynamic heap. Therefore, an application processing many
> small records likely would demonstrate a performance loss from
> using databases, but one such as yours with (relatively) few
> records will not.
>
My storyboards (for 10 minute films) would hold up to 100 shots,
each holding an average of 3 drawings, hence 300 records, the latter
being stored in the drawings database (per your earlier suggestion).
I can see this thing becoming huge if the user is working on a few
films. But I'm not too worried about that yet. I'll do a db access
performance test in a few days and that will help me decide whether
to cache or not to cache.

> Would someone care to confirm my thinking here?
> 
> As for loading your bitmaps in a quarter-second -- well, I haven't
> actually tried it, but I'd be surprised if it were any slower than
> that.
> 

Best !
Alex


> 
> Best regards,
> Jeremy Neal Kelly
> Software Engineer
> Peapod



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Advice sought on design of a db of linked lists of linked lists of bitmaps?

2003-07-11 Thread alexrousseau_jta
Hal Mueller <[EMAIL PROTECTED]> wrote:
> At 21:46 + 7/11/03, alexrousseau_jta wrote:
> >How would it help the user if I supported VFS?
> 
> More memory (probably more important for you than for most apps, 
> since I can see this becoming graphics-heavy).  And easier
> exchange ("here Fred, take a look at this one").  Depends on how
> big your database is of course, and also how it's structured
> (does each storyboard live in its own database?  or do you have
> one monolithic db?)
> 
I'm going to follow Jeremy Neal Kelly's suggestion and split the
data into relational databases (clips, shots, and frames). The
dependencies are such that it will be a triolith.  :)


> Heck, these days I think it's worth at least considering the idea
> of _requiring_ VFS for certain apps.  If it's file-heavy, and if
> the user might want to import/export graphics or music from other
> programs, doing all that with a FAT32 file system saves a lot of 
> design and operation headaches.  I can only think of about 4 
> current-production devices without VFS, and they're all either 
> low-end or specialty (baby Zire, Meazura, Fossil, Symbol).
> 
You convinced me. VFS it is, then. . More work ahead.

Thanks
Alex



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Advice sought on design of a db of linked lists of linked lists of bitmaps?

2003-07-11 Thread Jeremy Neal Kelly
"alexrousseau_jta" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]

> I forgot to ask: When you say "marginally slower", is it
> still fast enough to load a 2-bit-depth 160x160 bitmap
> in 250ms or less?

I'm glad to be of service! As for the 'slowness', my (rough) understanding
is that it has to do with the write protection affecting the storage area;
database operations need to account for this, whereas operations on the
dynamic heap do not. (Perhaps there is other upkeep associated with
databases -- someone else could better answer that.) Anyway, this upkeep
occurs at the record level, and once it is accomplished, read and write
operations take place (I believe) at the same speed they would on the
dynamic heap. Therefore, an application processing many small records likely
would demonstrate a performance loss from using databases, but one such as
yours with (relatively) few records will not. Would someone care to confirm
my thinking here?

As for loading your bitmaps in a quarter-second -- well, I haven't actually
tried it, but I'd be surprised if it were any slower than that.


Best regards,

Jeremy Neal Kelly
Software Engineer
Peapod




-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Advice sought on design of a db of linked lists of linked lists of bitmaps?

2003-07-11 Thread Chris Tutty
I think Hal's point (and it's one I agree with) is that rather
than have your interface code work directly with the database and
record calls that you wrap the database in a module that exposes
the objects in an abstract way.  I've got into the habit of doing this
with every database - you end up with a fairly standard set of
Initialise, Open, GetFirstx, GetNextx, GetxByIndex, Savex,
Createx calls - and have found it very useful later when altering the
way the data is stored or indexed.

As well as covering Hal's point about allowing the data to exist
in a database or VFS I've also found that it simplifies changes to
the database structure.  As an example, I recently had to extend
a database to store two types of record.  Because I'd created
a wrapper module the code using the existing record type didn't
change at all.  This is fairly standard code modularity, so this isn't
a revolutionary suggestion, just a reminder that doing things
properly will save you time in the long run.

Chris Tutty

From: "alexrousseau_jta" <[EMAIL PROTECTED]>
> Thanks for your good advice. I am completely ignorant of VFS
> (still focusing on OS 3.5+ support at this time).
>
> How would it help the user if I supported VFS?
>
> Also, I intend to support OS3.5+ and I guess that I'll still
> need a Dm-conversant layer in there, like you did.
>
> Thx!
> Alex
>
>
>
>
> Hal Mueller <[EMAIL PROTECTED]> wrote:
> > I needed some similar linking in one of my products.  I also did
> > _not_ need record categories.  So I ended up using the category
> > support to designate my record type.  Where you have addresses of
> > records, I used record IDs (supplied my own record ID).
> >
> > I ended up with an enumerated type that listed all of the record
> > types, and a sort routine that sorted records by category (and then
> > appropriately within category).  I also tagged "first polygon
> > index", "first line index", etc to boost lookup speed.
> >
> > I suggest you design from the beginning with VFS in mind.  For me,
> > this meant writing two levels of encapsulation routines for record
> > access (e.g. FindPolygon(database, poly #), FindLine(database, line
> > #), GetRecordHandle(datbase, recordIndex)).  The lower level of
> > routine chose either Dm or VFS calls, depending on where the
> > database was located (VFSFileDBInfo/DmDatabaseInfo,
> > VFSFileDBGetRecord/DmGetRecord).  I also wrote my own VFS version
> > of DmFindSortPosition.  I don't do any on-device editing of these
> > databases, but if I did I would want to transparently copy a VFS DB
> > to RAM, work with it, and then return it to RAM (allowing for the
> > possibility that power could die or card could be removed at any
> > moment).
>
>
>
> -- 
> For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Advice sought on design of a db of linked lists of linked lists of bitmaps?

2003-07-11 Thread alexrousseau_jta
Hi,

Thanks for your good advice. I am completely ignorant of VFS
(still focusing on OS 3.5+ support at this time).

How would it help the user if I supported VFS?

Also, I intend to support OS3.5+ and I guess that I'll still
need a Dm-conversant layer in there, like you did.

Thx!
Alex




Hal Mueller <[EMAIL PROTECTED]> wrote:
> I needed some similar linking in one of my products.  I also did 
> _not_ need record categories.  So I ended up using the category 
> support to designate my record type.  Where you have addresses of 
> records, I used record IDs (supplied my own record ID).
> 
> I ended up with an enumerated type that listed all of the record 
> types, and a sort routine that sorted records by category (and then 
> appropriately within category).  I also tagged "first polygon
> index", "first line index", etc to boost lookup speed.
> 
> I suggest you design from the beginning with VFS in mind.  For me, 
> this meant writing two levels of encapsulation routines for record 
> access (e.g. FindPolygon(database, poly #), FindLine(database, line 
> #), GetRecordHandle(datbase, recordIndex)).  The lower level of 
> routine chose either Dm or VFS calls, depending on where the
> database was located (VFSFileDBInfo/DmDatabaseInfo, 
> VFSFileDBGetRecord/DmGetRecord).  I also wrote my own VFS version
> of DmFindSortPosition.  I don't do any on-device editing of these
> databases, but if I did I would want to transparently copy a VFS DB 
> to RAM, work with it, and then return it to RAM (allowing for the 
> possibility that power could die or card could be removed at any 
> moment).



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Advice sought on design of a db of linked lists of linked lists of bitmaps?

2003-07-11 Thread alexrousseau_jta
--- "Jeremy Neal Kelly" <[EMAIL PROTECTED]> wrote:
> Perhaps you've already written code that uses linked lists,
> but in case you haven't, let me ask: why do you need them?
> Why not manipulate the data directly in the databases? This
> type of access is marginally slower, but if I understand the
> purpose of your application, the difference shouldn't be
> noticeable.
...


I forgot to ask: When you say "marginally slower", is it
still fast enough to load a 2-bit-depth 160x160 bitmap
in 250ms or less?

If not, I guess I'll have to use some form of cache...
Shouldn't be too hard in this case though because I only
need to pre-load the frames that make up a shot, and
there's rarely more than 5 or 6 per. Also, shots usually
last 1 second or more, so that should give me ample time
to preload the next shot's constituent frames.

Only thing that worries me is the jog shuttle response. TBC...

Thanks once more
Alex



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Advice sought on design of a db of linked lists of linked lists of bitmaps?

2003-07-11 Thread alexrousseau_jta
--- In "Jeremy Neal Kelly" <[EMAIL PROTECTED]> wrote:
> > It's certainly possible to save your linked lists in a database,
> > but the only method I know of is quite tedious. If you like,
> > I'll write it up for you; otherwise, perhaps someone has a neat
> > trick for doing this.
> 
> Er... as you can see, I went ahead and did just that; this paragraph
> should've been edited out. Sorry for the confusion!
> 
>  ~ J.

What confusion ?! Your explanation was pure gold. Your comment on
unexpected resets convinced me to go the easier way (as did your
explanation BTW :).

Thanks a lot for your help!
Alex



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Advice sought on design of a db of linked lists of linked lists of bitmaps?

2003-07-11 Thread Jeremy Neal Kelly
> It's certainly possible to save your linked lists in a database, but the
> only method I know of is quite tedious. If you like, I'll write it up for
> you; otherwise, perhaps someone has a neat trick for doing this.

Er... as you can see, I went ahead and did just that; this paragraph
should've been edited out. Sorry for the confusion!

 ~ J.




-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Advice sought on design of a db of linked lists of linked lists of bitmaps?

2003-07-11 Thread Jeremy Neal Kelly
Perhaps you've already written code that uses linked lists, but in case you
haven't, let me ask: why do you need them? Why not manipulate the data
directly in the databases? This type of access is marginally slower, but if
I understand the purpose of your application, the difference shouldn't be
noticeable. I would mimic the traditional 'relational' design by creating
five 'tables', each in a different database:

  ClipHdr
  ---
  ClipID
  Author
  Notes

  (One record per ClipID)

  ClipDtl
  ---
  ClipID
  ShotID

  (Multiple records per ClipID, with a different ShotID in each one; ClipIDs
are contiguous)

  ShotHdr
  ---
  ShotID
  Duration

  (One record per ShotID)

  ShotDtl
  ---
  ShotID
  FrameID

  (Multiple records per ShotID, with a different FrameID in each one;
ShotIDs are contiguous)

  Frame
  -
  FrameID
  Bitmap

  (One record per FrameID)

That's a lot of databases, but your app should be easier to code, and
there's no need to restore the data on start or save on close -- changes are
saved as the user makes them. (As a corollary, consider this: what happens
to the data in your linked list if the app fails or if the device is reset
for some reason?)

It's certainly possible to save your linked lists in a database, but the
only method I know of is quite tedious. If you like, I'll write it up for
you; otherwise, perhaps someone has a neat trick for doing this.

If you simply must use linked lists, you can add a set of 'ID' fields to
your item structures, one for each link pointer. Before saving, assign a
unique ID value to each item, and propagate this ID value to every
referencing item in the lists. Next, create a database record for each item,
starting with a 'type' value (to identify the type of item being stored),
and continuing with the contents of the item, substituting the ID fields for
the link pointers. To restore your lists from this database, create and load
an appropriate item structure for each record, then iterate each list and
assign the link pointers, using the ID fields to determine the correct
links. What a nightmare!

Good luck,

Jeremy Neal Kelly
Software Engineer
Peapod


"Alexandre Rousseau" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> Hi,
>
> title says it all, though cryptically perhaps.
>
> I am writing a mini storyboarding application and am
> about to embark on the persistence part of the project.
> And I need some advice on how to structure my db(s?)
> for this.
>
> So far, I have structured my data as follows:
>
> - the db will contain 0, 1, or more clips
> - each clip contains 0, 1, or more shots
> - each shot contains 0, 1, or more frames
> - each frame contains bitmap data
> - shots form a double-linked list
> - frames within a shot form a double-linked list
>
> i.e.
>
> typedef struct
> {
>   char author[80],
>   char notes[1024],
>   shot * head;
> }
> clip;
>
> typedef struct
> {
>   int duration;
>   frame * head;
>   shot * next;
>   shot * prev;
> }
> shot;
>
> typedef struct
> {
>   BitmapPtr data;
>   frame * next;
>   frame * prev;
> }
> frame;
>
>
> Any advice would be much appreciated.
>
> Thanks
> Alex



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Advice sought on design of a db of linked lists of linked lists of bitmaps?

2003-07-10 Thread Alexandre Rousseau
Hi,

title says it all, though cryptically perhaps.

I am writing a mini storyboarding application and am
about to embark on the persistence part of the project.
And I need some advice on how to structure my db(s?)
for this.

So far, I have structured my data as follows:

- the db will contain 0, 1, or more clips
- each clip contains 0, 1, or more shots
- each shot contains 0, 1, or more frames
- each frame contains bitmap data
- shots form a double-linked list
- frames within a shot form a double-linked list

i.e.

typedef struct
{
  char author[80],
  char notes[1024],
  shot * head;
}
clip;

typedef struct
{
  int duration;
  frame * head;
  shot * next;
  shot * prev;
}
shot;

typedef struct
{
  BitmapPtr data;
  frame * next;
  frame * prev;
}
frame;


Any advice would be much appreciated.

Thanks
Alex


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/