<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
	xmlns:media="http://search.yahoo.com/mrss/"
>

<channel>
	<title>s a i n e . b l o g</title>
	<atom:link href="http://stephensaine.com/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://stephensaine.com/blog</link>
	<description>Striving to better...</description>
	<lastBuildDate>Tue, 24 Aug 2010 20:40:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<!-- podcast_generator="podPress/8.8" - maintenance_release="8.8.4" -->
		<copyright>2006-2007 </copyright>
		<managingEditor>stephen.saine@gmail.com (s a i n e . b l o g)</managingEditor>
		<webMaster>stephen.saine@gmail.com (s a i n e . b l o g)</webMaster>
		<category>posts</category>
		<itunes:keywords></itunes:keywords>
		<itunes:subtitle></itunes:subtitle>
		<itunes:summary>Just another WordPress weblog</itunes:summary>
		<itunes:author>s a i n e . b l o g</itunes:author>
		<itunes:category text="Society &amp; Culture"/>
		<itunes:owner>
			<itunes:name>s a i n e . b l o g</itunes:name>
			<itunes:email>stephen.saine@gmail.com</itunes:email>
		</itunes:owner>
		<itunes:block>No</itunes:block>
		<itunes:explicit>no</itunes:explicit>
		<itunes:image href="http://stephensaine.com/blog/wp-content/plugins/podpress/images/powered_by_podpress_large.jpg" />
		<image>
			<url>http://stephensaine.com/blog/wp-content/plugins/podpress/images/powered_by_podpress.jpg</url>
			<title>s a i n e . b l o g</title>
			<link>http://stephensaine.com/blog</link>
			<width>144</width>
			<height>144</height>
		</image>
		<item>
		<title>Curious pups</title>
		<link>http://stephensaine.com/blog/?p=45</link>
		<comments>http://stephensaine.com/blog/?p=45#comments</comments>
		<pubDate>Fri, 20 Aug 2010 19:36:35 +0000</pubDate>
		<dc:creator>saine</dc:creator>
				<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://stephensaine.com/blog/?p=45</guid>
		<description><![CDATA[I constantly witness these 2 pups engage in a never ending face-biting contest.  I tried to document it with my iphone and they immediately become suspicious.  Dooley&#8217;s ears jump to full attention and then the momma bear aka Izzy comes directly to the source to investigate.  I think it is really funny how they react. [...]]]></description>
			<content:encoded><![CDATA[<p>I constantly witness these 2 pups engage in a never ending face-biting contest.  I tried to document it with my iphone and they immediately become suspicious.  Dooley&#8217;s ears jump to full attention and then the momma bear aka Izzy comes directly to the source to investigate.  I think it is really funny how they react.</p>
<p>Enjoy.</p>
<p><object width="500" height="400"><param name="movie" value="http://www.youtube.com/v/Sa1VF7NnsQI?fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/Sa1VF7NnsQI?fs=1" type="application/x-shockwave-flash" width="500" height="400" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://stephensaine.com/blog/?feed=rss2&amp;p=45</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Beer at work</title>
		<link>http://stephensaine.com/blog/?p=42</link>
		<comments>http://stephensaine.com/blog/?p=42#comments</comments>
		<pubDate>Fri, 02 Apr 2010 23:25:32 +0000</pubDate>
		<dc:creator>saine</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[beer yahoo]]></category>

		<guid isPermaLink="false">http://stephensaine.com/blog/?p=42</guid>
		<description><![CDATA[Mmmmmm &#8230; Friday afternoon cube drinking&#8230; About to head to Duke of Edinburgh]]></description>
			<content:encoded><![CDATA[<p>Mmmmmm &#8230; Friday afternoon cube drinking&#8230; About to head to Duke of Edinburgh</p>
<p><a href="http://stephensaine.com/blog/wp-content/uploads/2010/04/l_2048_1536_61F4C634-3462-4627-8FEE-E3AA43228CDA.jpeg"><img src="http://stephensaine.com/blog/wp-content/uploads/2010/04/l_2048_1536_61F4C634-3462-4627-8FEE-E3AA43228CDA.jpeg" alt="" class="alignnone size-full" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://stephensaine.com/blog/?feed=rss2&amp;p=42</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I love this cartoon because it is so true..</title>
		<link>http://stephensaine.com/blog/?p=39</link>
		<comments>http://stephensaine.com/blog/?p=39#comments</comments>
		<pubDate>Wed, 31 Mar 2010 20:02:03 +0000</pubDate>
		<dc:creator>saine</dc:creator>
				<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://stephensaine.com/blog/?p=39</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><img src="http://27.media.tumblr.com/tumblr_l02q2wPnOi1qzpfrmo1_400.jpg" alt="Funny Calvin cartoon" /></p>
]]></content:encoded>
			<wfw:commentRss>http://stephensaine.com/blog/?feed=rss2&amp;p=39</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Monster-sized scam!</title>
		<link>http://stephensaine.com/blog/?p=35</link>
		<comments>http://stephensaine.com/blog/?p=35#comments</comments>
		<pubDate>Wed, 31 Mar 2010 18:42:55 +0000</pubDate>
		<dc:creator>saine</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[hdmi]]></category>

		<guid isPermaLink="false">http://stephensaine.com/blog/?p=35</guid>
		<description><![CDATA[Apparently, when i paid $125 for my HDMI cable for my TV, I got ripped. FYI if you are buying these types of cables anytime soon. Read this Budget Planner – Mint.com]]></description>
			<content:encoded><![CDATA[<p>Apparently, when i paid $125 for my HDMI cable for my TV, I got ripped.  FYI if you are buying these types of cables anytime soon.</p>
<p><a href="http://www.mint.com/blog/trends/the-rip1/">Read this</a></p>
<p><a href="http://www.mint.com/blog/wp-content/uploads/2010/03/TheRipHDMI3.jpg"><img src="http://www.mint.com/blog/wp-content/uploads/2010/03/TheRipHDMI3.jpg" alt="" title="TheRipHDMI3" width="500" height="2812" class="alignnone size-full wp-image-9531" /></a><br />
<a href="http://www.mint.com/">Budget Planner – Mint.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://stephensaine.com/blog/?feed=rss2&amp;p=35</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Twitter- Can you hear me?</title>
		<link>http://stephensaine.com/blog/?p=27</link>
		<comments>http://stephensaine.com/blog/?p=27#comments</comments>
		<pubDate>Wed, 31 Mar 2010 06:17:45 +0000</pubDate>
		<dc:creator>saine</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://stephensaine.com/blog/?p=27</guid>
		<description><![CDATA[This post is to test whether my post goes to twitter or not]]></description>
			<content:encoded><![CDATA[<p>This post is to test whether my post goes to twitter or not</p>
]]></content:encoded>
			<wfw:commentRss>http://stephensaine.com/blog/?feed=rss2&amp;p=27</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Izzy is such a booze hound!</title>
		<link>http://stephensaine.com/blog/?p=24</link>
		<comments>http://stephensaine.com/blog/?p=24#comments</comments>
		<pubDate>Wed, 31 Mar 2010 06:07:32 +0000</pubDate>
		<dc:creator>saine</dc:creator>
				<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://stephensaine.com/blog/?p=24</guid>
		<description><![CDATA[Izzy just can't get enough of that taste of the rockies]]></description>
			<content:encoded><![CDATA[<p>Here is another funny one that is of just Izzy</p>
<p><object width="500" height="400"><param name="movie" value="http://www.youtube.com/v/AscqVRr7a2s&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/AscqVRr7a2s&#038;fs=1" type="application/x-shockwave-flash" width="500" height="400" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://stephensaine.com/blog/?feed=rss2&amp;p=24</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sonoma pups want ball in pool</title>
		<link>http://stephensaine.com/blog/?p=19</link>
		<comments>http://stephensaine.com/blog/?p=19#comments</comments>
		<pubDate>Wed, 31 Mar 2010 05:42:55 +0000</pubDate>
		<dc:creator>saine</dc:creator>
				<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://stephensaine.com/blog/?p=19</guid>
		<description><![CDATA[Here is a pretty funny video from my Sonoma trip of the dogs trying to get a ball which was in the pool.]]></description>
			<content:encoded><![CDATA[<p>Here is a pretty funny video from my Sonoma trip of the dogs trying to get a ball which was in the pool.  Gus (the black lab) had already been in the pool a million times but for some reason when the ball is 2 ft away versus 10 ft away, he will not jump in to get it.  The German shepherd is a princess and will not get in the water for anything, except maybe to bite Gus&#8217; neck on his way back from retrieval.</p>
<p>Sonoma pups want ball in pool</p>
<p><object width="500" height="400"><param name="movie" value="http://www.youtube.com/v/RHcqHXnGD3c&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/RHcqHXnGD3c&#038;fs=1" type="application/x-shockwave-flash" width="500" height="400" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://stephensaine.com/blog/?feed=rss2&amp;p=19</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Moving/Backing-Up Innodb tables from Ubuntu to MacOSX or Windows  *argh*</title>
		<link>http://stephensaine.com/blog/?p=7</link>
		<comments>http://stephensaine.com/blog/?p=7#comments</comments>
		<pubDate>Fri, 29 Jan 2010 08:29:59 +0000</pubDate>
		<dc:creator>saine</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://stephensaine.com/blog/?p=7</guid>
		<description><![CDATA[I just had the most frustrating and long battle with moving a MySQL database (both MyISAM and InnoDB tables) from my Ubuntu Dapper Drake 6.06 LTS. Currently, I have a MySQL slave server set up to accept a trickle down of data from the master of a VPN line to the office. This allows me [...]]]></description>
			<content:encoded><![CDATA[<p>I just had the most frustrating and long battle with moving a MySQL database (both MyISAM and InnoDB tables) from my Ubuntu Dapper Drake 6.06 LTS.  Currently, I have a MySQL slave server set up to accept a trickle down of data from the master of a VPN line to the office.   This allows me to shutdown the slave without interrupting the production environment and take snapshots of the database.  Well, I was doing my due diligence and wanted to check my restore process and write a shell script or little C program to handle some automation.  Come to find out, when I restored my copy of the database on my Mac OSX (10.4.10) I would get an error saying that my Innodb tables didn&#8217;t exist (&#8220;ERROR 1146 (42S02): Table &#8216;db.table&#8217; doesn&#8217;t exist&#8221;) but I was very careful when creating a binary backup of the files.  I checked and double checked the config files and my Innodb set-up.  Everything seemed in order.</p>
<p>After searching for days ( here and there, when I had the time to get caught in a rabbit chase ),  I finally found a flag that I thought might  show some effect.  Indeed it did.</p>
<pre class="programlisting">[mysqld]
lower_case_table_names=1</pre>
<p>See: http://dev.mysql.com/doc/refman/5.0/en/moving.html</p>
<p>This however encourages this flag to be set before any tables have been created.  Too late!  So, I switched the flag to 0 and it fixed all my problems on both Mac OSX and Windows XP.  Apparently, by default, this flag is set to 1 now.  Hope this helps someone that is perplexed by this problem.</p>
<pre class="programlisting">[mysqld]
lower_case_table_names=0</pre>
<p><!--2a0b33383d7bc2f521f88a4e7efc3d3f--></p>
<p><!--cb45cef939148137ff933a92007b4e9a--></p>
]]></content:encoded>
			<wfw:commentRss>http://stephensaine.com/blog/?feed=rss2&amp;p=7</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Learning how to learn</title>
		<link>http://stephensaine.com/blog/?p=6</link>
		<comments>http://stephensaine.com/blog/?p=6#comments</comments>
		<pubDate>Thu, 21 Jan 2010 08:29:03 +0000</pubDate>
		<dc:creator>saine</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://stephensaine.com/blog/?p=6</guid>
		<description><![CDATA[One of the most important lessons that I have &#8220;learned&#8221; is the invaluable asset of knowing how to learn. This may seem like a simplistic if not empirical skill that everyone surely possesses by simply finishing any flavor of structured education, but I would actually argue that this seemingly simple skill is often overlooked and [...]]]></description>
			<content:encoded><![CDATA[<p>One of the most important lessons that I have &#8220;learned&#8221; is the invaluable asset of knowing <em>how to learn.</em> This may seem like a simplistic if not empirical skill that everyone surely possesses by simply finishing any flavor of structured education, but I would actually argue that this seemingly simple skill is often overlooked and undervalued.  In my opinion, anyone willing to take note of how they absorb information best will be much more successful at mastering a subject/skill.<br />
Learning most commonly occurs through visual, auditory, interactive means and the majority of people are better at one or another when trying to retain information.  The first discovery should be to figure out through which channel you are best at retaining information: eyes,  ears, or hands.  I am very much a visual learner.  I think visually and do math visually and consequently learn better through visual means.  I also learn a great deal by doing something. So, before you hone your learning skills, identify your strengths.</p>
<p>Secondly, I believe that knowledge is power, power is valuable, and anything valuable doesn&#8217;t come without sacrifice and hard work.  The basis of this whole entry is to reveal the following story about how I was forced to learn how to learn by a few students in my high school.</p>
<p>When I was a freshman in high school (attending <a title="Donelson Christian Academy" href="http://www.dcanet.org">Donelson Christian Academy</a>), I was unfortunately in a serious car accident which left me with 3 days in intensive care, a severe concussion, lots of stitches from broken glass, and a broken ankle.  The injuries prevented me from participating in sports that Fall.  In place of the after school practices, I decided to enroll in an elective course dealing with the Internet (this was 1996 so we were pretty hip!).  As you might expect, the guys in this class were those audio/visual, computer geek-types that everyone steered clear of.  They even had pocket protectors (no joke!).  I was a bit hesitant at first but soon realized they were really nice people with very valuable information.  So, as I began to watch them program CGI <a title="Perl" href="http://www.perl.com">perl</a> apps, buy domain names, and install <a title="Linux" href="http://www.linux.org/">Linux</a> from floppy disks, I wanted in.  As I soon discovered, I enjoyed technology as much as them.</p>
<p>In order to get involved, I began asking questions and asking for guidance.  This approach however was not looked upon kindly by the guys who had put in the hard work and time to learn these skills themselves.  They wanted me to earn it the same as they had so they started handing me books to read (mostly technical manuals or programming specs).  I dug in.  They wanted me to learn how to teach myself by reading and researching.  This turned out to be one of the most valuable lessons of my life.  Instead of relying on someone telling me the answers to my possibly ignorant questions, my first stop was to consult the documentation.  With the proliferation of Internet resources and the power of the<a title="Google" href="http://www.google.com"> Google</a> search, there is no excuse for anyone trying to find information when they want it.  The information is endless.  Being willing to explore and knowing how to learn are all you need to participate.</p>
<p>Get involved!</p>
]]></content:encoded>
			<wfw:commentRss>http://stephensaine.com/blog/?feed=rss2&amp;p=6</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>HOW TO: Write an abstract database class in PHP5 (with MySQL)</title>
		<link>http://stephensaine.com/blog/?p=8</link>
		<comments>http://stephensaine.com/blog/?p=8#comments</comments>
		<pubDate>Fri, 15 Jan 2010 08:31:58 +0000</pubDate>
		<dc:creator>saine</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://stephensaine.com/blog/?p=8</guid>
		<description><![CDATA[So, if you are new to PHP or perhaps just new to creating web applications that connect to a relational database (such as MySQL), the following design pattern could help you get started on the right foot. I am gonna guess that if you have started to create a web application/CMS that is composed of [...]]]></description>
			<content:encoded><![CDATA[<p>So, if you are new to PHP or perhaps just new to creating web applications that connect to a relational database (such as MySQL), the following design pattern could help you get started on the right foot.</p>
<p>I am gonna guess that if you have started to create a web application/CMS that is composed of multiple PHP files (ie, news.php, calendar.php, pictures.php, etc), you are feeling the pain from all the database code that seems to be repeated.  This is precisely the problem that I would like to help you solve.  With an abstract database class, you can create generalized functions that will be flexible for later growth and unexpected twists.</p>
<p><code class="programlisting">class db {<br />
/*	    Members 	 */<br />
private $db_user;<br />
private $db_pass;<br />
private $db_name;<br />
private $db_server;<br />
private $link;<br />
private $result_id;</p>
<p>/*	Methods 	 */<br />
public function __construct($user=DB_USER, $pass=DB_PASS, $name=DB_NAME, $server=DB_SERVER){</p>
<p>$this->db_user = $user;<br />
$this->db_pass = $pass;<br />
$this->db_name = $name;<br />
$this->db_server = $server;</p>
<p>$this->connect();</p>
<p>}</p>
<p>private function connect(){</p>
<p>$this->link = @mysql_connect($this->db_server,$this->db_user,$this->db_pass) or die("can't connect to database");<br />
@mysql_select_db($this->db_name,$this->link) or die("can't select db (".$this->db_name.")";</p>
<p>} private function disconnect(){</p>
<p>@mysql_close($this->link);</p>
<p>}<br />
public function __destruct(){</p>
<p>$this->disconnect();</p>
<p>}</code>
<p>This will give us a good base to work from.  We have established the constructor, destructor and the methods responsible for making and breaking the connection to the database.  The reason we created a new function called connect and simply just wrapping the mysql_connect() function is because we want to the class to flexible enough such that if we wanted to change the database from MySQL to Postgres we could simply replace the mysql_connect() function with the pg_Connect() function without modifying potentially hundreds or thousands of database calls. (same would be true for disconnect())</p>
<p>Now that we can connect, we should create some functions that will allow us to SELECT something from the database.</p>
<p><code class="programlisting">public function select($params){</p>
<p>extract($params);</p>
<p>$sql = 'SELECT '.$fields.' FROM '.$table;</p>
<p>if(!empty($where)){<br />
$sql .= ' WHERE '.$where;<br />
}</p>
<p>if(!empty($group_by)){<br />
$sql .= ' GROUP BY '.$group_by;<br />
}</p>
<p>if(!empty($order_by)){<br />
$sql .= ' ORDER BY '.$order_by;<br />
}</p>
<p>if(!empty($limit)){<br />
$sql .= ' LIMIT '.$limit;<br />
}</p>
<p>$rows = array();<br />
$this->query($sql);<br />
return $rows;<br />
}<br />
private function query($sql){<br />
$rows = array();<br />
$this->result_id = @mysql_query($sql);</p>
<p>if($this->result_id){<br />
$rows = $this->fetch_rows();<br />
}<br />
return $rows;<br />
}</p>
<p>private function fetch_rows(){</p>
<p>$rows = array();</p>
<p>if($this->result_id){<br />
while($row = @mysql_fetch_object($this->result_id)){<br />
$rows[] = $row;<br />
}<br />
}<br />
return $rows;</p>
<p>}</code>
<p>As you can see we have now created functions that will create an abstraction layer on top of the MySQL functions so that we can easily replace the &#8220;guts&#8221; of those functions (if necessary) and all the lines of code that reference those functions will not have to change.</p>
<p>Hopefully you get the gist of how the rest would go.  I have included a more fleshed out version of the class at this <a title="Abstract Database Class" target="_blank" href="/files/db.class.txt">link (db.class.php)</a>.
<p>
<p><!--001e831d2cbe01dfb002015278a5334b-->
</p>
<p><!--a6b71962c010e8ea72ad877d7d12735a--></p>
]]></content:encoded>
			<wfw:commentRss>http://stephensaine.com/blog/?feed=rss2&amp;p=8</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
