Shafe Shifter Just another guy on the internet.

20Sep/110

Twitter Reacts To Facebook Upgrades.


This evening Facebook rolled out the latest in their upgrades.  Ever since Google Plus launched a few months ago Facebook has been rushing updates out the door, almost twice a week.  While we all know that people hate change and will complain about any change to anything they are used to, but CONSTANT change may be worst to the demise of the largest site on the internet.

Users want a good experience.  Users DO NOT want to have to go through pages of settings a few times a week because Facebook has changed them.  People visit their favorite social network to kill time and see what their friends are up to, NOT to spend extra time updating their settings or learning a completely new UI.  Previously I don't think this would have hurt Facebook.  People would complain and get used to it.  However this time, it has become apparent that this is a kneejerk reaction to Google+, and with as easy as Google+ is to use and how clean the Google+ UI is, I wouldn't be surprised if we start seeing a drop-off in Facebook usage.

In April 2008, Facebook overtook Myspace on Alexa, marking the beginnings of the end for the once top site on the internet.   Myspace responded by constantly rolling out new features that had obviously not been tested in all browsers, and outraging users.  During this time Facebook was busy staying consistent.  During that time the evolution of Facebook was happening on the developer side of things.  Facebook was fine-tuning their APIs and developers abilities to create apps for their platform.

The current state of Facebook feels like Myspace in the months following April 2008 and now with the new player on the block, it will be interesting to see how things play out.   Only time will tell.

It was pretty entertaining tonight watching people tweet about the Facebook updates, some real gems... Here are a few:

14Sep/110

Displaying a subversion commit log with PHP

php

I was recently tasked with a small project that had to pull commit logs from various subversion servers and repositorys and display them on a web page.

The process was a lot simplier than I first anticipated.  Hopefully someone else will find this useful.   This php code snippet requires that the server have SHELL_EXEC() enabled and subversion must be installed.   We'll use the SHELL_EXEC() function to actually use the subversion cli to grab the commit log from a remote server and store it in an xml file.

I'll break down the code a bit. This first bit, is a simple helper function that will help us read the XML file itself. We call the function xml_atrribute().

function xml_attribute($object, $attribute)
{
    if(isset($object[$attribute]))
        return (string) $object[$attribute];
}

Next up is to actually run the subversion CLI client with all of the correct parameters to generate an xml file of the commit log. You will want to adjust the server, username, password, repository name and output path to meet your needs.

$test = shell_exec("svn log --xml --verbose svn://svn.mydomain.com/reponame --username USERNAME --password PASSWORD > /home/html/svnlog/reponame.xml ") ;

Alright, at this point we should have a nicely formatted XML file that we can read, loop through and display information from. Here is a simple bit that loops through the various XML elements and displays them. As commented we go one step further than just reading the commit comments, we actually display the files and what action was performed on them.

foreach ($xml->logentry as $logentry)
{
  $date = date('m/d/Y', strtotime((string) $logentry->date));
  foreach ($logentry->paths as $paths)
  {

	echo ' <BR><B>Revision: ' . xml_attribute($logentry, 'revision') . '</B>';
	echo ' <BR>Date: ' . $date;
	echo ' <BR>Message: ' . $logentry->msg;
	echo ' <BR>Commited By: ' . $logentry->author;
	echo ' <BR> ' ;

		/* 	Now lets loop through and get a
			list of files that have changed
			in this commit */
		echo '<UL>';
		foreach ($paths->path as $path)
		{
			echo "
<li>" . $path['action'] . "  " . $path . "</l1>";
		}
		echo '</UL>';		

	}

  }

Here is the entire script all put together and commented:

<?php

/* 	This is a helper function
	to aid in reading our XML
	file we are going to create */
function xml_attribute($object, $attribute)
{
    if(isset($object[$attribute]))
        return (string) $object[$attribute];
}

/* 	Run SVN to get an xml file
	of the commit log.
	SHELL_EXEC() must be enabled
	on the server.
*/
$test = shell_exec("svn log --xml --verbose svn://svn.mydomain.com/reponame --username USERNAME --password PASSWORD > /home/html/svnlog/reponame.xml ") ;

/* Pull the XML file in */
$xml = simplexml_load_file(dirname(__FILE__).'/reponame.xml');

/* now lets roll through the XML and display the results */
foreach ($xml->logentry as $logentry)
{
  $date = date('m/d/Y', strtotime((string) $logentry->date)); // format the date
  foreach ($logentry->paths as $paths)
  {

	echo ' <BR><B>Revision: ' . xml_attribute($logentry, 'revision') . '</B>';
	echo ' <BR>Date: ' . $date;
	echo ' <BR>Message: ' . $logentry->msg;
	echo ' <BR>Commited By: ' . $logentry->author;
	echo ' <BR> ' ;

		/* 	Now lets loop through and get a
			list of files that have changed
			in this commit */
		echo '<UL>';
		foreach ($paths->path as $path)
		{
			echo "
<li>" . $path['action'] . "  " . $path . "</l1>";
		}
		echo '</UL>';		

	}

  }

