Tag Archives: PHP

Installing php-ffmpeg on CentOS 5.x

This can be a pain due to a bug in the ffpmeg_frame.c file … here are the commands to get up and going yum -y install ffmpeg ffmpeg-devel wget http://sourceforge.net/projects/ffmpeg-php/files/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2/download tar jxvf ffmpeg-php-0.6.0.tbz2 sed -i ‘s/PIX_FMT_RGBA32/PIX_FMT_RGBA/g’ ffmpeg-php-0.6.0/ffmpeg_frame.c cd ffmpeg-php-0.6.0 && … Continue reading

Posted in Commands, Internet, Linux, PHP | Tagged , , , | Leave a comment

jQuery wdCalendar Plugin: Expected ajax return

This plugin isn’t documented very well, so I figured I would post the bits and pieces I had issues with and hopefully help someone out. First thing I needed to do was move all the functions into a class and … Continue reading

Posted in JavaScript, PHP | Tagged , , | 8 Comments

phpize not found

This error is typically generated when you don’t have the PHP development libraries installed. Installing the libraries via repository is the easiest and quickest fix. For Fedora/Red Hat: yum install php5-dev For Ubuntu/Debian: apt-get install php5-dev Bookmark on Delicious Digg … Continue reading

Posted in Linux, PHP | Tagged , , , | Leave a comment

Python MySQL Associative Array

By default, the MySQLdb module to access a MySQL database returns the data as an integer indexed array. Sometimes this is not desirable and an associative array is preferred, such as the mysql_fetch_assoc function in PHP. In addition, we will … Continue reading

Posted in MySQL, PHP, Python | Tagged , , | Leave a comment

PHP function to validate MySQL UUID or GUID

/** * Function to validate a generated GUID / UUID * @param string $guid GUID * @return bool */ function validGUID($guid){ return preg_match(‘#^[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}$#’, $guid); } Bookmark on Delicious Digg this post Recommend on Facebook share via Reddit Share with Stumblers … Continue reading

Posted in MySQL, PHP | Tagged , | Leave a comment

PHP function to emulate MySQL UUID

/** * uuid * * uuid() simply replicates MySQL’s UUID function, which returns a 36 * character "random" hash (32 alphanumeric, 4 dashes). * @return string */ function uuid(){ return sprintf(‘%04x%04x-%04x-%04x-%04x-%04x%04x%04x’, mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0x0fff) | … Continue reading

Posted in MySQL, PHP | Tagged , | Leave a comment

PHP function to emulate Excel NormSInv

<?php function NormSInv($p){ $a1 = -39.6968302866538; $a2 = 220.946098424521; $a3 = -275.928510446969; $a4 = 138.357751867269; $a5 = -30.6647980661472; $a6 = 2.50662827745924; $b1 = -54.4760987982241; $b2 = 161.585836858041; $b3 = -155.698979859887; $b4 = 66.8013118877197; $b5 = -13.2806815528857; $c1 = -7.78489400243029E-03; $c2 … Continue reading

Posted in Excel, PHP | Tagged , , | Leave a comment