corycollier.com | Web Development and System Administration

Recently while working at my new job at Hydra Studio, my buddy Rob and I came across an issue that was killing us: 

“Invalid parameter number: no parameters were bound”

 When people used our search feature on our site, a few specific search terms would result in un-caught exceptions. Of course, this ONLY happened on the client’s server. Nothing like saying a project is solid, only to find out there’s something ’special’ about the production environment.

The first thing we did, was to list out what was unique about the client’s server. The client was using a Media Temple box running CentOS 5.2. For the un-initiated, CentOS is the free version of Red Hat Enterprise Server. We run Macs in the office, and our staging server is a Mac too. Other than the OS, the normal ‘LAMP’ stuff pretty much matched verbatim. 

So, we started digging into the differences between the compiled versions of PHP between the development and production environments, and one thing popped out at us:

PCRE

The version that’s supported on Red Hat / CentOS is 6.6. That’s horrible. 6.6 came out nearly 3 years ago, and the version the client was running had no support for unicode at all. A little research, and we found out that Zend Search Lucene (what we built the search functionality on top of) requires unicode for the way it stores search indexes.

With that, we figured we were done. The client had a limitation on their server, they needed to address it, and the problem would fix itself when they did. Not quite so fast …

I was testing some of the searching on my iMac, when the same issue happened on my own computer. Disaster! Could it be that something in our own code was the culprit? What half-reproducible error was causing this? 

After hours of searching for an answer on the googlez, I came across some help on the Zend Issue Tracker. It turns out, that PDO was failing when it was trying to prepare a statement, when that statement contained a question mark. When I switched my SQL adapter to Mysqli, the problem was solved. Both the production and the development environments were bug free after the change.

It turns out, that our search indexes would return fields that either contained question marks, because they actually existed in the document (as was the case locally), or because the document had encoding errors when the search index was built (as was the case on the production servers). The ORM we used would grab the documents, and grab relevant data from the database by querying with the fields stored in the index.

The SQL that was being prepared, would then look something like this:

‘SELECT id FROM folks WHERE first_name LIKE ‘Jo?hnny’

The question marks would be interpreted by PDO as variable markers, which rightfully didn’t exist.

So, the real solution wound up being a little bit of a mix between the client’s problem, and our own. Granted, we needed to catch question marks being stored in db before they got there. That improves the longevity of our own code. However, the search functionality will still return results that may have question marks in them, thus causing the same issue. That issue is resolved by using Mysqli, but that feels more like a hack, than a solution.

Anyways, I spent a long time trying to search the answer to this and found nothing except the one mention in the issue tracker. For those of you using Zend Lucence Search on Red Hat / CentOS servers. Make sure you use Mysql if you’re using the Zend ORM to populate models based on results returned from the index. 

Oh yeah, and make sure you filter your input too, Mr. Bobby Tables…..

Oct 06 2008

The End

So, after listening to all of the news, and hearing all of the hype, I’ve come to the single conclusion anyone can make:The end is near. Seriously though, I don’t know how anyone can stare down the barrel of the sort of debt collection going on right now, without visualizing the Four Horsemen.

I’m not an expert on finance. I write neat websites for people. I have a degree in civil engineering (which means I had to fight through some calculus classes). I’m not at all qualified to make judgement on what’s going on in global credit markets.

That doesn’t mean I don’t have an opinion however.

Hearing the amount of security trading going on is astounding; something like 60 trillion dollars of potential debt being traded on 5 trillion dollars worth of bonds and other investments. To put that number in perspective, the entire GDP of the country is 12 trillion dollars annually. That means, that the value of what our whole freakin country makes every year (the largest economy in the world), is worth 20% of what might need to be collected at any given time.

Again, I’m not an expert, but wasn’t much of the cause of the bank run in 1929 based on a re-valuation of assets in the stock market? When people started needing some re-assurance of the value of the companies they were buying into, and companies couldn’t produce proof of value, the value was adjusted, violently.

History, always repeating itself …

It’s a cliche, I know, but ‘Those who fail to learn from history, are bound to repeat it’. So, folks have invested 60 trillion dollars that’s only really worth 5 trillion dollars? Am I reading that right? If not, please let me know. But that’s the way it’s been explained to me. Imagine if your salary dropped to 8% of what it was before. In other words, if you made 100k a year before, you’d be down to 8k a year afterwards.

Nobody is going to take that sort of a loss lying down. People are going to fight to keep as much of their money as they can. That’s what makes the current ‘crisis’, sound much more apocalyptic. When folks are put in desperate situations, they do desperate things. There are a number of instances this has played out in history, and many of those instances were bloody. 

So, what does a normal guy do? How do you get food, and service when green money has no value? I’m jumping a few steps here, I know. However, I can’t see any other outcome, than a complete devaluation of printed money from this. I could be wrong (actually, I am quite likely completely wrong).

But seriously, if money has no value, then what does?

Welcome to a bartering society. What can you barter? Sex always sells. Drugs will sell. Food will sell. Post-economic collapse, it’s likely that they will sell in that order too.

