Blogging from emacs

I wrote a few months ago about how I post these
entries.
It seems a lot harder than what I do for email.
I type one letter to set up whether I’m writing a new
mail, replying to the sender, or replying to all recipients, and
whether I want the contents of the message I’m replying to in the
reply. Then I write my reply, and press a couple of keys to
send it. All without ever leaving emacs, which is the editor
that’s in my fingers so I don’t have to think about what to do
to move the cursor or delete or reformat.

For a weblog entry, I can edit the actual text in emacs, but
then I have to paste it into my browser and add tags and categories

So a couple of days ago I was catching up on news reading, and there was a
bug reported about weblogger in the emacs help newsgroup, which
indicated that the poster, while hitting an irritating problem,
had gotten farther towards getting it to work than I had, so I
decided to try it again.

Again, I didn’t get anywhere, but I was energetic enough to
send an email someone, who pointed me at someone else, who
answered my initial questions quite calmly and pointed me at the
bug list and the mailing list that he’d set up some time ago.

So I’m basically doing some testing for the developer on a
platform (wordpress) that he doesn’t have easy access to, and I
believe that we’ll eventually get a program that I really want
to have, namely a direct interface between emacs and my blogs.

In this case, both wordpress and emacs are open source
software, and they both use a well-documented protocol, so there
aren’t any insuperable barriers to being able to write this
program that I wish I had — someone just needs to write, document,
test, and debug the code. I’m helping with the documenting and
testing; maybe I’ll at some point get into the debugging, although
I was involved in gnus for several years without ever really
touching the code.

CSS to drool over

I’m still thinking about a better visual design for the Serpent Publications
Site.

What I’m basically planning is images of petrucci and lilypond
in the top and bottom of the page, preferably merging into each
other. I talked about how to do the transcription in this series of posts.

But every so often I look at the sites designed by real graphic
artists and wish I could have something like this.

Probably not, and it would still take a lot of work to get the
background image I would want. But I’ve gone as far as googling
for a wordpress theme based on that css.

One third down

I started this project of posting something to my blog every
day on February 25, four months ago. So if it ends up being a one-year
project, it’s one third done.

I have been successful at making a post every day. The only
one that was a real “I can’t post today” post was last Saturday.
And I really was over half way done with a fairly long and
difficult post
which I really did post the next day. John Scalzi, one of my
role models for doing this, is known for posting a picture of
his cat when he doesn’t feel like writing, but he’s also done,
“I don’t feel like writing today” posts.

You as readers can tell better than I can how well it’s worked
for entertaining the readers, but there do seem to be some
readers. I started keeping track of how many hits things have
gotten in April sometime. And it looks like even the most
inconsequential posts get a couple of dozen readers, and the
ones that get hit by a search, or have been pointed to in a
large mailing list, get hundreds.

Speaking as a writer, it has done some of what I wanted it to
— I now know a lot more than I did a few months ago how to pick
a subject I can write about in less than an hour, and how to
polish the 20-30 minutes of writing into coherence and then stop
and publish.

I was thinking it would be possible to see what the blogging
has done for my writing by reading the blogs from the Boston
Early Music Festival two years ago
and this
year.
Actually, there wasn’t as much difference in quality
of writing as I’d hoped for. The editing was definitely better
this year, and I think I’m more comfortable letting my
personality come out now. The quantity was definitely more two
years ago, but I remember that quantity as being very
difficult. This year I just decided it wasn’t possible to blog
and do 11 PM concerts and do morning concerts, so I just didn’t
do anything in the morning.

One disappointment about the blog as a way to connect with
people is that there really isn’t as much feedback as with the
other kinds of internet writing I do. If you post to a mailing
list or email a friend, it immediately becomes obvious if you haven’t
made your point. If you write a post on your blog, it’s quite
likely that you won’t get any comments at all. But it looks
like my audience has doubled in the last four months, so maybe
if I keep going I’ll eventually get an audience that
comments.

In terms of using the numbers of readers as a guide to what to
post about, it’s pretty inconclusive. It looks like of the easy
categories, the ones about food are read more than the ones
about the garden. The ones about using technology are also read
pretty often, probably because it’s something that people are
used to using google as a way to find answers for.

Another thing I hoped to accomplish was writing about my
experiences being involved in Bonnie’s death. That has
certainly happened more than it would have otherwise, but less
than I expected. This is partly because I still don’t have the
knack of breaking that subject up into small enough topics that
I can make those posts easy ones. Maybe I’ll get better at
it. Or maybe I’ll clear more time for hard posts, but that
doesn’t sound very likely. I’m still in the throes of the Serpent Publications
website
redesign, and when that’s done, I’ll have to move on
to redesigning this site.

