Tao’s Blog

  • Tao said: I twit, 20 minutes ago
  • Tao said: Aha 7 days ago

Sunday, March 25, 2007

DST trouble and fix [Tips] — tao @ 12:47 pm

The new DST (Daylight Saving Time) scheme took effect on March 11. All major operating systems for desktop, laptop, and handheld, are updated by the vendors. However, those old OSes, legacy systems, were left out by the vendors.

One of my Powerbook G4 laptop computer runs Jaguar, aka Mac OS X 10.2. Unfortunately, Apple decided to ignore this old OS, in favor of the newer Panther (OS X 10.3) and Tiger (OS X 10.4).

Similarly, Microsoft decided to leave Windows 2000 users in the dark.

Search for the internet, someone did make third party patches for both system:

Jaguar (Mac OS X 10.2)

According to Fix for DST on Jaguar (OS X 10.2) web page, you download the script patch-jaguartz.sh, then, open the shell script,

Changing the line

OLSON=2007a

to something like

OLSON=`curl -s ftp://elsie.nci.nih.gov/pub/|perl -ne '/tzdata(.....)/ && print "$1\n"' -`

Then, run the script,

sudo sh mypatch-java-zi-dir.sh

Of course, change the permission to allow execution by chmod + x to the script.

Windows 2000

It is much easier. Just download and run this patch.

Windows 2000 DST Patch

Windows Mobile 2003

I just get lazy, never bother with downloading the patch. I just manually changed the time zone from -5 Eastern to -4 Atlantic time. In November, I will change it back to -5 Eastern time zone.

Some new photos of my son [Digital Life] — tao @ 12:15 pm

In the middle of March, there was a snow. As much as I hate snow (ever since I purchased a car, that is), my son seems quite enjoy the white stuff. Along with some photos we took after the New Year, they are posted here.

Click the thumbnail to see the whole album

Sunday, March 18, 2007

eBook file formats detail [Tips] — tao @ 1:44 pm

Detail information about Mobipocket ebook format

Information about eReader format, and the markup language of eReader

To convert text files to eReader

PML Palm Reference eBook

Palm’s PML Reference

Palm Markup Language: Marking Up and Licensing

Saturday, March 17, 2007

Make ebooks for eReader and Mobipocket Reader [Tips] — tao @ 11:48 am

I use UltraEdit to process my text files, DropBook to make eReader books, and Mobipocket Creator to make Mobipocket books.

Html files

The most important tags are those for italic, bold, and chapters. So the fist step is to preserve those tags, and remove all other junk tags later.

1. Replace all instances of <i> with <i>#openitalic#, </i> with #closeitalic#</i>
2. Replace all <b> with <b>#openbold#, </b> with #closebold#</i>
3. Tag chapters with #openchapter# #closechapter# pairs

Then, transfer the html content to text file:

1. Open the resultant html file in Internet Explorer
2. Select all, copy and paste to UltraEdit
3. Remove all instances of anti-slash characters
4. Save as txt file
5. Remove all instances of double space to a single space, repeat until all instances of double spaces disappear
6. Remove all excessive hyphens. Replace all three hyphens to two hyphens, until nothing is found
7. Remove excessive blank lines. Replace all line breaks followed by a space by a single line break, repeat to end
8. Replace all instances of consecutive four line breaks with three line breaks, repeat until nothing left
9. Remove all empty pairs of italic and bold with nothing. Empty pairs can have a space or line break in between. Check all variations.
10. Double check for four continuous line breaks until nothing is found.

Now, branching for Mobipocket Reader and eReader. Save the resultant files as pml for eReader, and html for Mobipocket Reader. Before branching, double-check to make sure that there is no wrong line break inside the file. An easy way to check is to use the regular expression to search if any [a-z] in the beginning of the line.

For eReader:

1. Replace all instances of … or . . . to \a133
2. Replace all instances of double hyphens to \a151
3. Use \x pairs to replace #openchapter# #closechapter# pairs
4. Use \i pairs to replace #openitalic# #closeitalic# pairs
5. Use \B pairs to replace #openbold# #closebold# pairs
6. Make titles with \vTITLE=”Book Name”\v
7. If necessary, use \c\w=”30%”\c to replace the middle page divisions
8. Make eReader book with DropBook. Make sure don’t select the Dictionary option

For Mobipocket Reader:

1. Tag title with <h1></h1> pairs
2. Replace #openitalic# #closeitalic# with <i></i> pairs
3. Replace #openbold# #closebold# with <b></b> pairs
4. Replace #openchapter# #closechapter# with <h2></h2> pairs
5. Replace all instances of … or . . . to … (&hellip;)
6. Replace double hyphens with — (&mdash;)
7. Replace all three line breaks with <br><br><br>line break<p>line break
8. Replace all double line breaks with double line break <p>
9. Add remaining html tags, such as <html> <head> <body> pairs.
10. Make ebook with Mobipocket Creator. Create Table of content with <h2> tags.

Review and debug both books with corresponding desktop readers.

Text files

There are two kinds of text files, those text files with hard line breaks at each screen line, such as Project Gutenberg etext, or those without those screen line breaks.

First, Project Gutenberg etext:

1. Remove excessive space characters. Replace all double spaces with a single space character, repeat until none is found
2. Protect the single line break you wish to preserve, such as those at the end of each stanza of poetry or table of contents, with a “//” character combination
3. Replace line break with a space with a single line break
4. Replace three line breaks with #longbreak# characters
5. Replace two line breaks with $$$$$ characters
6. Replace a single line break with a space character
7. Replace two consecutive spaces with a single one
8. Restore $$$$$ back to two consecutive line breaks
9. Restore #longbreak# with three consecutive line breaks
10. Replace all line break with a space with a single line break
11. Replace four consecutive line breaks with three ones, repeat until none is found
12. Restore those single line breaks, replace all “//” with a single line break
13. Replace all line break with a space with a single line break
14. Search for any anti-slash characters and correct it

Now the text is ready for Mobipocket Creator or eReader DropBook.

For those without screen line breaks text files, it would be quite easy:

1. Replace two consecutive space characters with a single one
2. Replace a line break followed by a space with a single line break
3. Replace four consecutive line breaks with three ones, repeat until none is found
4. Make sure paragraphs are separated by two consecutive line breaks
5. Search for any anti-slash characters and correct it

Now the text file is ready for Mobipocket Creator or eReader DropBook.

To make eReader ebook:

1. Replace all instances of … or . . . to \a133
2. Replace all instances of double hyphens to \a151
3. Replace _ with \i characters
4. Add title with \vTITLE=”book title”\v
5. Add chapters with \x pairs
6. Make ebook with DropBook

To make Mobipocket ebook

1. Tag title with <h1> pairs
2. Tag chapters with <h2> pairs
3. Replace all instances of … or . . . to … (&hellip;)
4. Replace double hyphens with — (&mdash;)
5. Replace space and _ with <i>, _ and space with </i>, however, sometimes the underscore is not well formatted, in such as, you can either remove all underscore characters, or, keep them as is
6. Replace all three line breaks with <br><br><br>line break<p>line break
7. Replace all double line breaks with double line break <p>
8. Add remaining html tags, such as <html> <head> <body> pairs.
9. Make ebook with Mobipocket Creator. Create Table of content with <h2> tags.

Just remember, Mobipocket ebooks should be in /Ebooks folder, eReader should be in /Palm/Books folder.

Sunday, March 11, 2007

eBooks [Tips] — tao @ 1:21 pm

Formats

I mainly use PalmDoc format ebooks. It is free of any sort of DRM (digital rights management, nasty staff). It is essentially a compressed form of plain text file. It was first introduced for Palm Pilot, and it is very popular in PDA world, even Mobipocket Reader for Windows Mobile supports this format. So you can say it is the most versatile, cross-platform, and the most compatible ebook format after the good old plain vanilla text file.

Another DRM-free ebook format is Palm Plucker. It is a kind of compressed html reader, you can use the desktop software to grab a whole website, compress it, and load on your Palm handhelds.

Unfortunately, not all books are freely available as plain text and html formats. Other than DRM-free PalmDoc format ebooks, I also read eReader and Mobipocket format ebooks.

Software

Palm Reader, or eReader

A couple of years ago, I came across a wonderful ebook reader, Peanut Reader. At that time, I was using my ancient monochrome PDA, Palm IIIx. From today’s point of view, Palm IIIx is very slow, the monochrome screen is extremely difficult to read, the screen has terrible contrast. After an hour of reading, your eyes would start bleeding. Even with this slow PDA, Peanut Reader managed to give me a surprisingly good performance. My Palm IIIx feels very fast when reading with Peanut Reader.

Later on, Palm acquired the Peanut Press, and later, the Peanut Reader changed name to Palm Reader, and later on, they added Pocket PC support, and changed name again to eReader.

For a long time, I am quite satisfied with Palm Reader. On the Palm platform, the Palm Reader application is very much, dictionary look up is quite responsive. I purchased a copy of Merriam-Webster Collegiate Dictionary, 11th edition for the Palm Reader. It is an awesome combination to read ebooks.

Mobipocket Reader

