Back 10 entriesJune 18, 2005 to September 27, 2005Forward 10 entries

Secret Software September 27, 2005

There's been a meme crossing the internet of secret software. Basically, it's the software that programmers write for themselves that ends up in ~/bin and never sees the light of day. Putting the stuff up was probably started by jwz.

Anyway, let's see what I've got in mine.

afk

afk is a program I wrote in 2000. Asha and I wanted to talk all the time, but she didn't have a computer at the time. All she had was a shell prompt in the computer lab. I set her up with an account on sanc and we used ytalk to chat.

During this time, I wanted to be able to see when she logged in, so I made afk, which let me know who was logging in and out of sanc, as well as notifying me that I had email myself.

binarize

There was a short-lived thing where everyone on TempusMUD was putting binary ASCII in their title to spell words. This perl script translated both to and from that format.

checkip

I like to be able to get to my home computer from work, so this program contacts my router, parses out the external address, and checks to see if it changed from last time. If it changed, it updates the DNS on sanc to point to the new IP address.

fix-pgp-rfc2015

I had actually forgotten I had this. When I was using KDE, kmail used to only support pgp-signed messages in a particular format. This was a filter to fix the message signing.

mac2unix

Hm. I had forgotten I had this too. It just converts Macintosh line endings (code 13) to Unix line endings (code 10). This was more important when Asha still used a Mac

mac2winttf

This ruby script went through the AppleDouble information to get the resource fork of a Macintosh font. I can't remember it being entirely successful.

moz-new-window

Shell script to Do The Right Thing when opening a URL automatically in Mozilla. Firefox does the right thing already, so this isn't used much.

reverse

Ruby script to read lines from standard input, reverse their order, and print them back on standard output. Only truly useful when using lots of pipes on the command line.

summate

Another command line program, given numbers on standard input, writes their sum on standard output.

xmms-helper

Just a shell script that places its argument on xmms's playlist. I use it as the handler for mp3 files in Firefox.

journal-addentry

A perl script that adds an entry to my journal from standard input.

journal-virtue

A perl script that notes how often people have posted in their journals. Sherri is the top poster with 4.19 days per entry, followed by mels with 4.85. Useful, I know. I've got an entry every 7.77 days on average, myself.

spamscraper

Before I went to the more complicate spamassassin system on sanc, I used this. It flags a message as spam if a URL occurs more than twice in the same email. It was surprisingly effective.

tempus_stats

Opens up the player files for TempusMUD and figures out what the average and maximum character levels are.

word_analyzer

Does a word frequency analysis of my journal. It was surprisingly unenlightening.


PHP sucketh September 23, 2005

So I've been converting a project at work from MySQL to PostgreSQL, primarily due to licensing restrictions. About half of this project is written in the amazingly terrible but ubiquitous PHP. While looking at the code, I noticed that there were mysql_real_escape_string() calls everywhere. I knew that it was to prevent SQL injection attacks, but what was the _real_ bit about? Was there a mysql_imaginary_escape_string() call?

So I did a little more research, it turns out that the more concise mysql_escape_string() function is deprecated. This means that you shouldn't depend on it existing in the future. Why was it deprecated? From the manual:

This function is identical to mysql_real_escape_string() except that mysql_real_escape_string() takes a connection handler and escapes the string according to the current character set. mysql_escape_string() does not take a connection argument and does not respect the current charset setting.

It seems to me, lowly coder that I am, that if the original function didn't respect the character set the appropriate response is not to deprecate the sensible name and make a whole new function! You know that if or when the original function does disappear, everyone's code is going to be left with that crufty _real_ notation.

The best part of this is... The extra connection parameter that the new function was supposed created for is optional! They literally could have just replaced the old one entirely, fixing a potential security hole in older PHP code. Given the foreach fiasco which RedHat users everywhere have been suffering from recently, I can't believe that they consider backward compatibility to be important.

The more I learn of PHP, the more horrified I become.


July 05, 2005

A while back, I was emailed by a random person who wanted help with a problem in Common Lisp. He wanted a program that would generate a list of random numbers, using each number only once. Figuring that this was for a homework assignment, I gently prodded him with suggestions until he got something working. An elegant solution occurred to me soon after, so I copied it down.

