Skip to content


Forget Me Not: PHP Sessions Should Be Started First

I’m sure I’ll continue to forget this, since this is the third or so time it’s happened to me, but I’m going to leave a note for later anyway. Maybe this will make it more obvious to myself. :)

If you’re experiencing weird/broken stuff with your PHP SESSION variables, and if you check the error log and see a message about headers….

Warning: session_start(): Cannot send session cookie – headers already sent by

… then you are starting your session after some kind of output has already been sent to the user. For the visual example, take a look at the following before smacking your forehead. The first example is correct, the second is probably wrong.


session_start();
include ('header.php');

———

include ('header.php');
session_start();

Consider myself reminded. That is all.

Posted in php.

Tagged with , , .


The Participants In Iran – Where Do 40 Million Votes Come From?

Almost 40 million voters turned out for Friday’s election in Iran. The outstanding 85 percent voter turnout was praised by the current Iranian president, who, imagine that, just happened to be the victor as well. Is it so clear cut? Let’s see.

As of 2007, there are 70 million people in Iran. To try and figure out the eligible voter number, we have to dig deeper. According to the CIA factbook, over 14 million are under the age of 14. Looking at other age distribution maps, the number of 15-17 year olds is probably in the neighborhood of 5 million or so. This works us backwards to about 51 million eligible voters, close to the 47 million that an 85% turnout points us toward.

Summarizing the above – 40 million voters, 47 million eligible, 19 million under 18. Continuing…

If you’ve made it this far, here’s the confusing part. In 2007, the minimum age for eligible voters was raised from 15 to 18 years. This immediately took somewhere around 5 million eligible voters out of the voting pool.

In the 2005 election, there was a turnout of 62% for a total of 29 million votes (also magically based on 47 million eligible voters). Of these, Ahmadinejad only got 5 million in the first round, coming in second place, and then 17 million in the second round, becoming president. Take away the 5 million voters under 18 in that election who wouldn’t be eligible this time, and you have a voter turnout of 24 million people.

So. In 4 years time, the people of Iran somehow became so motivated that almost twice as many people over the age of 18 came out to vote. And they voted for the incumbent?

Ahmadinejad beat his 2005 first round total by 4 to 1! And 7 million more than his second round when he ran against one challenger.

And here I thought voter turnout was only supposed to be high when the people wanted a change.

Posted in election, iran, politics.


The Speed Counters of Iran – 40 million votes in 12 hours

Everybody has agreed thus far that an astonishing number of votes were counted in a very short period of time last Friday when Iran held their presidential election. Unfortunately, we don’t have access to the actual vote counting data in Iran, so all we are left with is guess work. I’ll use the numbers from this AP article as an example. Even if they are off a bit, the point is still there.

  • 39.2 million votes
  • Hand counted ballots
  • Total count released within 12 hours of polls closing.

With theory and numbers alone– it would take 907 people just over 12 hours of constant counting at 1 ballot per second to be able to count all 39.2 million votes. Possible, yes. Likely? Not so much. But you never know– read on.

As of 2005, Iran had 324 Shahrestans (counties) in 30 provinces. Tehran is the largest province at 13.5 million people and Ilam is the smallest at 500,000. Counting 40 million votes in 12 hours becomes a lot easier on paper when you split this project up into 324 counties. Once this is done, it would only take an average of 3 people counting for 12 hours in each county. Move your basic math around and you’re looking at 12 people for 3 hours. Granted I’m no expert, and it’s not the answer I was originally looking for, but one could successfully argue for a reasonable doubt that 40 million votes could actually be counted in 12 hours as long as the organization was there to handle it.

Of course, if it is true, I’m sure there are plenty of election officials across the world that would jump at the chance to see such a well oiled and efficient machine in action so they could duplicate for their own election processes.

Posted in election, iran, news, politics.


The Top 40 At TopTwit – What You Can Do Now

