Sunday, March 16, 2008

Farm News 03-16-08

Sunday morning, after chores

Barn News

Suzette has four bunnies, I miscounted the first time. Three of them are spotted and one is all black. They are now becoming round little balls instead of long sausages. They have their own fur and kick off their covering of Suzette's fur when the weather is warm.

Dave Ware, my brother, died this week, and I am not up to writing the weekly Farm News. I'll have something written for next Sunday, I hope.

Books

Biting the Moon by Martha Grimes

An Unfortunate Prairie Occurrence by Jamie Harrison

Labels: , ,

Sunday, December 02, 2007

Farm News 12-02-07

Sunday morning, after chores, 40°

Farm News, including previous editions, is available at the Farm News blog.

Barn News

Suzette spent Wednesday with Bucky, so she should have bunnies on New Year's Eve or thereabouts. I need to build a new, covered nest box before then, the old one finally fell apart. Does like a covered box so they can sit on top of it and escape from the demands of the bunnies. The high sides and cover also help hold the fur in the nest box.

Thursday evening I killed a possum I caught stealing cat food. It has been living in the barn for some time and was the biggest, fattest possum I have ever seen. Although possums do well eating cat food, they generally prefer young birds, which they kill by biting off their heads. They then eat the heads and leave the rest of the bird behind. I was very glad to get that possum out of the barn before baby chicks and ducklings start hatching.

Darkness

We are sometimes told that the Arabs preserved knowledge during the Dark Ages. It is interesting to note that the Dark Ages began not in Europe, but in Egypt, when the monks of Nitrea, led by Cyril, Archbishop of Alexandria, took Hypatia to the nearest church, laid her on the altar, and removed her skin with clam shells. Hypatia, the last librarian of the great library of Alexandria, did not survive the experience, nor did the library. I instinctively dislike people who abuse librarians or libraries.

News from Cambodia

Ray was asked to report on local reaction to the start of the trial of former Khmer Rouge officials on charges of crimes against humanity. Ray said that the only thing he has heard about it was from the news on CNN. The trial that has drawn the most attention is that of a rich Russian with a strong appetite for very young virgins. The interest is over whether justice or money will prevail.

Ray hasn't unpacked his camera, yet. He is staying busy walking on the beach, drinking coffee, and watching the passers-by. He reports that he still hasn't seen any violent acts, nor any aggressive police activity; instead, everyone is busy tearing down old buildings and replacing them with new shops. The people are industrious and feel that prosperity is finally arriving in Cambodia.

Writing

As I write this it is Monday evening, 8:16pm to be precise, and I don't want to write anything. Why not, I wonder? I'm 70 years old, I should have something interesting to pass on, but I can't think of anything. The day's events? Hardly.

I started the morning with chores, as usual. It didn't freeze last night and all the various water containers were unfrozen this morning, making the job much easier. I fed the goats, held a coffee can of grain for Beth, the human imprinted goose, to have a few bites before I tossed it out to be picked up by her and the other two geese, and gave a coffee can of non-medicated layer mash to the ducks. As I fed each I said their names, trying to teach them that when I call their name it means food. Lucy goat knows that when I call her name it means food, and Beth might make that association. The ducks seem to associate “Ducks, ducks” with food but generally prefer what they can find on their own.

Breakfast was my normal winter morning meal: a big bowl of oatmeal with honey and skim milk. I once spent a week in Scotland, staying at the rural home of three young men, all true “men's men.” They approved of me because I enjoyed oatmeal for breakfast, Scotch whiskey after dinner, and I liked their sheep dogs so much that I would yield my chair to the sweet old bitch who liked to spend the evenings in the house. Ever since I have preferred oatmeal for breakfast on cool mornings. During the summer I generally have a small bowl of Cheerios. My preference for oats in the morning I consider a major factor in my being the oldest male member of my family on both the maternal and fraternal sides, all the others died of heart attacks.

