Archive for the 'Web Development' Category

Let’s talk about your password model

First off, let me just say that I am by no means an expert cryptographer; there are all sorts of wonderful, terrible things about hashes and block ciphers that I just don’t understand (I’d like to believe that it’s because I’ve not been exposed to them, whoever’s fault that is, and that if given a [...]

Tuesday, February 9th, 2010

Arrays of Objects and __get: Friends Forever

In PHP, an object is always passed around as a reference, which allows one to deal with objects in a very transparent manner, since the only way to deal with a by-value copy instead of the real deal is to explicitly use the clone operator. Recently, I came upon a situation in which it [...]

Monday, January 11th, 2010

Did You Know? Class Visibility in PHP

While it remains an imperative-style language, since version 5 PHP’s object model has gotten significantly more sophisticated. While in PHP 4 objects were little more than arrays with functions, the newer versions have most of the trimmings of modern OOP. Among those, probably considered a basic triviality at best, is member visibility. [...]

Thursday, December 3rd, 2009

XML Is Like Violence…

…if it hasn’t solved your problem yet, you’re not using enough. Curiously, I always thought of that little quip as a subtle indictment of the problems with XML, but it seems to almost be a rallying cry for proponents of the standard (I refuse to recognize XML as a “language”).  And when I say [...]

Wednesday, September 30th, 2009

Javascript Abuse #2,463,981: Centering Content

Another quick rant/post about the wonderful world of abusing javascript. Consider the following code:

function moveScreen() {
var myWidth = 0,
myHeight = 0;
if (typeof(window.innerWidth) == ‘number’) {
//Non-IE
myWidth = [...]

Thursday, September 24th, 2009

Programming Nuances, PHP and JavaScript

Two little snippets, some simple things that seem to be forgotten when writing code.  First, a general example using PHP; have you ever found yourself writing a loop that looks something like this?

$i = 0;
while ($row = mysql_fetch_assoc($result) {
// …
// maybe something about $i % 2 to determine even-from-odd rows
++$i;
}

If so, remember this: you are [...]

Wednesday, September 23rd, 2009

POST via cURL under NTLM Auth: Learn From My Pain

If you’ve been working with PHP in a professional capacity on Today’s Internet, you’ve probably run across one or two instances where you’ve had to use cURL. And, if you didn’t use cURL, at least seen where it could be useful. For instance, if allow_url_fopen is turned off. In fact, most of [...]

Saturday, July 25th, 2009

CSS Versus Tables: The War Continues

Unfortunately, there’s a very ugly side to this debate. If you’ve actively been on either side of it, then you might hold the opinion that there is no pretty side to the debate, but in a relative sense, there is. The pretty side is about vertical alignment issues, low resolution displays, and the trauma of floats gone wrong. The ugly side is, without question, the unholiest member of the family that is CSS-supporting (however loosely the term need be applied) browsers: IE 6.

Thursday, July 23rd, 2009