Categories
Computers Lua Programming

bogotrain.lua

My spam filter of choice has been bogofilter for many a year now. For the mail I receive it got to be very accurate quickly and it has remained so ever since. It is one of the Bayesian variety of spam filters and requires “training” to keep it properly classifying email.

I use an IMAP server for working with my mail so integrating bogofilter with the server is less than ideal, which would be to use a keystroke and immediately reclassify the mail. Instead, I’ve assigned a couple of training folders that I then farm out to a script run as a cron job. Specifically, for misclassified spam (i.e. mail that’s actually good but was misclassified as spam) I created a spam2mail folder and for misclassified good mail (i.e. mail that’s actually spam but is classified as good) I use the Junk folder. The script, using IMAP, interrogates the mail folders, retrains bogofilter on the mail, and then places the mail in the appropriate final destination, either my spam folder or my INBOX.

Originally, I wrote the script in question using perl and IMAPtalk. Since I wrote an IMAP library in lua, I figured it appropriate to rewrite the script in lua using my library.

After the break is the code.

Categories
Football

The Right Approach

There’s been a bit of a mini brou-ha-ha since the Cowboys-Redskins game last week over mimicked snapped counts. I didn’t see the game, but the Cowboy’s center had a bunch of errant snaps and stated after the game that some of the Redskins’ linemen were mimicking Romo’s snap cadence, thus causing him to errantly snap the ball and causing various problems at inopportune times in the game.

In the hyper competitive world of professional football, anything goes even if it’s against the rules. It’s a 15-yard unsportsmanlike penalty if an official catches the defense calling a cadence to screw up the offense. The Redskins, of course, deny any such nefarious rule breaking occurred.

For my part, I have no doubt the Redskins were actually doing it. The fact is it’s one of those penalties that a defense is more likely than not to get away with. The officials are paying attention to lots of things and with all the distractions, a well-timed “HUT” from a defensive lineman near the center (or a blitzing middle linebacker) is just not going to get caught.

With all that, I like the attitude the Cowboys are taking in dealing with the problem:

“There’s been noise on the line of scrimmage in the NFL since Pudge Heffelfinger was around,” Garrett said Thursday, referring to the first man to sign a pro football contract. “So, that’s how it works. We just have to understand what the issues are there and we have to focus on whose voices we’re listening to and just get locked in and snap the ball the way it needs to be snapped.”

The quote is from this article, in which its pretty clear that the NFL is aware of the problem in general, but has little effective means of dealing with it. Even owner Jerry Jones is sounding a similar tune.

For my part, Garrett is absolutely correct. It’s a problem for which the burden is on the Cowboys to find some kind of solution. The best way is to make the act so unlikely to work that it isn’t worth the attempt. Rather than just relying on some authority to conjure up another rule that will likely be broken in the pursuit of winning. Or worse, conjure up some other modification that will have other repercussions. I hadn’t known about the miked up centers and it seems pretty clear that capturing the audio from them is a good way to steal cadences, audible calls and the like.

Anyway, as far as the Cowboys are concerned, the resolution espoused by Coach Garrett and owner Jones speaks well to having the right attitude towards their play and conduct generally. Take responsibility for everything about the game. Don’t complain about problems, instead adapt and overcome. That’s the attitude of a winner.

Categories
Family

Would-be Extortionists

The Wife took TV privileges away from the boy for tomorrow because he was being unnecessarily belligerent. Something about his sister’s toothbrush being left in the sink started it all off. Speaking of whom, she lost her Saturday morning cartoon privileges earlier this week because of, wait for it, excessive belligerence.

She comes home from school and wants lunch. But not just any lunch, she wants the lunch that she’s been dreaming about all her life. The one that will complete her childhood and make all of her dreams come true.

That’s right, she wanted hot dogs.

Amusingly, once the sentence was handed down, they both tried the exact same counter-strategy: blackmail.

Tonight, the boy told us that if he wasn’t allowed to watch cartoons tomorrow then he wasn’t going to go so soccer. Three guesses how that one turns out. First two don’t count.

After the lass had her go around earlier this week, she threatened not to eat. Or something like that. Regardless, her ultimatum worked as well as the boy’s will tomorrow.

They still haven’t quite got something they can leverage. But sooner or later, they will.

In the meantime, what the hell crawled up their craw this week? Yeesh.

Categories
Family

Hearts