Later, New York Public Library (NYPL) started to lend ebooks online. NYPL chose Mobipocket as the standard Palm ebook format. With no alternative, I installed Mobipocket reader on my Palm handhelds.

I am not impressed by the Mobipocket reader. At least on Palm platform, it is sluggish, very slow, and poorly documented. It crashed often. Compared to it, Palm Reader is rocket solid and fast. The only decent dictionary for Mobipocket reader is the Concise Oxford English Dictionary. The dictionary itself is good, but the looking up is very slow.

Later, I upgraded to version 5.2. It crashes less often, some of the most egregious bugs have been eradicated. But it is still not as stable and fast as Palm Reader.

I installed Mobipocket reader on all three handhelds: a Palm Tungsten T2, a Palm Tungsten E, and a Mio 168 RS GPS/Pocket PC combo unit, which runs Windows Mobile.

Then I discovered that the performance of Mobipocket Reader on Windows Mobile is much better than that on the Palm. One possible explanation is that Mobipocket’s programmers are better with Windows Mobile programming than with Palm programming, or the Windows Mobile devices generally have better hardware than those of Palm devices. Both explanations are quite possible. The bottom line is, Mobipocket Reader for Windows Mobile is much better than Mobipocket Reader for Palm.

Anyway, Windows Mobile version of Mobipocket Reader is quite responsive. Also, unlike Palm Reader, Mobipocket Reader is free on all platforms. In comparison, Palm Reader only has a stripped down free version for each platform. The free version does not have the capacity to look up dictionaries. For dictionary lookup, you need a Pro version, which cost $10. If you use different platforms, you need to pay for each platform. So in the end, Mobipocket reader is a more economic solution if you want to read ebooks on multiple platforms.

Mobipocket Reader user interface is configurable, you can assign the hardware buttons for different purpose. Palm Reader lacks this ability. You can only use the 5-way navigator to turn pages.

Palm Plucker

Another ebook format is Palm Plucker. I mainly use it for grabbing a whole web site, or part of a web site, and load it to my Palm handhelds. It is a very stable and fast application for Palm platform. The user interface is highly configurable. Among all the ebooks readers, Palm Plucker’s interface is the most configurable, even more so than Mobipocket Reader.

Formatting of ebooks

There are several sources of my ebooks. First, I download from Project Gutenberg. Project Gutenberg books are all plain text format, but it has hard carriage return characters for each screen line, and it uses two consecutive carriage returns for paragraph breaks, which can be quite ugly while reading on a PDA screen. So, after downloading the text file, I will manually format it to suit for PDA reading.

I usually use the following procedures to format Project Gutenberg text books:

1. Protect the paragraph breaks by replacing all two consecutive line breaks to some unusual character combinations, such as $$$$$. Repeat the procedures until no two consecutive line breaks remain.
2. Replace all remaining single line breaks with a space.
3. Replace all consecutive spaces to a single space character. Repeat until no consecutive spaces remain.
4. Restore the paragraph breaks by replacing all $$$$$ to two line breaks.
5. Save the formatted text file with another name.
6. Convert the formatted text file with MakeDoc for Windows software. This software generate PalmDoc files from text or html files. The right settings for make text PalmDoc files is: first, in advanced tab: clear “Ignore single line-breaks”, then, go to Line breaks tab: set “Remove LF (0x0A) characters”.

Sometimes, I can download ready made html files. The easiest way to convert these html files to PalmDoc is:

1. Open the html file with Internet Explorer.
2. Select all, and copy.
3. Open text editor, such as UltraEdit, paste the text to it.
4. Remove excessive line breaks. In this case, there is no single line breaks for each screen line, only two consecutive line breaks for each paragraph.
5. Make PalmDoc files using MakeDoc for Windows.

With html files, one can also use MakeDoc for Windows to directly convert the html file to PalmDoc. The resultant PalmDoc will have html tags. Mobipocket Reader can open the html tagged PalmDoc files, and render the formatting accordingly. The in file anchors may not work properly, but the formatting will be preserved, such as italics, bold, etc.

I purchase from eReader.com, Mobipocket.com, or Fictionwise.com. Of course, the purchased ones are simple, load the to the memory card, plug into your PDA, and start reading.

Install ebooks on storage card

Most likely, all the ebooks will be stored on storage cards to be used on PDA. The locations of the ebooks files are fixed.

For Mobipocket Reader, the ebooks pdb files should be stored at /Ebooks/

For Palm Reader, the pdb files should be stored at /Palm/Books/

For Palm Plucker, the pdb files should be stored at /Palm/Ebooks/

     

0.049 Hosted by tongtao.com and powered by WordPress cBlog