There were two computer repair jobs scheduled for today: a new client near Meriden and a repeat client near Oskaloosa. The gentleman near Meriden needed a new monitor. I charged him $20 for making the trip and told him to call me if he needed more help. The lady near Oskaloosa was unable to renew her Norton AV online, not surprising, as no one else can either. I spent over an hour trying to make it work and then installed AVG anti-virus. She had already paid Symantec $70 for renewing her Norton anti-virus and didn't want to waste her money. I kept trying to explain that she had already wasted her money, which took several hours. I charged her $35 and came home.

I could continue with this for pages, but to what end? It's dreadfully boring, even though I enjoyed the day. It wasn't solving the computer repair problems, it was driving through the countryside I enjoyed. I saw a badger and two big flocks of wild turkeys, but mostly I just enjoyed the trees, shrubs, and grasses along the roads. It's nice to be simple.

Friday morning a Blue Jay visited the bird feeder, the first in more than a week. Something, probably West Nile, almost wiped out the Blue Jay population. They're noisy and obnoxious, but I like them for their boldness. Jays are fairly easy to tame if you start with the young ones. I keep trying to remember to find a nest in the spring and start hand feeding the babies, a sure way to win their hearts and minds.

Two populations of crows live here: a year-round family who raise their babies here, and a migratory flock of mostly young, unmated birds that spend only the winter. The permanent residents do not approve of the rowdy ways of the migrators and don't mix with them. When the babies leave the nest in late summer the crows raise such a fuss that it becomes obvious what is happening. This year there didn't seem to be any young leaving the nest; again, I suspect, victims of West Nile. Young birds without feathers are helpless against the mosquitoes that carry the virus.

Health Care

Each year medical schools in the US reject about half of their applicants. We end up with a shortage of physicians which we then fill by robbing developing countries of physicians they disparately need. Why? Because the AMA, the organization responsible for accrediting US medical schools, has put a limit on the number of physicians the US can produce, has set a limit so that their members will make more money. If physicians were steel producers instead of health care producers they would all be paying a fine for anti-trust violations.

Labels: , , , ,

Sunday, April 22, 2007

Farm News 04-22-07

Sunday morning, after chores, 66°

Bunny and Kitty Adventures
On Tuesday the bunnies and kittens went to school. They visited two classrooms at the school and then went to the day care center for more visiting. They were very well behaved and left no messes behind. By Thursday the bunnies were hopping out of their nest box and bouncing around the cage. They will soon be big bunnies.

Shotgun, the mother cat, has moved her kittens from where they were easy for children to reach to a place that requires long arms to reach them. Silly cat, she doesn't understand that the more children play with her kittens, the more likely the kittens will find good homes.

Bebe the goose is still on her nest, keeping her eggs warm. She usually leaves around 5:00pm to go eat a bit, have a drink of water, and exercise. After twenty minutes or so she is back on her nest, protecting her eggs. Her babies are due to hatch at the end of this month.

After the Freeze
About half of the garden is planted with lettuce, radishes, beets, peas, carrots, onions, potatoes, zinnias, and marigolds. The asparagus is coming back after the freeze. The daylilies look terrible, worse than they looked in February. There probably won't be any fruit this year. The apples hadn't bloomed before the freeze, but the apples have never bloomed or bore fruit. I'm ready to cut them down and replace them.

The flowering dogwood is now covered with brown, crumpled flowers. The tulips that are left are missing half their petals. Enough of the Koreanspice Viburnum survived to bring in a few flower clusters that filled the house with fragrance.

Generating Text
Icon is a programming language developed at Arizona State University by Ralph Griswold. It is a great language for doing things with text. Icon is not widely used, the last time I checked there were two people in Kansas who were on the mailing list, and that was at least twenty years ago. Nevertheless, Icon is what I am going to use, because it fits the task so well.

Most programmers are comfortable with only one programming language and try to use that language for every task. I prefer to use a language that best matches the task at hand. I am not an expert in any language but I manage, especially now that I'm retired.

