Weekend...

Apr. 6th, 2008 02:21 pm
elfs: (Default)
[personal profile] elfs
I'd like to write that it was a crappy weekend. In some respects, it absolutely was. The date I had scheduled Saturday night, the one I've been trying to put together since, oh, mid-February, fell through due to illness. I discovered that my algorithm for doing word count was wrong and I wasn't at 42,600 words like I had thought, but only 40,900. A friend of mine put out the call Saturday night that his house had caught fire and he needed people to come over and help clean up the rest.

Still, Saturday night, after I had finished moping about my broken date and Omaha came home too exhausted from some long Democratic Party bureaucratic thingy, we went out to eat at Red Lobster, got home late, went more or less straight to bed.

Sunday we went up to our friend's and helped him move furniture, pull out bag after bag of smoke-contaminated clothing, and generally empty his house out enough that the professional cleaners could take care of the floors, ceilings, and walls.

Omaha had to run up to more politicking, and so after I dropped her off there I headed home with Kouryou-chan, who's playing on her computer right now. I'm feeling... dizzy. Exhausted. Worn out already. I'm not sure why. I should do another thousand words. It's on my list. But I think I'm gonna go lie down for a little bit.

algorithm for word count?

Date: 2008-04-07 12:52 am (UTC)
From: [identity profile] urox.livejournal.com
Can't you do something like count the number of spaces (ebcdic '40'x, unicode '20'x.. not that that is relevant at all, I just spend way too much work time looking at hex code) minus the number of periods? (I can't think of any other punctuation that has more than one space after or before it).

Re: algorithm for word count?

Date: 2008-04-07 01:14 am (UTC)
From: [identity profile] elfs.livejournal.com
Oh, it was much more fundamental than that. To understand the problem, you have to understand that I use emacs, keep each novel in its own directory (with a subdirectory for notes named "Notes"), and have one file per chapter. Since I use emacs, I use the semicolon character for inline note taking (which allows me to use ORG-mode and MUSE-mode's handlers for cross-file referencing).

My command for word count was:

grep -v '^ *;' *.txt | wc

Which has the bug. The problem is that grep, when presented with more than one file, unless told to do otherwise will print the name of the file on every line it encounters that matches the criteria. This means that every line that is not a comment gets at least one extra "word" counted: the filename. I have over two thousand lines, and that added up. The correct command is:

grep -hv '^ *;' *.txt | wc

Date: 2008-04-09 03:31 am (UTC)
From: [identity profile] shemayazi.livejournal.com
Tired is likely house-fire clean-up related - arsenic, walls outgassing - apparently you're supposed to take frequent breaks and no-one is supposed to spend more than an hour in a house that's burned until 18 hrs after. Voice of experience (and advice from our firemen team back in 92).

Sorry the weekend sucked. Must get fun back on track.

Profile

elfs: (Default)
Elf Sternberg

May 2025

S M T W T F S
    123
45678910
111213141516 17
18192021222324
25262728293031

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 7th, 2025 07:44 pm
Powered by Dreamwidth Studios