Smarty is perhaps the most powerful and widely used PHP template engine available for PHP-based application developments. Though its usage has now been a bit pulled-aside by the rise of more advance frameworks such as Drupal or CakePHP, which come with their own template system implementations, for a "bare" template engine Smarty is still the favorite. I myself still use the combination of Smarty and PEAR (PHP Extension and Application Repository) for most of my PHP projects.
Taking it more than just a template engine, Smarty provides a built-in caching functionality. Smarty caches the server response, and that is in pure HTML. This is nice in the term of performance, especially for an extensive script-processing generated page (ie. script that does several database queries). As long as the cache hasn't been invalidated, in subsequent request of the page Smarty will simply return the pure HTML cache instead of executing the script every time.
Simple Text-based CAPTCHA Implementation
Spambots are automated scripts that crawl on the net searching for URLs containing some kind of application forms - such as forums, guestbooks, or comment form on popular blogs -, and then automatically posting whatever its initial launcher (spammer) wants everybody to know. It usually carries commercial messages, offers, or simply just site promotions. This annoying practice has been one of the biggest problems of the Internet since the early days.
There are several known ways to fight this kind of spambot, like applying moderation mechanism to allow moderators of the site doing some sort of manual checking and validation against every post submitted. Despite being an effective (yet not too efficient) way to prevent spams, there is in fact a more preferred method called CAPTCHA (Completely Automated Public Turing test to tell Computers and Humans Apart). As being indicated by the word automatic in the name, this AI-based testing attempts to eliminate manual validations existed in a moderated system, adding a higher degree of efficiency.
Different algorithms have been developed to implement CAPTCHA. The most popular one is by challenge users to rewrite a certain text or word presented as a distorted image, assuming such text will be difficult for computer to read but still recognizable to human. Another algorithm is to present users a sound and challenge them to write what they've heard. But my favorite CAPTCHA implementation is the old and simple text-based challenge. It works by asking users to answer a randomly generated question, like "What is the color of the sky at night?" or simple math question like "What is twenty divided by five?". Personally I'd prefer this kind of question-answer interaction to a system that asking me to write down something it shows. It feels more "human", and it works at roughly the same security level as the other methods.
Within the last few years Ruby on Rails (RoR or just simply Rails) has gained great popularity in the way people develop web applications. It offers web developers to make an architecturally clean web application at a relatively faster time, compared to many existing technologies known. By clean architecture, I mean an application that you could painlessly maintain, change, and extend to meet the objectives of why it's built, even perhaps by someone who initially didn't develop it. For many developers such requirements are really not an easy task to accomplish, nor something that could be done quick enough to save them a moment to enjoy life. Yes, we're hopping from one project to another, time is precious.
About
- Blog: The main content type in Slepi.NET. It serves as the media of most of my writings.
- Programming: Theory and practice of programming, mostly within the context of web application development. Covers programming languages such as PHP, ASP, .NET, JavaScript, and Ruby.
- RSS feed for this archive
Blog archives
- 12 total entries since January 21, 2008 20:21.