I’ll confess to being somewhat addicted to playing the trump and trick genre of card games. The ones like hearts, spades, hi-lo-jack (or pitch) and even a little bridge (though it’s been so long that I probably couldn’t remember the rules) all have a pretty similar them of a hand consisting of a series of tricks that are won and lost according certain seniority rules.

The nice thing about hearts is it’s so easy to play, since just about any Windoze machine out there has the game on it. The kids have watched me play it any one of a number of times. Now that they’re becoming more comfortable with computers, they’ve even started dabbling with the game. The boy in particular has taken an interest in hearts.

So when he started asking me questions about how to play, I decided the best way was to actually teach him. One thing I know, having tried to explain the basic rules, is that even though the concepts are simple they have their own language and to explain the language a deck is required.

So I set about explaining the makeup of the deck: the suits and the relative strength of the cards and so forth. I put a lot of emphasis on the suits, because understanding the suits is key to understanding how to play hearts. Telling them that Ace is highest, 2 is lowest and all that is pretty easy. But explaining that sometimes, because a 2 is the right suit and an Ace isn’t that the 2 still wins is bound to cause some confusion. After that, we played some dummy hands because seeing it in action is worth more than a thousand words of explanation. The lass took a keen interest and sat and watched and listened very intently as the boy and I went through a few dummy hands.

Eventually, I dealt her in as well for a dummy hand and we went through the motions several times. We played with all cards showing and didn’t keep track of scoring. Well, I didn’t keep track. The boy, on the other hand, was a human abacus making sure he always knew who had the most hearts and where the dreaded Queen of Spades ended up. At one point, when he ended up with a few hearts, he asked if we could give “the other player” some hearts so that they could tie.

Sigh.

The whole thing held their attention quite impressively and by bedtime they both seemed to grasp the concept of “highest card in the suit led.” They even remembered how the player with the 2 of Clubs always starts a new hand. Thankfully, there were no tearful episodes either. Sometimes, that’s the best to hope for.

Categories
Family

Gone to Her Head

We had a town fair kind of thing this past weekend. I was there helping to sell popcorn for the Scouts. In the meantime, the lass was her soccer game. But afterwards, the Wife brought her down to the fair-kind-of-thing.

The Scouts have a game called Ga-Ga which is deceptively fun. It’s a simple court established by boards of wood stood on edge to form a hexagon. The play is basically dodge-ball like, with a few simple rules about when a player can touch the ball, what constitutes a valid hit (nothing above the knees), etc.

By the afternoon, the weather had cleared enough that there were quite a few kids playing and the lass joined them. She had a blast and got her picture taken by a photographer for one of the local town papers. The photographer asked me if it was OK to use her picture and I gave her the lass’ name and age.

Then I forgot about it.

Until last night at the boy’s martial arts class when one of the black belts walked up to me with a town paper and asked “Have you seen this?” There was the lass’ picture, prominently displayed at the top of the page. Below her was a picture of another little girl on one of the blow-up bouncy slide ride type things. She let me bring the paper home.

When I got home, I made a big show of it. Walking up to the lass and saying “Who’s this a picture of?”

Her first response?

“How come this other girl’s picture is in my paper?”

Categories
Family

The Beatings Will Continue…

So the kids have taken to regularly calling each other “stupid” and “idiot” and other wonderfully charitable sorts of adjectives. It would be one thing if it was just an every-now-and-again sort of occurrence. For instance, the boy is upset with the lass for some transgression and lashes out a bit. OK, fine- they have to be allowed to vent a little every now and again. Unfortunately, they’ve taken to doing it so regularly that the Wife and I felt the need to start intervening.

On the one hand, we can’t force them to like each other all the time. On the other, they’ve got to understand that resorting to name calling just doesn’t fly. The Wife and I have alternated between letting them pass, snapping at them and timeouts and the like to try and convince them to knock it off. Or at least to scale it back by and order of magnitude. Progress has been slow to non-existent so far.

So now, we’ve brought out the big guns. We decreed last night that they shall not be afforded cartoon time in the morning before school if we hear them call each other “stupid” or “idiot” of whatever other pejorative comes to their little mind. We were figuring to make it to the weekend.

Naturally, this morning, the lass wakes up in a not so good mood and let’s fly with an “idiot” at her brother.

Categories
Football

Cowboys Showing Guts

So Romo plays with a fractured rib; Dez Bryant plays banged up, as does Felix Jones and the Cowboys get a tough win where, it sounds like, a lot of things went wrong for them. In fact, that’s 2 weeks in a row where they’ve basically had bad games but still managed to get things right in the end and pull out a win.

