Home

Wednesday, December 22, 2004

Main > Christmas: Santa Physics

SantaCan Santa actually do his job? Read below. For believers, track Santa http://www.noradsanta.org/

1. There are approximately 2.5 BILLION children (persons under 18) in the world. This is based on the World Population Consensus of 2000 and using the US's basis of 42% population under 18. However, since Santa does not visit children of Muslim, Hindu, Jewish, or Buddhist religions, this reduces the workload for Christmas night to 33% of the total, according to www.statistics.com and www.religioustolerance.com; 825 MILLION (according to the World Population Reference Bureau). At an average rate of 2.5 children per household worldwide, that comes to 330 MILLION homes, presuming, of course, that there is at least ONE good child in each household, not a real safe assumption, but...

2. Santa has a total of 31 hours to work with, thanks to the different time zones and the rotational speed of the earth, assuming he travels from East to West, a safe assumption. This works out to about 3000 visits per second. This is to say that for each Christian home with a good child, Santa has just under 1/3000th of a second to park the sleigh, hop out, jump down the chimney or mist through a door or window, fill the stockings, distribute gifts around the tree, eat whatever snacks the good children have left him, get back up the chimney or back out the door, jump into the sleigh and get on to the next house. Assuming each of these 330 MILLION stops is evenly distributed around the landmass of the world (which we know is false, but accept to make the calculations simpler), we are now looking at about 0.78 miles per household; a total trip of 258 MILLION MILES, not counting bathroom breaks and watering the reindeer stops. This means that Santa's sleigh MUST move at about 8.3 MILLION MPH or 2,300 miles per SECOND – 3000 times the speed of sound. For purposes of comparison, the fastest manmade vehicle, Voyager II, moves at a pokey 39 miles per second, and a conventional reindeer can run at best 15 miles an HOUR!

3. The payload of the sleigh adds another interesting element. Assuming that each child gets nothing more than a medium sized Transformer© set of about 2 pounds and a small Spnge Bob SquarepantsTM hand puppet, the sleigh is carrying over 825 THOUSAND TONS, not counting the fat man himself. On land, a conventional reindeer can pull only 300 pounds. Even granting that these special reindeer could pull 100 times the normal amount, the job would take 36,000 reindeer. This, of course, increases the payload, not counting the fat man, another 54,000 tons, or roughly 7 times the weight of the QEII, the largest cruise ship on earth.

4. 880,000 TONS traveling at 2,300 MILES PER SECOND creates an enormous air resistance – this would heat up the reindeer in the same fashion as a shuttle reentering the atmosphere. The lead pair of reindeer would absorb 32 QUINTILLION (32,000,000,000,000,000,000) Joules of heat energy every second each! This is 6.4 x 1019 WATTS of power – enough to light up the United States for 55 MILLENIUM! In short, they would burst into flames and vaporize into plasma, the 4th State of Matter, instantaneously, exposing the reindeer behind them and creating a deafening sonic boom in their wake which would pulverize the remaining reindeer if they would, indeed, still be there. The entire reindeer team would be vaporized within 0.000 426 seconds, or right about the time Santa reaches the 2nd house of the trip. Not that this matters however, since Santa as a result of the tremendous acceleration from rest to 2,300 MILES PER SECOND in 1/3000th of a second would subject him to a force = 1.1 BILLION times the pull of gravity here on earth! A 250 pound Santa, a conservative estimate since that's my weight, would be pinned to the back of the sleigh by 275,000,000,000 POUNDS of force, instantly crushing his bones and organs and reducing him to a quivering blob of pink goo.

5. Therefore, if Santa ever existed, he doesn't now.

6. But, we all know that Santa DOES EXIST and survives very well, thank you, due to his special powers inherited from his home planet of Krypton.


Source: http://darylscience.com/santa.htm

Tuesday, December 21, 2004

Main > I Hate Daniel

He ate my little cookie.

Code > Currently Playing Update

