The Boston Diaries

The ongoing saga of a programmer who doesn't live in Boston, nor does he even like Boston, but yet named his weblog/journal “The Boston Diaries.”

Go figure.

Saturday, March 10, 2007

Page views

I came across Project Wonderful from Eric Burns. I read up on its advertising scheme and found it rather compelling. I have web space to sell ads, and given that Google's AdSense has been a disappointment, I thought I would sign up and give Project Wonderful a try.

I'll have to wait a while.

In trying to keep the system from imploding under heavy traffic, they're slowly expanding and I have to sign up for an invite to display their advertising. On the form asking for the invite, they asked for an average number of page views per day my site gets.

I don't have a package like AWStats, Webalizer or Analog installed (being too lazy to install and configure them). Instead, I have some home brewed programs that allow me to trawl through the log files manually (which for me gives me a better feel for what's going on anyway). I figured just searching for screen.css would give a good indication of page views (since it's used to render a page view), so I extracted the logs from a few days ago and checked.

Thirty-seven page views.

That's it?

I tried another day.

Thirty-seven.

I went back to the January logs.

Thirty-seven.

Thirty-eight.

Sixty-four.

Thirty-eight.

Oh.

That might explain the rather lackluster results from Google's AdSense.

But in going through the logs, I did come across the following:

Plus other feed readers that don't report the number of readers (about another 70) so my readership is up there, but primarily through outlets other than here.

Well then … perhaps I have to rethink the whole advertising thing then.


Whose bright idea was that design?

If anyone is wondering why: PHP's strpos() returns “false” when the second string argument does not occur as a substring of the first argument, and returns 0 when the second string argument occurs at position 0 of the first string argument. Thus, strpos( “/admin”, “/admin” ) returns 0, but strpos( “Cabbage/admin”, “/admin” ) will return a positive integer.

You're supposed to test the return value explicitly: “if( strpos( $a, $b ) !== false)”, but it only says that like five times in giant red letters on the manual page (http://us2.php.net/strpos) so it's easy to see how someone could miss it.

Re: Cabbage Based Authentication

Besides being reason #3.1415926 for hating PHP, this is a further example of my dislike for dynamically typed languages (and muddled thinking). What we have here is a function that returns a positive integer if we find one string within another, but a boolean otherwise. This mixing of return types is futher compounded by the fact that in PHP, an integer value of 0 is also treated as the boolean “false” value.

So let's not fix strpos() to return something sane, like -1 for “string not found,” let's instead extend the langauge with a silly “boolean only comparison” to fix this particular problem.

I would really love to know what Rasmus Lerdorf was smoking


Science in action II

Bunny received one of those forwarded emails that detailed a bunch of stupid cell phone tricks one could try. Among the stupid cell phone tricks (like dialing “*#06#” to get the phone's serial number, or dialing 800-FREE-411 (800-373-3411) for free dialing assistance) was one really silly bit:

Subject: Have you locked your keys in the car?

If your car has a remote keyless entry device this may come in handy someday. If you lock your keys in the car and your spare keys and spare remote keyless device are at home, call someone at home from your cell phone, hold your cell phone about a foot from your car door, and have the person at your home hold your spare remote keyless device up to the phone and tell them to press the unlock button. Presto, your car will unlock. Saves someone from having to drive your keys to you. Distance is no object. You could be hundreds of miles away. All you have to do is reach someone who has the other “remote” for your car and you will be able to unlock the doors or the trunk (where it might be a good idea to keep a spare set of keys in case you lose yours).

Another remote frob myth that sounded way too silly to me.

So of course I had to try it.

I gave Bunny my keys and went outside to stand next to my car. Then I called her. “Help, help, I locked myself out of my car,” I said.

“Okay,” she said. “Don't panic. I have your spare set of keys right here in the house. Hold your phone about a foot away from the car.”

I did that. Nothing.

We tried again.

Nothing.

Bunny then suggested using her landline to call me. Perhaps it would give a better signal.

Nope.

I suspect it doesn't work since my keyless frob works on radio waves, not an actual audible sound.

[Busted]

Obligatory Picture

[The future's so bright, I gotta wear shades]

Obligatory Contact Info

Obligatory Feeds

Obligatory Links

Obligatory Miscellaneous

You have my permission to link freely to any entry here. Go ahead, I won't bite. I promise.

The dates are the permanent links to that day's entries (or entry, if there is only one entry). The titles are the permanent links to that entry only. The format for the links are simple: Start with the base link for this site: https://boston.conman.org/, then add the date you are interested in, say 2000/08/01, so that would make the final URL:

https://boston.conman.org/2000/08/01

You can also specify the entire month by leaving off the day portion. You can even select an arbitrary portion of time.

You may also note subtle shading of the links and that's intentional: the “closer” the link is (relative to the page) the “brighter” it appears. It's an experiment in using color shading to denote the distance a link is from here. If you don't notice it, don't worry; it's not all that important.

It is assumed that every brand name, slogan, corporate name, symbol, design element, et cetera mentioned in these pages is a protected and/or trademarked entity, the sole property of its owner(s), and acknowledgement of this status is implied.

Copyright © 1999-2024 by Sean Conner. All Rights Reserved.