23 Jul, 2008
deadlock Open Source Projects yald
I just released YALD 2.4.1 the other day. Mainly this release just added admin password hashing and improved database table indexing. For large directories, this should offer quite a performance increase.
My next big task is to clean up some of the code for PHP Deadlock (which noteable has not had a release in over a year and a half). In addition to cleaning up the code, I would like to add some features such as group support. Based on the traffic and attention it gets, I’m thinking it has much more potential the the link directory. Hopefully, I can start begin the task before summer is over. I have a couple other paid, non open-source projects that need to be finished up first.
22 Jul, 2008
dreamhost godaddy Hosting review
A client of mine had been using Godaddy for all his websites in the past. Part of my task was to load about 10 million rows into a database table. I found some workarounds with Godaddy but everything was just slow. Attempting to run a few long queries through PHPMyAdmin resulted in a timeout. Obviously, this is problematic with a 10 million row database, especially if you need to perform maintenance or make a change on the rows. It wasn’t worth it to buy a dedicated server just to run a long query every now and then.
I started looking for a new host and stumbled upon Dreamhost. I had read some positive reviews and a couple negative, but overall it looked good so I suggested he switch. Developing the site on Dreamhost has been night and day compared to Godaddy. Since they provide shell access, all the workarounds I created for Godaddy became one basic shell script. Dreamhost does limit the number of processes per account or user. I tried running 2 instances of my import script and they were both terminated, but I can’t complain because this keeps their services running consistently. Another problem I had was that they decided to reboot the server half way through an import. Third and fourth tries were a charm, the script ran all the way through both times.
I have seen complaints about them having too much downtime, but I personally have not witnessed this at all except for the one time they rebooted their server. Normally, the reboot wouldn’t have been a problem since it resulted in less than a minute of down time, but was an inconvenience because it terminated my process. I don’t normally post affiliate links, but I will this time because I’ve been so impressed by their price and service.
If you sign up for Dreamhost, either use my affiliate link or enter promo code YALD for $10 off any package. The affiliate credit will support my open source projects. If you don’t want to give me any credit for whatever reason, you can use this link.
22 Jul, 2008
certification PHP test zend
I decided to have a go at the Zend PHP5 certification test a few weeks ago even though I don’t believe in this type of test. After all, testing you on whether or not you know exactly what the strtr() function does isn’t going to gauge how good of a programmer you are. In the real world, you’re going to have the PHP manual and Google at your fingertips. Of course having the certification can’t hurt on a resume.
I purchased the test on line for $125 along with 5 practice tests that costed a little extra and was able to schedule for the next day. Practice test #1 I failed, but I managed to pass all the subsequent tests. Yes, the practice tests helped.. they were very similar to the actual test.
My advice: If you’re planning on taking the Zend certification test, be sure you know your OOP syntax, function arguments and XML parsers. Since I don’t use OOP or XML too often, I had to brush up on those.
Overall, the test certainly wasn’t as easy as I thought and I didn’t feel that I did that well. Unfortunately, or fortunately rather, Zend doesn’t allow you to know your score. Regardless, despite my bad feeling, I managed to pass, so now I’m Zend certified. I am still awaiting the arrival of my certificate.
21 Jul, 2008
function PHP
So I needed a way to parse/extract a location string into the city and state or zip code for a client’s site. If you don’t quite know what I’m talking about, head over to Superpages and look at the location field. A couple Google searches later, I decided to just go ahead an write my own function. This sounds easy until you think about it. Any of the following inputs need to be able to be parsed.
- dallas tx
- dallas, texas
- los angeles california
- washington disctrict of columbia
- richmond virginia
- charleston west virginia
- 90001
This is beyond the scope of a simple regular expression. We can’t simply use the last word of the input either since the state could be multiple words like in case #4. There’s no way to determine which word or group of words is the state without testing the string against an array of states. As you can see, cases like #5 and #6 complicate things even further because if we test from the end of the string, virginia could also be west virginia.
Here is the function I came up with. Please let me know if you find a bug or condition that cannot be parsed. Read the rest of this entry »