Sad fact about all of that, all of the progress our society has made in tolerance, civil rights, equal protection under law; forget it. The entire basis of our society’s ability to enforce these ideas depends on the general populace’s willingness to abide by them. When folks can’t find their next meal, you can forget it. Outside of divine intervention, we will plunge into the sort of violence most people normally associate with the third world. You might hope that we would all come together in the worst of times. History does not bear that idea out. Remember, if you don’t learn from history …

So, what does a normal guy do? Get in shape, stock food, stock ammo, and hedge any investments you have with tangible worth. When society fails, you’ll need to provide worth in a society that will only require services that provide immediate security and well-being. 

Good luck.

I went to my first UCF home game at the new stadium yesterday, and I’m a little disappointed at the experience. There was plenty of cool tailgating going on, and there are a lot of new shiny buildings out there which were really nice too. Shiny things withstanding though, I’d rate it a mediocre experience for a few reasons.

  • Fan involvement -  While I was sitting in the USF side of the field, I swear the USF fans were much more involved in the game than UCF fans were. Those fans know all of the songs, word for word, and they belt them out with full force. By contrast, the only time our fans started to act half as involved, was when it looked like we had a shot to win.
  • Fair-weather Fans - with about 12 minutes left in the 4th quarter, a lot of UCF fans gave up, and started leaving. Of course, this was much to the delight of the USF fans, who started chanting “Where You Going?”. If our team has any shot of being successful (more on that in a bit), then our fans have to start acting the part. I suspect many are waiting for a successful team before they start rooting for us. That’s a bad attitude to have, and I suspect your life would reflect poorly if you carried that attitude at work, or at home.
  • Fan belligerence - I was attacked by a UCF fan when I was walking out of a Porto-Let. The guy had me confused with someone else, and as I opened the door, I got punched in the face. I’m not a small guy, so the guy doing the punching must have had a hell of a lot of liquid bravery. I wrestled him to the ground and pinned him, pleading him to stop. After a minute of futile squirming to escape, he gave up. However, as soon as I let the guy up, he was screaming obsenities at me. He just had his ass handed to him (and I didn’t hit him at all), and he was still ready to fight.
  • Undisciplined Players - I thought George O’Leary was some kind of disciplinarian. Watching the game last night, you wouldn’t know it. While I’ve heard some guys say that the refs were making bad calls, most of the calls I saw were completely legit. Our players were making some of the dumbest penalties I could think of, and it cost us the game. I might have sympathy for that sort of thing on the first game of the season, but not the second. I’m especially disappointed to see that sort of behavior against a team we lost severely too last season. I thought we were supposed to be the cleaner smarter team?

So, while the tailgating is excellent at UCF, the game leaves a lot to be desired. UCF fans were largely uninvolved. The most involved fan I saw all day, I had to pin his head to the ground to make him stop. That sort of behavior carried on to the field, were we might as well given guns to our players, so they could try to rob USF players. 

I’m not usually one to play Chicken Little, but I really think someone should be putting the pressure on O’Leary regarding the penalties. There’s no excuse for that sort of thing. If our players are outmatched, and we lose, that’s one thing: Playing dirty football is another. I’m quite ashamed today, even if we did almost win.

UPDATE

My buddy Alex has a good review of the game on his amazingly awesome UCF sports site, UCF Insider.

 

Gembecki Mechanical Services, Inc. - A greate HVAC contractor working out of Central Florida!

So, my AC stopped working last night. I live in Central Florida, and it’s August, which means I was in hell. Melissa and I tried to fix the issue, but eventually accepted that we needed a professional to repair the system. A mechanical engineering friend of mine recommended Gembecki Mechanical, so I gave them a call. I was quite pleased.

Melissa had called me yesterday morning to let me know something was up with the AC system. I was really busy at work, and hoped she was just crazy. I forgot about the problem, went to the CoLab Orlando open house and came home. When I got home, I learned quite quickly, that Melissa was not crazy at all. Read the rest of this entry »

Aug 28 2008

UCF Insider

So, my buddy Alex, a Web Developer in Melbourne, came up with the idea to aggregate news to a single site: ucfinsider.com. It’s a killer site with a ton of information from a variety of sources about UCF sports. I’m not sure what gave him the idea, but I think it might have something to do with the lackluster reporting of UCF sports from the local paper, the Orlando Sentinel.

Yeah, so UCF Insider rocks, and you should check it out.

;)

So, I was watching RoboCop last night, and I noticed something a little peculiar. During the scenes where RoboCop is being tested before use, his prompt screen shows some MS-DOS like boot sequences. Here, check this out:

RoboCop's Boot Screen

For those of you who don’t immediately see what I’m talking about, look at the lines on the screen ‘command.com’, ‘config.sys’, ‘bio.com’, ‘comspec.exe’, and ‘memory.dat’. Those are all very MS-DOS like files that run under typically Windows operating systems.

Seems appropriate, I suppose. Just think about it: “Police states of the future choose Microsoft!”

Loading the background image. This will cache after the first load.