I’ve had some geeky fun the last few days and finally added a few features to the Top 40 most recent links page that I’ve been meaning to get to for a while. Here’s the rundown on what you can expect.

New User Signup: Anybody can now sign up for their own TopTwit Top 40 page. All you need to enter is your Twitter username, Trim username, Trim password, and Disqus shortname. I will fully admit that I’ve been coding quick, so I don’t have the checks and balances coded and you can pretty much enter whatever the heck you want for everything and who knows what will happen. But if you enter valid info for the above stuff, you will have access to all the features thus far. You can probably skip the Disqus info if you don’t care about comments. Also note that until I get things dynamic enough, you’ll only have a pretty URL if you tell me in advance that you’re coming. Otherwise you will still work fine, but the URL just won’t be as fun.

Comments Are Enabled: I just added Disqus comments to all the tweets that are captured. You can click on the comment count to go to a page specifically built for the tweet and comment there if you would like. I’m still thinking out smarter ways to go about this, but it looks pretty cool.

Trim, Postly, Bitly All Work: The page is designed around Tr.im because their API has a cool feature to grab the visit count on the last X urls posted, saving a lot of time when refreshing the data every 5 minutes. However, you can still get the view count from post.ly (the Posterous url shortner and bit.ly, so I do. Bugs are always possible of course and I haven’t read into the bitly API enough, but I may need to have you enter a bit.ly api key at some point.

Broken Stuff: Of course there’s broken stuff because I’m the only one using the site and nobody’s complained about the broken stuff yet. :) Specifically the detection of URLs that you retweet but are from other people – those stats don’t show up the best and I’ll need to get some owner checking going on at some point. Also, reposting old urls does not refresh the age at this point, which would be kind of a nice feature in the future.

What else: That’s it. Please sign up and have some fun. It’s your own little personal Twitter Digg if you hadn’t thought of it that way yet. And if you hadn’t seen it already, this all exists because of Dave Winer and his challenge to have some fun after he made the first top40 app. So thanks to him because it has been fun. :)

Posted in toptwit, twitter.

Tagged with , , .


Google Wave – Conversation Doesn’t Have To Be Chess

I’ve been holding my Wave thoughts to myself for the most part barring random tweet or comment here and there, but after reading the Fast Company version, I finally decided to type a brief opinion out.

Brief admittedly because Google’s version of the Wave hasn’t launched, and it isn’t open source enough for me to have my own Wave implementation setup, so I have no idea how it really works up close.