?>

It's worth noting that when we read in the XML file we assume it lives in the same directory as the script reading it does. You can adjust this as needed. I Hope this is helpful to anyone out there needing to do something similar. The full source is here: svnsample.zip.

27Jun/110

Asteroid Passes Earth 32 Times Closer Then The Moon

An asteroid called 2011MD the size of a tractor trailer passed by this morning 32 times closer than the moon.   The asteroid was discovered as recently as June 22, 2011, there would have been very little time to prepare if it where to enter earth's atmosphere. It's worth noting the Tunguska Event of 1908 where a similar sized meteor exploded 3-6 miles above the earth's surface, Wikipedia says:

Although the meteoroid or comet burst in the air rather than hitting the surface, this event is still referred to as an impact. Estimates of the energy of the blast range from 5 to as high as 30 megatons of TNT (21–130 PJ),[6][7] with 10–15 megatons of TNT (42–63 PJ) the most likely[7]—roughly equal to the United States' Castle Bravo thermonuclear bomb tested on March 1, 1954, about 1,000 times more powerful than the atomic bomb dropped on Hiroshima, Japan, and about one-third the power of the Tsar Bomba, the largest nuclear weapon ever detonated.[8] The explosion knocked over an estimated 80 million trees covering 2,150 square kilometres (830 sq mi). It is estimated that the shock wave from the blast would have measured 5.0 on the Richter scale. An explosion of this magnitude is capable of destroying a large metropolitan area.[9] This possibility has helped to spark discussion of asteroid deflection strategies. The Tunguska event is the largest impact event over land in Earth's recent history.[10] Impacts of similar size over remote ocean areas would most likely have gone unnoticed[citation needed][dubious – discuss][11] before the advent of global satellite monitoring in the 1960s and 1970s.

Check out the wikipedia articles:

http://en.wikipedia.org/wiki/2011_MD
http://en.wikipedia.org/wiki/Tunguska_event

21Jun/110

Technology… I Feel Cheated.

When I was young....

I was told that by the year 2000 flying cars would be commonplace, in 2011 Flying cars are not commonplace. Instead, Flying in America is one of the most awful activities one can partake in that involves being fondled and having your shampoo poured out.

I was told that by the year 2000 more than 5% of the human race would be colonizing space and that the moon would be a popular vacation resort. Instead, we stopped going to the moon nearly 40 years ago and a human being hasn't left orbit since.

I was told that by the year 2000 household robots would be commonplace in most homes, and that these robots would free humans up from common housework. In 2001 Housework performing robots are not commonplace, although if you have enough money you can pay an undocumented alien well below minimum wage and treat them like crap for the same result.

I was told that by the year 2000 the average adult would have twice as much leisure time because they would only work 15-18 hours a week. In 2011 most adults in corporate America have an average work week of 50-80 hours.

I was told that by the year 2000 the worlds governments would unite and technology would stop any need or desire to wage wars. *cough* no comment.

Don't even get me started on jetpacks.....

19May/110

THINGS YOU’LL MISS IF THE WORLD ENDS SATURDAY

For those of us lucky enough to not get taken.. here are some things happening when all the wingnuts are gone...

May 21

  • Rapture Day

May 21

  • Ready, Set, Inflate!: The National Safe Boating Council is trying to break its first world record attempt to see how many people around the world can inflate a life jacket at once…They might get more than theybargained for if Camping’s predictions play out.

May 21

  • National Memo Day
  • Largest raft of canoes: Speaking of world record attempts, over in Cleveland, Ohio, they’re trying to make the largest raft out of canoes and kayaks…again a large raft may come in handy later on in the day.

May 22

  • Buy a Musical Instrument Day.

May 23

  • Lucky penny day: Find a penny, pick it up; all day long you'll have good luck…If only this had been before May 21.
  • National Pickle Day

May 24

  • Citizen Fish at the WOW Hall.
  • National Escargot Day
  • Hug Your Cat Day. Who is going to hug your cat if the world ends? Nicolas Cage?

May 25

  • Nerd Pride Day or Geek Pride Day
  • National Tap Dance Day - in honor of the birthday of legendary tap dancer Bill "Bojangles" Robinson on May 25, 1878.
  • Towel Day: Every year fans of Douglas Adams’ the Hitchhiker’s Guide to the Galaxy carry a towel around with them on this day…it was referenced in the book, they’re not just mad.
  • Zoopolis 500: It’s like the Indianapolis 500…just with tortoises. Every year the Indianapolis zoo gets a group of tortoises down a track in order to win a ‘fresh fruit tray.’
  • “Change Every Picture on the Internet to a Cat GIF Day.” Ok, fine, I made that up, but let’s make it happen, heathens!

May 27 -

  • Sunscreen Protection Day

May 27, 28, 29, 30

  • Indianapolis 500 Race: The ‘greatest spectacle in racing’ may have to give way to the last spectacle on earth…But if it does go ahead the 95th Indianapolis 500 Race should be a cracker.

May 31

  • National Macaroon Day.

 

Stop SOPA