String rotation method for simple encoding
Dec 19th, 2008 by admin


$a = rotateString($b,19); // encode
$b = rotateString($a,-19); // decode
Oct 27th, 2008 by admin

This scripts show the content of a div when clicked on an opener.

jQuery – Extend tablesorter plugin
Oct 16th, 2008 by admin

This js code extends the tablesorter plugin in jQuery:

  1. Parser for sorting values like “$1,300.50″
  2. Parser for sorting values like “2 months ago”,”3 years ago” (actual timestamp hide in the comment)
  3. Parser for sorting values like “SMALLER”,”SMALL” (actual text value hide in comment)
  4. Widget to highlight a row when mouse hovers it
  5. Widget to highlight a header when mouse hovers it
  6. Widget to save/memorize sort order via AJAX

Let’s get right into the code:

Demo HTML file

Time-Series Forecasting with PHP
Oct 2nd, 2008 by admin

This PHP 5 class forecasts future values from past data. It takes into account the growth trend, seasonality and irregularity (noise) in input data. This class uses an external class: linear regression analysis

Sample Usage

JSON with Padding = JSONP
Aug 19th, 2008 by admin

With JSONP, you can avoid the “Access is Denied” problem when loading a remote AJAX request. jQuery 1.2.x now supports JSONP, you can use that or this simple code snippet. In this example, let’s assume you’re on a page with a remote javascript loaded, now you only want this remote script to reload, not the whole page.

And the result of getJSON.php:

Reloading partial page content with JavaScript
Aug 6th, 2008 by admin

If you need to reload a partial content (not the whole page) with JavaScript, you can easily use AJAX (jQuery is the simplest). But if the content is also from another website (eg: some API), then you can use JSONP (JSON with Padding) to get around the security protection of AJAX requests.

And in the server-side javascript.php, you would return:

Javascript table grid sort
Mar 31st, 2008 by admin

PHP5 Class for Yahoo Term Extractor API
Feb 3rd, 2008 by admin

Given a content string, this class uses Yahoo Term Extraction API to generate a list of keywords/phrases that you can use for things like META tags or other SEO objectives.

Fix php_browscap.ini for PHP
Jan 19th, 2008 by admin

This class parses, fixes and prepares php_browscap.ini into browscap.ini for PHP. It also detects if the latest version needed to download.

Simple & fast spider detection
Jan 19th, 2008 by admin

Developers can use the browscap.ini to detect if the User-Agent is a search engine or data collection spider or not. However, that file is rather large and will be expensive on resources. If you need a faster, simpler (albeit less accurate) method, this class can be useful.

»  Substance:WordPress   »  Style:Ahren Ahimsa