It’s tempting to say the team has turned a corner, especially after last year. But I’m not convinced that the ‘Niners or ‘Skins are actually formidable opponents. Which means the Cowboys may be just good enough to lose big games against quality opponents. Kind of like what happened in Week 1 against the Jets, in fact.

History has shown repeatedly that top-notch teams beat the teams they should, and beat them handily. They also beat other good teams. Losses are rarely, if ever, to bad teams and when they are, it’s typically a division rival. It’s a mark of a consistent, high-level quality of play that a good team must have to make it to the playoffs and win a Super Bowl.

It’s still early days for this season. Early successes like the Cowboys have had these past 2 weeks can certainly help the psyche. Especially for the Cowboys, who lost so loudly and so often last year. In particular, it’s good to see that Romo has been able to get things done late in games to get wins at long last.

In fact, that’s probably the best that can be said about this year’s Cowboys team. Last year, they would have found ways to lose those games. But that’s still not the greatest of compliments. We’ll see where they are at in another couple of weeks.

Categories
Family

War- What’s it Good For?

I’ll tell you what: spittle-flecked rages and ear drum shattering cries of anguish when it seems like forever since one kid or the other has won a hand. Not so subtle attempts at cheating by trying to substitute the next card in the stack for the current because the kid took a peak and knows they’re about to lose another hand. Long, wailing laments about how it isn’t fair that they haven’t won a ‘war’ in “forever.” Longer, louder wailing laments when they haven’t won a game in “forever” and it should be “their turn” to win. Accusations of cheating, bending of the rules by pulling a clump of cards off and then “just happening” to pick the highest one out.

It’s also good for early bed times, under the right conditions.

In short, it’s good for building character,

Categories
Armoire Woodworking

Armoire Update

Progress has been slow, but steady on the armoire. The sides glued up without incident. Completing that portion allowed me to move on to the back. And working on the back brought the realization I’d made a mistake in my wood quantity calculation.

I’d originally thought I’d use tempered masonite for the rear panels. I, in fact, did exactly that for the lower portion. But in working on the back for the upper portion, it occurred to me there’s a major difference between the back of the lower half and the back of the upper half of the armoire: the rear panel of the upper half is visible. (The lower half consists of 3 drawers, so the only way to see the rear panel is to remove the drawers or get behind the whole thing, niether of which is easy.) Tempered masonite is fine to use as a panel, but not when it will be visible in a natural wood piece of furniture.

Fortunately, when I’d purchased the wood, I got more than I would need on the grounds that I’d just use it for another project down the line. Guess that project down the line has arrived.

After the jump are some pictures.

Categories
Family

The Lass in Her Glory

For posterior’s posterity’s sake.

Categories
Family

Welcome Back Louie

The moment has finally arrived. Ever since the boy brought home Louie the lass has been waiting for her turn. I picked her up and just got the two of them settled in.

Doesn’t look like Louie has changed much since the last time he was here.

Do I have to mention the dogs are excited to see Louie too?

Categories
Family

Parental Advice

Having read the latest in the ongoing “The Lass vs The Boy” wars, I got some advice from the Mom (my Mom):

Sounds like the kids are either having ‘hormonal’ issues with their behavior ….. or are just having simultaneous growth spurts and vying for top billing … they are certainly ‘taggersizing’ their parents … no friends, no electronic games, no special activities, no life …. levers are getting harder … maybe: take EVERYTHING away … only pre-committed activities then home … nothing else until they get the message … might take a week for them to see the consequences … it’s hard dealing with two competitive little personalities … challenge, challenge, challenge … no easy solution.

Mainly, I’m struck by the approach here: “take EVERYTHING away.” Wow. Definitive, harsh. I can just imagine them coming home and being relegated to sitting, no speaking, not even allowed to twitch. “I saw your finger move! That’s another week! No A MONTH!” I have a younger sister and brother- little wonder we walked the straight and narrow most of the time.

I think the main thing to realize about behavior patterns like the kids are exhibiting right now is it needs to be dealt with consistently until the message is received. Excusing it (Oh, they’re just tired from a long day at school) is tempting because nobody we naturally want to be understanding, but it doesn’t do the kids any favors. Or us for that matter. Misbehaving is misbehaving and granting excuses ultimately encourages the behavior.

