Intel's Ronler Acres Plant

Silicon Forest
If the type is too small, Ctrl+ is your friend

Saturday, March 7, 2009

The Curse Of UNIX

Regular Expressions are the work of the devil, nevermind what some Perl apologists say:
WARNING: This article contains more punctuation that many non-programmers like. That's because regexps and finite automata are concise ways of expressing powerful concepts. They are not for the faint of heart. Don't blame Perl if you don't like regular expressions. And don't blame Thompson or anyone else. If you don't like them, don't use them. But don't despise those of us who do.
Perl is it's own language, and unlike other human languages cannot be translated into anything mere humans can read. I suspect it originated with aliens who are trying to subvert our civilization to prepare for their conquest of our planet:
How can I convert my perl scripts directly to C or compile them into binary form?

The short answer is: ``No, you can't compile perl into C. Period.''

However, having said that, it is believed that it would be possible to write a perl to C translator, although it is a PhD thesis waiting to happen. Anyone need a good challenging thesis?

According to some people (alien lackeys, no doubt), Perl is a programming language. Perhaps if you are born and bred to it, you might think so. If you didn't grow up in the UNIX (or Linux) environment, you (and me) are more likely to describe it as gibberish.

So why am I making a fuss about this anyway? Perhaps I like beating me head against a wall. Or maybe I have an NSA complex and think I can crack anything, however inscrutable it appears.

I went to a PLUG meeting the other night down at PSU. Later on I was looking on their web site for a forum where I could post a message. I did not find a forum, but I did find something called IRC, which is what elite programmers used to communicate before there was the internet. You need a special program to use this communications channel. So I downloaded it and took a look at what we've got, and half the program is writen in Perl. So I set about trying to understand what one small file does. It took me a while, but I finally was able to translate it to C. I don't know that it is 100% accurate, there are still a bunch of environmental issues to consider, but I think I captured the essence. So, yes, you could earn yourself a doctorate if you could come up with a program that would translate this stuff to English or C or any other reasonable language.

Here is the Perl program findsyntax.pl:

#!/usr/bin/perl -w

while(<>) {
if(m!/\*.SYNTAX\:! || $tt) {
s/^\s+/ /;
if (/^ [A-Z]+/) {
print "\n";
s/^ //;
}
if (m!\*/!) {
$tt=0;
} else {
$tt=1;
chomp;
}
print;
}
}

And here is my translation to C:

void chomp(char* p1)
{
// Remove all trailing end-of-line characters from a string.

char* p2;

p2 = &p1[strlen(p1) - 1];
while ((p2 > p1) && (*p2=='\n'))
*p2-- = 0;
}

#define isblank(cx) ((cx==' ') || (cx=='\t'))

void findsyntax(void) // uses global variables s & tt
{
while (strlen(s))
{
if (strstr(s, "/*.SYNTAX:") || tt)
{
if (isspace(*s)) // Condense leading white space
{ // to one space.
while (isblank(*s++));
s--; // Point to last blank
s[0] = ' '; // Ensure that it is a space
if (isupper(*s[1]) // Is first non-blank character
{ // a letter?
putEOL();
s++; // move past space to letter
}
tt = !strstr(s, "/*");
if (tt)
chomp(s);
}
printf(s);
}
}
}

I suppose my translation is not much more intelligable, at least to the non-programmer.

NFL

These are some pretty amazing stunts. In these days digital imagery, you never know if this stuff is faked or not. These stunts are right on the edge of believable. I would like to think they are real. I looked around on the web, but couldn't find anything to confirm it either way, but maybe I just didn't hold my mouth right.

Stolen from Marty North and Greenfield Park.

Thursday, March 5, 2009

Executive functioning (Part Deux) & Home Warrantee (8 days & $200 vs. 1 day & $100)

Letter from Iowa:
Hi,

Ok I just spent 1.5 hours gathering information, initiating claims, calling repair people to get "home warrantee" work done on the house. Nothing has actually been fixed just executive functioning, to arrange for further need of more executive functioning.

The warrantee people make this sound like a fun carefree way to have your problems taken care of.

Maybe for people who have high level executive functions. I consider it torture.

5 items to fix:
  1. Clothes washer - only dribbles hot water - gentle cycle; sticks though this cannot be replicated
  2. Garage doors - old and working intermittently
  3. Oven - self cleaning feature & latch broke
  4. Ceiling fan - hummm loud and wall switch broke
  5. Swinging kitchen door, mechanism for holding door open broke
Home Warrantee process:

1) Itemize problems & model numbers & serial numbers

2) review contract to see if problem qualifies (akin to reading a home mortgage policy)
a) Clause states that garage door levers, rollers not covered
b) Kitchen Door - doesn't seem to be covered

