Notepad++
Presentation for developers
Yesterday, I had to give an introduction to the LAMP stack to a group of trainees. My energy was mostly focused on the MySQL and PHP part. I had gone to the workshop with some source code examples and no slides. I am convinced that this is the best way to present talks to a group of developers i.e. using a white board and source code. Though I will not say that the trainees were hanging on to my every word, they asked question and I did not see anyone fall off to sleep
. I introduced them to DBDesigener, phpmyadmin, and Adodb.
It also helped that I used these tools in most of the work I do and knew them quite well. I was able to show them how they will be using them in Real Life.
Advanced PHP Programming impressions
Got myself "Advanced PHP Programming" by Schlossnagle. I started reading it last night, (currently on chapter 3 - "Error Handling"). Excellent book, with clear and good examples. The examples are culled from real life. In chapter 2 (Object Oriented Programming through Design Patterns), he explains how Design Patterns can be applied when making websites. It was one of those "aha!" moments. This is a book I have been looking forward to lay my hands on for a long time.
One complaint though (with the Pearsons's Low Price Edition of this book) is the pathetic quality of figures. It looks like the pages have been photocopied from their original color print.
Fighting Comment spam
Wordpress has a nifty feature for fighting comment spam. It allows you to blacklist certain words (like Viagra, casinos). Any comment which has those words (either in the URL, comment body or email) is held for moderation.
However, this method is not perfect. For example, the default word list does not contain the words "poker" or "anti-wrinkle cream". I use a combination of Bloglines (my feed reader) and my "Comments RSS" feed. I have subscribed to my "Comments RSS" using Bloglines. This enables me to keep an eye on what comments have been posted on the site.
An aside: Interestingly, I have seen that the spammers target the articles which are older rather than the ones that are fresh. (i.e. my posts of November receive more spam comments as compared to the December ones). I guess, the idea is that once the articles have been moved off from the front page, not many users bother going back to the archives.Whenever a new comment appears on the blog, I can either respond to it (if it is legitimate comment) or in a quick glance check out what new words the spammers are linking to. Add the new words to the Wordpress's blacklist, rerun the comments through the new blacklist, remove the comments that have been trapped and you are back in business with a spam-comment free blog.
sending a geek on a guilt trip
One of the methods used by normal humans to send other (normal humans) on the "guilt trip" is to use the cliche "every time you do THIS or THAT god kills a kitten. Please, think of the kittens..." For an even bigger guilt-trip, you can use "every time you do THIS , somewhere a kitten gets run over by a Monster truck. given not ten minutes ago to the five year old girl standing by the side of the road, spattered, red, and crying as she fumbles with her inhaler" (Thanks to Brian Bilbrey, member of The Answer Gang for the picturesque description )
Frankly, the whole killing of the kitten part leaves me rather unmoved. Having lots of free time on my hand lately, I thought of things that would send me on a guilt trip.
- every time you do THAT, your email id gets harvested by Mr. Joseph Adisa of Lagos, Nigeria
- every time you do THAT, Microsoft issues ten critical updates
- every time you do THAT, some clueless bastard says "Linux has less viruses because it is less popular " (my veins are throbbing just writing this)
- every time you do THAT, some luser says "IE is better than Firefox since IE supports advanced features like ActiveX"
- every time you do THAT, someone starts building a new Linux distro
php manual on your hdd
One of the strong points of PHP is its well annotated online manual, which is peppered with useful code snippets and hints. How many times have you pointed your browser to php.net/manual/ to look up that at-the-tip-of-your-mouth function's argument list ? If you or your company use the manual frequently, it might be a good idea to mirror the manual in your internal network. I have mirrored the manual in my office, and the two benefits that I see are
- Faster manual lookup - Living in a bandwidth starved country(India), this is a major win for us.
- A peek at well written code, again a major win if you are always looking for new and nifty way for doing things
The process of how to go about mirroring the manual is surprisingly well documented at Mirroring The PHP Website. As suggested by the documentation, You may want to exclude out certain non essential things ,like the manual in different languages. I also excluded the tar.gz and the zip files in the extra directory.
After downloading the manual pages, I created the virtual host (a simple copy-paste with some minor modifications) for the manual and that was it. To keep the manual uptodate I run the rsync command once a week.
For the record, my rsync command is rsync -avzC --timeout=600 --delete --delete-after --include='manual/en/' --include='manual/en/**' --exclude='manual/**' --exclude='distributions/manual/**' --exclude='distributions/*.exe' --exclude='extra/*.zip' --exclude='extra/*.tar*' --exclude='distributions/*' rsync.php.net::phpweb ./ Of course, you will need to change this to suit your needs.
Page 55 of 61, totaling 427 entries