Cleaning Up Maildir Directories
I have a TON of old messages to clean up in a maildir style directory. I don’t want to just delete them, but I do need to clear some space. Unfortunately, setting up a mail account to download and delete them will take forever.
A few Google searches have revealed this fun tool: cleanup-maildir.
USAGE
cleanup-maildir [OPTION].. COMMAND FOLDERNAME..DESCRIPTION
Cleans up old messages in FOLDERNAME; the exact action taken
depends on COMMAND. (See next section.)
Note that FOLDERNAME is a name such as ‘Drafts’, and the
corresponding maildir path is determined using the values of
maildir-root, folder-prefix, and folder-seperator.COMMANDS
archive – move old messages to subfolders based on message date
trash – move old message to trash folder
delete – permanently delete old messages
There it is in a nutshell. Not only will this let you totally cleanup a maildir mailbox, but since it’s just a single python script, it’ll let you automate any archiving or deletion tasks to your heart’s content — either as a single user or as an admin keeping an entire system under control.
It’s worth bouncing off of the project page for some examples and for a direct download link for the script. Just “save as” and copy the script to the host with your mailbox.
Keep in mind that you need python installed. I’m currently testing it with version 2.4.5 and I’ve not run into any trouble.
Definitely a good tool to keep around for just these situations!
Moving Forward
My birthday was great. Despite not being able to spend as much time with Corinne as I’d have liked, it was still good. Got plenty of well wishes and talked to a bunch of people that I don’t typically talk to.
Been doing some pick-up IT work the past couple of days. It’s good to be back in the more admin side of things for a change. A lot of what I do at work is more implementation and environment build-out.
There’s not a lot going on to speak of. Just getting back into the grind and trying not to be overly busy. Sucks that I’m somewhat failing at that.
31
My experience with “getting older” has basically been making fewer mistakes over time. I don’t find this to be a bad thing at all!
I’m happier than I’ve ever been and I don’t have anything to really complain about that’s not weather or climate related.
If that’s all the real bitching I have, then I’d say I’m doing pretty damn good!
I’m also enjoying the fact that 31 is a prime number… because I’m a nerd.
Great Lego Gear Tutorial
I came across an amazing Lego gear tutorial earlier today. While a lot of the information is familiar to me, it’s written in a very concise way that I think a lot of people will benefit from.
This information has a lot of fundamental overlap with pulleys, drive trains in cars and other gear-related mechanics.
If you’re a Technic builder and haven’t really sat down and thought about how you use gears and when one is more appropriate than another, then take a few minutes and read through this tutorial. Then read it again tomorrow!
Definitely a great find.
Welcome Back Haiku!!
A few days ago, I posted about determining the number of syllables in a word. I’m still happy with it despite a number of edge cases that I know won’t get caught.
I ported the old haiku that were submitted years ago from an old database backup to the new database and rewrote a front-end for it. You can get there by simply clicking on the Haiku link in the main pages list at the top of the page. The biggest pain in the ass is dealing with html encoding and special characters that go along with it that aren’t alpha.
Right now, you can add new haiku and view random haiku. I still need to write a paginated view so you can look through all of them — but that’ll be for another day.
Feel free to submit some of your own and look at those that other people have submitted — that’s why it’s there!!
Holiday Travel – 2009
I have just under 9 vacation days (70 hours) that I need to take by the end of the year. If I don’t, then I’ll lose that time… which would be dumb of me to let happen.
To help combat that, I just booked a trip at the beginning of December to visit my Mom in North Carolina. I’m also going to be booking a trip to Portland, OR a bit after that. I just need to make sure the days work well for everyone before buying the ticket.
I would have spread it out a bit more, but I’m going to be busy pretty much for the entire month of November, so that’s out. And if I wanted to do something soon, I’d probably end up spending a lot more for a ticket than I want to – so December it is.
Luckily, I’ll be back in plenty of time to finish up any running around before Christmas.
Lego Customer Service — A Surprising Pleasure To Deal With
Today I received an order of Power Functions components from Lego and the order was a bit messed up. I had ordered two of the following:
- Power Functions XL-Motor
- Power Functions M-Motor
- Power Functions IR Receiver
- Power Functions IR Remote Control
- Power Functions Extension Wire 20”
Instead, I received the following:
- 0x Power Functions XL-Motor
- 3x Power Functions M-Motor
- 1x Power Functions IR Receiver
- 2x Power Functions IR Remote Control
- 2x Power Functions Extension Wire 20”
Whoops!
So I’m missing 2x XL motors and an IR Receiver, but have an extra M motor.
I called up Lego and talked to a very nice customer service rep that got everything square and is shipping out the missing pieces straight away. She asked if I needed expedited shipping, but I don’t so I told her it wasn’t necessary. She also told me to keep the extra M motor — which they would probably only barely break even on if they paid for return shipping and packaging (I only paid $6.37 for each), so that makes sense on a few levels.
Despite the mix-up, it was a very easy call to place and get things sorted. I was only on hold for maybe 60 seconds, which obviously made the whole ordeal that much less of an issue. I was also pleased to see that I wasn’t given any sort of harassment about trying to “prove” that the order was packed incorrectly. I was simply taken at my word and the issue was resolved. We’re not talking about a ton of money, but I’m sure there’s some vendors that would give you a hard time.
All-in-all, I’m rather pleased with the response of Lego Customer Service.
Counting The Syllables In A Word With PHP
Years and many site revisions ago, I used to have a very basic haiku page on my site. People could submit their own haiku and bring up random haiku that were submitted previously.
The only problem that I had was that either people couldn’t count or they had a different idea on the classic haiku format (three lines with five, seven and five syllables, respectively). Thinking that there was no meaningful way to check the number of syllables in a word via code, I never pursued it any further and just left it as-is.
For no real reason beyond random inspiration, I revisited this idea and came up with a pretty decent function that will take a word and simply return the number of syllables.
Here’s what the code looks like:
function count_syllables($word) { $word = strtolower($word);
// Regex Patterns Needed $triples = “dn\’t|eau|iou|ouy|you|bl$”;
$doubles = “ai|ae|ay|au|ea|ee|ei|eu|ey|ie|ii|io|oa|oe|oi|oo|ou|oy|ue|uy|ya|ye|yi|yo|yu”;
$singles = “a|e|i|o|u|y”;
$vowels = “/(”.$triples.”|”.$doubles.”|”.$singles.”)/”;
$trailing_e = “/e$/”; $trailing_s = “/s$/”;// Cleaning up word endings
$word = preg_replace($trailing_s, “”, $word);
$word = preg_replace($trailing_e, “”, $word);// Count # of “vowels”
preg_match_all($vowels, $word, $matches );$syl_count = count($matches[0]);
return $syl_count;
}
It works based on the following assumptions:
- The number of syllables a word has is equal to the number of “vowel sounds” in the word
- A “vowel sound” can be defined largely by series of consecutive vowels (greater than or equal to one) with a few exceptions
- There are certain instances in which a “vowel sound” doesn’t indicate a new syllable
The letter groupings defined in $triples, $doubles and $singles (which get concatenated into the pattern in $vowels) are the summation of these assumptions. To handle the third point, I remove trailing “s” and “e” letters from words. Since I’ve removed any “e” from the end of words and the suffix “-able” is two syllables, I look for the pattern “bl$” to account for these discrepancies.
Also, to account for contractions, I’ve found that the string “n’t” preceded by the letter “d” typically should count as a vowel sound. Just finding the string “n’t” in a word doesn’t necessarily count as a vowel sound by itself. This allows us to properly differentiate between the contraction such as “can’t” and “couldn’t”.
For the most part, I’ve matched up any two-vowel pair with the exception of “ia”. This allows us to treat “i” and “a” as single vowels in words like “pliable” where they’d be otherwise be treated as a single vowel sound if the pair “ia” was added to the regex pattern.
I’m sure there’s all sorts of additional edge cases that I’m missing. And additionally, any non-English word has a chance of not abiding by these rules. The good thing is that if there’s any glaring holes, you can add new vowel sounds to the patterns above. Since preg_match_all() “short circuits” on a successful match (meaning that it will start at the next character after a match is found and start at the beginning of the match string), be sure to add them at an appropriate spot in the list. This also explains why the “larger” patterns should probably come first.
All-in-all, the function is fairly tight and small for what it does. With a minor caveat that there may be exceptions to the results it returns for weird edge cases, this should provide sufficiently accurate and efficient
The Great Lego Pneumatics Return
Something very exciting is happening in 2010. While that’s a very open-ended claim, I’m just going to jump to the chase — Lego is reintroducing pneumatics in their Technics line.
After many years of requests from consumers and fans, the Lego Technic Log Loader 8049 will include pneumatic components in a mainline Lego set-
- 2 pneumatic cylinders
- 2 pneumatic switches
- 1 pneumatic pump
- a bunch of tubing
There’s also the possibility of some T-junctions because there’s mention of the option to add an auxiliary air tank to the set:
Add compressor function by purchasing 8293 Power Functions Motor Set
At only $60 (and available for pre-order on Amazon.com now), what’s most exciting is that with this being the highest-priced set of the first quarter of 2010, there’s still room for a really big set to incorporate even more pneumatics later in the year! Maybe we’ll see something epic like the amazing Lego 8455 Pneumatic Backhoe.
Only time will tell… but this is a great restart of one of the greatest sub-sets that Lego has ever put out. Add these to the Lego Power Functions and and Lego Mindstorms sets, and you have a really large set of amazing tools for the creative designer!
Hello Doctor Chickenhead
We ran to Target yesterday to pick up some kitty litter and other random household necessities. While heading to the cash registers, we happened past the rest of the pet stuff can saw a section for “pet costumes”. There were plenty dumb ones, and I had no intention of getting any, but then we saw a small chicken cat hat “costume”.
It was so hilarious, that we had no choice but to get it. Knowing that Sabine wouldn’t be a fan, it was totally spec’ed out for Doctor Lovington.
Here’s a couple of shots I took with my phone (click for larger):
I think the third one is my favorite.
If this isn’t one of the funniest things you’ve ever seen, I don’t know what’s wrong with you!