In my mind, the nub of the problem is, where their sibling is concerned, the boy and the lass have no impulse control. All they see is the challenge of an opponent who, in the heat of the moment, must be vanquished at all cost. Damn the consequences. It’s that last part that the Wife and I have to break through- start getting them to think for just a second “If I do this, Mom and Dad are gonna kill me…” Or something close to that.

I think I get the Mom’s thinking.

Categories
Football

Gimme A Break

It is my contention that football is an interesting enough game without silly, made-up drama. The games are highly entertaining, the sub plots for the playoff spots are a drama unto themselves, and the personalities of players are on display like never before. Plot lines don’t have to be made up, they are there for the offering.

But here we are, 2 games in to a 16 game football season, and the storyline du jour is that there are a bunch of QB’s who are “on pace” to break a season long record.

Really? I mean, really? Did I mention that the “on pace” part consists of 2 whole games? Were these guys extrapolating out the 400+ yard passing performances in week 1 and predicting someone would surpass the 6500 yard mark for season passing? Didn’t Brady pass for over 500 yards in week 1? I mean, why not predict the “much-ballyhooed” 8000 yard mark will be eclipsed?

Here’s the best quote from the linked article:

The NFL has morphed into a passing league in recent years, …

I mean, good grief. “In recent years”!?!?! How long has this person been watching football? And what were they watching that ever gave the impression the league was run dominated? I know Barry Switzer coached for a bit, but I’m pretty sure he left the wishbone back at Oklahoma. Hell, Oklahoma doesn’t even play a wishbone offense anymore.

The mind boggles at silliness like this.

Categories
Family

Wish I’d Been Wrong

On the way home from his martial arts class the boy asked me if I’d want to play Lego Star Wars on the Wii with him. He’d received a gift card a while back (to GameStop) and hadn’t spent it all in one place. He really wanted to buy another Wii or DS game so the Wife and I relented on the ground that, it’s his money anyway and we couldn’t really tell him ‘No.’ At least, not defensibly in our view.

Anyway, I answered by way of informing him that one of his friends would probably be coming over this weekend so I wasn’t sure. The information had the desired effect and he said “Well maybe he and I can play, right?”

I then went into my boilerplate response: “Well, if it’s rainy outside this weekend then maybe, but if it’s nice out then you guys are going to go play outside, not sit in the basement playing video games.”

And then, in a moment of jesting I ribbed him a little: “Besides, maybe he’ll do something and won’t be allowed to play video games. Or maybe you’ll do something and we’ll take video games away from you for the weekend. There’s a lot of time between now and Saturday.” I said it all with a smile so he knew I was joking and that I didn’t actually expect him to blow it. He replied he could do stuff to earn more Wii time and I told him that was a good attitude to have.

And then we got home.

Five minutes later, I’m preparing turkey burgers and I hear a commotion outside. The lass then comes running in as the Wife is heading out to investigate.

The lass says her brother hit her. I squeezed the wad of ground turkey, swore, scraped it off and started again with that patty.

So the Wife is calling him back in the house and asking if he hit her. He owns up to it but add “But only because she hit me.” The Wife then turns on the lass, who gets the words “I didn’t do it hard…” out of her mouth before the Wife acts with the swift, brutal sword of exasperation. I mangled another turkey patty.

Even before she passed judgment, I’m thinking it in my head. Then she pulls me into it: “You know what I’m thinking Dad? ” she yells over to me. I’m shaking my head as my earlier conversation with the boy is replaying in my head “I’m guessing it was something to do with the Wii and DS,” I answer. And then she makes it official, “I’m tired of this stuff from you two this week, every day after school you’re fighting with one another. Now, no video games this weekend, the Wii, DS or MobiGo.”

A short while later, the boy comes walking through the kitchen. I shake my head and ask him what he was thinking. He blurts out “I know. You were right. I’m so stupid!”

It was almost a classic “I told you so” moment. The only catch was I’d truly been kidding in the car. Or more accurately, I wasn’t wishing for him to screw up. Regardless, it was an unusual moment where I wish I’d been wrong.

Categories
Family

Scouting- The Adventure Begins

Tonight was our Joining Night for the Cub Scout pack. My Den grew from 6 kids to potentially 11. We also seemed to have picked up about 5 kids for our Tiger Den, which is what our Den started at last year.

Thankfully, this year’s group was just as befuddled about Scouting as we were last year. Good to know it wasn’t just us at the time. I tried to help them out, give them a blueprint of what they would be doing as Tigers and give them an idea about the Pack meetings and so forth. Don’t know if they felt any more comfortable with it by the end, but they’ll come up to speed.