3) Login to website and key in all claim information
a) The site responds to your claim with either
1) contact information for you contact a preapproved vendor
2) Ask you to contact a local vendor and arrange for a diagnosis and then send in estimate for approval

4) Call pre-approved repair people
a) they ask for all the same claim information that was asked for by warrantee company
b) they will arrange a time for a diagnostic visit. They ask for a 8 hour window on choice of two days over the next two weeks
1) The oven and washer use same repair company but they require two visits on two different days for which they ask a 8 hour window.

5) Find and call repair people for a diagnosis of out of-system-repairmen
a) Their estimate needs to be approved by the warrantee people before work done.

6) Arrange to wait for all the repair guys to come by and provide estimates, appears to be up to four days of waiting.

7) Provide warrantee company with estimate and wait for their approval

8) Arrange for repairs, up to 4 more days.

9) each repair has a $50 deductible

10) so using the warrantee system there are 2 hours of phone work, 8 days of waiting for repairmen & $200 of deductible fees, if everything is approved. Plus you need to keep track of 5 companies, contacts, schedules.

11) My guestimate of doing it myself would be 1 day of labor and $100 in parts, albeit with more technical functioning and much less executive functioning.

12) Funny how this executive functioning may not necessarily be the best way to do something. (this begs for further study)

Andy

Wednesday, March 4, 2009

Random Joke

Yesterday, I was buying 2 large bags of Purina dog chow at Walmart for my dogs; Winston, Chief, Gus, and Maximus. I was about to check out when a woman behind me asked if I had a dog. What did she think, that I had an elephant?

Since I had little else to do, on impulse, I told her that no, I didn’t have a dog and that I was starting the Purina Diet again, although I probably shouldn’t because I ended up in the hospital the last time.

On the bright side though, I’d lost 50 pounds before I awakened in an intensive care ward with tubes coming out of every hole in my body and IV’s in both arms. I told her that it was essentially a perfect diet and that the way it works is to load your pockets with Purina nuggets and simply eat one or two every time you feel hungry and that the food is nutritionally complete so I was going to try it again. (I have to mention here that practically everyone in the line was enthralled with my story by now.)

Horrified, she asked if I ended up in intensive care because the dog food had poisoned me. I told her no; I had stopped in the middle of the parking lot to lick my butt and a car hit me.

I thought the guy behind her was going to have a heart attack, he was laughing so hard!

Wal-Mart won’t let me shop there anymore.
Stolen from Dutty's Blog. Via Dustbury.

Monday, March 2, 2009

Today's Jumble: ASTHMA

Today's Jumble gave me a little trouble. I would expect any word with these letters to have at least one vowel in the interior. When I finally grokked that the answer was ASTHMA, I had to look it up in the dictionary because I wasn't sure of the spelling: the TH isn't even pronounced. A couple of minutes of poking around in the dictionary revealed the spelling. Who'd a thunk it?

"The Trap" by Daniel Brook

Brother remarks on "The Trap":
I thought it was very well written. He harps a little too much on the poor wealthy yuppies who can't do what they really want to do because they have to pay New York rents, but...the overall theme of being trapped in economic serfdom by a free-for-all system, resonated with me.

Plus at the end he talks a bit about Po Bronson, so I thought you might like it.

I liked it a lot, and was even a little peeved that a 20-something could so elegantly formulate and articulate these views that I've been struggling with for 40+ years.
At first glance I was ready to blow it off as garbage. But then I read one of the reviews. I don't think I have heard anyone else say what he is saying for at least 30 years. Selling out used to be a sin, but then we grow up and get a mortgage and all of a sudden you've got bills to pay.

I like to think I didn't sell out, but if I didn't it was probably more to dumb luck than any idealistic chops on my part.

Looked up Po on Wikipedia. How did he get to be such a success? Or rather, what did I do wrong? Or maybe, what's wrong with me? His story reads like a fairy tale.

Grand Rapids Mike responds:
They made him a success because he give an over-simplified black-or-white take-it-or-leave-it view of happiness.

In other words, he sold out nuance for obviousness.

Close Call

It must be the stupid mirrors. Either that or I'm getting old and decrepit. That cannot be the case, so it must be the mirrors.

I stopped at the intersection where the side road joins the main road. I looked both ways, then I pull out to turn left onto the main road. Halfway into the intersection I must have seen something out of the corner of my eye because I stopped short and watched a white Crown Victoria slide past me about a foot away from the right front corner of my truck and going 35 MPH. Geez, that was close.

My son John tells me the other driver apparently did not even notice us. This is the second time this has happened in the last couple of months. I need to get those mirrors replaced.

I was just looking at some motor vehicle accident animations/reconstructions last night on the web, too. Some were minor, some were horrendous. This incident this afternoon could have been really bad. The animations were done by the same company that did the video of the airliner landing on the Hudson river that I posted here a day or so ago.