<?xml version="1.0" encoding="utf-8" ?>

<rss version="0.91" >
<channel>
<title>mysiteonline™</title>
<link>http://life.mysiteonline.org/</link>
<description>Brendon Kozlowski's Home on the Web.</description>
<language>en</language>
<image>
        <url>http://life.mysiteonline.org/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: mysiteonline™ - Brendon Kozlowski's Home on the Web.</title>
        <link>http://life.mysiteonline.org/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>htmlentities() in PHP is Your Friend</title>
    <link>http://life.mysiteonline.org/archives/204-htmlentities-in-PHP-is-Your-Friend.html</link>

    <description>
        After constantly badgering a certain library calendar vendor over 2 years to fix his software&#039;s RSS feed charset issues. Personally I don&#039;t think getting raw text describing times in the form of &quot;6:30â€“8:30 p.m.&quot; is all that valuable...that&#039;s just a single example. The calendar website declared no charset information. I have no idea what charset the database is in, and the RSS feed was declared as ISO-8859-1. Our website, database, and everything else was declared as UTF-8, not that it really mattered though since the raw incoming text from the RSS feed was all garbled to begin with.&lt;br /&gt;
&lt;br /&gt;
Every once and awhile I&#039;d randomly try to find an answer to the problem. I&#039;ve been through using all sorts of different algorithms to solve the problem. None of them seemed to work, until one day I saw someone mention on StackOverflow (unfortunately I&#039;ve lost the link) that he tried using htmlentities() to solve his problem and it worked. I thought, &quot;It couldn&#039;t be that simple...&quot; However, I had nothing to lose and tested it. It worked. (What???) I still don&#039;t know why or how htmlentities managed to run a translation table on the garbled input to output the appropriate values, but I&#039;m happy! Even my attempts at REGEX were unsuccessful, though I probably was just unable to find ALL the right bit-level character code sequences needed. Apparently the translation table that htmlentities uses is pretty darn thorough! Thanks, PHP team!&lt;br /&gt;
&lt;br /&gt;
Okay, so that was the first use of htmlentities(). The second one?&lt;br /&gt;
&lt;br /&gt;
I realized I overlooked a severe security hole in my forms. When users did not provide correct details in their forms, I was simply reinserting the values they provided back in to the HTML form&#039;s VALUE tag (or in the case of a textarea, just rendering the value between the tags). For some reason this didn&#039;t strike me as being severely stupid at the time. I don&#039;t know why. I guess the &quot;never reprint what your users submit to you&quot; only made me think of &quot;back to the DOM&quot; - but only outside form elements. Who knows why. This let someone who actually put some (minimal) thought into it to run whatever PHP code they wanted simply by submitting a form without all required data. Escape the form element by using a standard HTML closing tag, then start writing the PHP. If you wanted valid HTML, just make sure to also include a dummy HTML input or textarea field once done. Simple. (Note: I am also in the process of re-examining CHMOD values of files and folders.)&lt;br /&gt;
&lt;br /&gt;
When I went back to &quot;fix&quot; my stupidity, I also initially thought of using PHP&#039;s filter functions. Although they worked, they also would sometimes (depending on user input) remove certain characters. Like a bolt of lightning (while I was eating lunch) it came to me. I just used htmlentities(), why not just use it again? ...so I did. Now my forms are a bit more protected &lt;strong&gt;and&lt;/strong&gt; our RSS feed is no longer displaying obnoxious characters to visitors due to the encoding mishaps of an external developer.&lt;br /&gt;
&lt;br /&gt;
Sometimes PHP&#039;s little gems are so awesome... 
    </description>
</item>
<item>
    <title>Edit a Wordpress Article with PHP and XML-RPC</title>
    <link>http://life.mysiteonline.org/archives/198-Edit-a-Wordpress-Article-with-PHP-and-XML-RPC.html</link>

    <description>
        I had created a topic discussing how to create an interface to add new posts to a Wordpress blog using PHP and XML-RPC. It was something I had needed for work. Unfortunately for many of my site visitors and readers from Google, I never had the need to edit an article, but many of them did. I no longer had a development installation of Wordpress and I don&#039;t particularly like Wordpress (due to its spaghetti like codebase).&lt;br /&gt;
