Archive for February, 2005

The Perfect Patron

The unfortunate reality is that artists need patrons. Many artists struggle with the fact. Some people call it selling out. I wouldn’t call it selling out, only trying to make a living doing what you love. Whatever you call it, many times the relationship between patrons and artists isn’t a good one or a healthy one.

Artists tend to have their own mind in regards to the way things should work. They tend to believe in having absolute control over their artwork. After all, it is their artwork right? Well, that’s the problem. When someone else is buying the artwork from an artist, or commissioning an artist to produce a work, the owner is a mixture of the artist and the patron. Very rarely do the artist and the patron’s views line up.

I suppose that’s why I’m blessed. My first patron, my friend Erik, has been very good to me. I had painted a painting and he asked if I would paint him 2 more for a certain price. I said “sure.” He had an idea of what he wanted and, for the most part, I agreed with his idea. Well, he was very patient with me and supportive. I took a long time to complete the paintings (months and months) but calmly he waited. Upon delivery of the paintings he seemed happy and expressed his happiness with them. He then paid me then and there for my efforts.

For all these things, Erik is the perfect patron. Unfortunately, I am spoiled because he is also my first patron. It can only be downhill from here.

As for me, I’m trying to get better about finishing work in a timely manor so the next patron won’t have to wait as long as Erik did. Not every patron will be as patient as Erik.

I just want to thank Erik for being such a great friend and patron. He’s a true blessing. I hope future patrons will act with a grace similar to him.

Online Poker & Cheap Viagra (aka Filtering Comment Spam in Movable Type)

I hate comment spam. I love movable type. What’s a boy to do when he receives more than 20 comment spams a day?

This boy edited the Movable Type source code to filter the comments.

Because I hated having to go through ever day and filter the valid comments from the spam, I wondered if there was a way to filter out the spam before it got posted. I noticed that most of my spam messages contained the <H1> tag and some sort of message about Cheap Viagra, Texas Hold’em or Online Poker. I then realized I might be able to flag comments containing words such as “poker” or “Viagra”, and certain tags, like the <h1> tag, as spam – thus giving the spammer an error. This solution works much the same way that your email spam filtering system does.

After a bit of searching I found the “Comments.pm” file in the “lib/apps/” folder. This file contains the code that preps and posts the comments to the database.

Do not confuse this file with the “comment.pm” file in the “lib/” folder and please, before you begin, make a backup of the “Comments.pm” file.

If you open the “Comments.pm” file, you’ll see a lot of code – somewhere around a thousand lines to be exact. We’re going to need to find a few lines of code around the 230-250 line count (the exact line depends on the release of movable type you’re using. I’m using a version of release 3). The code should look something like:

if (!$q->param(‘text’)) {
return $app->handle_error($app->translate(“Comment text is required.”));
}

Directly *after* those lines is where we want to put our code. Our code will look something like this:

my @postFilter = (“h1″);
my $indexCompare = -1;
my $postFilterInst = “”;
foreach $postFilterInst (@postFilter)
{
if (rindex(lc($q->param(‘text’)),$postFilterInst) != $indexCompare) {
return $app->handle_error($app->translate(“Your comment has been flagged as potential spam. Please email me if you are getting this error in error.”));
}
}

The first line of our code contains an array with the words we want to look for. Since all of the spam we get contains the “<h1>” tag, we set “h1″ as a flag by including it in this array. We have to be sure to type in all lower case because the rindex function we’ll be using on line 6 is case sensitive.

The second line is a variable containing the value of the rindex function if it doesn’t find a match.

The third line initiates the variable “$postFilterInst” – post filter instance. This will contain each individual instance of the postFilter array as we loop through to check the comment post against our flag phrases.

The fourth line contains the loop that will pull each value in our @postFilter array.

The sixth line is the part of the code that really does the work. This is where we check to see if the comment posting contains any of our flag phrases. If the comment does, the eighth line will pop out an error that tells the comment poster (aka spammer) that their post wasn’t valid and, in turn, not allow the program to insert the comment into the database. This is also where we convert the comment to all lower case so H1 or h1 will both create a match.

That’s it! So if we’d like to filter out poker, the code would look like this (all you have to do is replace the “h1″ in double quotations in the first line of our script with “poker”):

my @postFilter = (“poker”);
my $indexCompare = -1;
my $postFilterInst = “”;
foreach $postFilterInst (@postFilter)
{
if (rindex(lc($q->param(‘text’)),$postFilterInst) != $indexCompare) {
return $app->handle_error($app->translate(“Your comment has been flagged as potential spam. Please email me if you are getting this error in error.”));
}
}

Now lets say we want to get really fancy and filter out multiple words. It’s pretty simple, all you need to do is add more words to the @postFilter array by adding ,”whatever”. So if we wanted to filter our comments for “h1″, “viagra” and “poker” the code would look like this:

my @postFilter = (“h1″,”viagra”,”poker”);
my $indexCompare = -1;
my $postFilterInst = “”;
foreach $postFilterInst (@postFilter)
{
if (rindex(lc($q->param(‘text’)),$postFilterInst) != $indexCompare) {
return $app->handle_error($app->translate(“Your comment has been flagged as potential spam. Please email me if you are getting this error in error.”));
}
}

And that’s it. You can add as many filters as you’d like by adding more words or phrases to the @postFilter array.

Don’t forget, if you’ve edited the “Comments.pm” file locally on your computer, you’ll need to be sure to upload it in ASCII otherwise Movable Type will not work.

Exodus 20:7