The posts about books and movies are usually pretty easy, and
seem to get read fairly often. For the
most read one, about Little Dorrit, I
took the precaution of taking brief notes over the week or so I
was reading the book, so I ended up with several interesting
things already written. I should try to be more organized about
doing that.

One surprising thing is that none of the people who actually
know me personally seems to read the blog regularly. This
actually makes it easier — I don’t use anyone’s actual name
when I write about them, but I certainly sometimes say enough to
make it clear to someone who knows my friends who I’m talking
about.

So, Gentle Reader, do let me know what you think. If there’s a
topic you’d like more (or fewer) posts about, let me know. If
you’d rather have pictures of Sunny or the garden than “I can’t
post today” posts, let me know. If I’m being completely
incomprehensible about something, tell me and I’ll try to clarify.

Programming again

The web application I’m trying to set up for the Serpent Publications
website is the most programming I’ve done for several years.
I made my living as a programmer for several decades, so I wasn’t
expecting it to be quite this hard to get back into it.

Part of the problem is that mysql and php aren’t what I ever did for a
living. I don’t remember the details of the vocabulary even for
what I did used to do very well, but I never knew either mysql
or PHP without a reference book.

Anyway, I was finally making progress on setting up the mysql
views this morning, and I completely forgot that I hadn’t posted
to this blog, so this is a fast one because any minute now Sunny will decide
it’s time for his walk and I’ll have to take him.

Anyway, my advice for what it’s worth, if you haven’t
programmed for a while and need to, is to go back to doing very
small things at a time. It’s generally good advice for
programming anyway — you get testability and reusability and all
kinds of good things by breaking up the job into little
pieces.

So yesterday, I wrote up a list of all the fields that should
be in the pieceinfo view of my musicpublish database.

This morning I got each of them to work individually in an
interactive environment.

Then I wrote the sql that defines the pieceinfo view, which
takes data from the piece, book, and composer tables, by way of
the Book_Pieces_Table for joining book and piece.

Another good piece of advice is to set up an interactive
environment that you’re comfortable with. The command line mysql
is pretty good, but I got farther and faster when I switched to
the emacs sql mode.

Anyway, the upshot is that I’ve got a working although minimal
CSS theme, most of the hard part of the mysql is written, so what
I mostly have to do is write some PHP (some of which I may be able
to substitute python for), and then I’ll have a subset of the
functionality that I can throw at people for testing.

I’m not really sanguine about getting the whole application
written before BEMF, but I’m
optimistic that I can get at least as much functionality as is in
the current site, with improved design for easier upgrading.

Lilypond vs Petrucci, Round II

I said in the round one of this
comparison
that I’d let you know if I got any useful
answers to my query on the lilypond list. One of the list
contributors got interested in the problem and wrote me a new
layout block that does indeed look a lot more like what Petrucci
does. You can read the gory details on the
list.

Pictures

Here’s the first page of the Petrucci facsimile of Adieu
mes amours
by Josquin:

[Petrucci facsimile]

And here’s the cantus part lilypond produces now that I have
the new layout block:

[Lilypond cantus]

And here’s the tenor part from lilypond with the new layout block:

[Lilypond tenor]

Making the machine go

I’ve been spending more time than usual the last few days on just getting my
desktop computer to run.

Graphics card

The problem I was trying to solve was that it would slow to an
unusable crawl if firefox had been running for more than a day,
especially when the automatic backup kicked in every 4 hours.

One thing I thought might help would be to run the monitor off
of an NVIDIA GeForce 7300 SE/7200 GS graphics card. The network
know-it-alls on one of my mailing lists laughed their heads off at
this idea, but it still seems reasonable to me.

Unfortunately, it fixed the problem of firefox taking over the
whole computer when it had been running for more than a day,
because with the nvidia driver, the whole X system would freeze up
in much less than a day. The nvidia driver is a closed-source
product of the Nvidia corporation; there’s also an open source
driver called nv, but when I tried that, it would only let me run
at very low resolution.

Monitor

Then a small number of days later, I got home after midnight
and went to check my email before bedtime and the monitor died.
(The little light was yellow, and instead of turning green as the
screen came back to life, it went out and wouldn’t come back on no
matter what I did.)

So I hooked up the old heavy 17″ CRT that I replaced because it
got jittery and was giving me headaches, and ordered a new monitor
for pickup from microcenter. I use
microcenter (which is less than two miles away) for anything I
need fast, for anything that might have a problem with linux
compatibility, and for anything with a motor in it. They sometimes
cost a little more than buying online, but they’re really good
about taking returns.