The boy was in rare form all night from the time he got home. Running around and screaming and contorting his face. Remarkably, he did his homework without complaining. Then went right back to taggersizing his sister. Probably have to chalk it up to excitement about Scouts. He wore his shirt to school today, which earned him a reward at the meeting along with the other kids who wore their uniforms.

The lass was pretty good today, but the excitement of Scouts got to her. By the time she got home, she was screaming at anything that didn’t go her way, including not being able to buckle her seat belt and breaking a pencil multiple times. There was something about water at bedtime as well, can’t really be sure what it was about though. The only thing certain was she needed to go to bed. Badly.

Just another night with the Scouts.

Categories
Misc

I Want One

Of these.

Awesome.

Categories
Dictionary Family

Taggersizing

What’s “taggersizing” you ask?

Allow the lass to fill in the blank:

“Moooom! Daaaaad! My brother is taggersizing me!”

Hmmmm. It still might not be totally obvious. Let’s see…

At the time she made that statement, her brother was teasing her and making her upset in that way that only an older brother can manage.

Figured it out yet? Hint: it’s not “teasing.”

Alright, here’s what she would have said if her age matched her vocabulary:

“Moooom! Daaaaad! My brother is antagonzing me!”

Categories
Football

Well That’s Useless

I wanted to stream the game for a bit tonight on my laptop. Turns out that I can’t do that because NBC uses “Silverlight” technology from M$. Grrr. Never thought I’d be wishing for Adobe Flash, but there it is.

So the uselessness of NBC streaming decision aside, how ’bout Tony Romo? I wonder if that’s the sort of game that get’s things turned around for him, or if the injury keeps him out too long for it to matter. He always said he was a fan of Brett Favre, wonder what he would have done? Actually, no. I don’t. I wonder if Romo will do the same thing though. Guess we’ll find out next week.

The Patriots looked real good today. Although I wonder what Pat fans think of all of Brady’s gesticulating and yelling at receivers when he throws and incompletion. At one point, I could have sworn he had a “Manning-face.” My guess is Pat’s fans are just fine with it. He’s not Manning after all.

The Lions are looking interesting, as are the Bills. Both because of young QB’s who are looking pretty good right now. The trick will be seeing how much their schedules matter to their success.

Categories
Family

Kids Are Manipulators

Lest anyone think it’s just my kids who like to exploit a situation for their own gain, I’ll relate this quick story about the boy’s friend. For the purposes of this post, I’ll refer to him as “the friend.” (I know, highly original.)

The boy spent the afternoon after their soccer game with the friend. They were both in pretty good spirits because they’d won their game. While over there, the friend and the boy wanted to play the Wii. There was just one problem, the friend had been banished from playing the Wii for the weekend because he’d hit his younger brother earlier that morning.

But the friend is persistent and creative so he decided to try and exploit the boy’s presence as a guest. He told his Dad that the boy “was bored and really wanted to play the Wii.”

The friend’s father was relating all of this to me and I just had to laugh. I’m pretty sure the boy has tried that tactic as well, with a similar result.

The result was surely not quite what the friend had hoped for. The boy and the friend’s younger brother were allowed to play the Wii for a time, but not the friend.

Categories
Misc

Change

I think today has to be the unofficial first day of fall. Temps this morning were in the low 40’s and temps right now have fallen below 50. It was cool all day. All we need is some color in the leaves and we’re good to go.

The boy got good news today. His teeth are holding the correction and the orthodontist should be able to take them off during our next visit. He took a panoramic x-ray of his jaw (very cool technology BTW- all the incoming adult teeth are visibly obvious) just to make sure there weren’t any obvious problems with the incoming adult teeth. I think he’ll be happy to have them off, but sad he doesn’t get to choose the colors that cover the braces.

Our new couch arrived today. The kids were so excited it’s hard to describe it appropriately. While they were in school I moved the old couch into the basement; leaving a big open area in the family room. When the lass came home, she ran around the space just because she could, squealing with delight. You’d think she’d never been in the room before. Or any room period for that matter. When I picked the boy up from school, the first question out of his mouth was whether the couch had arrived. When he got home, he also ran around the room. When the couch finally arrived, they were the first ones on it. Who knew couches were such a hit?

Both kids have soccer tomorrow. It’ll be the lass’ second practice and the boy’s first game. It’s supposed to be a beautiful Fall day.