the difference between formats?

28 views
Skip to first unread message

lennart

unread,
Dec 11, 2009, 4:52:31 AM12/11/09
to Notecase Pro
What is the difference between the ncd, ncdb and ncz format? The e for
encrypted is clear. But when is it better to use the database file and
what is the advantage of the ncd? Portability or plain-text?

marbux

unread,
Dec 11, 2009, 6:39:53 AM12/11/09
to noteca...@googlegroups.com
.ncz is the same format as .ncd, but the file is compressed so takes
less disk space. It's most appropriate when a document is fairly
stable but large enough to consider the bandwidth required to
distribute it. E.g., the NoteCase Pro Help file is distributed in .ncz
format.


.ncd is a subset of HTML 4 plus some needed custom markup tags written
as HTML comments. E.g., here is a node property written in .ncd as a
HTML comment:

<!--property:icon_internal=folder-->

.ncdb is a SQLite database file rather than a flat HTML file.

.ncdb is more appropriate if you have really large files, e.g., a
photo album. With SQLite, only the particular record is updated when
you make a change in the document. So if file save times are a weighty
consideration, .ncdb is probably what you need.

But a caveat that with .ncdb or .ncde (the encrypted counterpart), you
need to occasionally run the Compact action found on the File Menu's
Document sub-menu. Database files become fragmented as records are
updated. The Compact action defrags the file.

Another factor to consider when choosing among the natively-supported
file formats is the recoverability of data in the event of file
corruption. With the encrypted formats and NCZ, it is unlikely that
you will be able to recover data from a corrupted file.

With .ncdb, chances of recovery are much better but you may need to
find someone who really knows SQLite to assist you.

With .ncd, the files can be opened (and edited) in a plain text
editor. (But a warning that NoteCase Pro does not accept unsupported
HTML markup.) The world is awash with people who understand HTML
markup, so your chances of recovering from file corruption are
probably best with .ncd.

Moreover, many HTML utilities can also be used with .ncd directly,
e.g., link checkers and the HTML Tidy validator. I've found the
KLinkStatus link checker a handy adjunct to use of .ncd files on
Ubuntu. <http://klinkstatus.kdewebdev.org/>. It can check both
internal and external links.

Any of the natively-supported formats can be converted to another of
those formats by using Save As or Export. (You'll probably want to
delete the original after doing this.)

I normally work with .ncd format, and confine my use of encrypted
formats to only those documents that really need it (storing
passwords, etc.).

Please let me know if you need more detail.

Best regards,

Paul





--
Universal Interoperability Council
<http:www.universal-interop-council.org>

Miro

unread,
Dec 11, 2009, 8:41:47 AM12/11/09
to Notecase Pro
Came late to the party.
Paul summarized the things nicely, thanks.

Regards,
Miro

lennart

unread,
Dec 11, 2009, 9:56:59 AM12/11/09
to Notecase Pro
Good explanation. Thanks!

One more question: do i need some extra support like a SQL server when
i use the ncdb file?

On 11 dec, 12:39, marbux <mar...@gmail.com> wrote:

Miro

unread,
Dec 11, 2009, 11:02:48 AM12/11/09
to Notecase Pro
No need for SQL server. Sqlite database (http://www.sqlite.org/) does
not use client/server architecture.
Entire code needed is contained within Notecase Pro executable.

Daniel H

unread,
Dec 12, 2009, 3:06:16 PM12/12/09
to Notecase Pro
Hi Paul, hi Miro,

On 11 Dez., 12:39, marbux <mar...@gmail.com> wrote:
> But a caveat that with .ncdb or .ncde (the encrypted counterpart), you
> need to occasionally run the Compact action found on the File Menu's
> Document sub-menu. Database files become fragmented as records are
> updated. The Compact action defrags the file.

I have never worked with the ncdb format yet, but you remark raises
the idea:
What about an auto-compact feature?
On every 10th save action for example, or less frequently?
Maybe, if compacting can take a long time and the user may be annoyed
if this is done automatically on every n-th save action, instead
present a dialog box to the user "It is recommended to compact the
file now [OK] [Remind me later] [Dismiss]"...

That way, users who do not know about compacting being necessary to
keep the file clean (and small?) do not end up with too fragmented
(and large?) files.


daniel

Miro

unread,
Dec 13, 2009, 2:07:58 AM12/13/09
to Notecase Pro
Hi Daniel,

> What about an auto-compact feature?
> On every 10th save action for example, or less frequently?
> Maybe, if compacting can take a long time and the user may be annoyed
> if this is done automatically on every n-th save action, instead
> present a dialog box to the user "It is recommended to compact the
> file now [OK] [Remind me later] [Dismiss]"...
>
> That way, users who do not know about compacting being necessary to
> keep the file clean (and small?) do not end up with too fragmented
> (and large?) files.

The problem is that the compacting can take a while on a big file, and
the fragmenting is probably not related to the number of save actions.
I hoped that sqlite database can return some percentage of
fragmentation, this would give a good indicator to decide when the
user should be notified. I haven't been able to find anything so far,
but I'll keep looking.

Regards,
Miro

marbux

unread,
Dec 13, 2009, 3:31:58 AM12/13/09
to noteca...@googlegroups.com
On Sat, Dec 12, 2009 at 11:07 PM, Miro <mra...@hotmail.com> wrote:
> Hi Daniel,
>
> The problem is that the compacting can take a while on a big file, and
> the fragmenting is probably not related to the number of save actions.
> I hoped that sqlite database can return some percentage of
> fragmentation, this would give a good indicator to decide when the
> user should be notified. I haven't been able to find anything so far,
> but I'll keep looking.

Might SQLite return a count of records updated? I'm not sure, but I
suspect that this might be a workable surrogate for percentage of
fragmentation, i.e., throw the message box question when X number of
records have been updated.

I like the idea of a nag screen for those unaware of the fragmentation
issue or its cure, or those who are forgetful like me. :-)

But perhaps a "Don't show this screen again" option on the nag screen
for those who would prefer to initiate the Compact action manually?
And the nag screen might also include the message: "You can defragment
this document later using the File > Document > Compact Document
action."

Miro

unread,
Dec 13, 2009, 6:33:32 AM12/13/09
to Notecase Pro
I found of possible algorithm to calculate fragmentation percentage
described here:
http://sugelan.co.uk/popfile/download/test/defragment.txt

I plan to investigate this.

Regards,
Miro

On Dec 13, 9:31 am, marbux <mar...@gmail.com> wrote:

marbux

unread,
Dec 13, 2009, 8:09:50 AM12/13/09
to noteca...@googlegroups.com
On Sun, Dec 13, 2009 at 3:33 AM, Miro <mra...@hotmail.com> wrote:
> I found of possible algorithm to calculate fragmentation percentage
> described here:
> http://sugelan.co.uk/popfile/download/test/defragment.txt
>
> I plan to investigate this.

Cool. I hope it works for the purpose.
Reply all
Reply to author
Forward
0 new messages