This task will, at first, be broken down into two programs, one to create data files and the other to use those data files to create travesties. The first, Scan, will go through the text and create a list of ngrams. An ngram is the little two to five character group that is found in the original text, where n is the number of characters. Take the sentence, “See Spot run.” If we set n equal to 2, the ngrams in the sentence are “Se, ee, e_, _S, Sp, po, ot, t_, _r, ru, un, and n.”. I substituted underscores for spaces to make it more clear. Also notice that the period at the end of the sentence is included.

It helps to know that, in most personal computers, a 'line' is a paragraph. The actual length of the line on the screen usually depends on the width of the window in which it is displayed.

I'm going to start with a very simple program, Scan0, which simply copies the original file to another file. This is what the Icon code looks like for that program:

# File: scan0.icn
# Subject: Simply copies input file to output file, one line at a time
# Author: The Geezer
# Date: 04/18/07
#
# file copier, a basis for a text scanner
#
#
procedure main
# Open files
lgf := open("Scan0.log", "w")
inf := open("Sample.txt", "r")
outf := open("Scan0out.txt", "w")
write(lgf, "Files opened")
#
# Initialize the variables
LinesRead := 0
line := ""
write(lgf, "Variables initialized")
# Process lines
while line := read(inf) do
{
LinesRead +:= 1
write(outf, line)
}
# Done! Write the number of lines to the log file
write(lgf, LinesRead)
# Close the files
close(inf)
close(outf)
write(lgf, "Files closed")
close(lgf)
# End of program.
end

In Icon any line starting with '#' is a comment, not a working part of the program. When the program runs, lines beginning with '#' are ignored. So, skipping all the comments, the first line of the program is procedure main(), which is the required name for the main part of an Icon program. The parentheses at the end are for command line arguments, which will be discussed later.

The first job is to open the files for use. A file variable is a name for the place where you put stuff you want to write to the file, or where you go to find what is read from the file. In some programming languages the file name is used instead of a file variable, but that practice can create some problems, so Icon uses file variables. The programmer can use any name he wishes for the file variable. I chose to use lgf for the log file, inf for the input file, and outf for the output file.

First the program opens the log file, with a “w” to tell the program it will be writing the log file. The the input file is opened with “r” to tell the program that it will be reading that file. Finally, the output file is opened for writing. When the files are opened the program writes a note to the log file that the files have been opened. A log file is not required, but it can be a help when something isn't working right and the programmer can't find the problem.

Next the program creates a variable I chose to call LinesRead and intializes it to zero. Because a line is a paragraph to the computer, this will keep track of the number of paragraphs processed. The next variable is line, which is used to carry the paragraph from the input file to the output file, and it is initialized to be an empty line. Notice that the operator := is used to assign a value to a variable. The := is used to avoid confusion with = which is used to compare to variables to see if they are equal.

Now we come to the actual work of the program. The statement while line := read(inf) do tells the program to do whatever follows every time it can read a line from the input file. When there are no more lines to be read the statement will fail and the program will move on to the next statement.

There are two things to do each time a line is read: increment LinesRead by 1 and write line to the output file. The operator +:= is a very handy thing, it tells the program to increase the value in the variable to the left by whatever number is to the right. The write statement is pretty much self explanatory, write the paragraph in line to the file indicated by outf.

Once the while statement has finished, the work is done. The only things left to do are to write the number of lines to the log file, which might be helpful if things didn't work correctly, and then to close the files. Those are simple tasks, and then end is the end of the program.

So, there is a program that does nothing worthwhile, but it works. Next week I'll start changing it to bring it a step closer to the desired program, one that creates a data file for a travesty generator.


To subscribe to receive Farm News by email, unsubscribe, contribute stories, or complain, send an email to FarmNews@GeezerNet.com . The editor reserves the right to steal ideas submitted, rewrite submissions, and sign false names to them whenever it strikes his fancy to do so.



Labels: , , , , , , , ,