&lt;br /&gt;
The people have spoken though, and I have listened. I reinstalled Wordpress to see if I could get an edit action to work. This is a two step process, you must first get the contents of the post, and then submit the edited version back to Wordpress. The tricky part here is modifying the date field.&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t read my first post on &lt;a href=&quot;http://life.mysiteonline.org/archives/161-Automatic-Post-Creation-with-Wordpress,-PHP,-and-XML-RPC.html&quot;&gt;adding a new post in Wordpress with PHP and XML-RPC&lt;/a&gt;, you&#039;ll want to read that. There I cover all of the basics you would be better off knowing before tackling an edit straight from this code (it won&#039;t make much sense otherwise).&lt;br /&gt;
&lt;br /&gt;
Using the same IXR library that I used in the post creation article, we&#039;ll use a similar approach to retrieve an article. There are two ways to get article information - if we know the ID of the article we can simply use &lt;tt&gt;metaWeblog.getPost&lt;/tt&gt;, or we can get a list of recent posts (with a maximum limit of - I believe - 15) using &lt;tt&gt;metaWeblog.getRecentPosts&lt;/tt&gt;.&lt;br /&gt;
&lt;textarea name=&quot;code&quot; class=&quot;php&quot;&gt;if (!$client-&gt;query(&#039;metaWeblog.getPost&#039;,&#039;1&#039;, &#039;username&#039;,&#039;password&#039;)) {
	die(&#039;An error occurred - &#039;.$client-&gt;getErrorCode().&#039;:&#039;.$client-&gt;getErrorMessage());
}
$request = $client-&gt;getResponse();&lt;/textarea&gt;&lt;br /&gt;
A simple print_r() of $request will give me the following:&lt;br /&gt;
&lt;textarea name=&quot;code&quot; class=&quot;php&quot;&gt;Array
(
    [dateCreated] =&gt; IXR_Date Object
        (
            [year] =&gt; 2010
            [month] =&gt; 05
            [day] =&gt; 07
            [hour] =&gt; 01
            [minute] =&gt; 33
            [second] =&gt; 49
            [timezone] =&gt; 
        )

    [userid] =&gt; 1
    [postid] =&gt; 1
    [description] =&gt; Welcome to WordPress. This is your first post. Edit or delete it, then start blogging! WAHOO! WAHOO!
    [title] =&gt; Hello world!
    [link] =&gt; http://example.com/?p=1
    [permaLink] =&gt; http://example.com/?p=1
    [categories] =&gt; Array
        (
            [0] =&gt; Uncategorized
        )

    [mt_excerpt] =&gt; 
    [mt_text_more] =&gt; 
    [mt_allow_comments] =&gt; 1
    [mt_allow_pings] =&gt; 1
    [mt_keywords] =&gt; 
    [wp_slug] =&gt; hello-world
    [wp_password] =&gt; 
    [wp_author_id] =&gt; 1
    [wp_author_display_name] =&gt; username
    [date_created_gmt] =&gt; IXR_Date Object
        (
            [year] =&gt; 2010
            [month] =&gt; 05
            [day] =&gt; 07
            [hour] =&gt; 01
            [minute] =&gt; 33
            [second] =&gt; 49
            [timezone] =&gt; 
        )

    [post_status] =&gt; publish
    [custom_fields] =&gt; Array
        (
        )

    [sticky] =&gt; 
)
&lt;/textarea&gt;&lt;br /&gt;
As I said, the tricky part here is the date. If we want to modify the date, we need to supply the IXR_Client object an IXR_Date object. But how do you do that?  Well, looking at the IXR class code, the constructor needs to be supplied either an ISO date, or a timestamp.  Since it&#039;s easy to supply a timestamp, I&#039;ll do that for this example.&lt;br /&gt;
&lt;textarea name=&quot;code&quot; class=&quot;php&quot;&gt;$newDate = new IXR_Date(strtotime(&#039;now&#039;));
$content = array(
	&#039;title&#039; =&gt; $request[0][&#039;title&#039;],
	&#039;description&#039; =&gt; $request[0][&#039;description&#039;].&#039; &lt;p&gt;I&#039;ve added this text to the end of the entry.&lt;/p&gt;&#039;,
	&#039;dateCreated&#039; =&gt; $newDate,
	&#039;categories&#039; =&gt; $request[0][&#039;categories&#039;]
);&lt;/textarea&gt;&lt;br /&gt;
I used strtotime() with &quot;now&quot; as the passed parameter so that we&#039;ll get back a timestamp for the current time. This is just an example, make it fit to your needs. I&#039;ve also put in the necessary data required for the $content variable, and used most of the variables from the previous metaWeblog.getPost request. So...now we simply call the actual query for metaWeblog.editPost:&lt;br /&gt;
&lt;textarea name=&quot;code&quot; class=&quot;php&quot;&gt;$published = ($request[0][&#039;post_status&#039;] == &#039;publish&#039;);
if(!$client-&gt;query(&#039;metaWeblog.editPost&#039;, $request[0][&#039;postid&#039;], &#039;username&#039;, &#039;password&#039;, $content, $published)){
	die(&#039;An error occurred editing the post - &#039;.$client-&gt;getErrorCode().&#039;:&#039;.$client-&gt;getErrorMessage());
}&lt;/textarea&gt;&lt;br /&gt;
&lt;br /&gt;
That&#039;s it. metaWeblog.editPost is pretty easy as long as you have the right data being sent to it.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Note: I will NOT be indulging questions pertaining to anything beyond the scope of this article, such as custom fields or any type of plugin that modifies the standard behavior.&lt;/strong&gt; 
    </description>
</item>
<item>
    <title>Outlook Web Access (Exchange) with PHP and cURL</title>
    <link>http://life.mysiteonline.org/archives/165-Outlook-Web-Access-Exchange-with-PHP-and-cURL.html</link>

    <description>
        I needed a way to authenticate users from our library from a server &lt;em&gt;outside&lt;/em&gt; our network, and therefore also not connected to Active Directory.  At first I was thinking LDAP would be the best way...then I did my research and learned enough about LDAP to realize just how much information it gives out - WAY too much for it to be very secure.  Even if I used SSL, created an account specifically for this access, set that account to read only...all it would take would be one person to hack our server and grab that information and all our organization&#039;s data is out there.  Although it&#039;s about as much of a chance as getting hit by lightning in the middle of the desert in a sand storm, I wouldn&#039;t want to be responsible.&lt;br /&gt;
&lt;br /&gt;
The only server with any sort of external web presence that is also touching the internet is our Exchange server&#039;s web access portal.  I thought, &quot;Ah HA! I can use cURL, or streams, or fsockopen or something to fake a login to this page to verify authentication!&quot;  After searching a bit (I&#039;m terrible every time I attempt to write something using cURL to authenticate), I came across a few things.&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Exchange Server 2007 uses SOAP to provide a web service...AWESOME!  We currently use 2003 though, but we will be upgrading later this year, so this may be helpful later on. &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/aa579187.aspx&quot;&gt;[Link]&lt;/a&gt;&lt;ol type=&quot;a&quot;&gt;&lt;li&gt;&lt;a href=&quot;http://www.howtoforge.com/talking-soap-with-exchange&quot;&gt;HowToForge article on how to use PHP with 2007&#039;s SOAP Web Service&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;li&gt;I found &lt;a href=&quot;http://web.archive.org/web/20090125160119/http://cadmuslabs.net/index.php?entry=entry081230-075614&quot;&gt;this PHP script&lt;/a&gt; that I tested, which successfully contacted our OWA server and authenticated.&lt;/li&gt;&lt;li&gt;I also found a PHP class on &lt;a href=&quot;http://code.google.com/p/tylerhall/source/browse/trunk/outlook-web-access/owa.php&quot;&gt;Google Code&lt;/a&gt; from Tyler Hall - it&#039;s not any particular project repository, just miscellaneous code he&#039;s hosting.  It looks like it&#039;s slightly more feature rich, allowing info from address books and a user&#039;s inbox, for example.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;
&lt;br /&gt;
I only needed to authenticate our building, so thankfully we had our own subdomain (not sure of the proper terminology) in the AD...  If your domain was example.com (DC=example,DC=com), just getting OUR office (assume &quot;Office1&quot;) was as easy as defining office1.example.com (DC=office1,DC=example,DC=com) after the @ symbol in the user&#039;s username (typically unnecessary information with OWA, but adding it explicitly was important here).  It (seemingly) worked perfectly.&lt;br /&gt;
&lt;br /&gt;
If you plan on doing something similar, just make sure that you cache (and encrypt) username/password information locally, hitting the OWA page continuously would probably make your System (or Email) Administrators a little unhappy with you. 
    </description>
</item>
<item>
    <title>Disable the Security Component in CakePHP only for Certain Actions</title>
    <link>http://life.mysiteonline.org/archives/175-Disable-the-Security-Component-in-CakePHP-only-for-Certain-Actions.html</link>

    <description>
        As I&#039;m working on a desktop application that needs to connect to the database backend, and CakePHP provides an awesome mechanism for REST or AJAX communication (as well as data validation), I decided to have my desktop application talk directly through the Cake interface to do its magic.&lt;br /&gt;
&lt;br /&gt;
Unfortunately, I was also using CakePHP&#039;s rather secure Security component to prevent XSS/CSRF attacks.  The problem is that because the desktop application was directly accessing the method with data and bypassing CakePHP&#039;s FormHelper automatically created (and Security Component friendly) rendered HTML, it was failing (and because it wouldn&#039;t even get to the action since the Security Component was set in the AppController, I couldn&#039;t even use $this-&gt;log($this, LOG_DEBUG) to see what was happening).&lt;br /&gt;
&lt;br /&gt;
After searching for a good 30 minutes or so, I came across &lt;a href=&quot;http://n2.nabble.com/how-to-disable-security-component-for-a-single-action-td682715.html&quot;&gt;this archived Google Group post&lt;/a&gt; by franky06l:&lt;br /&gt;
&lt;textarea name=&quot;code&quot; class=&quot;php&quot;&gt;if(isset($this-&gt;Security) &amp;&amp;amp; $this-&gt;action == &#039;myaction&#039;))
     $this-&gt;Security-&gt;enabled = false;&lt;/textarea&gt;I updated this to only be used in my specific controller&#039;s action, as so:&lt;br /&gt;
&lt;textarea name=&quot;code&quot; class=&quot;php&quot;&gt;function beforeFilter(){
	parent::beforeFilter();
	if(isset($this-&gt;Security) &amp;&amp;amp; $this-&gt;RequestHandler-&gt;isAjax() &amp;&amp;amp; $this-&gt;action == &#039;add&#039;){
 		$this-&gt;Security-&gt;enabled = false; 
	}
}&lt;/textarea&gt;Voila!  It now works as expected.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Note:&lt;/strong&gt; One will need to be extra cautious when disabling the Security Component.  The Security Component takes care of a lot of issues for us automatically, by disabling it, you&#039;re opening yourself up to some possible troubles.  Extra precaution is recommended, and I relinquish myself from any use of the above code that may cause harm - use at your own peril (or absolute need)!  :D 
    </description>
</item>
<item>
    <title>jQuery Printed Footer Links</title>
    <link>http://life.mysiteonline.org/archives/191-jQuery-Printed-Footer-Links.html</link>

    <description>
        I was randomly perusing the web and stumbled across an older interesting &lt;a href=&quot;http://www.alistapart.com/articles/improvingprint/&quot;&gt;List Apart article&lt;/a&gt; (September 19, 2005 to be exact).  In it, the author used JavaScript to create a list of all links found on the page, and then create a footer with a footnote-like list. I was using simple CSS to display the URL of the hyperlink in print display media, but that doesn&#039;t work in some browsers (IE), and worse off it can really mess up the visual order of the page.&lt;br /&gt;
&lt;br /&gt;
Inspired by the article&#039;s intentions, I decided to use some jQuery to whip up a similar solution &lt;em&gt;and I took the opportunity to use jQuery 1.4&#039;s new syntax for object creation&lt;/em&gt; (so this is 1.4 code only - see comments for a 1.3.x solution).  Differences? I exclude hyperlinks set to the hash symbol (#) which shouldn&#039;t be found anyway (graceful degredation people!), &quot;mailto&quot; links, and I don&#039;t find link element&#039;s citations (blockquote &quot;cite&quot; property).  I also believe his script would grab image information, but I&#039;m not entirely sure, mine only searches hyperlinks.  I also opted not to exclude listings of duplicate hyperlink values. If it&#039;s found twice, it lists it in the footer twice. Less JS processing, and more clear to the visitor (in my opinion).&lt;br /&gt;
&lt;br /&gt;
Expected Issues: It requires JavaScript (and the jQuery library included on your page). If JavaScript is enabled but CSS is disabled, the hidden content will be visible to the user.&lt;br /&gt;
&lt;br /&gt;
On to the code!&lt;br /&gt;
&lt;br /&gt;
First thing&#039;s first, we should find the links in our code that we&#039;d like to target.  For &lt;strong&gt;my&lt;/strong&gt; situation, I have a content class defined on my page for all content, and the column that contains the actual body is called &quot;.col2_right&quot; (yes, I know, ignore the fact of the poor naming scheme).  So, in jQuery, we&#039;re going to target all hyperlinks found in the col2_right and content classes, but we don&#039;t want to include links to hashes or mailto links. I&#039;ve also removed listing to nofollow links, but that is my choice (probably not a good one, but I digress).&lt;br /&gt;
&lt;br /&gt;
&lt;textarea name=&quot;code&quot; class=&quot;javascript&quot;&gt;var links = $(&#039;.col2_right.content a[href]:not([href^=#],[href^=mailto],[rel=nofollow])&#039;);&lt;/textarea&gt;&lt;br /&gt;
We&#039;ll also need some sort of container to keep these found links wrapped in.  I chose to use a fieldset and legend, you could just as easily create a DIV and a H2 or other tags for your own purposes. I also want to create an ordered list to match the found hyperlinks.&lt;br /&gt;
&lt;textarea name=&quot;code&quot; class=&quot;javascript&quot;&gt;var footnotesWrapper = $(&#039;&lt;fieldset&gt;&#039;, {
	css: {
		clear: &#039;both&#039;
	}
}).addClass(&#039;print_only&#039;);
var footnotesLabel = $(&#039;&lt;legend&gt;&#039;, {
	text: &#039;Website Addresses Used in the Document&#039;
}).appendTo(footnotesWrapper);

//create an OL to hold the footnotes
var footnoteList = $(&#039;&lt;ol&gt;&#039;).appendTo(footnotesWrapper);&lt;/textarea&gt;&lt;br /&gt;
Here comes the real center, meaty goodness of the script: looping through our list of found hyperlinks, creating a little notification text next to the hyperlink&#039;s text, and add the hyperlink URL itself to the footnote section in the ordered list as a list item.&lt;br /&gt;
&lt;br /&gt;
We use jQuery&#039;s each() method to loop through the items in the array, grab the link&#039;s URL so that we can do some testing on it, and modify it&#039;s value for inclusion in to the footnotes. Some links may be relative URLs, but that doesn&#039;t mean much to someone who doesn&#039;t know what a relative URL is. In fact, it would probably confuse me too at first. I then create a span tag to hold the associated footnote number (the ListApart article used a superscript tag, I found regular text is more easily readable), add a class to it so it&#039;s only visible when printed, and create my list item element with the URL from our link, and place those elements in to the document in the appropriate places with the appendTo jQuery function.&lt;br /&gt;
&lt;textarea name=&quot;code&quot; class=&quot;javascript&quot;&gt;$.each(links, function(i){
	var linkText = $(this).text();
	var linkValue = $(this).attr(&#039;href&#039;);
	if(linkValue.substring(0,1) === &#039;/&#039;){
		linkValue = &#039;http://&#039;+document.location.host + linkValue;
	}
	//create element to hold span with class to hide except on print
	var newElement = $(&#039;&lt;span&gt;&#039;, {
		text: &#039; [&#039;+ ++i +&#039;]&#039;
	}).addClass(&#039;print_only&#039;).appendTo($(this));

	var listEntry = $(&#039;&lt;li&gt;&#039;, {
		text: linkValue
	}).appendTo(footnoteList);
});&lt;/textarea&gt;&lt;br /&gt;
Last but not least, we append our entire footnote to the end of our content body section.  The full code is below.&lt;br /&gt;
&lt;textarea name=&quot;code&quot; class=&quot;javascript&quot;&gt;$(document).ready(function(){
	//get the container and target
	var links = $(&#039;.col2_right.content a[href]:not([href^=#],[href^=mailto],[rel=nofollow])&#039;);

	if($(links).length){
		//create a container and heading for the footnotes
		var footnotesWrapper = $(&#039;&lt;fieldset&gt;&#039;, {
			css: {
				clear: &#039;both&#039;
			}
		}).addClass(&#039;print_only&#039;);
		var footnotesLabel = $(&#039;&lt;legend&gt;&#039;, {
			text: &#039;Website Addresses Used in the Document&#039;
		}).appendTo(footnotesWrapper);

		//create an OL to hold the footnotes
		var footnoteList = $(&#039;&lt;ol&gt;&#039;).appendTo(footnotesWrapper);

		$.each(links, function(i){
			var linkText = $(this).text();
			var linkValue = $(this).attr(&#039;href&#039;);
			if(linkValue.substring(0,1) === &#039;/&#039;){
				linkValue = &#039;http://&#039;+document.location.host + linkValue;
			}
			//create element to hold span with class to hide except on print
			var newElement = $(&#039;&lt;span&gt;&#039;, {
				text: &#039; [&#039;+ ++i +&#039;]&#039;
			}).addClass(&#039;print_only&#039;).appendTo($(this));

			var listEntry = $(&#039;&lt;li&gt;&#039;, {
				text: linkValue
			}).appendTo(footnoteList);
		});

		// append the heading and &lt;ol&gt; to the target
		$(&#039;.col2_right.content&#039;).append(footnotesWrapper);
	}
});&lt;/textarea&gt;&lt;br /&gt;
&lt;br /&gt;
Note the added &quot;if&quot; statement to check the length of the links variable. If it is empty, we did not find any links and don&#039;t want to create any extra markup when printing the page.&lt;br /&gt;
&lt;br /&gt;
Oh, and the CSS: &quot;.print_only { display:none; }&quot; This should be placed in your normal style sheet, and leave it out from your print style sheet. If you don&#039;t have a print style sheet, extend it a bit: @media print { .print_only { display:none; } }&lt;br /&gt;
&lt;br /&gt;
Note: Thanks to Stiles to provide some fixes and compatibility changes for jQuery 1.3.x. 
    </description>
</item>
<item>
    <title>jQuery and Google Analytics: Take 2</title>
    <link>http://life.mysiteonline.org/archives/203-jQuery-and-Google-Analytics-Take-2.html</link>

    <description>
        Awhile back I had &lt;a href=&quot;http://life.mysiteonline.org/archives/174-Using-jQuery-and-Google-Analytics-to-track-Outbound-Clicks.html&quot;&gt;reported on my findings&lt;/a&gt; of how to use jQuery to automatically tag links on my site (that link to a site that is not my own) for event tracking with Google Analytics.&lt;br /&gt;
&lt;br /&gt;
Although there are ways to use the pageView method and parse the data within Analytics so that it does not skew your view of overall visits/hits, I simply find it easier to mark these as events since they aren&#039;t actually page views, but events.&lt;br /&gt;
&lt;br /&gt;
Unfortunately, it&#039;s helpful to see which external links are pertinent to people, and which page they&#039;re leaving your site from (and where they&#039;re going), so rather than identifying the event type itself (click), I used that field for a value instead so it could be categorized by any of these things from within Google Analytics.&lt;br /&gt;
&lt;br /&gt;
The problem I was having personally was that the values I was using were not strings (in my own tests at least; the code on the blog should have worked, theoretically). I was using document.location (type: object) and passing it to the trackEvent() method, which checks for value types (and denies incorrect calls). Here is the updated (using the new Async method) code which is tested, and works:&lt;br /&gt;
&lt;br /&gt;
&lt;textarea name=&quot;code&quot; class=&quot;javascript&quot;&gt;  &lt;script type=&quot;text/javascript&quot;&gt;
    var _gaq = _gaq || [];
    _gaq.push([&#039;_setAccount&#039;, &#039;UA-XXXXXX-1&#039;]);
    _gaq.push([&#039;_trackPageview&#039;]); //track this pages view

    (function() {
      var ga = document.createElement(&#039;script&#039;); ga.type = &#039;text/javascript&#039;; ga.async = true;
      ga.src = (&#039;https:&#039; == document.location.protocol ? &#039;https://ssl&#039; : &#039;http://www&#039;) + &#039;.google-analytics.com/ga.js&#039;;
      var s = document.getElementsByTagName(&#039;script&#039;)[0]; s.parentNode.insertBefore(ga, s);
    })();

    //the above code is Google&#039;s default code, below is my addition (using jQuery)
    $(document).ready(function(){
      var domain = document.location.host; //includes port if exists, whereas hostname does not
      var curPage = document.location.href;
      $(&#039;a[href^=&quot;http&quot;]:not([href*=&quot;&#039;+domain+&#039;&quot;])&#039;).each(function(){
        //track the events (string unless noted): 1st = method, 2nd = category, 3rd = action, 4th = label, 5th = (int)value
        //http://code.google.com/apis/analytics/docs/tracking/eventTrackerGuide.html
        $(this).click(function(){
          //track an outbound link-click event
          _gaq.push([&#039;_trackEvent&#039;, &#039;Outbound&#039;, curPage, $(this).attr(&#039;href&#039;)]);
        });
      });
    });
  &lt;/script&gt;&lt;/textarea&gt;&lt;br /&gt;
Remember to change your own account ID in the code above!&lt;br /&gt;
&lt;br /&gt;
There is no need to define your domain&#039;s actual information anywhere unless you want to track both subdomains as well as top-level domains under a single account. For that, take a look at the Google Analytics documentation. I haven&#039;t done this myself so would not be able to suggest a best-method approach for it. This code tracks any HTML-based links (links inserted dynamically with JS will not be tracked, you can do this with $(this).live(&#039;click&#039;, function()...) instead of $(this).click()) that point to anywhere NOT within your domain. If you use a redirect script as part of your domain, (ex: ...tracker.php?go=http://someothersite.com), then this will not track that page click as-is.&lt;br /&gt;
&lt;br /&gt;
This code specifically defines the event as &quot;Outbound&quot;, the category as the currently viewed page&#039;s URL, and the action field as the URL that the user will be taken to. Modify &#039;til your heart&#039;s content. :)&lt;br /&gt;
&lt;br /&gt;
For even more accurate results, see how to delay the loading of the external site so that the tracking code has more time to accomplish its task (race conditions are fun): &lt;a href=&quot;http://www.google.com/support/googleanalytics/bin/answer.py?hl=en&amp;answer=55527&quot;&gt;Google&#039;s Solution&lt;/a&gt; 
    </description>
</item>
<item>
    <title>Copying a jQuery Event from One Element to Another</title>
    <link>http://life.mysiteonline.org/archives/202-Copying-a-jQuery-Event-from-One-Element-to-Another.html</link>

    <description>
        When you&#039;re working with plugins, or trying to be as unobtrusive as possible while doing a bunch of different things to your original markup, sometimes you have the problem of specific elements being triggered by multiple actions.&lt;br /&gt;
&lt;br /&gt;
What happens when one action ends up replacing (visually) or covering up one element with another? Typically it&#039;s not a problem - unless the element that was replaced or covered up had an event attached to it. I had this happen to me recently when one jQuery script (dynamic icon overlay using a span) covered up another script (onclick event for an image to load a modal window for a video player). Uh oh!&lt;br /&gt;
&lt;br /&gt;
I could have ignored the problem and simply duplicated the original images and added the &quot;play&quot; icon directly to the images themselves. However, if I ever should want to change the icon, that would require modifying all of the images again - and I&#039;d need to keep the original images somewhere if that were ever the case. I could have built the overlay in to the original script, but then it&#039;s sort of losing scope on its original focus and intention.&lt;br /&gt;
&lt;br /&gt;
It seemed the best way to combat the problem was to try to get the event(s) (a click event in this case) that was registered on the IMG element, and apply it to the SPAN that was overlayed on top of it.&lt;br /&gt;
&lt;br /&gt;
While searching for answers, I accidentally stumbled across &lt;a href=&quot;http://ejohn.org/apps/workshop/adv-talk/#9&quot;&gt;slides from a talk by John Resig&lt;/a&gt; that contained a bit of jQuery that I had never known about before - but apparently every time I now hear about it, every one raves about it. It&#039;s jQuery&#039;s &lt;a href=&quot;http://api.jquery.com/data/&quot;&gt;$.data()&lt;/a&gt; utility method. Through using this method (and outputting JSON data directly through an alert box using Firefox&#039;s proprietary toSource() function), I was able to ascertain information about the events associated with a specific element.&lt;br /&gt;
&lt;textarea name=&quot;code&quot; class=&quot;html&quot;&gt;&lt;img class=&quot;video&quot; src=&quot;http://media.sspl.org/videos/history/ejones.jpg&quot; width=&quot;100&quot; height=&quot;76&quot; alt=&quot;ejones&quot; /&gt;&lt;/textarea&gt;&lt;br /&gt;
Note: The following alert would only work in Firefox. To alert JSON in all (native JSON unsupported) browsers, you&#039;d want to use &lt;a href=&quot;http://www.json.org/js.html&quot;&gt;Douglas Crockford&#039;s JSON2&lt;/a&gt;. In newer browsers, you should be able to just use the stringify() function (I just chose not to).&lt;br /&gt;
&lt;textarea name=&quot;code&quot; class=&quot;javascript&quot;&gt;alert($(&#039;img.video&#039;).data(&#039;events&#039;).toSource());&lt;/textarea&gt;&lt;br /&gt;
The above JS code acting on the HTML element (in my code, anyway) created the following string:&lt;br /&gt;
&lt;textarea name=&quot;code&quot; class=&quot;plain&quot;&gt;(
	{
		click:[
			{
				handler:(
					function () {alert(&quot;clicked&quot;);}
				),
				data:(void 0),
				namespace:&quot;&quot;,
				type:&quot;click&quot;,
				guid:1
			}
		]
	}
)&lt;/textarea&gt;&lt;br /&gt;
At first I thought I could just copy the data from one element&#039;s data property to another element. Unfortunately that does not work as it doesn&#039;t actually &lt;strong&gt;register&lt;/strong&gt; anything. I asked a question over at StackOverflow, and although the &lt;a href=&quot;http://stackoverflow.com/questions/4168875/how-can-event-handlers-be-dynamically-moved-to-a-different-element-with-jquery&quot;&gt;answers that I got&lt;/a&gt; weren&#039;t exactly what I was looking for, someone had already &lt;a href=&quot;http://plugins.jquery.com/project/copyEvents&quot;&gt;created a jQuery events copy plugin&lt;/a&gt;. I didn&#039;t want to have dependencies on other plugins in my code, so I looked over the plugin&#039;s code to go about my own solution.&lt;br /&gt;
&lt;br /&gt;
Since not all handlers will be using a plugin (and therefore simply contain a function name), very few will have a namespace. I didn&#039;t bother with that in my code (but I may refactor later). Instead, I took the necessary information and simply looped the events registered with the element, and re-binded them using jQuery&#039;s own bind() method.&lt;br /&gt;
&lt;textarea name=&quot;code&quot; class=&quot;javascript&quot;&gt;var events = $(this).data(&#039;events&#039;);
var curElement = $(this);
if(events !== undefined &amp;&amp;amp; events){
	$.each(events, function(eventType, data){
		//var namespace = data[0].namespace;
		var method = data[0].handler;
		var methodData = data[0].data;
		curElement.parent().bind(eventType, methodData, method);
		if(settings.preventDefault){
			curElement.parent().bind(eventType, function(e){ e.preventDefault(); });
		}
	});
}&lt;/textarea&gt;&lt;br /&gt;
Keep in mind that this specific piece of code I was working on created an overlay (an element that surrounded and rested) atop the target element (thus the parent().bind). Your particular uses may vary. The 2nd bind() was also specific to this code&#039;s purpose. Although a SPAN tag was created, if the target element&#039;s parent was not an anchor element, it would create one and wrap itself in that. The only way to prevent the default behavior of an anchor tag was to issue a 2nd bind (I didn&#039;t know how to pass it in to the initial bind call).&lt;br /&gt;
&lt;br /&gt;
Note: jQuery&#039;s &quot;helper&quot; events (ex: mouseenter, mouseleave) duplicate and/or enhance functionality of the mouseover and mouseout behaviors. Because of this, if you use jQuery to create a mouseenter event, internally it binds the element with a mouseover event, and then binds again with its own overriding event (from what I can tell, anyway). Therefore, my code here copies and registers both events (mouseenter and mouseover) and unfortunately will also fire both of them. This code (as-is) works best on native event types.&lt;br /&gt;
&lt;br /&gt;
Unfortunately I was unable to determine how to unregister or remove specific events. After looping I could remove all events from an object, but I couldn&#039;t perceive a way to do it within the loop itself. If you had to target a specific handler in your loops, I don&#039;t know if it would be possible to &lt;em&gt;move&lt;/em&gt; events, but only copy. 
    </description>
</item>
<item>
    <title>Hacked.</title>
    <link>http://life.mysiteonline.org/archives/200-Hacked..html</link>

    <description>
        My blog system has been hacked for the 2nd time now. I&#039;ve begun writing a new system at the root of this domain (no more subdomain), so if your RSS feeds break, I&#039;ve either moved to my new blog, or I&#039;ve upgraded this blog to fix the hack for the interim - until I can get comments working (which will take me to just get Akismet integration as comments are already technically ready).&lt;br /&gt;
&lt;br /&gt;
I&#039;m don&#039;t think the blog system has been secured, so I&#039;d suggest not posting any comments until or unless I update this post mentioning that it is now safe.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Update:&lt;/strong&gt; Despire the german theme&#039;s &quot;Written by&quot; text, this blog&#039;s been reinstalled from scratch with the newest version software, but using the same database. Hopefully nothing&#039;s still infected. This should give me a decent amount of time to properly move the article entries and comments to the new blog system without worrying too much (and figure out a mod_rewrite rule for the SEO redirects). 
    </description>
</item>
<item>
    <title>Finding all application Controllers in CakePHP (v1.3.x)</title>
    <link>http://life.mysiteonline.org/archives/201-Finding-all-application-Controllers-in-CakePHP-v1.3.x.html</link>

    <description>
        At some point in time you may find the need to get a list of all of the controllers within your application. It&#039;s actually quite simple so long as you don&#039;t need controllers from any plugins.&lt;br /&gt;
&lt;textarea name=&quot;code&quot; class=&quot;php&quot;&gt;    function listControllers() {
        $controllers = App::objects(&#039;controller&#039;);
        $controllers = array_diff($controllers, array(&#039;App&#039;, &#039;Pages&#039;));

        pr($controllers);die();
    }&lt;/textarea&gt;&lt;br /&gt;
Place this code in any of your controllers and view it from the web (for instance, from the Users Controller): http://www.example.com/users/listControllers&lt;br /&gt;
&lt;br /&gt;
You&#039;ll see something similar to the following:&lt;br /&gt;
&lt;textarea name=&quot;code&quot; class=&quot;php&quot;&gt;Array
(
    [2] =&gt; Comments
    [3] =&gt; Posts
    [4] =&gt; Tags
    [5] =&gt; Users
)&lt;/textarea&gt;&lt;br /&gt;
The &lt;a href=&quot;http://api.cakephp.org/class/app#method-Appobjects&quot;&gt;App::objects()&lt;/a&gt; method returns an array of objects of the given type, such as: &#039;model&#039;, &#039;controller&#039;, &#039;helper&#039;, or &#039;plugin&#039; - it also accepts other parameters, such as &quot;path&quot; in case you do eventually need to check controllers for your plugins.&lt;br /&gt;
&lt;br /&gt;
The array_diff() is there as a much simpler method to remove the AppController and PagesController from the returned results as they would most likely exist in your application regardless and aren&#039;t normally something you&#039;d need to worry about with ACL as there are other means within Cake to handle access to them. You&#039;ll notice that array_diff doesn&#039;t return an array starting at index of 0 since it removes keys from the original array too. That shouldn&#039;t be a problem, but if it is you can always use a loop instead of array_diff() and just unset or splice the matching values.&lt;br /&gt;
&lt;br /&gt;
I used the CakePHP convenience method of pr() (print_r surrounded by PRE tags), and a die() simply to show the returned results and print them to the screen. You&#039;d probably prefer to double underscore the function name (__listControllers()) to make it a private method to the class (rather than publicly viewable via the web), and change pr() to &lt;strong&gt;return&lt;/strong&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;What&#039;s the purpose of this?&lt;/strong&gt;&lt;br /&gt;
- Maybe you&#039;d want to create a web interface for ACL and need to know which controllers to give/deny access to/from&lt;br /&gt;
- Maybe you want to create a navigation menu based on your controllers&lt;br /&gt;
...maybe you can think of something that I can&#039;t. :)&lt;br /&gt;
&lt;br /&gt;
Alter to your own tastes. This is only a starting point.&lt;br /&gt;
&lt;br /&gt;
Other useful links (check version compatibility in these resources):&lt;br /&gt;
&lt;a href=&quot;http://debuggable.com/posts/quick-dessert-list-all-controllers-of-a-cakephp-application:480f4dd6-adf4-4b18-9fe8-4b99cbdd56cb&quot;&gt;Quick dessert: List all controllers of a CakePHP application&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://bakery.cakephp.org/articles/view/automatically-load-all-controllers-and-actions-into-aco-tables-for-acl-with-a-cakephp-task&quot;&gt;Automatically load all controllers and actions into ACO tables for ACL with a CakePHP Task&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://cakebaker.42dh.com/2006/07/21/how-to-list-all-controllers/&quot;&gt;How to list all controllers&lt;/a&gt; 
    </description>
</item>
<item>
    <title>Installing and Setting up Subversion (SVN) Under Windows XP</title>
    <link>http://life.mysiteonline.org/archives/67-Installing-and-Setting-up-Subversion-SVN-Under-Windows-XP.html</link>

    <description>
        For a long time I&#039;ve wanted to start using Subversion.  I see all the benefits of using such a system, but I haven&#039;t taken the time to learn it.  I&#039;ve installed it (v1.3.2) a long time ago, but I never really did anything with it -- it was simply so I could interact with SmartSVN (a SVN client) to download others&#039; repositories.  I think it&#039;s about time I start using it in a more meaningful way on my own projects.  In order to do this, I thought it would be best to start from scratch (and therefore uninstalled all previous, remotely related software).  (For further learning on SVN, please visit &lt;a href=&quot;http://svnbook.red-bean.com/&quot;&gt;Red-Bean&#039;s SVN Book&lt;/a&gt; online.)&lt;br /&gt;
&lt;br /&gt;
So, it had been so long since I&#039;ve done anything with Subversion, where was I to begin?  I&#039;ve read about all the great and wonderful things SVN can offer, but...how do I get it, how do I install it, and then how can I access it? &lt;br /&gt;&lt;a href=&quot;http://life.mysiteonline.org/archives/67-Installing-and-Setting-up-Subversion-SVN-Under-Windows-XP.html#extended&quot;&gt;Continue reading &quot;Installing and Setting up Subversion (SVN) Under Windows XP&quot;&lt;/a&gt;
    </description>
</item>
<item>
    <title>jQuery: Edit Content Inline on Dynamically Created Elements</title>
    <link>http://life.mysiteonline.org/archives/199-jQuery-Edit-Content-Inline-on-Dynamically-Created-Elements.html</link>

    <description>
        Unless you&#039;ve been living under a rock while learning jQuery, everyone should have learned of the .live() call within the jQuery JavaScript toolkit. If you haven&#039;t, shove that rock aside - the .live() method takes the place of bind() (which is the more powerful, and base method of .click(), .blur(), etc...) for elements that are created dynamically at runtime. If you dynamically create elements after the DOM has loaded, and assume generalized JavaScript functions you&#039;ve written to target these new elements (we&#039;ll presume you&#039;re targeting a &quot;findMe&quot; class) will work. Well it won&#039;t, unless you use .live().&lt;br /&gt;
&lt;br /&gt;
Now that we have that out of the way, another one of jQuery&#039;s really great features that mimics why Wordpress is so great - all of the user contributed plugins, whether they&#039;re efficient or not, the fact that someone else has already created a solution for you, and is willing to share it with you (most likely for free) is awesome. One such type of plugin that I was looking for today, and knew I&#039;d want to eventually use at some point, was an edit-in-place, or inline edit plugin - something that allowed me to edit content from within the DOM, such as in a DIV container (not in a textbox - or at least not initially rendered in one) dynamically.&lt;br /&gt;
&lt;br /&gt;
In my case today, I was experimenting with dynamically creating elements that might need to be edited after being created. My first gut-instinct thought? Yup, you guessed it: .live(). I replaced the call to .bind() in &lt;a href=&quot;http://arashkarimzadeh.com/index.php/jquery/7-editable-jquery-plugin.html&quot;&gt;the plugin&lt;/a&gt;&#039;s source and voilà! Nothing. It didn&#039;t work. The jQuery code in the plugin had been optimized beyond a point where I was comfortable to modify it further and understand what I was doing in order to make it work (which was kind of pathetic, but I digress).&lt;br /&gt;
&lt;br /&gt;
So, how could I solve my little problem?  Quite easily - I wasn&#039;t really thinking.&lt;br /&gt;
&lt;br /&gt;
The call to instantiate an event on targeted objects after the DOM is ready is something like this:&lt;br /&gt;
&lt;textarea name=&quot;code&quot; class=&quot;javascript&quot;&gt;$(&#039;div.editable&#039;).editable();&lt;/textarea&gt;I was scratching my head, trying to figure out if I&#039;d have to uninstantiate all elements and reinstantiate the event bubbling throughout the DOM each time I created a dynamically created element. I was over-thinking it. Instead, all I had to do was create the event on that newly created element on the element&#039;s creation itself. Ooh, hard. I know, I know - I&#039;m brilliant!&lt;br /&gt;
&lt;br /&gt;
jQuery v1.4+ example code:&lt;br /&gt;
&lt;textarea name=&quot;code&quot; class=&quot;javascript&quot;&gt;var pickSummary = $(&#039;&lt;div&gt;&#039;, {&#039;text&#039;: &#039;Hello World!&#039;}).addClass(&#039;editable&#039;).appendTo($(&#039;body&#039;)).editable({type:&#039;textarea&#039;});&lt;/textarea&gt;Easy and simple.&lt;br /&gt;
You can see how to further use and extend Arash Karimzadeh&#039;s jQuery &lt;a href=&quot;http://arashkarimzadeh.com/index.php/jquery/7-editable-jquery-plugin.html&quot;&gt;Editable plugin&lt;/a&gt;, or if you&#039;d prefer a more popular plugin for inline editing with jQuery, there&#039;s also Mika Tuupola&#039;s &lt;a href=&quot;http://www.appelsiini.net/projects/jeditable&quot;&gt;Jeditable&lt;/a&gt; plugin. According to the comments Mika intends to add .live() support soon, but until he does this should work just fine.&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;&lt;strong&gt;&quot;Why did you choose Editable over Jeditable if Jeditable is more popular?&quot;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;
In this specific case I didn&#039;t want to submit anything back to the server on edit, and it seemed like Jeditable was all about saving back to a data store somewhere. Editable just seemed simpler for what I was working on at the moment.&lt;br /&gt;
&lt;br /&gt;
Happy programming! 
    </description>
</item>
<item>
    <title>SWFObject 2.x and Zoomify</title>
    <link>http://life.mysiteonline.org/archives/197-SWFObject-2.x-and-Zoomify.html</link>

    <description>
        &lt;a href=&quot;http://www.zoomify.com/&quot;&gt;Zoomify&lt;/a&gt; is a software company/product that allows for continuous zooming on extremely large image data (JPEG2000) by first separating the original image in to many parts, and then using Flash (and XML) to dynamically piece them together again within a viewer. It works quite well (you can see an example from their website). They have a free &quot;express&quot; version; a version that comes bundled as part of Adobe Photoshop (CS3 or above - File -&gt; Export -&gt; Zoomify); a version that allows you to modify the look and feel of the view with XML (retail product), a version that contains the FLA source code (retail), and their flagship product, the Enterprise version which allows you to house everything necessary for simplistic creation all on the server...including everything all of the other versions offer, as well as more features and the ability to simply upload images directly to the server for parsing.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://code.google.com/p/swfobject/&quot;&gt;SWFObject&lt;/a&gt; is a JavaScript utility used for dynamically (or statically assisted) inserting of Flash media to a web page. If a user does not have Flash (or the correct version), it will automatically prompt them to download and install it. If they do not have JavaScript enabled, whatever content you were originally going to replace with the JavaScript will simply show instead. It also is unobtrusive, is Adobe&#039;s recommended way of embedding Flash to a web page, and has been time-tested to cover many edge-cases of its use.&lt;br /&gt;
&lt;br /&gt;
Zoomify is a great tool to use in places where fine detail is needed to be viewed, but either a slow connection or speedy access is required to the content (plus, who wants to wait over 30 seconds for an image to load?). With working in a library, I&#039;ve found it&#039;s an &lt;strong&gt;excellent&lt;/strong&gt; tool for displaying historic images - such as digital archives. These high resolution images are not really useful in a regular web-centric view, but once you add the ability to zoom in to see detail, such as a person&#039;s face from something which was originally a 1.5&quot;x3&quot; panoramic scene - well, even I was in awe. ...and it&#039;s quick!&lt;br /&gt;
&lt;br /&gt;
The problem with Zoomify is that by default, the free tools (for download from their website, or the one included in Photoshop) export an HTML page with EMBED and OBJECT tags directly in the HTML. If you work for a local/federal government or state owned library in the US, you are legally obliged to follow standards, and the EMBED tag is not an HTML standard and therefore breaks standards compatibility. What to do? Use SWFObject - it dynamically inserts the necessary code to get your browser to render the Flash movie on the page. Unfortunately, there&#039;s little information (if any?) on getting Zoomify to work with SWFObject out there on the web. Before I discovered I had a typo in my code, I emailed Zoomify support to ask about it and they emailed me back with Adobe&#039;s own version of AC_RunActiveContent.js - however &lt;a href=&quot;http://www.adobe.com/devnet/flashplayer/articles/swfobject.html&quot;&gt;Adobe recommends the use of SWFObject&lt;/a&gt; over their own JS implementation. I intend to thank Zoomify for trying, and giving them a link to this article entry. After all, they&#039;re more specialized as Flash developers so I can&#039;t fault them and their product really does seem to be the best (perhaps they accidentally attached the wrong project archive, who knows). &lt;a href=&quot;http://www.seadragon.com/developer/silverlight/&quot;&gt;Microsoft&#039;s Seadragon&lt;/a&gt; claimed to be revolutionary, and I had already been using Zoomify for about a year, and Zoomify felt more responsive and more people use Flash. Oh well, Microsoft. It&#039;s still cool.&lt;br /&gt;
&lt;br /&gt;
Sorry for my rambling, on to some substance.&lt;br /&gt;
&lt;br /&gt;
Zoomify provides the following HTML code by default in the HTML template that it creates for you:&lt;br /&gt;
&lt;textarea name=&quot;code&quot; class=&quot;html&quot;&gt;&lt;OBJECT CLASSID=&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&quot; CODEBASE=&quot;http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0&quot; WIDTH=&quot;400&quot; HEIGHT=&quot;400&quot; ID=&quot;theMovie&quot;&gt;
	&lt;PARAM NAME=&quot;FlashVars&quot; VALUE=&quot;zoomifyImagePath=example_img&amp;zoomifyNavigatorVisible=false&quot;&gt;
	&lt;PARAM NAME=&quot;BGCOLOR&quot; VALUE=&quot;#000000&quot;&gt;
	&lt;PARAM NAME=&quot;MENU&quot; VALUE=&quot;FALSE&quot;&gt;
	&lt;PARAM NAME=&quot;SRC&quot; VALUE=&quot;example_img/zoomifyViewer.swf&quot;&gt;
	&lt;EMBED FlashVars=&quot;zoomifyImagePath=example_img&amp;zoomifyNavigatorVisible=false&quot; SRC=&quot;example_img/zoomifyViewer.swf&quot; BGCOLOR=&quot;#000000&quot; MENU=&quot;false&quot; PLUGINSPAGE=&quot;http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash&quot;  WIDTH=&quot;400&quot; HEIGHT=&quot;400&quot; NAME=&quot;theMovie&quot;&gt;&lt;/EMBED&gt;
&lt;/OBJECT&gt;&lt;/textarea&gt;&lt;br /&gt;
So ignoring all of the classid, codebase, and other junk we don&#039;t completely care about, let&#039;s look at the actual values being passed to the browser through the PARAM tags within the OBJECT tag. These are the values we&#039;ll need to pass to SWFObject.&lt;br /&gt;
&lt;br /&gt;
SWFObject separates its value passing to two variables, &lt;tt&gt;flashvars&lt;/tt&gt; and &lt;tt&gt;params&lt;/tt&gt;. &lt;strong&gt;FlashVars&lt;/strong&gt;, found above, is its own PARAM variable, containing multiple values URL encoded. In this example, we have the variable &lt;tt&gt;zoomifyImagePath&lt;/tt&gt; with a value of &quot;example_img&quot;, and &lt;tt&gt;zoomifyNavigator&lt;/tt&gt; set to false. The navigator is a small box that hovers over your image (full opacity) showing where you&#039;re viewing within the overall aspect of the original image.  That takes care of the &lt;strong&gt;flashvars&lt;/strong&gt; values, not to the &lt;strong&gt;params&lt;/strong&gt; which is everything else. &lt;tt&gt;bgcolor&lt;/tt&gt; is, of course, the background color for the flash stage, which will be covered up by your image data, so you can optionally ignore it if you&#039;d like. &lt;tt&gt;menu&lt;/tt&gt;...to be honest I don&#039;t know what this does, I changed the values and saw no difference and even removed it.  &lt;tt&gt;src&lt;/tt&gt; is the source, or location of the Zoomify viewing flash application that is used to actually view your data. This is a relative path to your viewer file. If you will be using this script in more than a single place on your website, I strongly recommend you only use one viewer and point all of them to that single viewer.  Also notice the &lt;tt&gt;HEIGHT&lt;/tt&gt; and &lt;tt&gt;WIDTH&lt;/tt&gt; attributes to both the EMBED and OBJECT tags here. You can change them if you don&#039;t care about standards support and SWFObject, but they must match.&lt;br /&gt;
&lt;br /&gt;
So how do we set up SWFObject with the knowledge now in our hands?  Well, let&#039;s take a look at a standard (dynamic) SWFObject call.&lt;br /&gt;
&lt;textarea name=&quot;code&quot; class=&quot;html&quot;&gt;&lt;script type=&quot;text/javascript&quot; src=&quot;swfobject.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
//class object -&gt; method call ( &quot;location of SWF&quot;, &quot;the element ID on the page you wish to replace&quot;, &quot;width&quot;, &quot;height&quot;, &quot;Minimum flash version required&quot;, 
//	&quot;path to Flash player installer/detection&quot;, &quot;any flash vars to pass&quot;, &quot;any parameters to pass&quot; );
swfobject.embedSWF(&quot;myContent.swf&quot;, &quot;myContent&quot;, &quot;300&quot;, &quot;120&quot;, &quot;9.0.0&quot;, &quot;expressInstall.swf&quot;, flashvars, params);
&lt;/script&gt;&lt;/textarea&gt;&lt;br /&gt;
So going from the example there, and the data we&#039;ve collected, it seems pretty simple! But wait, what exactly is the &lt;strong&gt;zoomifyImagePath&lt;/strong&gt;? Should that have some sort of file extension? Well, no, and that&#039;s what threw me, honestly (quite silly, really). The Flash file knows to look for the XML file in the folder that you&#039;re telling it to look in, so all you need to do is send the location of the folder (relative URL) and it&#039;ll do the rest. So let&#039;s see what that would look like:&lt;br /&gt;
&lt;textarea name=&quot;code&quot; class=&quot;html&quot;&gt;&lt;script type=&quot;text/javascript&quot; src=&quot;swfobject.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
var flashvars = {
	zoomifyImagePath:&#039;example_img&#039;,
	zoomifyNavigatorVisible:&#039;false&#039;
};
var params = {
	src: &#039;example_img/zoomifyViewer.swf&#039;
};
swfobject.embedSWF(&quot;example_img/zoomifyViewer.swf&quot;, &quot;replaceMe&quot;, &quot;400&quot;, &quot;400&quot;, &quot;9.0.98&quot;, &quot;expressInstall.swf&quot;, flashvars, params);
&lt;/script&gt;
&lt;div&gt;&lt;p id=&quot;replaceMe&quot;&gt;This text should be replaced, if it is not, you have JavaScript disabled.&lt;/p&gt;&lt;/div&gt;&lt;/textarea&gt;&lt;br /&gt;
The &lt;tt&gt;flashvars&lt;/tt&gt; and &lt;tt&gt;params&lt;/tt&gt; variables expected by swfobject.embedSWF are JavaScript objects, not simple variables (or rather, variables with object notation) as the variables themselves hold variables.&lt;br /&gt;
&lt;br /&gt;
That&#039;s it. Keep in mind that the example above didn&#039;t use the &lt;tt&gt;bgcolor&lt;/tt&gt;, or &lt;tt&gt;menu&lt;/tt&gt; values. I also didn&#039;t use the &quot;attributes&quot; variable that can be passed to SWFObject where you can define the id, name, class, and align values. It&#039;s unnecessary for this example so I skipped it, as is showing a callback method (unnecessary that is).&lt;br /&gt;
&lt;br /&gt;
Mix that together with a little modal magic and you have something a little bit nicer, such as what I did in the following page:&lt;br /&gt;
&lt;a href=&quot;http://www.sspl.org/research/local_history/collections/veterans/&quot;&gt;Honoring Saratoga County Veterans&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Enjoy! 
    </description>
</item>
<item>
    <title>U.S. Public Education and Technology</title>
    <link>http://life.mysiteonline.org/archives/195-U.S.-Public-Education-and-Technology.html</link>

    <description>
        &lt;h2&gt;&quot;Are You Smarter Than a Fifth Grader™&quot;?&lt;/h2&gt;&lt;br /&gt;
Although this cliché&#039;d phrase has definitely been overused, the premise of the show of the same name just screams volumes to me. I remember learning all of that information during my education in school. I most definitely don&#039;t remember the vast majority of it today; nor is there much reason for me to have to (save being on that show to win some money). Think to yourself: exactly what percentage of the things we learned are we truly using in our lives today? How much of it did we need to lead a fulfilling life, or to prepare us for our jobs?&lt;br /&gt;
&lt;br /&gt;
It seems that kids are simply assembly line workers from a database repository. Let&#039;s see how much generic information we can fill them up with. Not only that, but we&#039;re telling them what to learn, we&#039;re not suggesting that they learn things that pertain to their own interests, the New York State Regents diploma doesn&#039;t really mesh well with that.&lt;br /&gt;
&lt;br /&gt;
Even with the ideology of pushing as broad of a range of topics on to children so they&#039;ll know (or discover) what interests them, when we do need to know something that we learned in school, how much of that do we typically have to look up again anyway? I am here to say honestly and truthfully - I am NOT smarter than a Fifth grader.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Workforce Intelligence&lt;/h2&gt;&lt;br /&gt;
But how does that work in to technology? I might not be smarter than a fifth grader, but I can find the information much quicker than most fifth graders that I know. Why? I&#039;ve taught myself how to use computers, applications, and how to successfully navigate the internet (and which websites I should try first, second, or third).  I&#039;ll be honest in that I have had official educational &quot;training&quot; in these areas, but 85% of what I know in this field is all self-taught, and that pertained to me pre-workforce as well as what I&#039;m doing currently. However, this is me, not my entire organization.&lt;br /&gt;
&lt;br /&gt;
Many of my coworkers have something called &quot;book smarts&quot;, or &quot;social smarts&quot; (a people person), or they&#039;re able to apply knowledge logically to situations. It&#039;s interesting to watch the different types work to solve similar situations. However, out of each group, many of them are limited in their technical knowledge and experience. They were not exposed to computers in their education, and now that they&#039;re in the workforce (and have been for some time) they&#039;re lacking a serious tool for their livelihood in the workforce itself.&lt;br /&gt;
&lt;br /&gt;
Is education to blame? Continuing education? The speed of technological advances versus &lt;strong&gt;required&lt;/strong&gt; training and funding?  Perhaps it&#039;s change itself which is to blame as some people just are not good at dealing with change.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Generation Gap&lt;/h2&gt;&lt;br /&gt;
Perhaps it&#039;s actually a generation gap.  I often hear that, &quot;Kids grew up with that stuff,&quot; or, &quot;I don&#039;t need it, I can do my job without it.&quot; Although both might be true, (1)you were engrossed in it while things were changing around you, and (2)you can do it better (more efficiently) with it.  Alternatively, I&#039;ve also heard, &quot;Why do I need to know Algebra, I can use a calculator!&quot; from the younger generation. Since I am part of that younger generation, I do agree with it.  &quot;Oh no!&quot;&lt;br /&gt;
&lt;br /&gt;
Think about it: if a company&#039;s computer system goes down entirely, does the business remain open or do they close operations?  Can it be done by hand?  It sure can!  Do most managers want to take the risk of extra possibility for human error to occur? From my experience, not likely. So again I ask, what is the point? In an ever-increasing world of electronic media, answers, and communication, there&#039;s little need for advanced mathematics (algebra was a poor example, I use algebra all the time, but how about Matrices? They were fun as hell to me, like a math-based Sudoku puzzle, but I&#039;ve never used it since).  Obviously if you&#039;re going to be working as a mathematician you&#039;d need to know it, study it, learn and re-learn it, but for the vast majority of us, why are we being force-fed this extensive knowledge when we could simply look it up on-demand after getting the simpler introductions to it instead?&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Technology in the Classrooms&lt;/h2&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;No cellphones&lt;/li&gt;
&lt;li&gt;No computers&lt;/li&gt;
&lt;li&gt;No group work&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
So how exactly does this mimic preparation for the workforce?&lt;br /&gt;
Do I use my cellphone at/for work? Yes.&lt;br /&gt;
Do I use a computer at work? (lol) Yes. Only two departments don&#039;t use a computer, although every staff member has an account to access our system.&lt;br /&gt;
&lt;br /&gt;
So again, I ask, why are we removing technology in the classrooms when we should be encouraging it? Even on tests, if we are in &quot;crunchtime&quot; on the job and need to be more efficient, we may use our computers; yet children aren&#039;t allowed? Sometimes proving that you can solve the answer in more important than how you solved the answer (keeping in mind copyrights).&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;College Capstone Courses versus Apprenticeship&lt;/h2&gt;&lt;br /&gt;
Perhaps my colleges weren&#039;t as beneficial in this regard as other colleges, but the capstone courses were made to theoretically mimic a real-life situation in business. Rarely did it seem like a business. We had other &quot;departments&quot; (courses) we were working for at any given time, we only went to work 2 or 3 days out of the week, and the &quot;boss&quot; wasn&#039;t ever worried about a deadline or economic downturn. How much experience did this really give me? Well, it actually did give a lot of experience as the courses were made to mix topics learned throughout our years there in to a single unified curriculum for the semester...however, it is no where near the amount of experience that could have been gained had we had an apprenticeship instead. Being able to work under someone in the exact same field that you aspire to be a part of, see the actual causes and effects from things done (or not done), feel real pressures, and take home true lessons that couldn&#039;t be learned in a classroom. (This is all assuming the apprenticeship itself wasn&#039;t run by someone working out of their garage.)&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Final Thoughts&lt;/h2&gt;&lt;br /&gt;
I have to at least quickly mention &quot;No Child Left Behind&quot;. I think the ideals behind it were magnificent. I think the actual implementation of it is the most dreadful thing I&#039;ve ever witnessed happen to the public educational institution in a long time. Some people just will be held back. For instance: I am terrible at remembering Computer Networking topics. It was the hardest course I&#039;ve ever taken. I managed to get a B-, and I was proud of that B-. Alternatively, I can sleep through other classes and get better than a B-. Some people are just better at certain things than others. &lt;strong&gt;If you force everyone to an equal footing, you&#039;ve already failed your students.&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Personally, I favor specialized career training such as what areas in Europe are doing. If we know we are bored out of our skull over History and we just want to work on cars to be an automotive technician, LET US. We&#039;ll be better at it, and you&#039;ll be better for it!  However, we need specialized training for everyone. If only a small portion of the student body is given this opportunity, that minority will be ridiculed for being &quot;different&quot; by their peers. Yes, it&#039;s important.&lt;br /&gt;
&lt;br /&gt;
Anyhow, getting back the main point: Specialized training in schools would go a long way to realizing a better system. We should be embracing technology and the changes that come with it, not sticking to old arbitrary thoughts of, &quot;Well if I did it, you should too&quot;. I learned how to type at 120wpm by the time I was 16; you&#039;re 46, I think you should too. ...does that sound reasonable to you? No?&lt;br /&gt;
&lt;br /&gt;
Whatever the case may be, our system needs a drastic look at how it&#039;s currently being implemented, and compared closely to successful systems overseas. I support teachers and the education system itself; but it also needs an overhaul. Example: Horrible tenured teachers should not be locked in to their jobs; they should be held accountable just like anyone else. I hope some day some more fruitful changes come around from great ideas through our politicians. 
    </description>
</item>
<item>
    <title>20Couch - A new web-based Twitter Client</title>
    <link>http://life.mysiteonline.org/archives/196-20Couch-A-new-web-based-Twitter-Client.html</link>

    <description>
        Note: My review is of version 1.02, and the current version is already at either 1.06 or 1.07, fixing a few of the issues I had described in my discussion.&lt;br /&gt;
&lt;br /&gt;
I&#039;ve had the luxury recently to test out an application recently built to make it easier to follow along with our Twitter conversations.  It&#039;s taken me about 4 weeks to finally get my review up on the web. Why? Because video/screen capture recording programs suck, that&#039;s why. After trying 3 different applications and trying to fix the video from one of them after-the-fact (which I took 2 days alone trying to fix it), I gave up and downloaded the trial of Camtasia Studio.  Ironically, Camtasia crashed on me during post-processing. Thankfully I saved the project moments before.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Anyway...&lt;/strong&gt; I did a video review so that I could talk freely for as long as I wanted without posting 20 odd pictures and causing huge scrolling. Unfortunately because the video was 20 minutes long, I couldn&#039;t upload it to Youtube (I couldn&#039;t get Camtasia to recognize my Youtube account information to upload it for me anyway), so it&#039;s currently an external link hosted on my own website.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://mysiteonline.org/videos/20couch/20couch.html&quot;&gt;Check it out here!&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Update:&lt;/strong&gt; I&#039;m happy to announce that since I&#039;ve skipped 5 minor versions (1.02 -&gt; 1.07), 20Couch now has the ability to mark posts as read by a set timeframe:&lt;br /&gt;
- all&lt;br /&gt;
- older than 6 hours&lt;br /&gt;
- older than a day&lt;br /&gt;
- older than 2 days&lt;br /&gt;
- older than a week&lt;br /&gt;
&lt;br /&gt;
Still no individual markings, but this is loads better. Also, this week was a code-storm week for Matt, developing one minor release each day of the week. Thanks for all of the hard work, Matt. Might I suggest some documentation on plugin and skin support?  :) 
    </description>
</item>
<item>
    <title>Style Switcher with jQuery</title>
    <link>http://life.mysiteonline.org/archives/194-Style-Switcher-with-jQuery.html</link>

    <description>
        While developing an Adobe AIR application using CSS/HTML/JS, I decided I wanted to allow for templating of the application. The default template has the ability to switch view states (horizontal, or vertical). Since I&#039;m building the application with CSS, HTML and JavaScript (with jQuery), I thought that in order to create this effect, I&#039;d use a style switcher.&lt;br /&gt;
&lt;br /&gt;
I then thought...hey, I wonder if this would work in browsers other than the WebKit version I&#039;ve been testing under?!&lt;br /&gt;
&lt;br /&gt;
It worked in Firefox 3.6.3, Opera 10.51, Chrome 5.0.342.8 beta, and Internet Explorer 6 (although my test CSS was broken in IE6). Opera 10.50 (tested first) had an issue with loading the secondary CSS on first attempt, but had it cached after that. 10.51 loaded everything just fine, but I can&#039;t be sure if it was still cached from the attempt with 10.50, or if 10.51 fixed an unknown issue to help fix it.&lt;br /&gt;
&lt;br /&gt;
So, how did I do it?&lt;br /&gt;
&lt;br /&gt;
Back in the day, Firefox had a little-known and not-often-used feature that allowed web-designers to incorporate multiple CSS layouts/designs right in the site, and the users could choose on-the-fly which UI they&#039;d like to use (on each session) by going to &lt;u&gt;V&lt;/u&gt;iew, Page St&lt;u&gt;y&lt;/u&gt;le, and then choose the style you wanted - if more than a single style was available from within the code. To give users this option, you include secondary stylesheets after the first, but in the link element, you specify that it&#039;s an &lt;strong&gt;alternative&lt;/strong&gt; stylesheet, as so:&lt;br /&gt;
&lt;textarea name=&quot;code&quot; class=&quot;html&quot;&gt;&lt;link media=&quot;screen&quot; title=&quot;horizontal&quot; href=&quot;http://life.mysiteonline.org/css/horiz-style.css&quot; type=&quot;text/css&quot; rel=&quot;stylesheet&quot; /&gt;
&lt;link media=&quot;screen&quot; title=&quot;horizontal&quot; href=&quot;http://life.mysiteonline.org/css/vert-style.css&quot; type=&quot;text/css&quot; rel=&quot;alternative stylesheet&quot; /&gt;&lt;/textarea&gt;&lt;br /&gt;
&lt;br /&gt;
I originally started with this concept and tried swapping out the primary for the secondary and vice versa.  Unfortunately this had some issues during development that may have been related to some other problems, but I dropped this attempt (but if Opera has a problem with caching, this route would solve that).  Instead, I simply changed the &lt;strong&gt;href&lt;/strong&gt; property of the link element. It was easier to target with jQuery without using URL matching/REGEX, or arbitrary naming of the &lt;strong&gt;rel&lt;/strong&gt; property.&lt;br /&gt;
&lt;br /&gt;
Anyhow, here&#039;s the code that I used (in this example, I am clicking on a button with ID of &quot;switch&quot;):&lt;br /&gt;
&lt;textarea name=&quot;code&quot; class=&quot;javascript&quot;&gt;//do the CSS style toggle change
$(&#039;#switch&#039;).bind(&#039;click&#039;, function(e){
	$(&#039;#application&#039;).fadeOut(200,function(){
		var cssStyle = $(&quot;link[media=&#039;screen&#039;][href]&quot;).attr(&#039;href&#039;);
		if(cssStyle == &#039;/css/vert-style.css&#039;){
			$(&quot;link[media=&#039;screen&#039;]&quot;).attr(&#039;href&#039;, &#039;/css/horiz-style.css&#039;);
		}else{
			$(&quot;link[media=&#039;screen&#039;]&quot;).attr(&#039;href&#039;, &#039;/css/vert-style.css&#039;);
		}
		$(&#039;#application&#039;).fadeIn(200);
	});
});&lt;/textarea&gt;&lt;br /&gt;
&lt;br /&gt;
What this is doing:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Bind an onClick event to the element with an id of &quot;switch&quot;&lt;/li&gt;
&lt;li&gt;find the LINK element of a media type of screen that contains an href property and assign it to the variable &quot;cssStyle&quot;&lt;/li&gt;
&lt;li&gt;fade out the application (or a website wrapper?)&lt;/li&gt;
&lt;li&gt;swap the CSS style for another (inline), depending on what&#039;s currently loaded&lt;/li&gt;
&lt;li&gt;fade the application (or website wrapper) back in with new style&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
...and we now have our style swapped out (quickly and easily) for an entirely new style. 
    </description>
</item>

</channel>
</rss>

