Posted on October 14th, 2006 by headwedge
Wrap mhash incantations in an exception protected, lean interface to facilitate modular class composition.
Example:
<?php
require_once “includes/header.inc.php”;
try { $input = “Lorem ipsum dolor sit amet!”; $hash = mhash(MHASH_SHA256, $input); echo “The hash is ” . bin2hex($hash) . “<br />\n”; $hash = mhash(MHASH_SHA256, $input, “owner_id”); echo “The hmac is ” . bin2hex($hash) . “<br />\n”; $h = new Hash(); echo $h; echo “The hash is ” [...]
Filed under: code, php | No Comments »
Posted on October 11th, 2006 by headwedge
I agree with Geneva’s comment in my rant about documentation. I think version control is a sign of maturity, but failing to comment your entries is kind of missing the point. I know that you just want to get your code in the repository and go home but if you just take a few minutes [...]
Filed under: ramblings | 1 Comment »
Posted on October 11th, 2006 by headwedge
Is it just me or does your coding style change over the years? Not so much what you write or the way you write it (as in extreme programming) but your philosophy?
Filed under: ramblings | No Comments »
Posted on October 10th, 2006 by headwedge
To paraphrase and trim the fat from Knuth’s “Literate Programming”
(Knuth, D. CSLI Lecture Notes 27: Literate Programming, Stanford, 1992)
and seive it through Joel Spolsky’s pragmatic dogma…
“Joel on Software: And on Diverse and Occasionally Related Matters That Will Prove of Interest to Software Developers, Designers, and Managers, and to Those Who, Whether by [...]
Filed under: rants | 1 Comment »
Posted on October 10th, 2006 by headwedge
Wrap mcyrpt incantations in an exception protected, lean interface to facilitate modular class composition.
Example:
<?php
require_once “includes/header.inc.php”;
try { $c = new Cipher(‘passphrase’); echo $c; $s = $c->encrypt(‘Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis [...]
Filed under: code, php | No Comments »
Posted on October 9th, 2006 by headwedge
Instance counting, debug facilitating, intuitive echoing, re-print from solution(004) for code continuity.
<?php/*** @licence Academic Free Licence www.opensource.org/licenses/afl-3.0.php* @author www.headwedge.com* @copyright 2006.08.16* @version 1.01, 1.0* @abstract base class** public class Object* file Object.obj.php* Object is the proposed root of a PHP5 class hierarchy.* Every class should have Object as a superclass to facilitate debugging and maintenance.* [...]
Filed under: code, php | No Comments »
Posted on October 9th, 2006 by headwedge
Working at the edge of sun’s influence recently so no blog activity, normal service will be resumed as soon as possible now that back in the pull of gravity.
Filed under: ramblings | No Comments »