Archive for November, 2007

gas_station.png

Gas Station BSOD – Windows: 0, Other OS: 1

When at the gas station earlier today, this is what I saw on the gas station TV-screen at a near-by pump (sorry for the blurry picture, I wasn’t very close to the pump and my camera on my phone is a little dirty):

gas_station.png

25lbs.png

How safe is this weight-loss program?

You be the judge.

25lbs.png

PHP Sessions – Quick and dirty

A session variable is a great way to store information about visitors on your site. For example if a user logs in you could store their username, and the date of login as session variables, then add a file include that checks to make sure the user is logged in before viewing a page.

Below is example code using session variables:

1
2
3
4
5
6
7
8
9
10
11
12
13
<?php
echo "Creating session variables... <br />";
$_SESSION['uname'] = "Steve";
$_SESSION['pass']  = "MyPassword";
echo "Displaying session data... <br />";
echo $_SESSION['uname'] . "<br />" . $_SESSION['pass'] . "<br />";
echo "Destroying session data... <br />";
unset($_SESSION['uname']);
unset($_SESSION['pass']);
echo "Displaying session data again (should be empty)... <br />";
echo $_SESSION['uname'] . "<br />" . $_SESSION['pass'] . "<br />";
echo "Done! <br />";
?>

That code, when run will output:

Creating session variables...
Displaying session data...
Steve
MyPassword
Destroying session data...
Displaying session data again (should be empty)...

Done!

The code is very simple to follow, $_SESSION[] variables are created named uname and pass, values are assigned to them and displayed via echo. Then unset() is used to delete the values, thus when echoing the output again the lines are blank. Cake.

Is Vista’s market share really that bad? Yes, it is.

I have been conducting some research over the last, to be honest 3 days concerning browser and operating system trends of people who visit websites I either own or host for people. I collected data based on just over 6000 requests from Saturday morning, until Monday night (11-10-07 to 11-12-07). The results of this were very interesting (to me and a few people I discussed this with). First I will show the usage graph:

os_graph.png
Possible -+0.1% margin of error.

As you can see, this graph shows 6195 total page requests over the 3 days the data was collected. Most requests were 1-2 pages, so this was not the result of user spam. Notice that Windows has 57.1% OS graph, OS X has 39.5%. That is surprising in the fact that OS X has such a high percentage. Most people consider OS X to be in the lower percentile, nearing 1-15% of the market share, but surely not nearly 40%.

Then take a look at Vista, in its splendor. Of the 6195 requests, only 11.5% of them were served to Vista computers. Compare that to 39.5% of OS X requests, and 45.6% of Windows XP requests. Is anyone surprised by these statistics? I honestly am, I expected Vista to have a higher share in the websites I researched (tech websites, due to privacy as of now I am not releasing the domain names).

Does this mean that Vista is not popular? Yes, in the scope of the researched sites. Granted this was in no way a global study, or a in-depth one it does give a glimpse into a few tech-oriented websites over a 3 day time period to show you how Vista is stacking up in the OS world.

And just for the heck of it, here was the data collected on browser trends:

browser_graph.png

-Steve

If my computer was like the ones in the movies, I wouldn’t use it

After watching the movie “Live Free or Die Hard”, the latest Die hard movie, a realization I made years ago was refreshed. The movie contains heavy computer-usage scenes as the entire movie revolves around the hacking of the entire U.S. infrastructure. In all of the computer scenes, a distinct sound can be heard every time the computer does something. That sound is a soft beep. A new window pops up, and it beeps, the user clicks, and it beeps, a window resizes, and it beeps. Everything done on the computer is followed by a beeping sound. How annoying.

Would you use a computer that beeps over and over every single time you do something? What about a computer that, instead of displaying text instantly required it to scroll all across the screen, while beeping of course. Would you use that computer? Probably not. The fact is that ‘Hollywood’ computer scenes consist of nothing more than constant scrolling and beeping, for absolutely no reason. That is enough to drive anyone crazy. The question is why do they do this?

PHP Generated iPhone User Images

I have been screwing around with some PHP using functions like imagecreatefrompng() and ImagePNG() to create a few images that create a ‘signature’ image that can be used on websites, etc.

Image 1:

Useage:

Forums: [img]http://www.rapidhash.com/rapidhash/autosig.php.png[/img]

Image 2:

Useage:

Forums: [img]http://www.rapidhash.com/rapidhash/iphone.php.png[/img]

Image 1 will just display the IP of the user. Image 2 will display the users IP, Browser, and Operating System.

Feel free to use them if you desire where ever you want. Just link to them (do not try to save the image, it will not work if you do).

Enjoy.

Digg Stack Screensaver as Wallpaper

A great little program exists for OS X called Wallsaver which allows you to load up a screensaver as your desktop background and keep it fully animated. I decided to take the new Digg ‘Stack’ screensaver and make it my wallpaper, allowing me to see whats going on while in class, without opening a web browser. Very nice.

digg_background.gif

Insane Cat

Seriously, this cat is nutso.

Track your site activity in PHP

Want to know who is visiting your website, when the peak times are, and how people are finding you? It is a lot easier than it sounds. While the code below may be over-simplified, it does get the job done. The code assumes that you have a include in your main source file that opens a database connection, and a code at the end of your source file that closes it.

The code will get the referring page, the date and time of access, and the IP of the users and store it in a table called tracker. You can then easily code a interface to view that database information. Later I will post code for an interface to this data.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php
// very simple PHP function, call when database connection is open using tracker();
// By Steve Morrissey
 
function tracker()
{
	$referer = $_SERVER["HTTP_REFERER"];
	$time = date("F j, Y, g:i a");
	$ip = $_SERVER['REMOTE_ADDR'];
	if($referer == "")
	{
	     $referer = "Direct hit";
	}
	mysql_query("INSERT INTO tracker (id, referer, ip, accessed) VALUES('', '$referer', '$ip', '$time')") or die(mysql_error());
} // end tracker
?>

Who Wants To Be a Millionaire – College Student Shines

pathetic.