Tag Archives: library

Graphing with jQuery CodeUnit 14 FEB 2010

Now while there are quite a number of excellent flash-based graphing libraries out there in the wild, it turns out that there aren’t actually all that many pure old jQuery plugins to churn out your data in pretty images for all to see.

So enter flot, a pure Javascript plotting library written exclusively for jQuery. It produces graphical plots of arbitary datasets on-the-fly client-side, with a focus on simple usage – meaning that all settings are pretty much optional to a developer. The graphs produces are attractive and flot goes that extra step in adding interactive features like zooming and mouse tracking, meaning you can add things like tooltips and clickthroughs to any graph with particular ease.

It works with Internet Explorer (with the help of the excanvas emulation helper), Firefox, Safari, Opera and Konqueror, making use of the HTML canvas tag.

Quick to implement, churns out a variety of different graphs and produces some stunning results, making it a particularly worthy graphing library to implement on any of your data analysis projects! :)

Related Link: http://code.google.com/p/flot/

Fatal error: Call to undefined function: curl_init() CodeUnit 24 JUN 2009

PHPPretty damn useful: Client URL Library, or cURL for short. From the pages of PHP.net:

PHP supports libcurl, a library created by Daniel Stenberg, that allows you to connect and communicate to many different types of servers with many different types of protocols. libcurl currently supports the http, https, ftp, gopher, telnet, dict, file, and ldap protocols. libcurl also supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading (this can also be done with PHP’s ftp extension), HTTP form based upload, proxies, cookies, and user+password authentication.

If however you keep getting the error message Fatal error: Call to undefined function: curl_init() when you try running a PHP script or two on your server, then I’m afraid you currently don’t have this great little library enabled and as such, really should think about installing it ASAP.

So how do you do it?

Well first, let’s make sure that our diagnosis is in fact correct. Whip up a quick check page by creating a .php file with a phpinfo(); command in it and upload it to your server. Browse to file’s URL and search for ‘curl’ on the resulting page. If cURL support is enabled, then there will definitely be a listing for it.

If however it doesn’t appear on the page, you’ll need to go about enabling it yourself. Of course, if you are with a hosting company and not in control of the server yourself, simply ask them to do it for you! :)

Otherwise, if you are running a linux-based system, you need to ensure that your PHP is compiled with cURL support and the libcurl library needs to be installed. To install the php5-curl package, run sudo apt-get install php-curl and then restart the Apache web server with sudo /etc/init.d/apache2 restart.

If you are running a Windows-based system, cURL can be enabled by simply editing the php.ini file to remove the semi-colon in front of the extension=php_curl.dll line and then restarting the web server service/application.

(Note: If you get an error Unable to Load X:/path/php/ext/php_curl.dll error, locate and copy the ssleay32.php and libeay32.dll (OpenSSL) libraries to your system32 folder.)