Reading PDF files on a portable device

This is a holy grail for people who want to carry their libraries in their pockets and read without glasses or special lighting. The problem is that a lot of the people who distribute ebooks seem to think that using a page-description language like PDF is a suitable distribution method. But actually reading something formatted for an 8″x6″ page on a 2″x3.5″ screen is difficult.

I have it figured out. I’m not sure if this is something that’s changed recently in the software, or if it was always like this and I was too stupid to figure it out.

I’ve asked on several mailing lists, and they seem to have been too stupid to figure it out, too. The best suggestion was from Peter
Flynn
who posted a LaTeX file that resizes the PDF’s pages to be the size of your device, and trims the margins. But on my Nokia N810, I need reading glasses to read the resulting page. You can make a case that I should get better reading glasses, but I don’t think I’d enjoy even good ones.

My new method is as follows:

  • Run:
    pdftohtml -stdout pdf-filename > html-filename
  • open the html-filename in emacs.
  • There are two major problems you want to fix here:
    • Every line in the original ends with a break. The original line-length of the paper book is unlikely to be useful on your portable device, so what you need, and what I’ve always before failed to fine, is a way to distinguish the breaks that are actually new paragraphs from the ones that are just line breaks. For the PDF files I’ve looked at since yesterday, the ones that are just linebreaks end in &nbsp;<br>, and the ones that are new paragraphs end in <br>. So what I’m doing these days is replacing the &nbsp;<br> with just a space. I may decide at some point to replace the <br>‘s with <p>‘s, but so far what I’m doing now looks pretty good.
    • There is junk like page numbers between the pages. This varies by book, but for the book I’m reading at the moment, there was a file url at the bottom of every page and an anchor tag of a line like “dummy 2” at the top of every page. It would be real programming to write something that would continue a paragraph across a page break like this, so I’m putting up with new pages translating to new paragraphs even when they obviously shouldn’t. But I’m using emacs to remove anything that writes some distracting non-text. In this case, that’s removing the file url and the “dummy 2” text. Be careful about the file url — it might not be on a line by itself.

If you’re using FBReader on a device with a sizeable memory card, you’re done. Just put this html file on your device.

Otherwise, do whatever you normally do to sizeable html files (zipping is probably a good idea) and put that on your device.

Marty Sasaki, RIP

[marty from post to his high school facebook page]

Marty from post to his high school facebook page

Marty’s death apparently happened about six months ago.
He stopped posting to his blog
on August 13. His recorder teacher, who told me about it, had
seen him at her student recital (which may have been the one on
September 12) two days before he died.