I added a timeout code so after 15 min of no activity, it says winamp is stopped. If you're listening to a song longer than 15 min, sorry. Ill try to find a plugin that will send song time if possible then calculate the time from that. heres the code:

  1. $time=strtotime($songinfo[time]); 
  2. $now=time(); 
  3. $today=date("Y-m-d"); 
  4. if ((($now - $time) > 900) || ($today != $songinfo[date])){ 
  5. $content = "Winamp Stopped"; 
  6. } else { 
  7. $content = "$songinfo[artist] - $songinfo[title]<br />"; 
  8.  
  9.  
  10. // echo link to googles "im feeling lucky" search "$artist - $title lyrics" for lyrics 
  11.  
  12. echo "<a href='http://www.google.ca/search?q=$songinfo[artist] - $songinfo[title] Lyrics&btnI=I%27m+Feeling+Lucky' target=_blank>Lyrics</a>"; 

Code > Currently Playing

Updates below:

Well, if you look on the right hand side, you can see the song I'm currently listening to. Want to know how? Ok, I'll tell ya.

First, you need Winamp. Now add the DoSomething Plugin.

Edit the preferences for the plugin, uncheck 'disable plugin', add action 'submit url'. For the url, make something like:
'http://blog.megatech.tk/winamp.php&title=%%URL_CURRENTSONG%%'

(this isnt the actual url, so dont even try to submit junk to it)

I made a file called winamp.php, heres what it looks like now:

  1. $info=explode(" - ", $title); 
  2. $title=$info[1]; 
  3. $artist=$info[0]; 
  4. mysql_query("insert into winamp(artist, title, date, time) values('$artist', '$title', now(), now())"); 

Make a DB called winamp, rows - artist(varchar(255)), title(varchar(255)), date(date), time(time).

The explode part of the script rips the songtitle apart from the artist, this is not neccessary.

Then on the side I just made an sql query:
"select * from winamp order by date, time DESC limit 0,1".
Pretty self explanitory. Thats about it.

Edit: SQL ordered the dates backwards.
Changed to "select * from winamp order by date DESC, time DESC limit 0,1".


Update:

Because of the way my songs are labelled, heres the better paring script. This is not final, but it is better.

new winamp.php code:

  1. $info=explode(" - ", $title); 
  2. $title=$info[1]; 
  3. $artist=$info[0]; 
  4. if($info[2]){ 
  5. $title=$info[2]; 
  6. if($info[3]){ 
  7. $title=$info[3]; 
  8. if(eregi("([0-9]{2})", $info[2])){ 
  9. $artist=$info[1]; 
  10. } else { 
  11. $artist=$info[2]; 
  12. if($info[4]){ 
  13. $title=$info[4]; 
  14. if(eregi("([0-9]{2})", $info[3])){ 
  15. $artist=$info[2]; 
  16. } else { 
  17. $artist=$info[3]; 
  18. mysql_query("insert into winamp(artist, title, date, time) values('$artist', '$title', now(), now())"); 


K, I got rid of the parsing stuff. Just displays my winamp title for simplicity.

Main > Bored

Well. I'm bored. And in being bored, I'll write. I'm not sure what about. I've run out of things to aadd to my site. Wait, picture gallery. Although, I am pretty tired, so I might leave that until tomorrow. Hm, I think I'll add a "currently playing"(Done) list to my site. Uses a winamp plugin if I remember correctly. I'll probably build a database of what songs I play at what time, and make a results page. I also need to add tracking (Done). I'll either modify the one I use for my business site, or make my own. Ohh. I should make a "blog roll" for my new sites I visit. Save me from using desktop sidebar. Maybe a weather block too. Ooh this is fun. I'll read this post later and think of more stuff later. I'm too tired, so I'm off to bed. Gnight.

Monday, December 20, 2004

Code > Now it works better. <code>

I had a few problems with the old code. It didnt always parse the code right. It used to find <code> anywhere in the line. Now <code> has to be the only thing on the end of the line. I also added auto tabbing for structure.
  1. if(eregi("</code>$", $text[$b])){ 


Here's the full code.
  1. function do_code($text){ 
  2. $text=explode("\r", $text); 
  3. $coded="no"; 
  4. $comment=""; 
  5. $tab=1; 
  6. for($b=0;$b<count($text);$b++){ 
  7. if($coded == "no"){ 
  8. if(eregi("<code>$", $text[$b])){ 
  9. $coded="yes"; 
  10. $output .= "<OL class=code>"; 
  11.  
  12. if($coded=="yes"){ 
  13. if(eregi("}", $text[$b])){ 
  14. $tab--; 
  15.  
  16. $line="tab".$tab; 
  17. if(eregi("^/\*", $text[$b])){ 
  18. $comment="start"; 
  19. if(eregi("\*/$", $text[$b])){ 
  20. $comment="end"; 
  21. if(eregi("^//", $text[$b])){ 
  22. $comment="end"; 
  23. if($comment=="start"){ 
  24. $line="cmnt"; 
  25. if($comment=="end"){ 
  26. $line="cmnt"; 
  27. $comment=""; 
  28. if($coded=="yes"){ 
  29. if(!eregi("code>$", $text[$b])){ 
  30. $output .= "<LI class=$line><CODE>".formattext($text[$b])."</CODE>\n"; 
  31. if(eregi("</code>$", $text[$b])){ 
  32. $coded="no"; 
  33. $output .= "</OL>"; 
  34. $tab=1; 
  35. } else { 
  36. $text[$b]=formattext($text[$b]); 
  37. $output .="$text[$b]"; 
  38.  
  39. if($coded=="yes"){ 
  40. if(eregi("{", $text[$b])){ 
  41. $tab++; 
  42.  
  43. return $output; 

Code > Yay, It works.

My CODE tag now works. heres the code behind it. :

  1. function do_code($text){ 
  2. $level=0; 
  3. $text=explode("\r", $text); 
  4. $coded="no"; 
  5. $comment=""; 
  6. for($b=0;$b<count($text);$b++){ 
  7. if($coded == "yes"){ 
  8. if(eregi("<code>", $text[$b])){ 
  9. $text[$b]=eregi_replace("<code>", "<code>",$text[$b]); 
  10. $level++; 
  11. if(($level <> 0) && (eregi("</code>", $text[$b]))){ 
  12. $text[$b]=eregi_replace("</code>", "</code>",$text[$b]); 
  13. $level--; 
  14. if ($level <> 0){ 
  15. $text[$b]=formattext($text[$b]); 
  16. if($coded <> "yes"){ 
  17. if(eregi("<code>", $text[$b])){ 
  18. $coded="yes"; 
  19. $output .= "<OL class=code>"; 
  20. $line="tab1"; 
  21. if(eregi("^/\*", $text[$b])){ 
  22. $comment="start"; 
  23. if(eregi("\*/$", $text[$b])){ 
  24. $comment="end"; 
  25. if(eregi("^//", $text[$b])){ 
  26. $comment="end"; 
  27. if($comment=="start"){ 
  28. $line="cmnt"; 
  29. if($comment=="end"){ 
  30. $line="cmnt"; 
  31. $comment=""; 
  32. if($coded=="yes"){ 
  33. if(!eregi("code>", $text[$b])){ 
  34. $output .= "<LI class=$line><CODE>".formattext($text[$b])."</CODE>\n"; 
  35. } else { 
  36. $output .="$text[$b] 
  37. "; 
  38. if(eregi("</code>", $text[$b])){ 
  39. $coded="no"; 
  40. $output .= "</OL>"; 
  41. return $output; 

Needs tweaking, but it works.

Code > <code> test

Text before code.
  1.  
  2. Some Code. 
  3.  
  4. //Single Line Comment  
  5.  
  6. More Code. 
  7.  
  8. /* Multi 
  9. Line 
  10. Comment*/ 
  11.  
  12. More Code. 
  13.  

Text After Code.

  1.  
  2. Some Code. 
  3.  
  4. //Single Line Comment  
  5.  
  6. More Code. 
  7.  
  8. /* Multi 
  9. Line 
  10. Comment*/ 
  11.  
  12. More Code. 
  13.  

More Text After Code.

Code > CSS

I've decided to learn CSS. Interesting stuff. Complicated, yet simple. I still think tables are easier. But it's the new age, and I need to keep my skillz up. Ive decided XML is useless. LOL. For me right now it is anyway.

Main > Update

I've added a few cosmetic tweaks to the admin page. I updated the layout and framework to support multiple themes, and widened the main body div to allow the comics to fit properly. no more compression. Ive got a few more idea's to add. I'll keep you posted
Select a Page
Page 7 of 11 Pages < 1 2 3 4 5 6 7 8 9 10 11 >