It is beautiful outdoors this morning. A front moved through yesterday. The excessive heat and humidity we had earlier in the week went away. I woke up with chest pain, but think it is my lungs trying to clear out the effects of several consecutive ozone days. I am hoping to get out and do some errands later on today.
State Fair started yesterday. Looks like perfect weather for it today. The 18 bus goes to the fairgrounds in West Allis. In a way I would like to go one more time, but don’t want to get overtired and mess up the move preparations.
The plans for the move are progressing. Some days it feels like time is racing while on others I get impatient.
Some friends gave me some lovely home grown tomatoes on Wednesday. I had one left this morning so decided to make a North-South fusion, stick to your ribs breakfast to follow my usual mug of tea. I sliced the tomato and put it in a plate with an over-easy egg but substituted mush (or polenta, cooked yellow corn meal) for grits. The seasonings were salt, pepper, and butter. Colorful and tasty, a great summer breakfast/brunch.
I have been doing Perl CGI scripting almost every day. Earlier in the week, I got the “sticky” behavior of forms to work the way a client wanted, then passed on how to do it to someone who asked about the same thing on the Perl Monks CB.
I wanted to show the first few lines of information retrieved from a MySQL text field in a popup list roster. What I came up with was:
while (@data = $sth->fetchrow_array()) { push @item_no, $data[0]; $items{$data[0]} = $data[1].' - '; if (length($data[2]) < 60) { $items{$data[0]} .= $data[2]; } else { # list first few words for long entries my $end = index ($data[2], ' ', 55); $items{$data[0]} .= substr ($data[2], 0, $end); $items{$data[0]} .= '...'; } }
Placing the ellipsis at a word boundary looks cleaner to me than the way phpMyAdmin handles displaying text fields in the browse view. Pushing the record number into @item_no is to preserve the sort order from the query in the popup list labels and values.
It was tempting to use a regex, but I resisted...
There appears to be a bug in WordPress, it is inserting an extra </pre> tag at the end of my entry. I tried using their code tag but it didn't preserve my indentation. Oh well, it displays OK.