2006-06-27 03:18:31 - Book Oddities

I've been plugging away at making Newton X Press - its quite fun to see things come together!

In deciphering output from Newton Press - I've noticed some odd things:

In the document Newton Formats 1.1, one is told that dates are stored in a 4 byte, unsigned integer number on disk. This number is the number of seconds since the midnight Jan 4th, 1904. They LIE!!!! This number is the number of MINUTES since jan 4th 1904. This one was rather confusing at first as all of the common tools for dealing with timestamps of this sort expect a value in seconds :-/

Newton press has a really twisted sense of what "title" and "long name" should mean. Newton books, as interpreted by my mp2100 have 3 different names in them. The package name - which is part of the package header, and required by every package, and two entries in the book specific section of the package, "title" and "shortTitle". On my mp2100 - the name that shows up in Extras is the shortTitle, the name of the book shown by opening the book, tapping the i button, and tapping "about" is the title, and when one uses a tool like PkgInfo by TKnollsys to get information about the package, one sees the package name.

So it would make sense to me to put the full name of the book in ackageName and title, while putting the extras icon name in shortTitle. NewtonPress even has two name fields you can enter, title and long name. What does it do? it makes PackageName = long Name and both shortTitle and title = the title you enter. Note that this means one cannot normally see what one puts in LongName, and the shorter icon name is all one can find on the newton side. Does this strike anyone else as completely backwards?

I'm uncertain if NOS 1.x devices work in the same manner. Regardless, Newton X Press will let you specify these three names separately, and the input boxes will be named in a manner that makes it clear which name shows where on a newton.

Someone on this list mentioned that having a feature to easily make backdrop image packages for Avi's backdrop would be useful, so I will be looking at incorporating such into Newton X Press.


Comments:

1. J. Tyler Nichols
Tue, 27 Jun 06 03:19:53 -0700 by Site Admin

J. Tyler Nichols wrote:

They LIE!!!! This number is the number of MINUTES since jan 4th 1904.

Correction: the number for a date stored in book packages is actually the number of minutes from midnight Jan 1st 1904 - so Newton Formats 1.1 has both what unit of time is counted, and the date from which they start counting - yeesh!

2. Woody Smith
Tue, 27 Jun 06 03:20:56 -0700

Thank you for the update, its good to hear that you are making progress. I for one am looking forward to Newton X Press.

3. Eric W. Brown
Tue, 27 Jun 06 03:22:27 -0700

J. Tyler Nichols wrote:

In the document Newton Formats 1.1, one is told that dates are stored in a 4 byte, unsigned integer number on disk. This number is the number of seconds since the midnight Jan 4th, 1904. They LIE!!!! This

number is the number of MINUTES since jan 4th 1904. This one was rather confusing at first as all of the common tools for dealing with timestamps of this sort expect a value in seconds :-/

AFAIR the spec is actually correct with regard to seconds versus minutes; it's Newton Press that's wrong here. All those other tools (and I believe MessagePads, too) expect the value in seconds because that's what it's really supposed to be.

That was actually one of the "real world gotchas" that was in the Newton Book project I assigned in class at BU -- a case where one of the most popular pieces of software using the spec actually goofs up and forgets a factor of sixty. It's just a bug in Newton Press.

For parsing the books and giving something approximating the correct date we look for the Newton Press creator credit blurb and (if present) adjust the time appropriately.

4. Dan
Tue, 27 Jun 06 03:24:04 -0700

Woody wrote:

Thank you for the update, its good to hear that you are making progress. I for one am looking forward to Newton X Press.

As am I. And if you ever figure out multiformats (classic, MP2000 portrate, Landscape, Emate, etc). Do let us know. That has been one nut that I have not cracked for quite a while. But then I was trying to get the current software to make them. I still think that they have, or were planning on adding it in the next release of the Bookmaker and or Press. You can select which format via taping the i then the prefs which you can choose the display size. But with the current tools it is not possible (perfectly anyway) to add more formats with the current tools. I did mange to get them to work with bookmaker somewhat but the pagination was not perfect and you would loose a few lines every few pages depending on what format you were using. I never did figure out how to get past this, though I did come close.

5. Morgan Aldridge
Tue, 27 Jun 06 03:24:55 -0700

I too am glad to hear a progress update. I know the feeling well of when things finally start to fall into place (even just a little bit), it's great!

Keep up with it. It's a tool that many of us will be happy to have at our disposal!

6. Matt K.
Tue, 27 Jun 06 03:25:32 -0700

Great work, James! I'm also looking forward to Newton X Press, and I hope this will not be a tool solely for the Apple people to use!

Keep up the good work!

7. J. Tyler Nichols
Tue, 27 Jun 06 03:28:15 -0700 by Site Admin

All I know is that the numbers for the creation date, modification date and publish date (the first two being part of the package header, not the book Part) as stored on disk, from Newton Press are minute counts, not second counts. The odd thing is that the Newton treats them as minutes as well - perhaps if the value is below a cutoff, the newton recognizes that the value is in an odd format and handles it differently than if it were in seconds like it should be. I'll have to experiment with putting larger, obviously second count values into the packages and see how the newton reacts.

Come to think of it, I wonder if BookMaker handles date stamps correctly.

8. Eric W. Brown
Tue, 27 Jun 06 03:32:02 -0700

J. Tyler Nichols wrote:

All I know is that the numbers for the creation date, modification date and publish date (the first two being part of the package header, not the book Part) as stored on disk, from Newton Press are minute counts, not second counts. The odd thing is that the Newton treats them as minutes as well - perhaps if the value is below a cutoff, the newton recognizes that the value is in an odd format and handles it differently than if it were in seconds like it should be. I'll have to experiment with putting larger, obviously second count values into the packages and see how the newton reacts.

Interesting. I'm about 99% sure (it was quite awhile ago) that when I first tested it on a Newton I saw the dreaded "1904" date confirming that it was indeed a bug in Newton Press using minutes rather than seconds. I was pretty careful with it as I was assigning it as a class project, but it is possible that I goofed.

My guess would be that books created with the bug became so widespread that later versions of the OS just auto-detected Newton Press and calculated the timestamp accordingly, probably the same way I do it in the Mozilla Newton Book Reader. Now you've aroused my curiosity though and I'll have to try and go back and check on as many different Newtons as I can get my hands on (not too many, I'm afraid).

The modification date isn't the only field in the package header not mentioned in the Newton Formats spec -- there's also a variable length record in the variable length data area that's used informally for giving the creation program credit. For Newton Press, it always says "Built with Newton Press" (without the quotes). With the Newton Book Reader, I check for that marker and convert to seconds if I find it.

J. Tyler Nichols wrote:

Come to think of it, I wonder if BookMaker handles date stamps correctly.

That's a good idea... I've always assumed that it was a Newton Press only type of thing, and didn't explicitly test that field with BookMaker (we really just used Newton Press for class).


Add a comment:



Please use BBCode markup:
[url=http://blah.com]clickhere[/url], [quote=bob]blah[/quote], [quote]anonymous blah[/quote], [img=http://blah.com/smily.gif], [b]bold[/b],and [i]italic[/i].