The Internet accepts all queries,
responds to all requests,
but sometimes the answer is 404.
September 2010 M T W T F S S « Jul 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 Archives
Friends
The Internet accepts all queries,
responds to all requests,
but sometimes the answer is 404.
When I watch shows like South Park online, they serve short video ads. Invariably, at least 3 of the 4 ads are the same ad, if not all 4 of them. However, without fail, all 4 ads are completely irrelevant to me.
Privacy is a huge concern for everyone (including people who use unsecured computers over Wifi), but I’m frustrated enough to trade some privacy to not have my time wasted. Show me something I’m remotely interested in. What a concept!
We have the technology. Can we get it together enough to not show the same ad to the same person more than twice per session? We’re web nerds; can’t we do better?
Oh, and when I’m watching the “clips”, don’t serve me a 30 second ad in front of a minute and 30 second clip. It’s ridiculous. Makes you look desperate for cash.
Hulu makes an effort with a tiny link asking ‘is this ad relevant?’ Plus they have Anime that features nude cartoon babes; that makes it worthwhile to sit through the ads.
Sometimes you want an empty Object. Here’s how I go about it:
$Object = (object) null;
I cast the value ‘null’ as an object. You can do this with other kinds of variables too:
$array = array('dog' => 1, 'cat' => 5); $Object = (object) $array;
$Object now has two properties: dog and cat. Enjoy.
I never believed that Sam Neil could outrun a Velociraptor. Not for a minute.
Here’s a fun little trick. When looping over an array, you can access the values by reference. Instead of:
foreach ($things as $i => $thing) { $things[$i] = strtolower($thing); }
You can reference the values of the array:
foreach ($things as &$thing) { $thing = strtolower($thing); }
It’s a small difference, but it comes in handy once in a while, especially when you’re doing more significant processing with each item.