Wave is not a reinvention of email. Google may have said it is, but it’s not. Wave is another version of conversation. The fears laid out in the Fast Company article (especially #2), say it all:

“With live transmission as you type, participants on a wave can have faster conversations, see edits and interact with extensions in real-time.” That’s what Google says. Am I the only one who writes an email, then revises it for tone and clarity? It’s creepy enough that other people know when I’m typing on Gtalk. Now they can see what I’m thinking as I try out sentences?

That is exactly what a conversation is.

When I’m standing in the same room as somebody and conversing with them, anything that comes out of my mouth is heard. If I stutter, or misspeak, or change my mind mid sentence… I am allowed. If the person listening to me needs to interrupt me or offer an answer that I’m having trouble expressing, they can. Just like that. Two people don’t sit and stare at each other while they try to formulate the perfect response.

Conversation doesn’t have to be chess. And to me, Google Wave is for conversation.

Posted in google, opinion, wave.

Tagged with , .


Twitter As News

Brief thoughts on an idea that’s been extensive in my head lately.

Twitter has long been talked about as a news source. If it ever decides to work as a news source, or if we ever decide to actually use it as one, there will be two parts:

  1. The raw news will be complete madness, and everybody will be allowed in.
  2. Many somebodies, from many different groups and interests, will harness the madness into usefulness.

This is easier (ha) than it sounds.

Six degrees of separation, or something similar to that, will determine that I as an editor/publisher can choose my trusted raw news sources that cover my area of interest. If I’m looking for local news in my town of 30,000, I only need a handful of trusted sources sending out raw news in order for me to edit/publish an aggregation of news for that locality. A larger city (Chicago) only requires a handful more sources.

For edit/publishing tasks, I will have a way to strip out tweets that are unrelated from that stream and a way to categorize the tweets that are related. Once a category (story) has valuable information from enough sources, it will be published. Once published, it remains alive. I can remove/add information and sources. Everyone can react, republish, comment, or do whatever they would like with that story.

More later I think. I might be working on it.

Posted in news, twitter.

Tagged with , , .


TopTwit Update

FYI, this is more of a log for my use. But read if you’re interested.

The original TopTwit has pretty much failed for the time being, but that doesn’t mean the idea is dead. Soon I’ll head back into that code and clean it up (a year later). It does still work if you want to try it out– sign up and build your twit lists and you have a nice page to keep track of your favorites.

On the other side of things, I’ve been having fun playing copycat to the 40 most recent links from @davewiner. You can see my version over at 40 most recent links from @jeremyfelt. I’ve recently added support for bit.ly and post.ly in addition to the default tr.im functions. I have categories built in (using hash tags), but I took them off of the display for now because it seemed like a waste of characters. Not sure what new features will show up here in the near future, but it definitely needs a design overhaul.

Posted in toptwit, twitter.

Tagged with , , .


Your profile is not yet eligible to be featured in Google Search.

Hearing that Google Profiles are starting to be included in search results, I head over to my Google Profile page and see a little message:

Your profile is not yet eligible to be featured in Google search results.

To have your profile featured, add more information about yourself.

A link is given for Add more info to my profile, and learn more. I follow the learn more link, as I’ve already added plenty of info to my profile and I can’t figure out what else they could need.

The learn more section has the basics — add info to your profile, add links to your web pages, etc, etc — and then a section for “Verify your name” and get a “Verified” badge on your account.

Sweet, I can be Google Official! I click on verify your name and am brought to a page that tells me I should:

  • Sign in on the Knol homepage.
  • Select Preferences from the My profile drop-down menu in the top right corner of the page.
  • Click Name Verification.
  • Select how you want Google to verify your name.

So I sign into the Knowl homepage and at first the My profile link isn’t up in the top right corner, but after a few clicks it suddenly appears. I click on the My profile link and go to preferences and then Name Verification.

Wow, two options — Phone or credit card. Each seems easy enough, so I go with phone. I enter my name, address, phone number and click the button to have Google call me.

Alas, I am not in the “directory”, whatever that is. So I cannot use this method for verification.

Whatever, credit card is just as easy. I click Verify name by credit card. Enter name, address, credit card number… and no — “We encountered the following problem: Error: please try later.” How descriptive.

So then I gave up and added a short biography of nonsense, and then added my special super powers, and then added something I can’t find on Google. Saved my profile one more time, and voila, my profile is eligible to be featured in Google search.

Huh?

Posted in google.

Tagged with , , .


Tweenbots Explaining Artificial Intelligence

Tweenbots (and their need of help) reminded me of a thought I had the other day about Artifical Intelligence that takes more than 140 characters to express. Not much more, but enough to justify the first blog post in a long time. :)

While I’m not that familiar with AI or the methods involved in trying to solve it, it seems to to me that the goal would be to create a machine with an artificial “brain” that is comparable to that of a newborn. The true test of AI would then be to see if you could teach that “brain” enough things over the next 18 or more years for it to become self sufficient in its abilities to learn and make judgements.

If a machine were ever to be artificially intelligent enough for its “brain” power to match that of a human’s, it should have the years of experience and guidance that we get in addition to the hardwired rawness of (1+1=2).

Posted in science.

Tagged with , , .


YouTube – Dramatic McCain

YouTube – Dramatic McCain

Posted in Asides.