“You shall not take the name of the LORD your God in vain, for the LORD will not leave him unpunished who takes His name in vain.”

Notice that God is exercising the original brand managament with this verse, one of the ten commandments.

Phone

“God called, he wants your life back.”

Sometimes I feel that message is for me. And, yes, I ripped that from goonieheart.

She Fell

An elderly woman fell today trying to ride the escalator at barnes and noble. She drove her walker onto the escalator and stepped on, but she stepped on the crack between the 2 stairs so it threw her off balance and she feel backwards. She hit hard, hit her head pretty good.

Her grand-daughter (I’m assuming) watched it all as she had gotten on the escalator first. I watched it all happen as well as I was waiting for help (with books) at the base of the escalator. As I was watching her first mounting the escalator I thought to myself “this isn’t going to be good, maybe I should come up behind her and make sure she doesn’t fall.” By the time I had decided to not do what I had thought, she was falling. My initial thought, gut instinct, was dead on… If I would’ve gotten on the escalator behind her I probably could’ve prevented her from hitting her head (or hitting as hard at least). Unfortunately I fought against it and didn’t react.

As soon as she fell though, I ran up and helped her. I was the first one to her, the grand-daughter was just looking on in horror with her hands over her mouth. I held her hand and her body as she lay there. I really didn’t know what else to do. Fortunately, more people came very quickly and we lifted her off the escalator and carried her down to the first floor (per an MD’s advice who happened to be there). Someone called 911. She was a bit groggy at first, I wouldn’t be surprised if she lost consciousness for a while but she seemed to be ok in the end. Thank God.

Things like this make me very sad. They also strike a rebellion chord against growing older. I don’t want to be one of the ones who falls at barnes and noble or has a heart attack at home. I love being alive and would only trade it for a quick peaceful death and an eternity in Heaven. I guess these things serve as a reminder of mortality and the fallen state of the world.

Salty’s

We have places where they serve no food, you just go there and drink drinks. Some people call these bars. They’re very popular.

I’ve decided to open the opposite. I’m going to open a place that serves only food, no drinks. I’ll call it “Salty’s.” I think it’ll be a big hit.

Listen, Validate, Pray

Not of my own invention, this is the simple three step guide to support in a small group or person to person interaction.

1) Listen
2) Validate
3) Pray

There is no belittling of pain, no taking responsibility, you are simply showing your support for the person with the problem. I think it’s a pretty handy guide to go by.

Just Do It

I know that’s a trademark by a corporation but man did they hit the nail on the head. Just do it. So simple, but so right.

I find in my life it’s hard to just do it. I usually have fears and reservations. I find it hard to just dive in. But I should just do it. The phrase is inspiring. Perhaps, this time, I will just do it.

My new year’s resolution is to be uncomfortable. Here I come.

Missing the Point

I talked to my mother last night. Among other things we talked about giving. She said something really simple, yet very profound. More proof that I miss the point way too much in this life. She said (paraphrased):

“It’s not about giving. That’s not the point. God calls us to become more Christ-like, not to give ourselves away. Now, in becoming more Christ-like you’ll probably be more giving but giving certainly isn’t the point or where the focus should be. The focus should be on getting yourself to be more Christ-like, no matter what it takes, however God calls you to do that. So if God want’s you to become a hermit because that will help you to be more Christ-like, that’s what you should do. You might not be giving much of anything to anyone if that’s what you do, but in the end it’s about your heart and the person you are, not the works you do.”

I thought that was really great. I still don’t believe there will ever be a point in live where anyone has nothing to give. And she agreed with that…but I suppose we could all argue detail all day or we could go apply some of this stuff.

Giving Too Much

Some friends and I got into a discussion today about giving. The real question of the discussion is “Is it possible to give too much.” My friends argued yes it’s possible, I argued that it’s not.

Here are some thoughts.

1. Giving to recieve is not true giving, thus is not what I’m talking about. Giving so someone will compliment you or do something nice in return is not true giving. True giving is giving out of love with no expectance of return gifts.

2. It is possible to give someone too much of what they don’t need. Giving someone what they don’t need is not true giving. Giving someone a stone when they ask for a fish, or need a fish, is not the right kind of gift. It’s certianly possible to give too much of the wrong thing.

How do you know what to give? You have to trust that God will tell you what the other person needs, or you can ask them what they need (note: they may not tell you what they need, only what they want… which are not the say. God knows what we need, we know what we want… If we’re in line with God sometimes we know what we need.)

3. How can I give good things when I’m broken? Shouldn’t I take some time to fix myself before I give… then I can give better? No. Trust God that he’ll make your gifts good (it’s not like you can give good gifts on your own anyway)… I believe God will give us anything we need. I think it’s our job to focus on giving and get past focusing on ourselves. If we waited to give until we were all fixed up, we’d never be able to give anything because we’ll never be fixed up. I think if we put ourselves out there and try to do good things God will help us out as He sees fit.

4. Well, what if I give everything? What if I have nothing else to give? I think you’re imperfect and I doubt you’ll give everything you think you can give. I also believe God will provide us with things to give. It’s not like we’re really giving anything anyway, we’re only allowing God to use us an a channel for his love… for his giving… and He is a well that never runs dry. In that way I guess you could say God is a little like Santa with the bottomless gift bag.

So what I’m saying is that if we give all that we can, and we make sure we’re truly giving and trying to align ourselves with the Lord, we can’t possibly “give too much.” I’m also saying “taking time to heal” is a load of BS. I think we are failing to rely on God and put our faith in God, or we’re giving the wrong gifts, if we’re afraid we’re “giving too much.”