<?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/"
	>

<channel>
	<title>Food for thought from TheHuey</title>
	<atom:link href="http://www.thehuey.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thehuey.com/blog</link>
	<description>News and other posts for friends and family</description>
	<lastBuildDate>Wed, 14 Apr 2010 02:05:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Open source Ipad app</title>
		<link>http://www.thehuey.com/blog/2010/04/13/open-source-ipad-app/</link>
		<comments>http://www.thehuey.com/blog/2010/04/13/open-source-ipad-app/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 02:05:20 +0000</pubDate>
		<dc:creator>huey</dc:creator>
				<category><![CDATA[Technical Musings]]></category>
		<category><![CDATA[iPad]]></category>

		<guid isPermaLink="false">http://www.thehuey.com/blog/2010/04/13/open-source-ipad-app/</guid>
		<description><![CDATA[Having played with my new iPad for over a week, I have come to the conclusion that while it may not yet replace the laptop, it creates a new category of tech devices.
The large format screen and familiar iPhone OS were easy to get acquainted with. The touch interface and keyboard is much easier to [...]]]></description>
			<content:encoded><![CDATA[<p>Having played with my new iPad for over a week, I have come to the conclusion that while it may not yet replace the laptop, it creates a new category of tech devices.</p>
<p>The large format screen and familiar iPhone OS were easy to get acquainted with. The touch interface and keyboard is much easier to thumb type with. The A4 CPU feels much faster and scrolling is quite smooth.  I am still trying out different apps to find what works well for my needs but so far the redesigned mail application is truly an experience.</p>
<p>Netflix has a free application for the iPad and iPhone that allows subscribers to watch their instant watch library via the app.  It is a great way to watch movies on the go or without turning on a computer. The built in Youtube app is also great for those who like independent content.</p>
<p>Drawing programs are another breed of fun applications. There are many to choose from, but a good price to feature app is ArtStudio. The $0.99 price belies the advanced features found on this app.  With layer support (up to 3 layers), brushes and image import/export, you can save to your photos or email them to others.</p>
<p>News readers are another really excellent group of apps.  Many newspapers have free apps allowing easy access to their content.  I haven&#8217;t gotten a chance to check out most of them, but the WSJ app is pretty nice. The interface takes a little getting used to, but once you get the hang of it, it is far superior to searching thru the printed version.  SkyGrid is another news aggregator and allows searching multiple sources for recent news.</p>
<p>Back to the post topic.  Wordpress is a popular blogging software (which powers this blog), and this post is being written on their iPad app.  The app is open source as well, so if you are interested in developing iPhone/iPad apps, you can start by checking out the code.  My complaint about this app is the save feature is a little broken.  This is my third attempt at writing this post.  When you click the home button, it seems to recover your changes, but when you hit save, it reverts to the older version. So hit Save before you go play a tune.</p>
<p>-Huey</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thehuey.com/blog/2010/04/13/open-source-ipad-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How many books will fit in a box?</title>
		<link>http://www.thehuey.com/blog/2009/09/15/how-many-books-will-fit-in-a-box/</link>
		<comments>http://www.thehuey.com/blog/2009/09/15/how-many-books-will-fit-in-a-box/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 19:03:57 +0000</pubDate>
		<dc:creator>huey</dc:creator>
				<category><![CDATA[General Posts]]></category>

		<guid isPermaLink="false">http://www.thehuey.com/blog/?p=65</guid>
		<description><![CDATA[Our marketing department at Chegg.com will be posing a challenge question at an event later this month.  Since I know pretty much none of my readers (all 2 of them) will be there to participate, I wanted to put this question to the general public.
How many Campbell Biology textbooks (11.2&#8243; x 9.3&#8243; x 2&#8243;) [...]]]></description>
			<content:encoded><![CDATA[<p>Our marketing department at Chegg.com will be posing a challenge question at an event later this month.  Since I know pretty much none of my readers (all 2 of them) will be there to participate, I wanted to put this question to the general public.</p>
<p>How many Campbell Biology textbooks (11.2&#8243; x 9.3&#8243; x 2&#8243;) can you fit in a cardboard box (46&#8242; x 22&#8242; x 9&#8242;) ?</p>
<p>Note: There is 1 answer, but many approximations.</p>
<p>I&#8217;m looking for your answer and the way you solved for the answer.</p>
<p>-Huey</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thehuey.com/blog/2009/09/15/how-many-books-will-fit-in-a-box/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gallery2 Media Rss Patch for CoolIris Embed Wall</title>
		<link>http://www.thehuey.com/blog/2009/03/08/gallery2-media-rss-patch-for-cooliris-embed-wall/</link>
		<comments>http://www.thehuey.com/blog/2009/03/08/gallery2-media-rss-patch-for-cooliris-embed-wall/#comments</comments>
		<pubDate>Sun, 08 Mar 2009 21:23:14 +0000</pubDate>
		<dc:creator>huey</dc:creator>
				<category><![CDATA[Technical Musings]]></category>
		<category><![CDATA[cooliris]]></category>
		<category><![CDATA[gallery2]]></category>
		<category><![CDATA[media rss]]></category>
		<category><![CDATA[php programming]]></category>

		<guid isPermaLink="false">http://www.thehuey.com/blog/?p=52</guid>
		<description><![CDATA[Use Cooliris to show your photos using Gallery2.  The quickest and coolest way to showcase your photos.  Follow the patches and you can too!]]></description>
			<content:encoded><![CDATA[<p>I was recently looking at different opportunities and saw a quite a few great companies doing wonderful things.  Among them is Cooliris, previously known as PicLens.  Their flagship product is a browser plugin which allows a very enticing scrolling view of media files.  Images, videos, and music scroll by on the screen in an endless wall.  Clicking on an image will zoom in to a higher resolution photo and a video file will zoom in and start playing.  Needless to say this is a pretty cool little tool, but it&#8217;s a plugin which means the download stops a lot of potential users.  But wait, they have a flash embed file which allows any website to embed the same experience on any web page!  Let&#8217;s see how we can use this to <a href="http://www.thehuey.com/cooliris/index.html">show off our photos</a>. <span id="more-52"></span></p>
<p>Wanting to use it for my own photos, I couldn&#8217;t wait to get started.  Since I already have a bunch of my own photos hosted using Gallery2, I decided to see if I could hook up an RSS feed and get it running quickly.  Unfortunately the default installation of the RSS plugin with Gallery2 didn&#8217;t support media rss.  My plugin version was a bit outdated so first I had to upgrade it.</p>
<p>Being new to Gallery2 development, I had to take a little bit and familiarize myself with the code.  The code structure is very well done and was pretty easy to start seeing what needed to be done.  I wanted to stick with the existing convention and not break anything unintentionally, so I made copies where needed and was careful about what I changed in shared files.</p>
<p>The code is located mostly under the /modules directory.  The /core sub-directory contains the Gallery core files.  What we&#8217;re interested in lies in /rss.  Makes sense right?  First thing I did was to make a examine the existing usage.  When viewing an album via a browser, the RSS feed link shows that the resource is accessed via g2_view=rss.SimpleRender.  So I made a copy of /rss/SimpleRender.inc to /rss/MediaRss.inc. My original version of the RSS plugin did not have any support for the media rss format, but the latest update does.  That helps make my task a LOT easier, but there is still more to do.  </p>
<ol>
<li>Add the &#8216;useMedia&#8217; parameter and the page variable to the params array.<br />
<code><br />
      $params['useCloud'] = false;<br />
      $params['useMedia'] = true;</p>
<p>      $params['page'] = GalleryUtilities::getRequestVariables('page');<br />
      $ret = $this->continueRender($params);<br />
</code>
</li>
</ol>
<p>Next, we need to examine the other classes that are used to support the feed generation.  Looking under the /classes directory (/modules/rss/classes), we see two that catch the eye immediately.  RssHelper.class and RssGenerator.class.</p>
<p>RssHelper.class generates the SQL which is used to find items to show in the feed.  One of the main things missing here is the ability to paginate results.  So let&#8217;s add it!  In the getFeed function, find the function call for fetchAlbumTree and make the following change:<br />
<strong>From</strong><br />
<code>RssHelper::fetchAlbumTree(<br />
   $entity->getId(),<br />
   $param['count'],<br />
   $newOnly,<br />
   $param['feedType'] != 'album',<br />
   $param['feedType'] == 'photosRecursive' ? $param['photosRecursiveLimit'] : 0,<br />
   $param['feedType'] == 'photosRandomRecursive');<br />
</code><br />
<strong>To</strong><br />
<code>RssHelper::fetchAlbumTree(<br />
   $entity->getId(),<br />
   array('count' => $param['count'], 'offset' => $param['offset']),<br />
   $newOnly,<br />
   $param['feedType'] != 'album',<br />
   $param['feedType'] == 'photosRecursive' ? $param['photosRecursiveLimit'] : 0,<br />
   $param['feedType'] == 'photosRandomRecursive');<br />
</code></p>
<p>We&#8217;ll put in the calculations for the offset in a bit.  First we worry about how to make sure it&#8217;s used.  In the &#8216;fetchAlbumTree&#8217; function, we need to check the $limit parameter and use it to set the offset.<br />
<code><br />
if (isset($limit)) {<br />
  $params['limit'] = array('count' => $limit);<br />
}<br />
</code><br />
<strong>Becomes</strong><br />
<code><br />
if (isset($limit)) {<br />
  if (is_array($limit)) $params['limit'] = $limit;<br />
  else $params['limit'] = array('count' => $limit);<br />
  }<br />
}<br />
</code><br />
The offset parameter is now used in the $gallery->search call.  Now, I thought I was all done, but when reviewing the response, I noticed the media:thumbnail url was set the same as the description.  This resulted in Cooliris not being able to pull in the thumbnails for the wall.  The bug is in the RssHelper.class code, function addPhotoOrAlbum.  Here is the change:<br />
<code><br />
          $itemSettings['thumbnail']['url'] = $url;<br />
SHOULD BE<br />
          $itemSettings['thumbnail']['url'] = $imageUrl;<br />
</code></p>
<p>RssGenerator.class does just that.  Depending on the version of RSS and whether you are &#8216;useMedia&#8217;, it generates the correct response XML document for feed readers.  There are a few changes here.</p>
<ol>
<li>Add a &#8216;default&#8217; statement to function generate() so we use 2.0 by default<br />
<code><br />
  case '2.0':<br />
  default:<br />
    return $this->generate200();<br />
    break;<br />
</code>
</li>
<li>Because we want pagination of our results, for the infinite wall experience in cooliris, we need to determine the next and previous feed URLs.  We will use an Apache rewrite rule for a pretty URL, so here&#8217;s the code to generate the links based on the current URL.<br />
<code>
<pre>
     $platform =&#038; $gallery->getPlatform();
      $lf = $platform->getLineEnding();

      if (isset($this->_properties['useMedia']) &#038;&#038; $this->_properties['useMedia'] == 1) {
        $generator = $gallery->getUrlGenerator();
        //GalleryUtilities::putRequestVariable('page', 4);
        $current = $generator->getCurrentRequestUri();
        $matches = array();
        if (preg_match("#media(\d*).rss$#", $current, $matches)) {
          $curPage = $matches[1];
          if (intval($curPage) < 1) {
            $curPage = 1;
          }
          $nextPage = $generator->makeUrl($current);
          $nextPage = preg_replace("#media\d*.rss#", "media" . ($curPage + 1) . ".rss", $nextPage);
          if ($curPage > 1) {
            $prevPage = $generator->makeUrl($current);
            $prevPage = preg_replace("#media\d*.rss#", "media" . ($curPage - 1) . ".rss", $prevPage);
          }
        }

        $multiPage = &lt;&lt;&lt;MULTIPAGE
    &lt;atom:link rel="previous" href="$prevPage" /&gt;
    &lt;atom:link rel="next" href="$nextPage" /&gt;
MULTIPAGE;
      }</pre>
<p></code>
</li>
<li>Since we&#8217;re using ATOM, we need to tell setup the XML namespace in our response.<br />
<code><br />
  if (isset($this->_properties['useMedia']) &#038;&#038; $this->_properties['useMedia'] == 1) {<br />
    $data = '<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/" xmlns:atom="http://www.w3.org/2005/Atom">';<br />
  }<br />
</code>
</li>
<li>Finally, we add the links into the response right after the link tag.<br />
<code><br />
         '
<link>' . $this->_properties['link'] . '</link>' . $lf .<br />
          $multiPage . $lf .<br />
          '<description>' .<br />
</code></p>
<li>All this, but we&#8217;re not handling the pages correctly during the request.  What we&#8217;re missing is the ability to control where the slice happens.  Open up Render.inc in the /modules/rss/ directory and find where <code>$generator->sliceItems($count);</code> is being called.  We have already changed RssHelper::getFeed to handle the SQL offset, all we need is to set the &#8216;offset&#8217; variable.<br />
<code>
<pre>
    if (isset($params['page']) &#038;&#038; $params['page'] > 1) {
        $start = ($params['page'] - 1) * $count;
    } else {
        $start = 0;
    }
    $params['count'] = $count;
    $params['offset'] = $start;

    $generator = new RssGenerator();
</pre>
<p></code>
</li>
</ol>
<h2>Pretty SEO URLs</h2>
<p>We want to present easy to understand URLs to any spider.  Instead of /main.php?g2_view=rss.MediaRss&#038;g2_itemId=xxxx&#8230;.., let&#8217;s do something like the /v/album1/subAlbum/ style URL.  Of course, the Cooliris embed wall only seems to like urls that end in .rss which means we MUST do this step.</p>
<p>If we take a look at the existing rewrite rule for Paths, we can just modify their scheme to fit our needs.<br />
<code><br />
        RewriteCond %{THE_REQUEST} /gallery/v/([^?]+)(\?.|\ .)<br />
        RewriteCond %{REQUEST_URI} !/gallery/main\.php$<br />
        RewriteRule .   /gallery/main.php?g2_path=%1   [QSA,L]<br />
</code><br />
Now it look simply like everything after /gallery/v/ and before query parameters is dumped into a g2_path variable.  We need the same thing except we must also check the page that we are on.  I settled on a URL like:<br />
<code>/gallery/m/album_path_info/media2.rss</code><br />
Here, we use the same path method that View does and we have additional page information after media.  Our rewrite rule would look something like:<br />
<code><br />
        RewriteCond %{REQUEST_URI} /gallery/m/([^?]+)/media(\d*).rss<br />
        RewriteRule .   /gallery/main.php?g2_view=rss.MediaRss&#038;g2_path=%1&#038;g2_page=%2   [QSA,L]<br />
</code></p>
<p>That&#8217;s pretty much it.  We can now access any of our albums with a media.rss feed that allows pagination and viewing in Cooliris&#8217;s Embed Wall.</p>
<p>For future enhancements, it should be possible to hook up the album navigation thru Javascript and have a seamless interface suitable for a Gallery2 Theme.</p>
<p>Maybe I&#8217;ll do that for fun next weekend.<br />
-Huey</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thehuey.com/blog/2009/03/08/gallery2-media-rss-patch-for-cooliris-embed-wall/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Why you should buy stock of failing or bankrupt companies</title>
		<link>http://www.thehuey.com/blog/2008/10/07/why-you-should-buy-stock-of-failing-bankrupt-companies/</link>
		<comments>http://www.thehuey.com/blog/2008/10/07/why-you-should-buy-stock-of-failing-bankrupt-companies/#comments</comments>
		<pubDate>Tue, 07 Oct 2008 16:29:52 +0000</pubDate>
		<dc:creator>huey</dc:creator>
				<category><![CDATA[Investing & Finance]]></category>

		<guid isPermaLink="false">http://www.thehuey.com/blog/?p=49</guid>
		<description><![CDATA[The current dislocation in the market has placed some pretty funny values on companies.  Looking at two in particular (disclosure: I own shares in both), Circuit City (CC) and General Growth Properties (GGP), we can see that they are facing cash flow problems and issues with refinancing debt.  Definitely things to be concerned [...]]]></description>
			<content:encoded><![CDATA[<p>The current dislocation in the market has placed some pretty funny values on companies.  Looking at two in particular (disclosure: I own shares in both), Circuit City (<a href="http://finance.google.com/finance?q=NYSE:cc">CC</a>) and General Growth Properties (<a href="http://finance.google.com/finance?q=NYSE:GGP">GGP</a>), we can see that they are facing cash flow problems and issues with refinancing debt.  Definitely things to be concerned about, but the values placed on them value them at 0.07X book value and 0.36X book value respectively.</p>
<p>Which means, if the two companies declare bankruptcy and were liquidated (isn&#8217;t this the worst case senario?), shareholders would get over 10X and 2.8X their cost of shares at current prices of $0.50 (CC) and $4.20 (GGP).  Assuming the companies lose some more money, shareholders would still reap a tidy profit in a liquidation.</p>
<p>Circuit City: Estimated quarterly loss $170MM this quarter.  Reducing their book value from ~ $1.2B to ~$1.0B leaving a Price to Book ratio of 0.08X.  Put another way, you can buy 100% of CC stock and control the company with ~$85MM and control over $960MM of commercial real estate.  I can&#8217;t imagine what is causing such a tremendous discrepancy between value and price, but I&#8217;m going to be happily buying down to $0.01/share.  </p>
<p>GGP: Same story.  Their assets are over $2B greater than their liabilities.  Current price action values the company at $1.12B making it pretty undervalued as well.</p>
<p>What&#8217;s causing all this?  My guess is the many smaller hedge funds and other institutional holders are facing extraordinary redemption requests and are being forced to sell their holdings.  This could only go on for so long, but until investors are able (willing?) to stomach the discomfort, we may see these and other distressed companies at firesale prices.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thehuey.com/blog/2008/10/07/why-you-should-buy-stock-of-failing-bankrupt-companies/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>NYT Double-click annoyance</title>
		<link>http://www.thehuey.com/blog/2008/09/02/nyt-double-click-annoyance/</link>
		<comments>http://www.thehuey.com/blog/2008/09/02/nyt-double-click-annoyance/#comments</comments>
		<pubDate>Tue, 02 Sep 2008 16:49:26 +0000</pubDate>
		<dc:creator>huey</dc:creator>
				<category><![CDATA[General Posts]]></category>
		<category><![CDATA[new york times annoyance]]></category>

		<guid isPermaLink="false">http://www.thehuey.com/blog/?p=47</guid>
		<description><![CDATA[Dear NYT,
I thank you for making your excellent articles available for free and I get a majority of my news from you.  I don&#8217;t even mind paying a bit for archived articles.  However, in your eagerness to boost pageviews and revenue, you created a bastard child called altClickSearch.js.  This little bugger has [...]]]></description>
			<content:encoded><![CDATA[<p>Dear NYT,</p>
<p>I thank you for making your excellent articles available for free and I get a majority of my news from you.  I don&#8217;t even mind paying a bit for archived articles.  However, in your eagerness to boost pageviews and revenue, you created a bastard child called altClickSearch.js.  This little bugger has caused me untold grief as I like to highlight as I read, double-clicking becomes an instinctual action.  I can&#8217;t deal with the pop-ups that even Firefox 3 won&#8217;t block.</p>
<p>As I write this, I would like to put a little more room between us.  I feel smothered with your constant attention to what I highlight.  My other friend Greasemonkey has shown me a wonderful relationship modifier that is allowing me to proceed with my sanity intact, appropriately called &#8220;New York Times (NYT) Sanity&#8221;.</p>
<p>Thanks and please keep up the excellent articles.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thehuey.com/blog/2008/09/02/nyt-double-click-annoyance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend Layout and Navigation</title>
		<link>http://www.thehuey.com/blog/2008/04/01/zend-layout-and-navigation/</link>
		<comments>http://www.thehuey.com/blog/2008/04/01/zend-layout-and-navigation/#comments</comments>
		<pubDate>Wed, 02 Apr 2008 06:56:20 +0000</pubDate>
		<dc:creator>huey</dc:creator>
				<category><![CDATA[Technical Musings]]></category>

		<guid isPermaLink="false">http://www.thehuey.com/blog/archives/44</guid>
		<description><![CDATA[I&#8217;m not sure how everyone else is using Zend_Layout, but I&#8217;m doing the following to render my navigation and footer links.  It&#8217;s not the most DRY code, but works until I learn more about the framework.
In my Action file, I add actions to the stack for nav, footer, etc.

class IndexController extends ....
{
  function [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m not sure how everyone else is using Zend_Layout, but I&#8217;m doing the following to render my navigation and footer links.  It&#8217;s not the most DRY code, but works until I learn more about the framework.</p>
<p>In my Action file, I add actions to the stack for nav, footer, <span id="more-44"></span>etc.<br />
<code><br />
class IndexController extends ....<br />
{<br />
  function indexAction()<br />
  {<br />
      $this->_helper->actionStack('main', 'nav', 'default');<br />
      $this->_helper->actionStack('footer', 'nav', 'default');<br />
      $this->_helper->actionStack('right', 'nav', 'default');<br />
     /* other stuff */<br />
  }<br />
}<br />
</code></p>
<p>Then I have a NavController that simply calls setResponseSegment or renderScript to set the named variables.</p>
<p><code><br />
class NavController ..<br />
{<br />
  function footerAction()<br />
  {<br />
     /* Stuff to display */<br />
    $this->renderScript('nav/footer.phtml', 'nav');<br />
    // Or I could use<br />
    // $this->_helper->viewRenderer->setResponseSegment('nav');<br />
  }<br />
}<br />
</code></p>
<p>This allows me to finally use the nav variable in my layout file<br />
layout/default.phtml<br />
<code><br />
echo $this->layout()->nav;<br />
</code><br />
Simple eh?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thehuey.com/blog/2008/04/01/zend-layout-and-navigation/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Zend Framework 1.5.1 and my Models code</title>
		<link>http://www.thehuey.com/blog/2008/04/01/zend-framework-151-and-my-models-code/</link>
		<comments>http://www.thehuey.com/blog/2008/04/01/zend-framework-151-and-my-models-code/#comments</comments>
		<pubDate>Tue, 01 Apr 2008 22:25:02 +0000</pubDate>
		<dc:creator>huey</dc:creator>
				<category><![CDATA[Technical Musings]]></category>

		<guid isPermaLink="false">http://www.thehuey.com/blog/archives/43</guid>
		<description><![CDATA[Someone asked how I get a db connection in my models using ZF1.5.1
Basically I have a ConfigDB singleton pattern that gets one db connection, then sets the default adapter so when I extend the Zend_DB_Table_Abstract class, the default connection gets carried around.
class ConfigDB {
  static private $instance;
  private function __construct() {
  }
 [...]]]></description>
			<content:encoded><![CDATA[<p>Someone asked how I get a db connection in my models using ZF1.5.1</p>
<p>Basically I have a ConfigDB singleton pattern that gets one db connection, then sets the default adapter so when I extend the Zend_DB_Table_Abstract class, the default connection gets carried around.</p>
<p><code>class ConfigDB {<br />
  static private $instance;<br />
  private function __construct() {<br />
  }<br />
  public static function getInstance() {<br />
    if (!ConfigDB::$instance) {<br />
      $params = array(<br />
/* redacted */<br />
      );<br />
      ConfigDB::$instance = Zend_Db::factory('Mysqli', $params);<br />
      Zend_Db_Table_Abstract::setDefaultAdapter(ConfigDB::$instance);<br />
    }<br />
    return ConfigDB::$instance;<br />
  }<br />
  public static function selectDb($db) {<br />
    return ConfigDB::$instance->getConnection()->select_db($db);<br />
  }<br />
}<br />
ConfigDB::getInstance();<br />
</code><br />
That grabs the connection and sets the default adapter.  So in my model class I can do:<br />
<code>class Country extends Zend_Db_Table_Abstract {<br />
 protected $_name = 'countries';<br />
 protected $_primary = 'country_id';<br />
 function __construct($country = 1, $abbr = '')<br />
 {<br />
  parent::__construct();<br />
 }<br />
}</code></p>
<p>That&#8217;s it</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thehuey.com/blog/2008/04/01/zend-framework-151-and-my-models-code/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Baby Kaylan has arrived!</title>
		<link>http://www.thehuey.com/blog/2008/02/28/baby-kaylan-has-arrived/</link>
		<comments>http://www.thehuey.com/blog/2008/02/28/baby-kaylan-has-arrived/#comments</comments>
		<pubDate>Thu, 28 Feb 2008 17:05:27 +0000</pubDate>
		<dc:creator>huey</dc:creator>
				<category><![CDATA[Baby News]]></category>

		<guid isPermaLink="false">http://www.thehuey.com/blog/archives/42</guid>
		<description><![CDATA[ I&#8217;ve finally gotten the time to put up pictures of our newest addition, Kaylan.  She arrived Feb. 25th at 9:36AM weighing in just under 8 lbs and measuring 19 inches long.  A little bit under her sister Audrey&#8217;s weight and length, Kaylan came out very angry and hungry.  You see, we [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.thehuey.com/imgs/blog/BirthAnnounce.jpg" alt="Baby Kaylan Hu" /> I&#8217;ve finally gotten the time to put up pictures of our newest addition, Kaylan.  She arrived Feb. 25th at 9:36AM weighing in just under 8 lbs and measuring 19 inches long.  A little bit under her sister Audrey&#8217;s weight and length, Kaylan came out very angry and hungry.  You see, we interrupted her beauty sleep and she wasn&#8217;t quite ready to meet us yet.  Mommy Yun is doing very well.  This time we skipped the long labor part and went with a scheduled C-section so Mom is recovering much faster.  They were doing some pain study at Stanford Hospital so Mommy had a local anesthetic delivery system for the incision.  This reduced the pain quite a bit for the 2 days it was in and if your insurance pays for it, I&#8217;d highly recommend it.  It reduces the side effects of pain pills and IV injections because the medication is delivered straight to the surgery site.</p>
<p>Kaylan is getting in a regular schedule now of crying every two hours, being fed, then sleeping until the next cycle.  Great things come in small packages, unless of course it comes in a disposable diaper.  Once you get used to the lack of sleep and the fatigue, babies are truly wonderful.  Every little tot is a gift to be treasured.  Their smiles, cries, and every little movement is something to be remembered.  They are growing every day and the challenges of parenting change along with them.  Mommy and I are both looking forward to helping our little bit of heaven grow into a beautiful little angel.</p>
<p>-Mom and Dad</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thehuey.com/blog/2008/02/28/baby-kaylan-has-arrived/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Business Intelligence Software &#8211; What&#8217;s your favorite?</title>
		<link>http://www.thehuey.com/blog/2007/11/16/business-intelligence-whats-your-favorite/</link>
		<comments>http://www.thehuey.com/blog/2007/11/16/business-intelligence-whats-your-favorite/#comments</comments>
		<pubDate>Sat, 17 Nov 2007 01:18:45 +0000</pubDate>
		<dc:creator>huey</dc:creator>
				<category><![CDATA[Business Intelligence]]></category>

		<guid isPermaLink="false">http://www.thehuey.com/blog/archives/40</guid>
		<description><![CDATA[I&#8217;ve been tasked recently with investigating business intelligence tools for our company.  Every business has metrics and trends that they need to keep a good pulse on. Sometimes the things to measure are easy to define, and sometimes no one knows what they are looking for.
There are plenty of offerings out there. Most notably [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been tasked recently with investigating business intelligence tools for our company.  Every business has metrics and trends that they need to keep a good pulse on. Sometimes the things to measure are easy to define, and sometimes no one knows what they are looking for.</p>
<p>There are plenty of offerings out there. Most notably <a href="http://www.microstrat.com/" rel="nofollow">MicroStrategies</a>, <a href="http://www.oracle.com/" rel="nofollow">Oracle</a>, <a href="http://www.sap.com" rel="nofollow">SAP</a>, and more.  Of course most of the ones I just listed are simply not cost feasible for a small company to explore. To pay to play, it&#8217;s easy to lay out over $100K just to get something basic.  Of course my budget was much much smaller than that so my boss pointed me towards an open source project called <a href="http://www.pentaho.org/">Pentaho</a> and I have been steeped in it for the past month.</p>
<p>The <a href="http://community.pentaho.com/index.php">documentation for Pentaho</a> is pretty comprehensive if you are educated in the technologies involved.  But for me, I had to get familiar with quite a few things before getting to do something useful.</p>
<p>Over the next few weeks, I will post up progress and some small tutorials to help someone new get started with the world of Pentaho.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thehuey.com/blog/2007/11/16/business-intelligence-whats-your-favorite/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Sudoku, Fad or Fun?</title>
		<link>http://www.thehuey.com/blog/2007/08/02/sudoku-fad-or-fun/</link>
		<comments>http://www.thehuey.com/blog/2007/08/02/sudoku-fad-or-fun/#comments</comments>
		<pubDate>Fri, 03 Aug 2007 07:09:38 +0000</pubDate>
		<dc:creator>huey</dc:creator>
				<category><![CDATA[General Posts]]></category>

		<guid isPermaLink="false">http://www.thehuey.com/blog/archives/38</guid>
		<description><![CDATA[It&#8217;s been more than 2 years since the number game sudoku started spreading internationally.  During that time, it has popped up in many daily publications and numerous websites have created their own dedications to the game.  A subset of latin squares (or magic squares), it is logic based and purports to help sharpen [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been more than 2 years since the number game sudoku started spreading internationally.  During that time, it has popped up in many daily publications and numerous websites have created their own dedications to the game.  A subset of latin squares (or magic squares), it is logic based and purports to help sharpen one&#8217;s mind.  Nintendo has used it (very successfully) to market their DS game platform [<asin>B000EGELP0</asin>]. Palm also has multiple publishers of sudoku games.  My question is &#8220;How long will people play Sudoku?&#8221;</p>
<p>When I first found the game, it was <a href="http://www.websudoku.com" rel="nofollow noindex">Websudoku.com</a> that provided an easy and addictive introduction to the game.  I spent numerous free hours trying to improve my solving skills.  However, after writing a javascript sudoku solver in 2006, I&#8217;ve found that only very occasionally will I even think about it anymore.  Is this common?  How many of you are/were addicted to sudoku?</p>
<p>Seems like I can&#8217;t even goto the grocery store anymore without having sudoku puzzle books taking up valuable checkout line shelf space. Unlike crossword puzzles, sudoku does not expand your vocabulary.  It also doesn&#8217;t help with making word associations and re-enforce current events. Is it just the biggest productivity sapper ever created?</p>
<p>Well, for me anyway, it&#8217;s helped me polish up some javascript coding. I recently finished revamping my solver to allow actual game play. Still needs some more TLC and some sticky features, but some features are fairly unique to the online sudoku games.  For instance, my implementation allows you to take a snapshot of your work so you can go back if it gets hopelessly messy. I should allow you to save the progress and come back, but that&#8217;s for a future release. My <a href="http://www.numbercrazy.com/">best Sudoku puzzle game</a> can be found at http://www.numbercrazy.com/.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thehuey.com/blog/2007/08/02/sudoku-fad-or-fun/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