[marty from fellow photographer's page]

Marty from fellow photographer’s tripod page

We shared a cubicle in 1981-2, when we were both programmers in
the Radiology Department of the Brigham and Women’s Hospital.
Although it was at that point one of the better jobs I’ve ever had
in my life, we both found some of the political aspects of it
frustrating. We would occasionally both get into his car and go
to a hill in Brookline and fly kites.

[One of Marty's kites]

One of Marty’s kites

He was at that point not long out of MIT, and in much better
touch with the cutting edge of programming than I was, so I
learned a lot from him. He was the first person I ever saw using
emacs, and it was his copy of The TEXbook that
introduced me to Donald Knuth and TEX.

When he left that job for another job in the Harvard Medical
Area, he was the first person I ever kept in touch with by email
and a “talk” program that ran on the Vax.

We eventually fell out of touch, but then when I was just
starting to be the Administrator of the Boston Recorder
Society
, I got an email from him (in my capacity as
administrator; we’d neither of us particularly identified as
recorder players when we knew each other). He was thinking about
picking up the recorder again, and wondered if what the BRS was
doing would help. He must have decided that it wouldn’t, because
I don’t think he ever came to one of our meetings, but he did get
involved in other recorder-related activities in the Boston area,
and I occasionally saw him there.

The most recent real conversation we had was when he came as
part of the group that spelled the Cantabile Band at the Walk for
Hunger last year. He was looking quite a bit thinner than when
I’d most recently seen him, and seeming more mobile. We talked
about how much more energy blogging takes than you would expect,
and about the process of winding up the affairs of a dead person.
He was talking to me instead of playing because he’d gotten
frustrated by the playing — most of the other players in the
group were a lot more experienced than he was. But I had a bit
the same sense of returning peace that I remembered from flying
kites on the hill in Brookline.

He will be remembered at a recital on Saturday.
I won’t be able to go, because there’s a memorial service for
another friend at the same time. Having conflicting memorial
services makes me feel old, but that’s another post.

Another Chopin Concert

Judith Conrad, Fortepiano

with the Delight Consort

Sunday, March 7, 2010, 3:00

The Loring Greenough House

Celebrating Fryderyk Chopin’s 200th Birthday

with parlor music by himself and his forbears

Frederic Chopin, whose 200th birthday is March 1st, 2010, played a
square piano in his youth in Poland, and continued to perform on them
in salons and even in concert halls into the 1840’s. And much of his
music was written to be played in parlors which often were equipped
with pianos much like the Loring-Greenough House fortepiano. Judith
Conrad will play a program of the sort that would have been played in
such a parlor on March 7 at 3:00pm, focusing on the smaller-scale
music of Chopin and including music for cello, flute, recorder and
fluegelhorn with Otto Guzman, Frank Fitzpatrick and Paul
Ukleja. Composers in addition to Chopin include Handel, Beethoven,
Marya Szymanowska, Prince Michal Cleofas Oginski and Princess Anna
Maria of Dresden.

The Loring-Greenough House, built in 1760, is located at 12 South
Street (at the Civil War Monument) in Jamaica Plain, MA. It is
wheelchair accessible. For more information on the Loring-Greenough
House, see www.loring-greenough.org.

Tickets are available at the door:
donation $17 ($12 seniors, students and JPTC members) which includes a
“preservation fee”. For further information call Judy Conrad at
508-674-6128 or e-mail judithconrad@mindspring.com.

Program

First Half

Oginski Polonaise ‘Les Adieu a la Patrie’
Maria Szymanowska Piano Fantaisie
Polonaise Chopin wrote for his first piano teacher when he was 11
Chopin Mazurkas
Etude opus 10 no. 2, Cello and piano
Chopin Songs: Smutna Rzeka; Dumka
Song – Maiden’s Fancy, played by ensemble

Second Half

Handel Polonaise
Three Dances from the Polish Renaissance
Beethoven Variations on Hail the Conquering Hero – Piano and cello.
Piano music from the Archives in Dresden, Polonaises and Sonatinas by
and for Princess Anna Amalia c. 1770
Bellini Costa Diva – Paul on Fluegelhornby
Chopin Waltzes, nocturnesby
Martini Plaisir D’Amour – Sung by the audience

The Spare Room

This
book
is about aspects of taking care of a dying person
that I mostly didn’t do with Bonnie.

The main character (Helen) lives near Melbourne, and has a
close friend (Nicola)
with cancer
who lives in Sidney but has found a “clinic” in Melbourne that she
believes will cure her cancer. So she moves in with Helen for the
three weeks the treatment will take.

During those three weeks, Helen has to do a lot of physical
nursing, deal with Nicola’s denying that she is dying, and deal
with Nicola’s refusal to realize that this clinic treatment
she’s getting isn’t going to do any good and she has to go to
real doctors for real treatments.

The writing is good, and the discussion of the issues of how to
deal with a dying person is perceptive. But in the most amazing
paragraph, Helen describes how Nicola organizes her own home care after
Helen finally convinces her that she can’t do it all:

I didn’t know yet how many times I would fly to Sydney to
play my small part in the remains of her care, or how often,
when I buzzed at Iris’s apartment, the door would be opened by
Harriet from Yass, her round, weather-beaten face sweating and
wild with fatigue, or by Marion the Buddhist, white, composed,
and stoic after a five-day stint without relief. I had not
prepared myself to sleep on the floor beside Clare from Byron,
when Iris, half out of her mind, pulled on a backpack and
fled north, on foot, along the coast of New South Wales.

I coule not imagine the urge to start drinking that would
seize me every time I entered the high, airy rooms of the
apartment and found Nicola enthroned on the sofa where, propped
against its hard padded arm, she woke and slept and laughed and
coughed, commanding the stewing of Chinese herbs, planning brown
rice fasts and drastic alkaline diets, turning her face up each
morning to the sun that streamed in through the uncovered
windows. Nor could I foresee that one day, with her swollen
legs resting on a stack of cushions, she would announce
brightly, “I’ve suddenly realized why I feel so terrible — I
must be anemic.” Or how dull my life at home would seem between
my visits to Sydney, how I would write to her on a postcard: “I
miss you. I’m bored. I’d rather be scrubbing shit off Iris’s
bathroom tiles.” For this too would be required of me: like
otherw who served her, whom I came to love in the intimacy of
our labor. I would have to help carry her to the lavatory,
where I learned to wash her arse as gently as I had washed my
sister’s and my mother’s, and as someday someone will have to
wash mine.

I might have guessed that she would resist the hospice until
the contents of her lungs began to bubble up into her nose and
throat, until everyone around her was deranged with exhaustion,
fury, nad despair. She relented only when Marion said to her,
“Don’t regret the things you haven’t done. That’s the past.
Let it go. Rejoice: you’re our teacher now.”

None of Bonnie’s illness worked out much like that — Bonnie
went into the hospital as soon as it was clear that she couldn’t
take care of herself, and by the time she might have been
denying what was happening, she’d had the stroke that left her
unable to talk. But I do recognize both the urge to drink and
the love and closeness with the other people caring for
Nicola.

This is a short book. At the beginning I wondered if the
one-column review
in the New York Times had told me everything I was
interested in knowing about this book. But it really does get
even more interesting at the end.

http://rcm.amazon.com/e/cm?t=laymusicorg-20&o=1&p=8&l=as1&asins=0312428170&fc1=000000&IS2=1&lt1=_blank&m=amazon&lc1=0000FF&bc1=000000&bg1=FFFFFF&f=ifr

Following up on last August’s arrest

I spoke to my neighbor who was arrested
last August when a neighbor called the police because his dog
was barking.

He’s still not completely out of the woods, but his lawyer made
a motion last month to have the evidence thrown out on the basis
that the breakin was improper, and the judge granted the
motion.

So the DA can still go through appeals and drag it out, but
they may just drop the case, if they accept that they don’t have
any admissible evidence.

I asked him if that meant he would get his computer back, and
he said he’d asked that too. His lawyer said the next thing the
police would do is apply for “destruction of the evidence”, which
will certainly apply to the alleged marijauna plants, and might
apply to the othe items seized in the breakin. (Not just the
computer, but his camera, printer, monitor…)

I can see claiming that a hard drive is evidence, but I really
don’t see how a printer can be.

Anyway, the lawyer’s advice is that he can fight the
destruction of evidence application, but he advises against it,
on the grounds that it might well cost more time and money than
the equipment is worth.

I’m glad I set up my offsite backup system.

Cantatas, Sonatas and Moral Tales: Songs and Instrumental Music from 18th-century Germany

Last night I went to another concert in the Viols
and Friends series.
This one was of eighteenth
century music, which we’re on the whole more familiar with than
we are the seventeenth
century music
that I heard last October. Although the
performance included composers as familiar as Telemann and
Handel, it was in general the same kind of exploration of
little-known and delightful byways that characterizes this
series. Lutenist Olav Chris Hendriksen and Gambist Carol Lewis
were joined by mezzo-soprano Pam Dellal.

The first half included a humorous song by Telemann about
Fortune, written to be performed in the parlors of Hamburg. I
was reminded that the last concert I heard with Telemann parlour
songs had made me want to look them up, but I hadn’t yet gotten
around to it. There was also a lute-viol duet reconstructed by
Chris Hendriksen from the lute part. Again I marveled at how
well Chris and Carol Lewis (his wife) play together.

The second half ended with pieces from the end of writing for
viol and lute. Carl Friedrich Abel (1723-1787) was the last well-known
composer to write for (and play) viol. One of the pieces was
written for Thomas Gainsborough, better known as a portrait
painter, but apparently also an impressive amateur musician.
When I was in school, they skipped from Bach to Haydn when they
taught music history, leaving you to wonder what there must have
been in between. The music on this half of the program is part
of the answer.

[Gainsborough portrait of Abel]

The program ended on a note of hillarity, with Die Schlauen Mägdchen
by Johann Christian Beyer, who is known only because he
published one of the last treatises on the lute before modern
times in 1760. This piece is a humorous song about two girls
who are tired of being woken by their elderly aunt when the
rooster crows, so they kill the rooster. Their wicked plot
fails to benefit them, because the aunt, not being able to count
on the rooster waking her, wakes up at all hours of the night
and awakens her nieces. The piece was published entirely in
lute tablature, so probably originally performed with the
lutenist singing it.

You still have one more chance to appreciate this series, when
they perform French Renaissance music from the court of Louis
XIII with guest soprano Anne Azéma on April 17th and 18th.

Start of the Winter Olympics

[fiddler competing with shadow]

I spent last night watching the Olympics opening ceremony on
NBC. Then I spent 15 minutes over coffee this morning reading
what the New York Times had to say about the death
of the Georgian luger
and the opening
ceremony.

If I hadn’t watched the show, I wouldn’t have seen the music
and the dancing, but otherwise, I would have been at least as
well-informed about what had actually happened.

In fact, NBC apparently decided for reasons of taste or
something to not keep showing the video of the luge crash.
They spent 10 minutes at the beginning of their show, which I
missed because I was still eating dinner. But I watched it this
morning from the NY
Times link
, and I’m just as glad I didn’t have to see it 6
times the way you always do when a football player gets
injured.

The NBC report did mention that the track was very fast and
other people have crashed. They didn’t mention that it had
already been controversial as too difficult for the
less-experienced lugers who can be expected at the Olympics, or
that the Canadians had been criticized for trying to up their
medal count by providing less access to the course for training
than has been traditional.

So I might go on watching coverage when I have the time, but if
I miss it because of another commitment, I won’t feel bad if I
have to watch the videos on my computer instead of seeing things
live.

Chopin Concert


[Photograph of Chopin]

I gave the basic information about this Wednesday, but didn’t
include the program, or performer’s bio. Here’s what’s on the flyer:

Music of Fryderyk Chopin

on the occasion of his 200th birthday

born March 1, 1810, Żelazowa Wola, Poland

died October 17, 1949, Paris, France

Judith Conrad, Pianist

Sunday, February 21, 2010, 3:00 PM

First Baptist Church

228 North Main Street, Fall River, MA

open to all – Polish pastries will be served after the concert

Suggested Donation $10

donations beyond expenses will go to the Partners in Health hospital in Haiti
and to the Iraq Family Relief Fund – concert supported in some
part by a grant from the Fall River Cultural Council

For further information call (508) 674-6128 or e-mail JudithConrad@mindspring.com

Program

Polonaise in A-flat, written by the 11-year-old Chopin for his
first piano teacher, 1821

Polonaise in A-Flat opus 53, 1843

Waltz in E, 1829

Grande Valse Brillant in a, opus 34 no. 2

Waltz in D flat major, “Minute”, opus 64, no. 1

Nocturne in c-sharp minor, 1830

Nocturne ni f minor, opus 52 1844

Fantaisie-Impromptu, opus 66 (posthumous) 1834

Intermission

Ballade in g minor, opus 23 1831-5

Mazurka in B-flat, opus 17 no. 1

Mazurka in a, a Emile Gallard

Mazurka in C, opus 24 no. 2

Mazurka in A-flat, opus 59 no. 3

Mazurka in c-sharp minor, opus 41, no. 1

Etude in E, opus 10 no 3

Etude in e, opus 25 no. 5

Revolutionary Etude, opus 10 no. 12 1831-34

Ms. Conrad studied piano with International Concert PIanist
Theodore Lettvin in Boston, and with Freeman Koberstein at Oberlin
Conservatory, nad holds a degree from Harvard University. She has
upcoming concerts in Boston, Millis, Beloit, Wisconsin and
Almeria, Spain. She is Organist/Pianist at Good Shepherd Lutheran
Church in Kingston RI. A specialist in early music and performer
on clavichord and harpsichord (both of which Chopin played), she
is also the Founder/Director of the Delight Consort, which
specializes in music of the Renaissance and Baroque, and of the
Fall River Fipple Fluters, an amateur recorder-playing group. She
is accompanist of the Allegro Glee Club and secretary fo the Fall
River Symphony Society, and she gives piano and recorder lessons
and tunes pianos locally.

“Buying” a cell phone


[Ada and Richard]

It’s time for me to acquire a new cell phone. Actually, I
should have gotten one 2 years ago when the current one acquired
its intermittent problem. It stops hearing what I say. I can
make phone calls, and people can call me, but they all hang up
on me because they can’t hear me saying anything to them. I did
some ill-considered fiddling with passwords, so now the only fix
for this problem is to take the battery out for a few minutes.
This only happens every few months, so I haven’t done anything
about it, but now that I’m eligible for a new subsidized phone,
I figure I should get one.

The two features I’d like are a better camera and an ability to
read books. The better camera looks doable for a few tens of
dollars. This is frivolous, since I already have a better
camera, but it doesn’t fit easily even into my jacket pocket, so
I often don’t have it when I want it.

Reading books costs several hundred dollars, though. If you buy
from the T-Mobile store, any of
the phones smart enough to run reading software require a data
plan, which costs $25/month. So for the two year life of the
contract, that’s $600, plus whatever the phone costs.

I really don’t see that I want internet in my phone $600
worth. I need a phone that’s capable of internet, as a backup in
case the cable goes down, but that’s a few days a year at most.
Since I got Comcast instead of Verizon, I’ve had only a few hours
of down time, which happened at night so I didn’t need to use the
cell phone. When I’m at home, I have an upstairs desktop and a
downstairs laptop, and most of the places where I go and have time
to browse the internet have WIFI (so I can use the internet tablet). I know the people who have
iPhones do use their internet access, and maybe I’d wonder how I
lived without it if I got it, but right now I don’t feel like
spending the money.

Of course, you can buy an unlocked phone from Amazon or Newegg,
and probably you don’t need to get the data plan if you do that.
But the unlocked phones are all $300 more than a subsidized
version that comes with the data plan.

And again, this would be frivolous, because I already have my
Nokia N810 Internet Tablet for reading books. And it does fit
easily into a jacket pocket, so it’s only bad organization when
I don’t have it.

I investigated whether I could use the camera on the Internet
tablet for better pictures than the cell phone gets me, and it
turns out that I can’t, although it’s possible someone
could use it for something. It’s a fixed focus, intended for
doing video calls, so taking anything but yourself is difficult,
and the software seems to be pretty flaky. I managed to get an
out-of-focus shot of something unrecognizable, but never managed
to get the dog (my usual test subject), even though he’s taking
his morning nap and not difficult to shoot with a normal camera
at all.

So I’ll probably just upgrade to something similar to what I
have, maybe spending the $40 to get a better camera. In two
years, maybe the cost analysis will be different. Or maybe the
unlocked phones will get cheaper in less than two years.

There’s a character in Dickens’ Bleak
House
who is described thus:

He immediately began to
spend all the money he had in buying the oddest little ornaments and
luxuries for this lodging; and so often as Ada and I dissuaded him
from making any purchase that he had in contemplation which was
particularly unnecessary and expensive, he took credit for what it
would have cost and made out that to spend anything less on something
else was to save the difference.

One of my friends who bought an iPhone justified the expense
because his cell phone plan was $30 less per month than someone else’s he
knows (although it’s $30 more than mine). I do a certain amount
of that kind of thing, too, but I’m resisting the temptation in
this case.