Monthly Archives: November 2009

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

Linux: Cleaning up your login tracks

So you’ve logged into a Linux machine but you don’t want anyone to know you were there. Why? Who cares. Here are a couple of things to clean up your tracks. Once you log in, you’ll notice that message that … Continue reading

Posted in Linux, Security | Leave a comment

C++ Guessing Game

/** Guessing Game Copyright 2009 Travis Crowder travis.crowder@spechal.com Published under the MIT License */ #include <iostream> int main(int argc, char* argv[]){ /** Create our variable to hold the guess made */ int guess = 0; /** Let’s keep track of … Continue reading

Posted in C++ | 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