<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>One man's voice</title>
	
	<link>http://www.robert-gonzalez.com</link>
	<description>Thoughts, rants and commentary of a simple man</description>
	<lastBuildDate>Thu, 15 Mar 2012 17:59:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/robert-gonzalez" /><feedburner:info uri="robert-gonzalez" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>robert-gonzalez</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><feedburner:feedFlare href="http://add.my.yahoo.com/rss?url=http%3A%2F%2Ffeeds.feedburner.com%2Frobert-gonzalez" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif">Subscribe with My Yahoo!</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2Frobert-gonzalez" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare href="http://feeds.my.aol.com/add.jsp?url=http%3A%2F%2Ffeeds.feedburner.com%2Frobert-gonzalez" src="http://o.aolcdn.com/favorites.my.aol.com/webmaster/ffclient/webroot/locale/en-US/images/myAOLButtonSmall.gif">Subscribe with My AOL</feedburner:feedFlare><feedburner:feedFlare href="http://www.bloglines.com/sub/http://feeds.feedburner.com/robert-gonzalez" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffeeds.feedburner.com%2Frobert-gonzalez" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2Frobert-gonzalez" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2Frobert-gonzalez" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><feedburner:feedFlare href="http://www.plusmo.com/add?url=http%3A%2F%2Ffeeds.feedburner.com%2Frobert-gonzalez" src="http://plusmo.com/res/graphics/fbplusmo.gif">Subscribe with Plusmo</feedburner:feedFlare><feedburner:feedFlare href="http://www.thefreedictionary.com/_/hp/AddRSS.aspx?http%3A%2F%2Ffeeds.feedburner.com%2Frobert-gonzalez" src="http://img.tfd.com/hp/addToTheFreeDictionary.gif">Subscribe with The Free Dictionary</feedburner:feedFlare><feedburner:feedFlare href="http://www.bitty.com/manual/?contenttype=rssfeed&amp;contentvalue=http%3A%2F%2Ffeeds.feedburner.com%2Frobert-gonzalez" src="http://www.bitty.com/img/bittychicklet_91x17.gif">Subscribe with Bitty Browser</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsalloy.com/?rss=http%3A%2F%2Ffeeds.feedburner.com%2Frobert-gonzalez" src="http://www.newsalloy.com/subrss3.gif">Subscribe with NewsAlloy</feedburner:feedFlare><feedburner:feedFlare href="http://www.live.com/?add=http%3A%2F%2Ffeeds.feedburner.com%2Frobert-gonzalez" src="http://tkfiles.storage.msn.com/x1piYkpqHC_35nIp1gLE68-wvzLZO8iXl_JMledmJQXP-XTBOLfmQv4zhj4MhcWEJh_GtoBIiAl1Mjh-ndp9k47If7hTaFno0mxW9_i3p_5qQw">Subscribe with Live.com</feedburner:feedFlare><feedburner:feedFlare href="http://mix.excite.eu/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2Frobert-gonzalez" src="http://image.excite.co.uk/mix/addtomix.gif">Subscribe with Excite MIX</feedburner:feedFlare><feedburner:feedFlare href="http://download.attensa.com/app/get_attensa.html?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2Frobert-gonzalez" src="http://www.attensa.com/blogs/attensa/WindowsLiveWriter/BadgeredintoBadges_10C02/attensa_feed_button5.gif">Subscribe with Attensa for Outlook</feedburner:feedFlare><feedburner:feedFlare href="http://www.webwag.com/wwgthis.php?url=http%3A%2F%2Ffeeds.feedburner.com%2Frobert-gonzalez" src="http://www.webwag.com/images/wwgthis.gif">Subscribe with Webwag</feedburner:feedFlare><feedburner:feedFlare href="http://www.podcastready.com/oneclick_bookmark.php?url=http%3A%2F%2Ffeeds.feedburner.com%2Frobert-gonzalez" src="http://www.podcastready.com/images/podcastready_button.gif">Subscribe with Podcast Ready</feedburner:feedFlare><feedburner:feedFlare href="http://www.flurry.com/pushRssFeed.do?r=fb&amp;url=http%3A%2F%2Ffeeds.feedburner.com%2Frobert-gonzalez" src="http://www.flurry.com/images/flurry_rss_logo2.gif">Subscribe with Flurry</feedburner:feedFlare><feedburner:feedFlare href="http://www.wikio.com/subscribe?url=http%3A%2F%2Ffeeds.feedburner.com%2Frobert-gonzalez" src="http://www.wikio.com/shared/img/add2wikio.gif">Subscribe with Wikio</feedburner:feedFlare><feedburner:feedFlare href="http://www.dailyrotation.com/index.php?feed=http%3A%2F%2Ffeeds.feedburner.com%2Frobert-gonzalez" src="http://www.dailyrotation.com/rss-dr2.gif">Subscribe with Daily Rotation</feedburner:feedFlare><feedburner:browserFriendly>Thank you for taking the time to sift through my thoughts, rants and commentary.</feedburner:browserFriendly><item>
		<title>Storing singleton objects in PHP sessions</title>
		<link>http://www.robert-gonzalez.com/2012/03/14/storing-singleton-objects-in-php-sessions/</link>
		<comments>http://www.robert-gonzalez.com/2012/03/14/storing-singleton-objects-in-php-sessions/#comments</comments>
		<pubDate>Thu, 15 Mar 2012 06:49:51 +0000</pubDate>
		<dc:creator>Robert Gonzalez</dc:creator>
				<category><![CDATA[Geek Stuff]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.robert-gonzalez.com/?p=3138</guid>
		<description><![CDATA[A friend of mine, who is working on a sick little diet and exercise tracking application, asked me today if PHP allowed singleton objects to be stored in a session. My first reaction was absolutely they can be so long as you follow the normal rules of unserializing objects in PHP... namely, making sure the [...]]]></description>
			<content:encoded><![CDATA[<p>A friend of mine, who is working on a sick little diet and exercise tracking application, asked me today if PHP allowed singleton objects to be stored in a session. My first reaction was absolutely they can be so long as you follow the normal rules of unserializing objects in PHP... namely, making sure the class is in scope before attempting to create an object from it OR having an autoloader that does that for you. But as I thought about it more I began to think that maybe this might not work as expected since singletons generally have no public access to their constructors. However, when an object is unserialized, it is instantiated, for lack of a better term, and populated with the data that was exposed from the serialization process.</p>
<p><strong>Note</strong>: for those of you that are unfamiliar with the way PHP handles session data or are just wondering why I am using serialization so much in my examples, the basics are you start a session and PHP assigns a random MD5 hash to it as an id. You write data to the session via the $_SESSION superglobal array and when the script terminates or you call <a href="http://us.php.net/session_write_close" title="Sorry, we're closed. Come back tomorrow.">session_write_close()</a>, PHP serializes the $_SESSION array and writes that serialized string to the file system for retrieval on subsequent requests so long as the session time limit has not expired. I really did not want to run this entire session process and inspect what was being written to my file system so I decided to mock that interaction myself by creating an arbitrary array, serializing it, grabbing the serialized string and unserializing it. </p>
<p>As I began to dig into this I started playing with PHP's magic <a href="http://us2.php.net/manual/en/language.oop5.magic.php#object.sleep" title="Go the eff to sleep">__sleep()</a> and<a href="http://us2.php.net/manual/en/language.oop5.magic.php#object.wakeup" title="Wakie wakie eggs and bakey"> __wakeup()</a> methods. Those seemed to do what I wanted them to do except in the case of protected and private properties of my class. As soon as I added those in my serialization took a crap all over itself, even when I cloned the singleton object and got the public properties exposed through <a href="http://us3.php.net/manual/en/function.get-object-vars.php" title="I object your honor">get_object_vars()</a>. So, thanks to the PHP manual - the most awesome tool in any PHP developer's arsenal - I discovered <a href="http://us2.php.net/manual/en/class.serializable.php" title="Can I have serial for breakfast?">the PHP Serializable interface</a>.</p>
<p>This interface defines two methods: <a href="http://us2.php.net/manual/en/serializable.serialize.php" title="Why so serial?">serialize()</a> and <a href="http://us2.php.net/manual/en/serializable.unserialize.php" title="Unserialize this">unserialize()</a>. These methods override the default behavior of __destruct() and __construct() so if you are using these you should keep that in mind and either put your __destruct() and __construct() code into these methods or allow for calls to __destruct() and __construct() from within these methods. Your homework is to decide which is the better implementation. <img src='http://www.robert-gonzalez.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Now, back to the lesson at hand... the following object - let's say it is saved to a file named dummy.php - is a super simple implementation of a basic singleton pattern. It includes both a serialize() and unserialize() method to allow it to be serialized for storage.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000000; font-weight: bold;">class</span> DummySingleton implements Serializable <span style="color: #009900;">&#123;</span>
    <span style="color: #009933; font-style: italic;">/**
     * Test properties of various visibility
     * @var string
     */</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000088;">$dProp</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000088;">$dPropX</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Nothing to see here folks'</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000088;">$_prop</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'y u try see dis?'</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #009933; font-style: italic;">/**
     * Instance holder for this singleton
     * 
     * @var DummySingleton
     */</span>
    <span style="color: #000000; font-weight: bold;">private</span> static <span style="color: #000088;">$_instance</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #009933; font-style: italic;">/**
     * Private singleton constructor, simply sets a property
     */</span>
    final <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">dProp</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'I was finally built'</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #009933; font-style: italic;">/**
     * Singleton instance getter
     * 
     * @return DummySingleton
     */</span>
    <span style="color: #000000; font-weight: bold;">public</span> static <span style="color: #000000; font-weight: bold;">function</span> getInstance<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">self</span><span style="color: #339933;">::</span><span style="color: #000088;">$_instance</span> <span style="color: #339933;">===</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">self</span><span style="color: #339933;">::</span><span style="color: #000088;">$_instance</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> DummySingleton<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">self</span><span style="color: #339933;">::</span><span style="color: #000088;">$_instance</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #009933; font-style: italic;">/**
     * Implementation of the Serializable interface, called automatically just 
     * before this object is serialized. This will override any calls to a
     * __destruct method, so if you have a destructor you should call it from
     * here.
     * 
     * @return string
     */</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #990000;">serialize</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #990000;">serialize</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">get_object_vars</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #009933; font-style: italic;">/**
     * When this object is created from an unserialization this method is called. 
     * It implements the Serializable interface and uses the data from the 
     * serialize() method herein. Since this method overrides the __construct
     * method you should make any accomodations for constructing your object
     * in this method.
     */</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #990000;">unserialize</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$data</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;">// &quot;Instantiate&quot; our singleton</span>
        <span style="color: #000000; font-weight: bold;">self</span><span style="color: #339933;">::</span><span style="color: #004000;">getInstance</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #666666; font-style: italic;">// Set our values</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">is_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$data</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$data</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$k</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$v</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #000088;">$k</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$v</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>If you build up this object then serialize it, then rebuild it from the serialization, you can see that it remains in tact. Let's test this by simulating the session array, first creating an array then adding the DummySingleton object to that array, then serializing it:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">// Grab the class</span>
<span style="color: #b1b100;">include</span> <span style="color: #0000ff;">'dummy.php'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Get our instance</span>
<span style="color: #000088;">$o</span> <span style="color: #339933;">=</span> DummySingleton<span style="color: #339933;">::</span><span style="color: #004000;">getInstance</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Set something into it for testing</span>
<span style="color: #000088;">$o</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setFromOutside</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'What the hell is this madness?'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Make an array of stuff</span>
<span style="color: #000088;">$a</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$a</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Robert'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$a</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">23</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Add the singleton</span>
<span style="color: #000088;">$a</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'dummy'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$o</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Serialize it</span>
<span style="color: #000088;">$s</span> <span style="color: #339933;">=</span> <span style="color: #990000;">serialize</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$a</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>The serialized output from this yields:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">a:3:{s:4:&quot;name&quot;;s:6:&quot;Robert&quot;;s:2:&quot;id&quot;;i:23;s:5:&quot;dummy&quot;;C:14:&quot;DummySingleton&quot;:187:{a:4:{s:5:&quot;dProp&quot;;s:19:&quot;I was finally built&quot;;s:6:&quot;dPropX&quot;;s:25:&quot;Nothing to see here folks&quot;;s:5:&quot;_prop&quot;;s:16:&quot;y u try see dis?&quot;;s:14:&quot;setFromOutside&quot;;s:30:&quot;What the hell is this madness?&quot;;}}}</pre></div></div>

<p>If you take that string and subsequently load it and unserialize it then inspect it, you'll see that the singleton object has been restored along with all private properties of it:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">// $s is our serialized string from above</span>
<span style="color: #000088;">$o</span> <span style="color: #339933;">=</span> <span style="color: #990000;">unserialize</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$s</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">var_dump</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$o</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Output:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">array(3) {
  [&quot;name&quot;]=&gt;
  string(6) &quot;Robert&quot;
  [&quot;id&quot;]=&gt;
  int(23)
  [&quot;dummy&quot;]=&gt;
  object(DummySingleton)#1 (3) {
    [&quot;dProp&quot;]=&gt;
    NULL
    [&quot;dPropX&quot;]=&gt;
    string(25) &quot;Nothing to see here folks&quot;
    [&quot;_prop&quot;:&quot;DummySingleton&quot;:private]=&gt;
    string(16) &quot;y u try see dis?&quot;
  }
}</pre></div></div>

<p>Since this is, in essence, the process that PHP follows for its default session management it's safe to say that you can, indeed, store singleton objects in a PHP session. Now onto to bigger and better questions, like...</p>
<p>Why would you ever want to store a singleton object instance in a PHP session?</p>
<img src="http://feeds.feedburner.com/~r/robert-gonzalez/~4/rLwzcGRu9cQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.robert-gonzalez.com/2012/03/14/storing-singleton-objects-in-php-sessions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript, WebKit and ‘closed’</title>
		<link>http://www.robert-gonzalez.com/2012/02/26/javascript-webkit-and-closed/</link>
		<comments>http://www.robert-gonzalez.com/2012/02/26/javascript-webkit-and-closed/#comments</comments>
		<pubDate>Sun, 26 Feb 2012 23:32:55 +0000</pubDate>
		<dc:creator>Robert Gonzalez</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.robert-gonzalez.com/?p=3130</guid>
		<description><![CDATA[The other day I was playing around with a simple letter scrambler script that I had written to assist my daughter with a birthday party game. The concept is simple enough... enter a phrase, hit a button and the phrase gets "cryptoquoted", a process where each letter in the phrase is substituted with another letter. [...]]]></description>
			<content:encoded><![CDATA[<p>The other day I was playing around with <a href="http://robert-gonzalez.com/personal/code/tools/crypto.php">a simple letter scrambler script that I had written to assist my daughter with a birthday party game</a>. The concept is simple enough... enter a phrase, hit a button and the phrase gets "cryptoquoted", a process where each letter in the phrase is substituted with another letter. One of the things I designed this program to do was hide the input box so that, if you were viewing it on the web, the solution would not be visible to anyone looking at the puzzle. But I also programmed it so that if you click a link, the input box would be revealed. This toggling of the visibility of the input box is simple enough to do. Just add a little jQuery and BAM!, you have a simple revealer.</p>
<p>And this is exactly how this performed until the last time I tried it a couple of days ago. My toggler suddenly stopped working right, but only in Chrome and Safari. All of the javascript was firing in the proper order, and the function I had written was being called but my slider was not sliding. After digging into this a little bit, and doing a bit of debugging, I found out that a variable name I was using the monitor the state of the visibility of the input box was being clobbered in Chrome and Safari. Firefox worked just fine as it always has. The variable name I was using was <code>closed</code>.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// Set the closed flag</span>
<span style="color: #003366; font-weight: bold;">var</span> closed <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">/**
 * Toggles visibility of the input box
 */</span>
<span style="color: #003366; font-weight: bold;">function</span> toggleSolution<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>closed<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		closed <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#puzzle-key'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">slideDown</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Hide solution'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
		closed <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#puzzle-key'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">slideUp</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Show solution'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>When inspecting this code in Chrome Developer Tools, regardless of any actions, events or any other browser interaction, the <code>closed</code> variable always was valued as <code>false</code>. I still don't know why this is happening, but I do know this is a WebKit issue. And I also know that changing the variable name from <code>closed</code> to <code>_closed</code> solved the issue I was having. Also, as a simple test, without declaring the variable anywhere in my code, I opened up the console on a page without any javascipt at all and, sure enough, the variable was set to the value false. </p>
<p>So if you writing javascript and run across an issue where you are using a variable named <code>closed</code> in your code that always seems to be valued at <code>false</code>, be aware this might be an issue with your browser and simply changing the name of your variable in your code might make things all better for you.</p>
<img src="http://feeds.feedburner.com/~r/robert-gonzalez/~4/42pwTB5mES0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.robert-gonzalez.com/2012/02/26/javascript-webkit-and-closed/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>A simple PHP regular expression tester</title>
		<link>http://www.robert-gonzalez.com/2012/02/22/a-simple-php-regular-expression-tester/</link>
		<comments>http://www.robert-gonzalez.com/2012/02/22/a-simple-php-regular-expression-tester/#comments</comments>
		<pubDate>Wed, 22 Feb 2012 18:27:41 +0000</pubDate>
		<dc:creator>Robert Gonzalez</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Regular Expressions]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.robert-gonzalez.com/?p=3126</guid>
		<description><![CDATA[I love making my own tools for the simple and mundane tasks I face during the day. One of those tasks is the repeated need for testing regular expressions that I am faced with when programming. Yes, there are a multitude of regular expression testers on the web today, and all of them have a [...]]]></description>
			<content:encoded><![CDATA[<p>I love making my own tools for the simple and mundane tasks I face during the day. One of those tasks is the repeated need for testing regular expressions that I am faced with when programming. Yes, there are a multitude of regular expression testers on the web today, and all of them have a laundry list of cool things they do. But none of them are mine, and none of them are necessarily simple. And few of them let you see how they work. So with that, I decided to take one of the many tools I've built for myself and offer it here for you.</p>
<p><a href="http://robert-gonzalez.com/personal/code/tools/regextester.php">My (very) simple regular expression</a> is just that... a simple tester that takes a regular expression and a subject string and gives you back your matches as PHP would see them in your application. There is one small bit of robustness (I had to use robustness... the word is just so cool) added to this tester that will allow you to group your matches together (<code>PREG_SET_ORDER</code>) and allow you to include the string position of the match in the subject (<code>PREG_OFFSET_CAPTURE</code>). But that is where the robustness ends the simple kicks in again.</p>
<p>So if you want <a href="http://robert-gonzalez.com/personal/code/tools/regextester.php">a simple little regular expression tester</a>, or just want to see how I've coded mine, feel free to use my tester for your own needs. Have fun, stay curious and GO BIG.</p>
<img src="http://feeds.feedburner.com/~r/robert-gonzalez/~4/BDjB1yFqdgg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.robert-gonzalez.com/2012/02/22/a-simple-php-regular-expression-tester/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Preparing my 2012</title>
		<link>http://www.robert-gonzalez.com/2011/12/31/preparing-my-2012/</link>
		<comments>http://www.robert-gonzalez.com/2011/12/31/preparing-my-2012/#comments</comments>
		<pubDate>Sat, 31 Dec 2011 17:54:37 +0000</pubDate>
		<dc:creator>Robert Gonzalez</dc:creator>
				<category><![CDATA[Personal Messages]]></category>
		<category><![CDATA[Exercise]]></category>
		<category><![CDATA[Family]]></category>
		<category><![CDATA[Health]]></category>

		<guid isPermaLink="false">http://www.robert-gonzalez.com/?p=3108</guid>
		<description><![CDATA[As 2011 comes to a close I've been looking back on it and trying to find those memorable moments that stand out to me the most. There have been a few moments, some good and some bad, that I can immediately associate with the term '2011', and while I could easily get into all of [...]]]></description>
			<content:encoded><![CDATA[<p>As 2011 comes to a close I've been looking back on it and trying to find those memorable moments that stand out to me the most. There have been a few moments, some good and some bad, that I can immediately associate with the term '2011', and while I could easily get into all of that mess, my preference is to not look back and instead focus on what lies ahead of me. With that, I figured that to bring some reality and tangibility to my goals for 2012, I would write them down, make them public and leave them here for me to come back to when I am feeling like I need a refresher.</p>
<p>I've been thinking for a few months now about what I want my 2012 to be like. In past years I would think in terms of what I <em>don't</em> want, but something I've learned in 2011 is to look at what I <em>do</em> want and pursue that rather than attempt to evade what I don't want. My thought is, if I know clearly what I am pursuing I will have something clear to aim for as opposed to just trying to outrun what I don't want to be a part of. That began to make a lot of sense to me in the last half of 2011 and it is something I plan to continue in 2012.</p>
<p>In keeping with that principle, I am also of the mind that if I speak something enough I have to power to see it come to fruition. As I put my thoughts to work and turn them into words I have a chance to put my words to work and turn them into actions. And, the more action I take, the better the chances of my original thoughts becoming reality. So with that in mind, here are some of the things I will do, achieve, accomplish or complete in 2012 and, where feasible, when.</p>
<ul>
<li><strong>January</strong>
<ul>
<li>Drink no alcohol</li>
<li>Eat no refined sugars</li>
<li>Exercise six days a week</li>
<li>Don't eat what I can't accurately measure the nutrition on</li>
<li>Sign up for Krav Maga with my daughter Rebekah</li>
<li>Get started with CrossFit</li>
<li>Lose 10 pounds</li>
</ul>
</li>
<li><strong>February</strong>
<ul>
<li>Drink no alcohol</li>
<li>Exercise six days a week</li>
<li>Don't eat what I can't accurately measure the nutrition on</li>
<li>Lose 10 pounds</li>
<li>Finish Chalene Johnson's book PUSH</li>
</ul>
</li>
<li><strong>March</strong>
<ul>
<li>Start P90X2</li>
<li>Start distance running</li>
<li>Exercise six days a week</li>
<li>Don't eat what I can't accurately measure the nutrition on</li>
<li>Lose 10 pounds</li>
</ul>
</li>
<li><strong>April</strong>
<ul>
<li>Hike Mission Peak at least once</li>
<li>Throw Sarah an awesome 16th birthday party</li>
<li>Exercise six days a week</li>
<li>Don't eat what I can't accurately measure the nutrition on</li>
<li>Lose 10 pounds</li>
</ul>
</li>
<li><strong>May</strong>
<ul>
<li>Help the kids give their mom a memorable Mother's Day</li>
<li>Hike Mount Diablo at least once</li>
<li>Complete P90X2</li>
<li>Start Insanity Asylum</li>
<li>Exercise six days a week</li>
<li>Don't eat what I can't accurately measure the nutrition on</li>
<li>Lose 10 pounds</li>
</ul>
</li>
<li><strong>June</strong>
<ul>
<li>Enjoy a family filled Father's Day</li>
<li>Complete Insanity Asylum</li>
<li>Exercise six days a week</li>
<li>Don't eat what I can't accurately measure the nutrition on</li>
<li>Get under 200 pounds for the first time since high school</li>
</ul>
</li>
<li><strong>July</strong>
<ul>
<li>Earn my 32" waist</li>
<li>Give Alaynah her own birthday party</li>
<li>Give Rebekah her own awesome birthday party</li>
</ul>
</li>
<li><strong>August</strong>
<ul>
<li>Take the family to Yosemite</li>
<li>Run a Yosemite trail</li>
<li>Have all school shopping done</li>
</ul>
</li>
<li><strong>September</strong>
<ul>
<li>Give Adriannah a great birthday party</li>
<li>Run Tough Mudder NorCal</li>
</ul>
</li>
<li><strong>October</strong>
<ul>
<li>Run Warrior Dash NorCal</li>
</ul>
</li>
<li><strong>November</strong>
<ul>
<li>Host Thanksgiving</li>
<li>Have all my Christmas shopping done</li>
</ul>
</li>
<li><strong>December</strong>
<ul>
<li>Attend a New Years Party outside of my own city</li>
<li>Finish the year under 210 pounds</li>
</ul>
</li>
<li><strong>Some time in 2012</strong>
<ul>
<li>Pray daily with my family</li>
<li>Find a church and become a member</li>
<li>Read at least two self improvement books</li>
<li>Own a motorcycle</li>
<li>Replace my car</li>
<li>Complete a 5K</li>
<li>Complete a 10K</li>
<li>Run a sub-six minute mile</li>
<li>Attend a software developer conference</li>
<li>Give a talk at a meetup or conference</li>
<li>Go to a concert</li>
<li>Go to an NFL game</li>
<li>Travel out of state</li>
<li>Learn a new programming language</li>
</ul>
</li>
</ul>
<p>I know it seems like a lot of this is wrapped around health. I'm of the opinion that I need to continually work on my health - physically, emotionally and spiritually - so I can continually improve myself. If there is one thing that I gleaned from 2011 it's that I need to become a better human being. I need to learn to be more patient, more kind, more understanding. I need to improve me. 2012 will be my year for that. </p>
<p>I expect some amazing things this year. And I am determined to see these through completion. My prayer is that I can look back on these things a year from now and be able to say that I've done them all. I'm certain that's possible. </p>
<img src="http://feeds.feedburner.com/~r/robert-gonzalez/~4/PMrKuuxRUv8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.robert-gonzalez.com/2011/12/31/preparing-my-2012/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Be grateful in all things</title>
		<link>http://www.robert-gonzalez.com/2011/12/19/be-grateful-in-all-things/</link>
		<comments>http://www.robert-gonzalez.com/2011/12/19/be-grateful-in-all-things/#comments</comments>
		<pubDate>Mon, 19 Dec 2011 15:27:52 +0000</pubDate>
		<dc:creator>Robert Gonzalez</dc:creator>
				<category><![CDATA[Personal Messages]]></category>
		<category><![CDATA[Attitude]]></category>
		<category><![CDATA[Holidays]]></category>

		<guid isPermaLink="false">http://www.robert-gonzalez.com/?p=3103</guid>
		<description><![CDATA[I woke up this morning with a feeling of anxiety. This happens from time to time, but more recently it has happened more often. I'm not talking about clinical anxiety but more the anxiety that comes as a precursor to the culmination of a great journey coupled with major change in the usual surroundings of [...]]]></description>
			<content:encoded><![CDATA[<p>I woke up this morning with a feeling of anxiety. This happens from time to time, but more recently it has happened more often. I'm not talking about clinical anxiety but more the anxiety that comes as a precursor to the culmination of a great journey coupled with major change in the usual surroundings of your life. Like when you're getting ready to start a new job or when you're entering into a new relationship.</p>
<p>But as I thought about all that <em>could</em> be causing me anxiety I began to realize that this feeling, this nervous energy that seems to overtake me, stems from the knowledge that where I am in life is simply not good enough. It's because I want more - I need more - out of life that I seek a higher level. </p>
<p>I'd be the first to tell you that if you are not happy where you are go find your happiness. Seek out with all your might that which you so greatly desire and aggressively pursue it until you've acquired what you seek. You only have one life to live and you're not getting any younger. So stop living your life wondering and wishing and start making the necessary moves to find that place in life you want to be. But today I've decided to change my attitude. Today I choose to be grateful. </p>
<p>As we enter into the last few days of Christmas and, realistically, the last few days of the year, I am reminded that there is so much for me to be thankful for in my life. I have a beautiful and amazing family. My children are all healthy, brilliant, creative, thriving children who have shown me this past year that they are tough as nails and soft as silk. I have a great relationship with them and they, with me. We live our lives together as harmoniously as a family can and we have shown over time that we are a tight knit family that is capable of withstanding the worst possible situations while still being able to celebrate the best ones.</p>
<p>I have a skillset that is heavily sought after and positions me to be able to take care of my children financially. It's good to be a tech head <em>in</em> Silicon Valley at this particular time in history. I love what I do and because I'm in a rather niche market, I am actually pretty valuable. This is a good thing.</p>
<p>I have a wonderful home for my children that is warm, inviting, filled with the sounds of playful screams, craftily composed piano tunes and strong voices that are right on pitch. The creativity flows through my house in every aspect but none stronger than music. I am reminded every day just how blessed I am to be surrounded by such musically inclined kids.</p>
<p>The basic necessities of life are always at our disposal. We literally want for nothing. No, we don't live a high roller lifestyle by any stretch of the imagination but very seldom do we have to tell ourselves "no". All in all, life is pretty good. </p>
<p>So as the week winds down, and Christmas lists get poured over and things get bought and the "want meter" is showing elevated readings, I want to take a minute to slow down, consider what I really want the most and enjoy the last few days of this year with an attitude of gratitude. Yes, there is going to be an extraordinary amount of change coming very, very soon. I am preparing myself for the coming year because it will open with change right out of the gates. But for now, or at least the next couple of weeks, I will be thankful. I will choose to be happy with what I have and I will choose to enjoy my life exactly as it is.</p>
<img src="http://feeds.feedburner.com/~r/robert-gonzalez/~4/gBl3bGYd1co" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.robert-gonzalez.com/2011/12/19/be-grateful-in-all-things/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple PHP table maker</title>
		<link>http://www.robert-gonzalez.com/2011/11/28/simple-php-table-maker/</link>
		<comments>http://www.robert-gonzalez.com/2011/11/28/simple-php-table-maker/#comments</comments>
		<pubDate>Tue, 29 Nov 2011 03:18:18 +0000</pubDate>
		<dc:creator>Robert Gonzalez</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Nerdgasm]]></category>

		<guid isPermaLink="false">http://www.robert-gonzalez.com/?p=3098</guid>
		<description><![CDATA[A little while ago I was in need of a way to take tab separated data sets and make HTML tables out of them cleanly. Mostly this was from data copied from a spreadsheet, but sometimes copying from web pages or even text documents has brought this need up for me. So in keeping with [...]]]></description>
			<content:encoded><![CDATA[<p>A little while ago I was in need of a way to take tab separated data sets and make HTML tables out of them cleanly. Mostly this was from data copied from a spreadsheet, but sometimes copying from web pages or even text documents has brought this need up for me. So in keeping with my mantra of "Why not write a program to do that?" I decided to write a simple HTML table maker that will take in tab separated, structured data and return an HTML table from it, complete with column headings, a caption and a summary (sidenote: I know that table summaries are being deprecated... still, I included it because at the moment they are still in use for pre-HTML5 markup).</p>
<p>So without further ado, I bring you <a href="http://www.robert-gonzalez.com/personal/code/tools/tablemaker.php" title="My simple HTML table maker script">my simple HTML table maker</a>. It isn't the most robust thing in the world, but it is still pretty neat. Plus? It totally serves my purpose to the tee. So if you don't like it, why not <a href="http://www.robert-gonzalez.com/personal/code/tools/tablemaker.phps" title="Source viewer for the HTML table maker">gank the code for it</a> and make it better? </p>
<img src="http://feeds.feedburner.com/~r/robert-gonzalez/~4/Q9Md_uNwXAw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.robert-gonzalez.com/2011/11/28/simple-php-table-maker/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Happy Thanksgiving 2011</title>
		<link>http://www.robert-gonzalez.com/2011/11/24/happy-thanksgiving-2011/</link>
		<comments>http://www.robert-gonzalez.com/2011/11/24/happy-thanksgiving-2011/#comments</comments>
		<pubDate>Thu, 24 Nov 2011 16:34:53 +0000</pubDate>
		<dc:creator>Robert Gonzalez</dc:creator>
				<category><![CDATA[My Thoughts]]></category>
		<category><![CDATA[Personal Messages]]></category>
		<category><![CDATA[Holidays]]></category>
		<category><![CDATA[Thanksgiving]]></category>

		<guid isPermaLink="false">http://www.robert-gonzalez.com/2011/11/24/happy-thanksgiving-2011/</guid>
		<description><![CDATA[Another thanksgiving is upon us. It seems in recent years that we are cycling through holidays at breakneck speed, never being able enjoy any one particular holiday because the next holiday is already up in stores or being advertised on the Internet. This saddens me, especially at thanksgiving time, since we often times neglect the [...]]]></description>
			<content:encoded><![CDATA[<p>Another thanksgiving is upon us. It seems in recent years that we are cycling through holidays at breakneck speed, never being able enjoy any one particular holiday because the next holiday is already up in stores or being advertised on the Internet. This saddens me, especially at thanksgiving time, since we often times neglect the spirit of giving thanks for the rush of acquiring more crap on the morning after. </p>
<p>Being thankful is something I've tried to teach my kids for a while now. It's also something I've tried to live my life by as well, although I am nowhere near perfect at it so inevitably I overlook something I <em>should</em> be thankful for, usually in favor of being cranky about something else. This past 12 months it has been way easier to count my curses than it has been to count my blessings. But I've had a quiet last few weeks, time that I've been able to spend thinking about my life and the many blessings that surround me daily. </p>
<p>While the past year has been challenging, the blessings in my life have shown themselves to me clearly. Among these blessings are the tangibles and the intangibles, the valuable and the invaluable. Although I'm sure I'm forgetting many, it would be silly of me not to at least try to address the more prominent blessings in my life. </p>
<ul>
<li><strong>My kids</strong> - My children have been the greatest blessing to me and continue to be. Not a day goes by that I am not totally and completely amazed by them in some way. Whether it be their creative outward expressions or their tender, sincere, loving hearts toward me and their siblings, I'm reminded everyday of just how powerful a blessing my children are.</li>
<li><strong>My family</strong> - My family has shown me this past year just what love is and to just what lengths they will go in order to care for me and my kids. When I say "my family" I am most definitely talking about my blood family (my brother, my sister, my cousins, my nieces and my nephews). But I am also talking about my mother-in-law, my father-in-law, my sisters-in-law and my brothers-in-law. My entire family seemed to rally around my immediate family this year and even through the hardest of times have stayed by my side.</li>
<li><strong>My friends</strong> - I'd like to think that everyone has friends. And although I have a crapload of friends on Facebook and Twitter, I can count the number of close friends I have on one hand. But this year my closest friends really showed themselves. They came out of the woodwork to encourage me, make me laugh and generally just have my back. I don't know where I'd be on this thanksgiving if not for my friends reaching out to me, talking to me and listening to me. You know who you are. I just hope you know how thankful I am for you.</li>
<li><strong>My possessions</strong> - I know that stuff is just stuff, but I count among my stuff the basic necessities of life: a house, a car, electricity, running water, etc. Yes, I also include toys and gadgets in my "stuff" (I mean who doesn't love their phone) but being able to keep my kids warm, fed, clothed and sheltered is a tremendous blessing to me.</li>
<li><strong>My skills</strong> - I love being a nerd. I've said it before and I'll continue to say it. What started out at a hobby for me has blossomed into a career. A well paying, lucrative career. I'm thankful that I've been blessed with an inquisitive mind and a passion for learning, and that I can leverage that into a skill set that continues to provide for my children.</li>
<li><strong>My health</strong> - I've worked hard to get myself healthy. I've worked hard to stay healthy. I'm blessed to say that I don't need medication everyday just to live and that I can experience life with my children with energy, fervor and passion, never missing a thing with them because "daddy doesn't feel like it today kids".</li>
<li><strong>My struggles</strong> - Anyone that knows me knows that I like to push myself to achieve things that I might not be able to achieve under normal circumstances. And most folks that know me know that I'm not one to get smacked on the chin without swinging back. This year has shown this more clearly than any other. The struggles came in droves this year, each one presenting a new challenge, a new problem that needed a new and different way to approach it. To say that this past year was trying would be minimizing what actually took place. Still, through each of the struggles came an equally rewarding victory and a promise of a brighter future. And for that I am immeasurably blessed.</li>
<li><strong>My failures</strong> - If there was one thing I can say I am more blessed by this year than last year it would have to be my realization of my own imperfection and my coming to grips with many of my behaviors, attitudes and actions that have led to failure in many areas of my life. It's been said that if you want to continue to get the same results of your actions simply keep doing the same thing. I realized this year that I did <strong>not</strong> want to keep getting the same results in life I've always gotten and that in order to change course I had to take a deep look within myself to identify those areas of myself that may have been preventing my own success. That has been painful to say the least, but it has also been an indescribable blessing in that for the first time in my life I've come face to face with many of my shortcomings and have been able to begin rectifying them. Change is good, even if it is uncomfortable.</li>
</ul>
<p>There is so much more that I should be thankful for. But as I sit behind the keys staring at the emptiness of what will soon become the last few lines of this post, I'm reminded that I have a house full of kids that need their daddy's attention and affection. And that is a blessing I can no longer pass up. </p>
<p>Happy thanksgiving. May this holiday season be a blessing to you and may it open you up to be a blessing to others. </p>
<img src="http://feeds.feedburner.com/~r/robert-gonzalez/~4/OwkQzaBeuaU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.robert-gonzalez.com/2011/11/24/happy-thanksgiving-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Yet more change is afoot</title>
		<link>http://www.robert-gonzalez.com/2011/11/04/yet-more-change-is-afoot/</link>
		<comments>http://www.robert-gonzalez.com/2011/11/04/yet-more-change-is-afoot/#comments</comments>
		<pubDate>Fri, 04 Nov 2011 19:38:37 +0000</pubDate>
		<dc:creator>Robert Gonzalez</dc:creator>
				<category><![CDATA[On Family]]></category>
		<category><![CDATA[Personal Messages]]></category>
		<category><![CDATA[Career changes]]></category>
		<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://www.robert-gonzalez.com/?p=3089</guid>
		<description><![CDATA[A little over a year ago I posted about an upcoming career change that I was embarking on. I'm not at all the kind of person that likes to bounce around from job to job nor am I a huge risk taker when it comes to matters of finance, career growth and personal change. However, [...]]]></description>
			<content:encoded><![CDATA[<p>A little over a year ago I posted about an upcoming career change that I was embarking on. I'm not at all the kind of person that likes to bounce around from job to job nor am I a huge risk taker when it comes to matters of finance, career growth and personal change. However, sometimes life happens, and sometimes things happen beyond your control that put you into a position of having to pull back the reins and get things in order once again, even if you have to take a risk to do it. To that end, I am heading down a path that I've not even so much as entertained the idea of let alone had the guts to pursue. I am changing jobs again.</p>
<p>This change is much needed for various reasons which I don't need to go into here. But let me just say that while I look back on the last year of my work with mixed emotions, when I look forward I look on with excitement, butterflies and a determination to make some magic happen. I am leaving the comfort of something stable for the vast wonderland of something that is far from proven. I am taking a risk. A big risk. But one I absolutely need to take at this point in my life.</p>
<p>Starting next week I will be the lead architect and head engineer of a niche marketing company in Concord. I will be working a short term contact with long term potential and will be able to make an immediate, very visible impact of the business operations of the company. I will be a part owner and I will be responsible for making business, technology, architecture, implementation and deployment decisions the likes of which I've yet to do in my career. I'm more than a little nervous about that. But I am also more than a little excited about that. </p>
<p>There is just something about looking out over the great expanse of the unknown and seeing for yourself what that landscape looks like. Then stepping off the ledge of safety into that unknown, preparing to face all sorts of unexpected happenings and trusting in yourself to not only get through it but kick ass along the way to a major victory in your life. Yeah, I feel like a boxer throwing punches in the locker room just before a title fight. This is going to be freaking awesome and I am looking forward to it.</p>
<p>I do have to say however that there are some people I will miss from my current employer. While I've only been here a year I have had a chance to develop some strong professional and personal relationships with some amazing people that do some amazing things day in and day out. I've had to work with these folks daily, supporting them, being challenged by them and working with them collaboratively to achieve common goals and mutual awesomeness:
<ul>
<li>Ravi - Dude, I don't know how you manage to do what you do every day without blowing a gasket. You only have two hands yet you work like an army of employees daily, getting things done by yourself that I've seen entire teams not get done at all.</li>
<li>Jay - I've had more fun working with you, talking with you, debating with you and collaborating with you than anyone else in the office. You are a great developer and I see big things for your future. Also? Competing in triathlons? Bad. Ass.</li>
<li>Fai - You are a gifted and talented front end designer and developer. Don't let anyone ever tell you otherwise. You have an eye for style, color, relationships of objects... all of it. You were an asset to our company from the day you came on board.</li>
<li>Kim - What can I say dude, you are just bad ass from top to bottom. You get things done, you handle your business, you see a need before the client does and have an amazing work ethic. Any company would be blessed to have you on their team. It has been a tremendous pleasure working with you. And don't cover up those tattoos. If there isn't a handbook saying you have to there isn't a rule saying you have to.</li>
<li>Adrian - Bro, you made my job so much more bearable, so much more sane. I'm glad we had a chance to work together, and I am glad you always brought a positive spin to the table every single day. Even if things were awful in my office, you coming over made things better. I hope you realize what an asset you are. Thanks for making my job as wonderful as you did bro.</li>
</ul>
<p>And there you have it... news of yet another change in my life. So many changes in such a short period of time... and they aren't done yet. Just you wait and see. <img src='http://www.robert-gonzalez.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<img src="http://feeds.feedburner.com/~r/robert-gonzalez/~4/9U6ySH4Um_E" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.robert-gonzalez.com/2011/11/04/yet-more-change-is-afoot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Charge of the Light Brigade</title>
		<link>http://www.robert-gonzalez.com/2011/10/07/the-charge-of-the-light-brigade/</link>
		<comments>http://www.robert-gonzalez.com/2011/10/07/the-charge-of-the-light-brigade/#comments</comments>
		<pubDate>Fri, 07 Oct 2011 19:26:42 +0000</pubDate>
		<dc:creator>Robert Gonzalez</dc:creator>
				<category><![CDATA[On Family]]></category>
		<category><![CDATA[On Fatherhood]]></category>
		<category><![CDATA[On Manhood]]></category>
		<category><![CDATA[On Marriage]]></category>
		<category><![CDATA[Personal Messages]]></category>
		<category><![CDATA[Make life count]]></category>
		<category><![CDATA[Poetry]]></category>

		<guid isPermaLink="false">http://www.robert-gonzalez.com/?p=3083</guid>
		<description><![CDATA[When the movie "The Blind Side" came out my wife and I went to see it. While I loved the story line of the movie, and the character portrayals in it, there was a subplot to it that really stood out to me. In the movie, Michael Oher, the character on whom the story is [...]]]></description>
			<content:encoded><![CDATA[<p>When the movie "<a href="http://www.imdb.com/title/tt0878804/" title="The Blind Side">The Blind Side</a>" came out my wife and I went to see it. While I loved the story line of the movie, and the character portrayals in it, there was a subplot to it that really stood out to me. </p>
<p>In the movie, Michael Oher, the character on whom the story is based, was tasked with reading and dissecting an Alfred, Lord Tennyson poem called "The Charge of the Light Brigade", a poem written about a band of soldiers in the 1850's that literally rode into the face of death at the command of their superior even though he had made a mistake. They knew they were going to die, they knew it was going to be painful, they knew it was a lost cause. Yet they rode, because that is what soldiers do. Their role as soldiers gave them no latitude to question the motives or commands of their superior. They had pledged to follow him and his orders, and do that they did.</p>
<p>There is a story about life in this. There is also a story about parenting, marriage, education, work and every other aspect of your life that can sometimes catch you up in stress, anger, frustration or doubt. At the end of the day, whatever your role is - be it husband, father, president, stock clerk or son - you have a responsibility to fill that role with every ounce of your being. That is what those soldiers did. And that is what I choose to do daily.</p>
<p>I am currently embroiled in one of the greatest challenges in my personal life that I have ever experienced. To that end, I am resolved to do what's right wholeheartedly throughout the entire ordeal. I absolutely need to. My wife needs me to. My kids need me to. My friends need me to. I need me to. Challenges, battles, sorrow and loss come. It happens. The true test of a man's character, as I see it, is not his ability to handle those times but the manner in which he handles himself during those times. When faced with certain loss, certain death, certain pain, will you press on anyway?</p>
<blockquote><p><strong>The Charge Of The Light Brigade</strong><br />
by Alfred, Lord Tennyson<br />
Written 1854</p>
<p>Half a league half a league,<br />
Half a league onward,<br />
All in the valley of Death<br />
Rode the six hundred:<br />
'Forward, the Light Brigade!<br />
Charge for the guns' he said:<br />
Into the valley of Death<br />
Rode the six hundred. </p>
<p>'Forward, the Light Brigade!'<br />
Was there a man dismay'd ?<br />
Not tho' the soldier knew<br />
Some one had blunder'd:<br />
Theirs not to make reply,<br />
Theirs not to reason why,<br />
Theirs but to do &#038; die,<br />
Into the valley of Death<br />
Rode the six hundred. </p>
<p>Cannon to right of them,<br />
Cannon to left of them,<br />
Cannon in front of them<br />
Volley'd &#038; thunder'd;<br />
Storm'd at with shot and shell,<br />
Boldly they rode and well,<br />
Into the jaws of Death,<br />
Into the mouth of Hell<br />
Rode the six hundred. </p>
<p>Flash'd all their sabres bare,<br />
Flash'd as they turn'd in air<br />
Sabring the gunners there,<br />
Charging an army while<br />
All the world wonder'd:<br />
Plunged in the battery-smoke<br />
Right thro' the line they broke;<br />
Cossack &#038; Russian<br />
Reel'd from the sabre-stroke,<br />
Shatter'd &#038; sunder'd.<br />
Then they rode back, but not<br />
Not the six hundred. </p>
<p>Cannon to right of them,<br />
Cannon to left of them,<br />
Cannon behind them<br />
Volley'd and thunder'd;<br />
Storm'd at with shot and shell,<br />
While horse &#038; hero fell,<br />
They that had fought so well<br />
Came thro' the jaws of Death,<br />
Back from the mouth of Hell,<br />
All that was left of them,<br />
Left of six hundred. </p>
<p>When can their glory fade?<br />
O the wild charge they made!<br />
All the world wonder'd.<br />
Honour the charge they made!<br />
Honour the Light Brigade,<br />
Noble six hundred!</p></blockquote>
<p>Borrowed from <a href="http://www.nationalcenter.org/ChargeoftheLightBrigade.html">http://www.nationalcenter.org/ChargeoftheLightBrigade.html</a></p>
<img src="http://feeds.feedburner.com/~r/robert-gonzalez/~4/5-i26RBd1LM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.robert-gonzalez.com/2011/10/07/the-charge-of-the-light-brigade/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>If, by Rudyard Kipling</title>
		<link>http://www.robert-gonzalez.com/2011/10/06/if-by-rudyard-kipling/</link>
		<comments>http://www.robert-gonzalez.com/2011/10/06/if-by-rudyard-kipling/#comments</comments>
		<pubDate>Thu, 06 Oct 2011 17:48:46 +0000</pubDate>
		<dc:creator>Robert Gonzalez</dc:creator>
				<category><![CDATA[On Family]]></category>
		<category><![CDATA[On Fatherhood]]></category>
		<category><![CDATA[On Manhood]]></category>
		<category><![CDATA[Poetry]]></category>

		<guid isPermaLink="false">http://www.robert-gonzalez.com/?p=3076</guid>
		<description><![CDATA[Some things come at you hard and fast, and hit you in the face like a rush of ice cold water on a hot summer day. Others wrap their arms around you and tell you it's going to be ok while coaxing you into a peaceful calm. Still others reach into the very core of [...]]]></description>
			<content:encoded><![CDATA[<p>Some things come at you hard and fast, and hit you in the face like a rush of ice cold water on a hot summer day. Others wrap their arms around you and tell you it's going to be ok while coaxing you into a peaceful calm. Still others reach into the very core of who you are and add value - strength, courage, determination, resolve - to an otherwise broken and fragile being. This poem, by Rudyard Kipling, is one of those that just encourages and strengthens me.</p>
<blockquote><p><strong>If</strong><br />
Rudyard Kipling</p>
<p>If you can keep your head when all about you<br />
Are losing theirs and blaming it on you;<br />
If you can trust yourself when all men doubt you,<br />
But make allowance for their doubting too;<br />
If you can wait and not be tired by waiting,<br />
Or, being lied about, don't deal in lies,<br />
Or, being hated, don't give way to hating,<br />
And yet don't look too good, nor talk too wise;</p>
<p>If you can dream - and not make dreams your master;<br />
If you can think - and not make thoughts your aim;<br />
If you can meet with triumph and disaster<br />
And treat those two imposters just the same;<br />
If you can bear to hear the truth you've spoken<br />
Twisted by knaves to make a trap for fools,<br />
Or watch the things you gave your life to broken,<br />
And stoop and build 'em up with wornout tools;</p>
<p>If you can make one heap of all your winnings<br />
And risk it on one turn of pitch-and-toss,<br />
And lose, and start again at your beginnings<br />
And never breath a word about your loss;<br />
If you can force your heart and nerve and sinew<br />
To serve your turn long after they are gone,<br />
And so hold on when there is nothing in you<br />
Except the Will which says to them: "Hold on";</p>
<p>If you can talk with crowds and keep your virtue,<br />
Or walk with kings - nor lose the common touch;<br />
If neither foes nor loving friends can hurt you;<br />
If all men count with you, but none too much;<br />
If you can fill the unforgiving minute<br />
With sixty seconds' worth of distance run -<br />
Yours is the Earth and everything that's in it,<br />
And - which is more - you'll be a Man my son! </p></blockquote>
<p>If you are interested in learning more about this poem or would like to socialize and connect with folks who have delved deep into this piece, check out <a href="http://www.allthingsif.org/">All Things If, a blog dedicated to this poem</a>.</p>
<img src="http://feeds.feedburner.com/~r/robert-gonzalez/~4/0QfY4C3zEiI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.robert-gonzalez.com/2011/10/06/if-by-rudyard-kipling/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