I bought this
Acer 22 inch wide monitor.

I had to boot it several times in order to get it configured
right. It seems that with the nvidia driver, you have to run both
envyng and nvidia-setup, or some such to get it to recognize that
you have a different sized monitor.

And it ran for most of a day, but this morning when I got up, X
was frozen again.

So I googled some more, and found a different open source
driver called “nouveau”. It figured out the right resolution and
size to run the screen at, so it looks good so far. It’s only been
two hours, though.

If you’re running ubuntu and have an nvidia card, you just have to “apt-get install
xserver-xorg-video-nouveau” and then edit /etc/X11/xorg.conf to
say “nouveau” instead of “nvidia” or “nv”.

Browsers

I’ll tell you some more about the browsers I’ve been
investigating later. The current situation is that the google
chromium-browser is great when it works, but has serious bugs,
like not displaying this blog at all and the “copy link address”
not copying. So I’m currently using that as well as firefox,
which is still what my mail program opens links in.

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

Mental Health Day

This has been a bad year in this part of the world for people
with pollen allergies. I’ve been singing O bother the
flowers that bloom in the Spring
vigorously and frequently. On Thursday
night, I was congested enough to be having real trouble sleeping.

I realized on Friday morning that while I was almost certain it
was the pollen, I was actually hoping for a bit of a fever, so
that I could spend the day in bed.

Then I realized that since I work for myself, I didn’t really
need the thermometer to validate a day off, so I declared a mental
health day, and went back to bed after posting to this blog.

Two hours later, I woke up feeling refreshed and much less
congested. I took the dog on a walk, and hit the money machine
and decided to eat lunch on the patio at the Cambridge Brewing Company.

[Cambridge Brewing Company]

Then I went home and fooled around instead of practicing and
watched a lot of the baseball game and then watched other TV all
evening.

Results

Of course, what you hope about a day like that is that you’ll
wake up the next day invigorated and get lots more done than you
would have if you’d kept your nose to the grindstone both
days.

I won’t claim to have set the world on fire yesterday, but I
did some good practicing, solved a couple of problems on the blog
(note the Most Read
Posts
section on the sidebar), and took the computer apart
to put back a video card.

I did spend more time watching TV than I sometimes do when I’m
getting a lot of work done, but it was TV I wanted to
watch. The Kentucky Derby had been a good enough horserace that I
wanted to watch the Preakness, and I had a movie from Neflix that
I’d been looking forward to.

Choosing a blogging platform

I started thinking about this again after my post
about how I write my posts.

I got a comment from a
reader
who blogs on a platform (jekyll) that’s set up so that everyone
posts directly from their editor.

I actually started blogging on blosxom, which
is a really nice simple program. If all you want is to post your
own thoughts in a blog sort of format, I would recommend it.

However, if you want to add features, you will soon run into
problems like this,
from a pyblosxom (a close relative of blosxom) user:

I’ve just spent the whole night setting up blog comments. PyBlosxom doesn’t make it painless, sadly, more like the opposite.

First: don’t be scared by the list of comment-related plugins on the PyBlosxom site. There’s only one important plugin: comments. All others depend on it and enhance its functionality. The last three or four times I was about to add comments to my blog I got scared at step one: evaluate the available plugins. Don’t repeat my mistake!

Second, follow the instructions carefully. There’s no shortcut.

Third, fix what’s broken. Be prepared to debug the source
code. print >> sys.stderr, "message" is your friend.

Fourth, fiddle with the look (CSS and HTML).

It was when I wanted to add comments that I switched to wordpress. I figured that if you want other people
to do the testing for you, you need to sign up with a widely used
program, so that there will be lots of other people running it.

It has worked out pretty well. When I’ve run into problems,
I’ve pretty often been able to find a solution just by googling
the problem, and someone else had hit it before me and written up
the solution.

Monoculture

Of course, there’s a dark side to using the most commonly used
anything, which has been called the monoculture
problem.

If someone wants to do the work to crack a site for their own
nefarious purposes, they aren’t going to do it on some little
python program that’s used by a small fraction of the people who
wish they could post directly from emacs to their blogs. They’re
going to crack wordpress. This is the same reason why Mac and
Linux people worry a lot less about viruses and other malware than Windows people.

My blog has in fact been hijacked
several times, and when it happens, I always think of going back
to something simpler and less common.

My current solution to at least some of the hijacking problems
is to not use the wordpress uploading facilities. I’ve often
found they don’t “just work”, and to make them work, I’ve
sometimes done undesirable things that have compromised the site
security.

