Vote for Andrei

This is a shameless plug for my friend Andrei.

Vote for Andrei

Andrei is writing something that forms the very essence of my future employment: PHP 6, and more specifically, unicode support in PHP 6. ICU in PHP is three meaningless letters about three other meaningless letters to most of you. I get that. Even though this meaninglessness stuff has 60% market share and powers sites like Yahoo!, Wikipedia, WordPress, Facebook… (The “Vote for Andrei” generator above was written in PHP. It powers the websites for JPG Magazine and Flickr below.)

So when I say that it’s really important to keep this guy happy, please believe me. Think about the last time that you visited to the above websites. You wouldn’t want them to suck do you? If your native language is not English, then you would want them to work in your country right?

Luckily, photography is infinitely more accessible than the stuff that pays the bills. So please, take some time off from your day of ignoring my blog posts to do the world a favor and vote for this photo on JPG magazine (and tell your friends to too):

It’s a great photo and utterly appropriate with the theme of the month. My only complaint with it is he should have gotten with the bandwagon on photos like this and LOMO’d the sucker beyond recognition. I can almost recognize what it is.

[Andrei and photography after the jump.]Continue reading

My programming pattern maxim

There are few people this side of Harry Fuecks who have rode the php design patterns money train as much as I have. In fact, programming patterns have been very good to me: they’ve provided trips to exotic locales, paid for my conference admission, impressed all the hot women…

Well maybe not that last one.

But Alejandro’s recent spate of GoF patterns on DevShed, besides being a blast from the past, made me realize that practicality hangs over my Pattern Bubble like the Sword of Damocles, pointedly showing just how oppressive programming design patterns in PHP are.

Time for a new rule:

“With few exceptions, by the time you deduced what a pattern is from its clever name, you could have just coded it.”
—Terry Chay, 2007

and my original inspiration:

“PHP isn’t Java. Deal.”
—Terry Chay, 2003

[The Flyweight makes an appearance after the jump]Continue reading

Interesting PHP factoids

It’s times like these that I wish someone just told the reporter that PHP is a programming language for web development that has a larger marketshare than Java J2EE and Microsoft dotNet combined:

[Web 2.0 technologies] also mean applications can be built much more quickly, says Mr Boloker. He is a big fan of PHP, an open-source scripting language which makes building mashups even easier. Originating in Greenland, PHP is now managed by an Israeli company called Zend.
Sydney Morning Herald

I didn’t realize that Rasmus wasn’t in Canada when he wrote PHP and that Cupertino is now in Israel.

Good to know.

Oh yeah, it’s nice that they’re allowed to use Apple Macintoshes in IBM, I didn’t know they’re so generous. Will they be taking his away with the Intel switch?

Other than that hilarity, thank you Dave Boloker for plugging PHP. Now I can go around saying that the former chief of Java Technologies at IBM Software Group is a “big fan of PHP.”

Rock on.

The Zend Engine is my bitch

I don’t read php-internals anymore because I’m partial to getting work done, but there was an interesting question the dealmac developer posted. Basically dealmac, like my current employer, has a large array structure in a PHP file somewhere that is included on every page. It’s abusing memory.

Brian then notices that if you use var_export()(a function I keep forgetting exists), he was able to cut the memory usage from 5MB to 1.2MB. Storing it serialized reduced the memory usage to 20% but with double to load time performance penalty.

How could a 300K file use up so much space in memory?

The way you answer this is to use vld to make the Zend Engine your bitch.

[The answer after the jump.]Continue reading

A mile wide, an inch deep

When my brother was just starting out as an economist, he told me that economics was easy because it was “a mile wide and an inch deep” meaning that it was everywhere in social sciences, but analytical tools were so poorly applied and misused that you could strike gold anywhere you stuck them.

Books like Freakonomics [Revised and Expanded]: A Rogue Economist Explores the Hidden Side of Everything show that analytical tools are still misused: that book is a circular indictment on itself.

Nothing has changed in economics.

I read this today:

PHP Seen as a Popular Hacker Target

Looking at other e-commerce security trends for 2007, the report also expects the wildly popular PHP programming language to continue to provide a bounty of opportunities for hackers. PHP was invented more than a decade ago and has been used to create every type of software program needed to operate an online store, including shopping carts, payment systems, CRM and newsletter applications. Unfortunately, PHP developers to date have all too frequently emphasized functionality over security, according to ScanAlert, who reported that its security researchers had uncovered critical security flaws in several PHP programs.

<sarcasm>I bet that was a challenge to find all those security holes!</sarcasm>

PHP application-level security: a mile wide and an inch deep.
Continue reading

My data in a box

Warning. This post is too geeky for words.

The inspiration,


12:36:44 PM ed: I wrote a twitter client
12:36:51 PM me: Yes, I noticed
12:36:55 PM ed: that’s how I roll.
12:36:58 PM me: also changed some phpsecurity update thing
12:37:04 PM me: white and nerdy baby
12:37:31 PM ed: php security is for the squares, dude
12:37:50 PM ed: I roll with my globals registered and all that shit.
12:39:20 PM me: fuck that bitch, I say all ports open
12:40:09 PM ed: I ain’t afraid of yo buffer overflow!
12:42:16 PM me: Stick your buffer overflow in a box!

Which inspired me to rewrite this song in honor of Ilia’s new filter extension and all the hard work the PHP team in putting security fixes with the latest releases.

[The song after the jump]Continue reading