I wanted to share this solution to Sean, who has no patience for strange languages. So I translated it rather easily to perl. This led to some speculation about benchmarks, naturally, so I rewrote it in C as well.

It's been a while since then, but I figured I'd share the solutions along with their relative times. This is partially motivated by an attempt to clean up my home directory:

2005-07-12 update: Redid the timing tests and added a ruby version. Oddly, the ruby version is faster on digital.


Nerdlings July 01, 2005

We were in a comic book store tonight, and there were a bunch of high school students studying and/or roleplaying at one of the tables. While perusing a stack of comics, I overheard one of them say, "That is so disturbing on so many levels"... and it was so disturbing on so many levels.


June 29, 2005

While we were on our New Mexico vacation, one of the things I wanted to do was to buy a drum. My in-laws really took this to heart, and we spent a lot of time looking for that perfect drum.

We were driving through the Chochiti reservation on our way to the Tent Rocks trail, when I saw a sign outside that said "Drums for sale," and then a second one that read "Pottery." Both Asha and I were very interested, but her parents were less so, and we went on to Tent Rocks.

It was a good thing, because we nearly collapsed under the heat. One of my vacation purchases was a Tilly hat, and I'm positive it saved my life. At several points, the two dogs we had brought with us were throwing themselves to the ground in any place that might offer shade. By the time we went back down, it was considerably cooler.

But enough with the digression. Later, we went to the pueblo and I was able to order the drum from a guy named Red Bird. He showed us exactly how he made the drums and pictures of the drums he had previously made. I ordered one from him, and he said I should get it sometime in the next week.

So we came back to Birmingham, and a week passed, and there was no drum. A week more passed, and then another. Finally, I called him at home, and he was very apologetic. Apparently, he had left his day planner out in the rain! He took down my address and phone # again, and said he'd mail it out next Tuesday.

So next week, I should have a cool authentic drum custom-made. :D


June 26, 2005

This has been a pretty good weekend.

Friday night, Asha and I went to go see Batman Begins and I can honestly say that it rocks. Christian Bale is becoming one of my favorite action movie heros. It easily blows all the other Batman movies out of the water.

Saturday, Kevin, Tracey, Asha and I went onto his forested 20 acres to cut up a fallen tree for firewood and gather blackberries. Then Asha and I drove to Tuscaloosa to eat at the deli and shop in Manna Grocery, then drove back and took the dog out to the park, which we had nearly all to ourselves.

This morning, cooked blackberry pancakes. Awww, yeah...

Predictably, Sean roped me into messing around with the internet radio streaming program, so it's starting to shape up into a very functional piece of software. Since nothing else seems to exist that does the same job simply, I'm probably going to release it as soon as I do all the packaging necessities.


June 20, 2005

At work today, I wrote a script that will enable some other guy to administer accounts on our company file share. That's lifted a load off my shoulders, since I've been hassled with menial account stuff since we started it. It should make everyone else happy, too, since now they don't have to deal with a crabby programmer/sysadmin who makes them type in a text console window.

Added Section 1.10 of the Common Lisp bit of pleac. Yee hah.

Sean is wanting to start up an internet radio again, and I've offered to help. We'll see if that pans out. I don't really listen to internet radio anymore, but I might if we get something going like the shasradio thing.


Fun times June 18, 2005

Asha and I went with four of her grad student friends to Visionland - an amusement park about twenty minutes away. We had a lot of fun, and I got to ride on my first real roller coaster.

Then we came home and collapsed in happy exhaustion. Watched Ocean's 12 on DVD, which I liked as much as 11, but in a very different way. Still need to see the new Batman movie.


A new beginning June 18, 2005

Following Aegir's example, we won't discuss the tardiness of journal entries. We'll just catch up on current events.

I live in a house now in Alabaster, AL. Same job, shorter commute. I've been enjoying it for the most part. We did have a bit of a disaster with a leaky toilet, but it looks as though that's over and done with.

A couple of weeks ago, we went to New Mexico to visit Asha's parents for a week. I've put up the photos from that trip.

I've been involved in the Programming Language Examples Alike Cookbook lately, getting the Common Lisp examples up to par. No reason, except it's cool to be in the AUTHORS file.

hatchet got a much-needed update. Command line arguments: OooOOoOOooooo.

That should be enough catchup.


Back 10 entriesJune 18, 2005 to September 27, 2005Forward 10 entries