What’s supposed to happen is that you tell wordpress while
you’re writing a post that there’s a file you want to upload,
e.g. a picture. Then it uploads the file somewhere it knows
about, and there’s some simple syntax you can use for including it
in that post, and a slightly more complicated syntax for showing
it with a different post.

What actually happens when I do it is that is tells me I can’t
upload, and then when I finally do get it uploaded, I can’t
remember the syntax for including it. And if I have to upload 5
pictures (for instance, for the garden posts), I have to go
through this for each one of them.

So what I do instead these days is just upload the pictures
into a directory on my site (not under wordpress) and refer to
them by their normal URL’s. This would be a bit more typing if I
did it all for each picture, but since I’m in emacs, I just type
the URL once, and modify the filename for the next picture.

Comparing Lilypond and Petrucci

While I’m working intensely on the site redesign, you might
have to put up with the things I’m writing about it to help me
think.

Here’s a query I made on the lilypond-users
mailing list:

In general, I love the way lilypond output looks when compared with
other computer-generated sheetmusic.

I’m aware that the ideal espoused by the developers is the 19th century
hand-engraved sheet music.

I usually like the look of my lilypond output as compared with the late
sixteenth and early seventeenth century printers I usually transcribe.

I always like the look of lilypond output as compared with anyone’s
hand-written music.

But when I transcribe Petrucci from the facsimile, the spacing lilypond
does always looks clunky, especially in the parts with large
note-values.

I’ve recently figured out that the large note-values look better if you
put:


context{
Score
override SpacingSpanner #'base-shortest-duration = #(ly:make-moment 1 1)
}

in the layout block.

I believe Petrucci’s spacing is just equal spacing for every note, no
matter what its value.

Does anyone have any tricks for making lily’s output look a little more
like that?

I’m trying to redesign my website, and one idea I have is to have a
graphic in the header with a facsimile on one side and lily’s output on
the other. So it’s important that people not look at the lilypond
output and say, “Wow, that’s ugly compared to the facsimile.” Of course
one way to do that would be to use an ugly facsimile (of which there are
many), but it would be more fun to use a beautiful facsimile and also
have beautiful lilypond.

I’ll let you know if I get any useful answers.

PIctures

Here’s the first page of the Petrucci facsimile of Adieu
mes amours
by Josquin:

[Petrucci facsimile]

And here’s the cantus part lilypond produces:

[Lilypond cantus]

And here’s the tenor part from lilypond:

[Lilypond tenor]

Site Redesign Progress

I finally got started on the site redesign, so this has to be a
short one.

It’s the kind of project that every time you solve one problem,
three others pop up, so I suspect it will be at least days if not
weeks before I have it ready even for friendly perusal, let
alone to loose on the unsuspecting public.

I’m starting with the thematic wordpress
theme framework. It allegedly lets you customize almost
anything, but that turns out to be only true if you know CSS. I
learned a bit about it the last time I did site redesign, and
actually sort of liked the look of the site I did for the Boston
Recorder Society (they changed it when I stopped maintaining it,
so you can’t see it there). Anyway, I have the mechanics pretty
much the way I want them, and the look something like the old
BRS site, so now all I have to do is:

  • Write the content for the new pages, including the new
    search form.
  • Fiddle with both LaTeX and Gimp to get the banner at the top
    of the pages right.
  • Fiddle with the wordpress stuff so the sidebars and footers
    are the way I want them.

My accomplishments for yesterday included:

  • Finding where the home page on the new hosting site should go. I
    broke accessing it altogether twice yesterday afternoon trying
    to be too cute about that.
  • Setting up a test environment on my home machine. There’s
    still work to do on this, because I used the Ubuntu wordpress
    package to do it, so I have to fiddle with permissions and
    ownership and groups and maybe links before it really lets me
    work on it right. But I made substantial progress.
  • This morning before breakfast, I installed keyring and now I can do openssh to both the old
    and the new hosting sites without entering passphrases.

I was frustrated enough yesterday when I had access to the new
site broken and hadn’t yet figured out how to customize anything
in thematic that I considered just going to bed and reading
trash fiction, but I have persevered, so far.

The most inspiring story I learned in high school was in the
history of English literature book. Thomas Carlyle had spend
several years writing the history of the French Revolution, and
he gave the only copy of the manuscript to his friend Macauley
to see what he thought. Macauley’s maid (at least, she had to
take the rap) thought it was trash and put it in the fire.
Carlisle went to bed and read trashy fiction for a week and then
got up and wrote the book over again.

I admit that story has more often inspired me to go to bed and
read trashy fiction than to write the history of the French
Revolution. But it’s really true that there are times you just
shouldn’t be doing some things, and it was looking like
yesterday afternoon was the wrong time to be slaving over a hot
computer.