Data Converter
Tuesday, September 7th, 2010
Takes CSV or tab-delimited data from Excel and converts it into several web-friendly formats, include JSON and XML.
Takes CSV or tab-delimited data from Excel and converts it into several web-friendly formats, include JSON and XML.
Great script (in CSS and Javascript) which makes it really easy to display boxplots on a website. Great!
Need to debug AJAX? Beside some tips I found on the Net, here is one I found particularly useful, at least in my current case. Just use a
tail -f /private/var/log/apache2/access_log
Or
tail -f /private/var/log/apache2/error_log
which displays the latest log entries… which can help to solve some major issues.
Gix, this extension helps GIS developers to migrate ESRI ArcView projects to the most popular Free and Open Source alternatives for Geographic Information Systems (GIS).
Like that one. Lightweight, easy, supply of additional information by mouseover. Really neat.
Nice mapserver, enabling vector display as well. Based on GeoExt.
Datamob highlights the connection between public data sources and the interfaces people are building for them.
/**
* Formats numbers to the specified number of significant figures.
*
* @author Bevan Rudge, Drupal.geek.nz
*
* @param number $number
* The number to format.
* @param integer $sf
* The number of significant figures to round and format the number to.
* @return string
* The rounded and formatted number.
*/
function format_number_significant_figures($number, $sf) {
// How many decimal places do we round and format to?
// @note May be negative.
$dp = floor($sf - log10(abs($number)));
// Round as a regular number.
$number = round($number, $dp);
// Leave the formatting to format_number(), but always format 0 to 0dp.
return number_format($number, 0 == $number ? 0 : $dp);
}
?>
… and another one ….
round(1241757, -3); // 1242000
RoundSigDigs(1241757, 3); // 1240000
?>
Works on negative numbers too. $sigdigs should be >= 0
function RoundSigDigs($number, $sigdigs) {
$multiplier = 1;
while ($number < 0.1) {
$number *= 10;
$multiplier /= 10;
}
while ($number >= 1) {
$number /= 10;
$multiplier *= 10;
}
return round($number, $sigdigs) * $multiplier;
}
?>
Outputs a human readable number.
# Output easy-to-read numbers
# by james at bandit.co.nz
function bd_nice_number($n)
{
// first strip any formatting;
$n = (0+str_replace(",","",$n));
// is this a number?
if(!is_numeric($n)) return false;
// now filter it;
if($n>1000000000000) return round(($n/1000000000000),1).' trillion';
else if($n>1000000000) return round(($n/1000000000),1).' billion';
else if($n>1000000) return round(($n/1000000),1).' million';
else if($n>1000) return round(($n/1000),1).' thousand';
return number_format($n);
}
?>
Outputs:
247,704,360 -> 247.7 million
866,965,260,000 -> 867 billion
Some nice data visualization.
Good tool to see how many web pages are linking to someone elses website.

Very nice login/registration form. See it here in action.

The 960 Grid System is an effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
Nicely done, and a couple of cool drill-down functionalities with this library.
Nice small app, in case you need to create some “passwords”, or lengthly keys.
Here’s a function that uses PHP’s round() to calculate significant figures:
function sigFig($value, $sigFigs) {
$exponent = floor(log10($value) + 1);
$significand = $value / pow(10, $exponent);
$significand = round($significand * pow(10, $sigFigs)) / pow(10, $sigFigs);
$value = $significand * pow(10, $exponent);
return($value);
}
//Examples
sigFig(123.45, 6); // 123.45 (doesn't pad with zeros)
sigFig(123.45, 5); // 123.45
sigFig(123.45, 4); // 123.5
sigFig(123.45, 3); // 123
sigFig(123.45, 2); // 120 (rounds to 2 figures)
sigFig(123.45, 1); // 100
sigFig(123.45, 0); // 0 (!)
?>
![]()
Another nice visualization of assessment data.
![]()
Nice visualization coming out of IUCN, a little bit unexpected to me. Although very visually attractive, one has always to ask if the display achieves what it is supposed to do: bring a message across, show trends, etc.