<?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>VerySimple</title>
	<atom:link href="http://verysimple.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://verysimple.com</link>
	<description>Custom Software Development</description>
	<lastBuildDate>Wed, 18 Aug 2010 23:16:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>HungryFEED RSS Plugin for WordPress</title>
		<link>http://verysimple.com/2010/07/22/hungryfeed-rss-plugin-for-wordpress/</link>
		<comments>http://verysimple.com/2010/07/22/hungryfeed-rss-plugin-for-wordpress/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 05:53:35 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://verysimple.com/?p=702</guid>
		<description><![CDATA[I decided to delve into the world of WordPress plugin development this week.  I&#8217;m a contributor to a site for film camera gear and we have a page that lists equipment for sale.  We wanted to pull in an RSS feed from eBay and display it on a page.  There seems to be a WordPress [...]]]></description>
			<content:encoded><![CDATA[<p>I decided to delve into the world of WordPress plugin development this week.  I&#8217;m a contributor to a site for film camera gear and we have a page that lists equipment for sale.  We wanted to pull in an RSS feed from eBay and display it on a page.  There seems to be a WordPress plugin for anything, but I was surprised that I couldn&#8217;t find one that worked the way I liked.  Anyway, two hours later and I had managed to write my own.  Without further ado, here&#8217;s <strong><a href="/products/hungryfeed/">HungryFEED</a></strong>.</p>
<p>I&#8217;m really impressed with the WordPress plugin API and distribution system.  It&#8217;s well organized with great documentation.  I was psyched to see the little &#8220;upgrade available&#8221; button next to my own plugin once I published it to the <a href="http://wordpress.org/extend/plugins/">WordPress plugin directory</a>!  Even though I prefer object-oriented code, I have to admit the procedural style of WordPress code is consistent and easy to follow.</p>
<p>In the process I also had get my hands dirty with <a href="http://simplepie.org/">SimplePie</a> RSS library that WordPress uses.  It does a nice job of parsing all kinds of RSS but I found it a bit difficult to debug feed errors.  Its also a little touchy with eBay feeds and there seems to be some glitches using set_feed_url(), so I would up accessing feed_url directly, which doesn&#8217;t seem right.  But it works so it&#8217;ll have to do for now.</p>
<p>If you give the plugin a try, feel free to leave a comment on directly the HungryFEED page.</p>
]]></content:encoded>
			<wfw:commentRss>http://verysimple.com/2010/07/22/hungryfeed-rss-plugin-for-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Phreeze Running as a Joomla Component</title>
		<link>http://verysimple.com/2010/07/10/phreeze-running-as-a-joomla-component/</link>
		<comments>http://verysimple.com/2010/07/10/phreeze-running-as-a-joomla-component/#comments</comments>
		<pubDate>Sat, 10 Jul 2010 05:37:39 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Digital Life]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://verysimple.com/?p=579</guid>
		<description><![CDATA[Our company has decided on Joomla to manage our primary website, however we&#8217;ve been writing code using our own Phreeze framework for several years and have a lot of time invested in these applications.  We&#8217;re now trying to integrate all of our web properties and provide single sign-on, which is a challenging task.  It occurred [...]]]></description>
			<content:encoded><![CDATA[<p>Our company has decided on <a href="http://www.joomla.org/" target="_blank">Joomla</a> to manage our primary website, however we&#8217;ve been writing code using our own <a href="http://www.phreeze.com" target="_blank">Phreeze</a> framework for several years and have a lot of time invested in these applications.  We&#8217;re now trying to integrate all of our web properties and provide single sign-on, which is a challenging task.  It occurred to me that we might be able to run our Phreeze applications as a plugin within the Joomla framework to avoid having to re-write a lot of code.</p>
<p><span id="more-579"></span><a href="http://verysimple.com/wp-content/uploads/2010/07/poc.png" rel="shadowbox[post-579];player=img;" title="Proof of Concept"><img class="alignright size-medium wp-image-580" title="Proof of Concept" src="http://verysimple.com/wp-content/uploads/2010/07/poc-300x242.png" alt="" width="300" height="242" /></a>The solution so far is to write a custom authentication plugin plus a component for Joomla.  The plugin handles sign-on and the component allows us to render basically anything within the content area of the Joomla site.  I was able to get proof-of-concept running today and not only does the Phreeze code render correctly inside the Joomla system, it wasn&#8217;t even necessary to merge the Phreeze code, it runs just fine with the source code in a separate folder from Joomla.  The component just has to do a little magic and configure some paths to make Phreeze happy.</p>
<p>This seems to be one of those rare moments where strict coding practices actually pays off.  I designed Phreeze to be an extremely modular MVC / ORM with the idea that we might one day use another rendering engine, or switch data engines.  We&#8217;re even in the process of swapping out direct database connection with REST services with no change to the views, which will be exciting.  Dependency injection is used for all the various parts so you can swap anything.  But I hadn&#8217;t really considered running the entire framework within another system.  So I was somewhat surprised when the code just ran with almost no configuration.</p>
<p>The biggest problem is with relative URLs.  Joomla I must say is pretty great about passing control to a component and then staying out of the way, even if you throw lots of weird querystring parameters on the end of the URL.  However, the relative paths to scripts, styles, images, etc are proving to be problematic.</p>
<p>I haven&#8217;t decided on the best approach yet but I&#8217;m considering simply writing new Views for Joomla.  This allows us to re-use all of our Model and Controller code.  I&#8217;d prefer to just use everything exactly as-is in each application but in some ways it might make more sense for the apps to render themselves differently when inside the Joomla system vs when running stand-alone.</p>
<p>Phreeze has a URL writer class which does help to solve the relative URL problem, however we didn&#8217;t use it consistently in all the views and so there is some cleanup to do.  Also this class isn&#8217;t accessible from within static JavaScript code, so that might get messy with some of the more advanced pages that make a lot of Ajax calls.</p>
<p>This is possibly my nerdiest post ever but it&#8217;s exciting to spend so much effort at writing adaptable code and then finally the day comes where you get to see it work in a totally unexpected way.</p>
]]></content:encoded>
			<wfw:commentRss>http://verysimple.com/2010/07/10/phreeze-running-as-a-joomla-component/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install WordPress 3 with Multiple TLDs</title>
		<link>http://verysimple.com/2010/07/09/install-wordpress-3-with-multiple-tlds/</link>
		<comments>http://verysimple.com/2010/07/09/install-wordpress-3-with-multiple-tlds/#comments</comments>
		<pubDate>Fri, 09 Jul 2010 05:27:12 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://verysimple.com/?p=560</guid>
		<description><![CDATA[WordPress 3 now includes the features that were previously available as WordPress MU.  &#8220;MU&#8221; stands for Multi-User (or Multi-Site) and this lets you to run multiple blogs all from a single WordPress installation.  This walk-through will help you configure WordPress to manage multiple sites, each with their own top-level domain (TLD). As you go through [...]]]></description>
			<content:encoded><![CDATA[<p>WordPress 3 now includes the features that were previously available as WordPress MU.  &#8220;MU&#8221; stands for Multi-User (or Multi-Site) and this lets you to run multiple blogs all from a single WordPress installation.  This walk-through will help you configure WordPress to manage multiple sites, each with their own top-level domain (TLD).</p>
<p>As you go through this walk-through, it helps to understand that WordPress MU was originally designed to create a branded, automated community of blogs using <strong>sub-domains</strong> such as user1.wordpress.com, user2.wordpress.com, etc.  You can sign up on wordpress.com right now and get your own instant blog, hosted on their servers.  You become a part of the wordpress.com community.  WordPress MU was designed to allow you to create your own communities under your own domain name branding.</p>
<p>This walk-through addresses a slightly different type of user which is perhaps a server admin or simply a person who runs several blogs.  There is no &#8220;community&#8221; and you don&#8217;t allow anonymous users to stop by and create a blog.  You might currently have WordPress installations on multiple servers with totally unrelated domains.  Keeping the code and plugins updated for multiple blogs gets to be a hassle, so the idea of a single, centralized WordPress install is appealing for maintenance reasons.  Thanks to WordPress&#8217;s flexible architecture you can do this, but it&#8217;s not part of the original design.</p>
<p>The reason I write all of this is to hopefully explain why TLDs are outside the scope of  WordPress&#8217;s original design.  You can still set it up without understanding any of this, however it will make things easier if you know how the pieces fit together.</p>
<p><span id="more-560"></span></p>
<h2>Requirements</h2>
<p>To keep this simple I&#8217;m only going to write about the multi-site configuration.  I&#8217;m assuming you know how to install WordPress, edit config files on your server, create a MySQL database on your host and map sub-domains.  These things may be done differently depending on your host so you will need to do the research for your own host server.  If you run your own server you may have to know how to configure it for multiple domains as well.</p>
<h2>DNS Configuration</h2>
<p>Again, I&#8217;m not going to get into DNS configuration.  However, I will say that a simple setup is to simply point all of your domains to the same IP address and let WordPress do the rest.  You can also assign one domain an IP and then park each additional domain onto this one, which may save hosting fees.  WordPress relies on the hostname, so it doesn&#8217;t matter how you&#8217;ve configured Apache or IP addresses, so long as the domain maps to the physical location of your WordPress install.</p>
<p><em>As a handy tip &#8211; you can edit your local hosts  file to point a domain to the IP of your WordPress installation and WordPress will install easily this  way.  This is a great way to experiment and migrate over an existing site without taking the domain name offline.  If you don&#8217;t understand what this means, then don&#8217;t worry about  it!</em></p>
<h2>1. Install WordPress</h2>
<p>Install using all defaults is fine.  You should install this onto the domain that you plan to use as your &#8220;master&#8221; domain.  My recommendation is to install it at the top level of your domain, for example &#8220;domain.com&#8221; (without the &#8220;www&#8221; prefix).  If you plan to use sub-domains for different sites then this will keep things simple.  You can always add &#8220;www&#8221; during site configuration, but you can&#8217;t remove it from your sub-domain sites if it was installed that way.  For example your sites will look like this: site1.www.domain.com  instead of simply site1.domain.com.</p>
<p>Verify that WordPress is running but don&#8217;t bother putting any content in at this point.  In the next few steps we&#8217;re going to enable new menu items one after the next that are necessary to use the multi-site feature.</p>
<h2>2.Enable the WordPress Multi-Site Feature</h2>
<p><a href="http://verysimple.com/wp-content/uploads/2010/07/ss1.png" rel="shadowbox[post-560];player=img;" title="ss1"><img class="alignright size-full wp-image-561" title="ss1" src="http://verysimple.com/wp-content/uploads/2010/07/ss1.png" alt="" width="160" height="139" /></a>Assuming WordPress is running, edit <strong>wp-config.php</strong> and add the following line:</p>
<p>define(&#8216;WP_ALLOW_MULTISITE&#8217;, true);</p>
<p>After you add this line and save the file, return to the Worpress Admin page and look for a new menu item <strong>Tools-&gt;Network</strong>.  Navigate to this new menu and you&#8217;ll be prompted to &#8220;Create a Network&#8221; in order to enable the multi-site feature.</p>
<p>You have some choices as to whether you want to use sub-domains or sub-folders for your network.  Leave all the defaults and choose sub-domains.  We&#8217;re going to be using separate TLDs anyway so choosing sub-domains seems to make more sense to me.  If you choose folders, you&#8217;ll be on your own from this point forward.</p>
<p><a href="http://verysimple.com/wp-content/uploads/2010/07/ss2.png" rel="shadowbox[post-560];player=img;" title="ss2"><img class="alignright size-full wp-image-562" title="ss2" src="http://verysimple.com/wp-content/uploads/2010/07/ss2.png" alt="" width="158" height="104" /></a>Once you enable the network, you will be given text that you must copy and paste into an <strong>.htaccess</strong> file and some additional variables to be pasted into <strong>wp-config.php</strong>.  Do this as directed on the Network page.</p>
<p>After you edit these files and re-login you should see another new menu &#8220;<strong>Super Admin</strong>&#8221; which is above the dashboard menu.  Your site is now ready for multiple sites.</p>
<h2>3. Install Plugin WordPress MU Domain Mapping</h2>
<p>At this point your server is already setup to handle multiple sites, but we need to install a plugin in order to support TLDs.  The plugin to use is called &#8220;<a href="http://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/">wordpress-mu-domain-mapping</a>&#8220;  This plugin also includes a special file known as a &#8220;drop-in&#8221; which must be manually copied and hooks into the lower levels of the WordPress API.</p>
<p>You can install this plugin by manually uploading it, or through &#8220;Plugins-&gt;Add New.&#8221;  Just make sure<br />
you install version .052 or higher.   After you have installed it, go ahead and activate the plugin.  You&#8217;ll notice that plugins now have an option to &#8220;<strong>Network Activate</strong>&#8221; which activates a plugin for all sites.</p>
<p><a href="http://verysimple.com/wp-content/uploads/2010/07/ss3.png" rel="shadowbox[post-560];player=img;" title="ss3"><img class="alignright size-full wp-image-563" title="ss3" src="http://verysimple.com/wp-content/uploads/2010/07/ss3.png" alt="" width="157" height="221" /></a>Once the plugin is installed, you need to manually install the Sunrise &#8220;drop-in&#8221;  which is included with the plugin source files.  You may either copy <strong>sunrise.php</strong> from <strong>/</strong><strong>wp-content/</strong><strong>plugins/wordpress-mu-domain-mapping/</strong> to <strong>/wp-content/</strong> or if you prefer  you can create a symbolic link (for example <em>ln -s plugins/wordpress-mu-domain-mapping/sunrise.php</em>.  I prefer the link myself).</p>
<p>Once you&#8217;ve copied or linked the file, you have to edit <strong>wp-config.php</strong> one last time and add the following line which will tell WordPress to activate the drop-in:</p>
<p>define(  &#8216;SUNRISE&#8217;, &#8216;on&#8217; );</p>
<p>Once you re-load the console you&#8217;ll once again have some new menu items.  This time they appear under the Super Admin menu and they are <strong>Domain Mapping</strong> and <strong>Domains</strong>.  The Domain Mapping has some settings that don&#8217;t actually need to be changed.  The Domains page is where we&#8217;ll map TLDs to a site (in the next step).</p>
<h2>4. Create a Second Site</h2>
<p>At this point your server is fully ready to support TLD sites, you just need to know how to add them.  The basic concept is that you create a site first using WordPress&#8217;s normal functionality.  Then you using the domain mapping plugin to map the TLD to the new site based on it&#8217;s Id.  Because WordPress doesn&#8217;t yet natively support TLDs, you have to do a little fudging with the forms.</p>
<p>First, under <strong>Super Admin</strong> go to the <strong>Sites</strong> page.  You&#8217;ll be confused because you have to choose a sub-domain for your site, even though we&#8217;re going to use a TLD.  That&#8217;s ok, just enter whatever you want as the sub-domain and add the site.</p>
<p>Now that you&#8217;ve added the site, you can click &#8220;Edit&#8221; under the new site and this will bring up a long page with lots of settings.  Don&#8217;t worry about changing everything right now but you do want to change these two fields: <strong>Domain</strong> and <strong>Fileupload URL</strong>.  These need to be changed to your new TLD:</p>
<p><a href="http://verysimple.com/wp-content/uploads/2010/07/ss5.png" rel="shadowbox[post-560];player=img;" title="ss5"><img class="alignnone size-thumbnail wp-image-565" title="ss5" src="http://verysimple.com/wp-content/uploads/2010/07/ss5-150x72.png" alt="" width="150" height="72" /></a> <a href="http://verysimple.com/wp-content/uploads/2010/07/ss6.png" rel="shadowbox[post-560];player=img;" title="ss6"><img class="alignnone size-thumbnail wp-image-566" title="ss6" src="http://verysimple.com/wp-content/uploads/2010/07/ss6-150x150.png" alt="" width="72" height="72" /></a> <a href="http://verysimple.com/wp-content/uploads/2010/07/ss7.png" rel="shadowbox[post-560];player=img;" title="ss7"><img class="alignnone size-medium wp-image-567" title="ss7" src="http://verysimple.com/wp-content/uploads/2010/07/ss7-300x38.png" alt="" width="240" height="30" /></a></p>
<p>At some point once WordPress natively supports TLDs you would probably be done at this point.  In fact you will be able to visit your new site if your domain is already configured, but you won&#8217;t be able to log into the admin panel for the site.  So we need to map the domain over to the new site.</p>
<p><em>Before you leave the Sites page, make a note of the ID of your new site.  (In the screenshot above, my site &#8220;whatever&#8221; has the ID of &#8220;8&#8243;).  If it&#8217;s a new install, then your ID will probably be &#8220;2&#8243;.</em></p>
<p><a href="http://verysimple.com/wp-content/uploads/2010/07/ss8.png" rel="shadowbox[post-560];player=img;" title="ss8"><img class="alignright size-medium wp-image-568" title="ss8" src="http://verysimple.com/wp-content/uploads/2010/07/ss8-300x141.png" alt="" width="180" height="85" /></a>Head to the <strong>Super Admin -&gt; Domains</strong> page and there is a form at the bottom to add a new Domain.  Leave the Primary checkbox checked.  Enter your site ID from above and the domain.  Click Save to add the mapping.</p>
<p>At this point you&#8217;re done and you should be able visit your site using your TLD as well as login to the admin panel.  I hope this tutorial worked for you and helped you to understand how WordPress MU feature works as well as some of it&#8217;s current shortcomings.</p>
<p>Please leave a comment if you have any suggestions to make this walk-through easier.</p>
]]></content:encoded>
			<wfw:commentRss>http://verysimple.com/2010/07/09/install-wordpress-3-with-multiple-tlds/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Forcing a Flex VBox to scroll when necessary</title>
		<link>http://verysimple.com/2010/06/16/forcing-a-flex-vbox-to-scroll-when-necessary/</link>
		<comments>http://verysimple.com/2010/06/16/forcing-a-flex-vbox-to-scroll-when-necessary/#comments</comments>
		<pubDate>Wed, 16 Jun 2010 13:07:12 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.verysimple.com/blog/?p=552</guid>
		<description><![CDATA[The VBox Flex container allows you to stack objects vertically.  If your VBox can have an unknown number of children and your app is not a fixed height, a weird behavior can occur where the VBox height expands beyond the height of it&#8217;s parent.  This usually causes scroll-bars to appear in unexpected places and possibly [...]]]></description>
			<content:encoded><![CDATA[<p>The VBox Flex container allows you to stack objects vertically.  If your VBox can have an unknown number of children and your app is not a fixed height, a weird behavior can occur where the VBox height expands beyond the height of it&#8217;s parent.  This usually causes scroll-bars to appear in unexpected places and possibly messes up your application layout.  Fixing this can be a nightmare of chasing down parent containers and trying to control their clipping.</p>
<p>Fortunately there&#8217;s a simple solution . Just set  <strong>minHeight=&#8221;0&#8243;</strong> and it will tell the component to not expand beyond the height of it&#8217;s Parent.  This works for any container with a vertical layout as well including  Panels</p>
<p>There&#8217;s additionally an <strong>autoLayout</strong> property which can be set to false, however I can&#8217;t get consistent results with that.  It seems like there would be some more intuitive property name to control this behavior, but at least there is a solution.</p>
]]></content:encoded>
			<wfw:commentRss>http://verysimple.com/2010/06/16/forcing-a-flex-vbox-to-scroll-when-necessary/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Adding and Removing Children from a Flex XMLList</title>
		<link>http://verysimple.com/2010/03/22/adding-and-removing-children-from-a-flex-xmllist/</link>
		<comments>http://verysimple.com/2010/03/22/adding-and-removing-children-from-a-flex-xmllist/#comments</comments>
		<pubDate>Mon, 22 Mar 2010 05:21:20 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[actionscript]]></category>

		<guid isPermaLink="false">http://www.verysimple.com/blog/?p=527</guid>
		<description><![CDATA[I seem to always forget how this is done and for whatever reason there&#8217;s a lot of posts floating around with confusing information.  The XMLList doesn&#8217;t have any methods for adding and removing items, or even obtaining items at a specific index.  Adding and removing children from an XMLList in Flex is actually simple, though. [...]]]></description>
			<content:encoded><![CDATA[<p>I seem to always forget how this is done and for whatever reason there&#8217;s a lot of posts floating around with confusing information.  The XMLList doesn&#8217;t have any methods for adding and removing items, or even obtaining items at a specific index.  Adding and removing children from an XMLList in Flex is actually simple, though.   The XMLList can be treated as if it were an Array.</p>
<pre>
// create an XML object with one child.
var parentXml:XML = ;

// parentXml.child is an XMLList.  add two new elements
parentXml.child[parentXml.child.length()] = ;
parentXml.child[parentXml.child.length()] = ;

// remove the 2nd item
delete parentXml.child[1];
</pre>
<p>Put this code inside a function and step through it in the debugger to see what&#8217;s happening.</p>
<p>One thing to note is that if you are binding controls to &#8220;parentXml&#8221;, the UI doens&#8217;t necessarily receive update events when the child nodes are manipulated.  In this case you may have to dispatch an event to force the UI to re-call the getter for parentXml.  Although, that is a subject for another post&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://verysimple.com/2010/03/22/adding-and-removing-children-from-a-flex-xmllist/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Sending from multiple email addresses on iPhone</title>
		<link>http://verysimple.com/2010/03/16/sending-from-multiple-email-addresses-on-iphone/</link>
		<comments>http://verysimple.com/2010/03/16/sending-from-multiple-email-addresses-on-iphone/#comments</comments>
		<pubDate>Wed, 17 Mar 2010 02:07:45 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Digital Life]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.verysimple.com/blog/?p=519</guid>
		<description><![CDATA[If you use multiple email addresses that all forward to the same email account, it&#8217;s easy to setup with the OSX desktop mail app.  All you have to do is enter your various email addresses into the account setup Address field, separated by commas.  When writing messages, you can select reply-to address from a drop-down. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://verysimple.com/wp-content/uploads/2010/03/mail.jpg" rel="shadowbox[post-519];player=img;"><img class="alignright size-full wp-image-520" src="http://verysimple.com/wp-content/uploads/2010/03/mail.jpg" alt="" width="192" height="288" /></a>If you use multiple email addresses that all forward to the same email account, it&#8217;s easy to setup with the OSX desktop mail app.  All you have to do is enter your various email addresses into the account setup Address field, separated by commas.  When writing messages, you can select reply-to address from a drop-down.</p>
<p>On the iPhone, though, the Address field in the account setup brings up a limited character keyboard and the comma is not one of the characters that you can type.  This would seem to indicate that the iPhone doesn&#8217;t support multiple addresses without adding a separate account for each.</p>
<p>What you can do, though is type your addresses, separated by commas in the Description field and then copy/paste the whole thing into the Account field.  The craziest part is that it actually works!  Once you paste your email addresses, you will see a &#8220;From&#8221; field when composing emails.  Clicking this field will allow you to choose your reply address &#8211; the same as the Mail desktop app.</p>
<p>It&#8217;s a little strange and surprising that Apple prevents you from typing the comma into that field, yet manages to support multiple reply-to addresses anyway.  It probably has some security implications for any application that rely on a limited character keyboard for input validation.  Because originally there was no copy/paste on the iPhone, it would have been impossible to type illegal characters.  With copy/paste, though, you can circumvent that limitation.</p>
]]></content:encoded>
			<wfw:commentRss>http://verysimple.com/2010/03/16/sending-from-multiple-email-addresses-on-iphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Writing effective code comments</title>
		<link>http://verysimple.com/2010/03/15/writing-effective-code-comments/</link>
		<comments>http://verysimple.com/2010/03/15/writing-effective-code-comments/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 03:42:51 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Digital Life]]></category>

		<guid isPermaLink="false">http://www.verysimple.com/blog/?p=507</guid>
		<description><![CDATA[Many programmers, both good and bad, dislike writing comments.  When working on a team, lack of comments will eventually lead to lost productivity due to time spent tracing and re-learning.  The problem continues to get worse as revisions are made over the life-cycle of an application.  This can be especially true in larger teams where [...]]]></description>
			<content:encoded><![CDATA[<p>Many programmers, both good and bad, dislike writing comments.  When working on a team, lack of comments will eventually lead to lost productivity due to time spent tracing and re-learning.  The problem continues to get worse as revisions are made over the life-cycle of an application.  This can be especially true in larger teams where people come and go and/or work is outsourced.  However even if you&#8217;re the only programmer working on the code, it&#8217;s easy to forget why you did something months or years ago.</p>
<p>It&#8217;s my opinion that great programmers comment their code even if they&#8217;re the only person working on a project.  Not only does the small investment pay off later, it&#8217;s a simple habit that forces you to plan and proof-read your own work.  A poorly conceived function will become more apparent as you try to explain your thinking in the comments.  JavaDoc can be written before the code itself which helps to flesh out ideas before writing a lot of code.</p>
<p><span id="more-507"></span>To write effective comments, I try to find a balance between two things.  First, that someone might be reading only the generated documentation without access to the source code.  Second, comments that simply repeat the function and argument names are not helpful.  Great comments may briefly explain *what* a function does, but more importantly it should explain *why* the function exists.</p>
<p>Take this function as an example:</p>
<pre>/**
 * <em>this function adjusts the print margins</em>
 */
private <strong>void</strong> adjustPrintMargins(<strong>int</strong> x, <strong>int</strong> y) {}
</pre>
<p>The comments for this function are basically worthless because it doesn&#8217;t give any information that wasn&#8217;t already apparent. The purpose of the function is fairly obvious and you might even thing that it could get by without comments.  Judging by the function name it obviously adjusts the print margin and x &amp; y are an increment of some sort.  The function itself is possibly simple, but there&#8217;s actually a lot of vagueness.  This would probably require looking into the source code to figure out what it really does, which takes time.  Here&#8217;s the same function with some better documentation:</p>
<pre>/**
 * <em>Adjusts the margins of this document based on the printable area</em>
 * <em>allowed by the selected printer.  This function is called by Printer.preRender()</em>
 * <em>immediately before the document is spooled for printing.</em>
 *
 * @<strong>todo</strong>: add validation to ensure x/y are legitimate values
 * @<strong>param</strong> int the minimum horizontal margin (in pixels) supported by the printer
 * @<strong>param</strong> int the minimum vertical margin (in pixels) supported by the printer
 */
private <strong>void</strong> adjustPrintMargins(<strong>int</strong> x, <strong>int</strong> y) {}
</pre>
<p>Oh brother, who wants to type out all of that garbage, right?  Well if you&#8217;re using a decent IDE it would have auto-generated all of the formatting and @params as soon as you typed /**.  After that it took about one minute to type the actual text.</p>
<p>The comments above give a brief description of what the function does, but it also clarifies some of the vagueness and gives a little more detail about *why* the function is necessary.  Another important detail is that it mentions *when* this function would normally be called &#8211; by another function Printer.preRender().  (If this function was called from a lot of places, though, it might be better to describe when it&#8217;s called more generally, perhaps mention the circumstances or types of objects that would call it.)  Lastly, there&#8217;s a TODO in the comments which could indicate some part of the functionality that isn&#8217;t fully implemented or isn&#8217;t as clean as it could be.  This didn&#8217;t take much time to type, but there&#8217;s a lot of really helpful information that could allow you to utilize or refactor this function with a little more confidence.  Without these comments it might be easy to figure out what the function does, but perhaps no so easy why it is necessary.  You might have to set breakpoints and trace the code backwards to figure that out.  Turning on the debugger just to figure out why a particular function is called can waste a lot of time.  It might take an hour to trace the code backwards, whereas it only took about one minute to write the comments.</p>
<div id="attachment_509" class="wp-caption alignright" style="width: 443px"><a href="http://verysimple.com/wp-content/uploads/2010/03/ac.png" rel="shadowbox[post-507];player=img;"><img class="size-full wp-image-509" style="border: 1px solid black" src="http://verysimple.com/wp-content/uploads/2010/03/ac.png" alt="" width="433" height="168" /></a><p class="wp-caption-text">Auto-complete in Eclipse w/ PDT Plug-in for PHP</p></div>
<p>The comments themselves are important, but learning to write proper JavaDoc  gives you even more added value.  Even if you aren&#8217;t writing in Java, it&#8217;s used as the basis for just about every language.  Of course you can use any number of  open source tools to generate nicely formatted documentation.  Additionally many IDEs will parse javadoc and display it when auto-completing functions.  Even the best programmers don&#8217;t remember the arguments for every function they&#8217;ve ever written.  Having auto-complete display documentation for you inline as you type will pay off again and again, saving you huge amounts of time.</p>
]]></content:encoded>
			<wfw:commentRss>http://verysimple.com/2010/03/15/writing-effective-code-comments/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>PHP behaves erratically when writing to files</title>
		<link>http://verysimple.com/2010/03/05/php-behaves-erratically-when-writing-to-files/</link>
		<comments>http://verysimple.com/2010/03/05/php-behaves-erratically-when-writing-to-files/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 06:41:41 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.verysimple.com/blog/?p=502</guid>
		<description><![CDATA[This is such a dumb error  but I wanted to write it in case anybody else becomes mystified if a stable PHP application starts suddenly behaving erratically when writing to files. The cause of this weird behavior could be that your server&#8217;s hard drive has run out of free space.   To check your server&#8217;s drive [...]]]></description>
			<content:encoded><![CDATA[<p>This is such a dumb error  but I wanted to write it in case anybody else becomes mystified if a stable PHP application starts suddenly behaving erratically when writing to files.</p>
<p>The cause of this weird behavior could be that your server&#8217;s hard drive has run out of free space.   To check your server&#8217;s drive space on a Unix machine, you use the &#8220;df&#8221; command.  This will show you a percentage of used space.  If it&#8217;s in the high 90&#8242;s then obviously you need to clean out some files or upgrade the hardware.</p>
<p>This can cause a wide variety of very strange symptoms including:</p>
<ul>
<li>Permission denied errors are thrown when opening, writing or closing files even though PHP has full permission granted</li>
<li>PHP stops appending to log files</li>
<li>PHP can create new files, but they are empty even though you are expecting PHP to write some data)</li>
<li>PHP can&#8217;t start new sessions, or doesn&#8217;t remember user&#8217;s session (because it can&#8217;t write session files)</li>
<li>Unknown error in Line 0.  (This actually occurs if you have an exception in your destructor, however this is a common place to close file handles so you might see this error)</li>
</ul>
<p>Obviously the server is in an unreliable state so it&#8217;s likely to cause all kinds of weird and seemingly random behavior.  If you notice any other symptoms feel free to post a comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://verysimple.com/2010/03/05/php-behaves-erratically-when-writing-to-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install PDT Plugin in FlexBuilder 3</title>
		<link>http://verysimple.com/2010/02/18/install-pdt-plugin-in-flexbuilder-3/</link>
		<comments>http://verysimple.com/2010/02/18/install-pdt-plugin-in-flexbuilder-3/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 00:26:10 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.verysimple.com/blog/?p=495</guid>
		<description><![CDATA[Installing PDT (PHP Development Tools) Plugin for FlexBuilder allows you to work with PHP projects within the FlexBuilder environment.  This is useful if you are using AMFPHP, WebORB for PHP or some other PHP-based remote server.  There are similar instructions posted elsewhere, however I found that they have become outdated.  Because FlexBuilder 3 is based [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_499" class="wp-caption alignright" style="width: 310px"><a href="http://verysimple.com/wp-content/uploads/2010/02/pdt1.gif" rel="shadowbox[post-495];player=img;"><img class="size-medium wp-image-499" src="http://www.verysimple.com/blog/wp-content/uploads/2010/02/pdt1-300x180.gif" alt="" width="300" height="180" /></a><p class="wp-caption-text">PDT Screenshot</p></div>
<p>Installing <a href="http://www.eclipse.org/pdt/" target="_blank">PDT</a> (PHP Development Tools) Plugin for FlexBuilder allows you to work with PHP projects within the FlexBuilder environment.  This is useful if you are using <a href="http://www.amfphp.org/" target="_blank">AMFPHP</a>, <a href="http://www.themidnightcoders.com/" target="_blank">WebORB for PHP</a> or some other PHP-based remote server.  There are similar instructions posted elsewhere, however I found that they have become outdated.  Because FlexBuilder 3 is based on an older release of Eclipse, you now have to specifically install older versions of the PDT files.</p>
<p>Note &#8211; If you are using a recent version of Eclipse with FlexBuilder plugin, or are using FlexBuilder 4 then you should not follow these instructions &#8211; instead install the most recent version of PDT.  These instructions are only necessary for FlexBuilder 3 Stand-Alone edition.</p>
<h2>Installing PDT:</h2>
<ol>
<li>Open FlexBuilder 3 menu Help-&gt;Software Updates-&gt;Find and Install</li>
<li>Search for new feature to install</li>
<li>Click &#8220;New Remote Site&#8221; and enter the following:
<ul>
<li>Name: PDT 1.x</li>
<li>URL: http://download.eclipse.org/tools/pdt/updates/<br />
(<span style="color: #800000">note is that this URL is to the old 1.x update site</span>)</li>
</ul>
</li>
<li>After adding the site, click OK and select the following two Sites to include:
<ul>
<li>Europa Discovery Site</li>
<li>PDT 1.x</li>
</ul>
</li>
<li>Click &#8220;Finish&#8221; to begin searching for updates</li>
<li>Once the results are displayed, un-check the box that says &#8220;Show latest version of a feature only&#8221;</li>
<li>Expand PDT 1.x and select <strong>PDT SDK 1.0.3</strong><br />
(<span style="color: #800000">important &#8211; do not select a higher version than 1.0.3</span>)</li>
<li>After you have selected PDT SDK, you may have required libraries missing.  You can try at this point clicking &#8220;Select Required&#8221; and they will be automatically selected from the Europa Discovery Site.  However, this sometimes causes FlexBuilder to lock up.  In which case, you have to force quit FlexBuilder, start the process over and manually select the required libraries which are:
<ul>
<li>Graphical Editors and Frameworks-&gt;Graphical Editing Framework 3.3.2</li>
<li>Java Development-&gt;Eclipse Java Development Tools 3.3.2</li>
<li>Models and Model Development-&gt;Eclipse Modeling Framework (EMF) Runtime + End-User Tools 2.3.2</li>
<li>Models and Model Development-&gt;XML Schema Infoset Model (XSD) Extender SDK 2.3.2</li>
<li> Web and JEE Development-&gt;Web Standard Tools (WST) Project 2.0.2<br />
(<span style="color: #800000">if any of these libraries are missing and do not appear, it probably means that you have already installed them</span>)</li>
</ul>
</li>
<li>You should now be able to click &#8220;Finish&#8221; and agree to the license.  You can then restart the app and begin working with PHP project within FlexBuilder.</li>
</ol>
<h2>Configure Smarty (TPL) Template Editing</h2>
<p>There is another project called <a href="http://code.google.com/p/smartypdt/" target="_blank">smartypdt</a> &#8211; however it doesn&#8217;t seem to be compatible with the older version of PDT &#8211; at least I couldn&#8217;t get it working.  Instead I simply configure TPL files to open using the PHP editor:</p>
<ol>
<li>Open the menu Window-&gt;Preferences</li>
<li>Navigate in preferences to General-&gt;Content Types</li>
<li>Expand the Text node and highlight &#8220;PHP Content Types&#8221;</li>
<li>In the File associations list, add *.tpl</li>
</ol>
<p>At this point you should be able to open a PHP folder and edit both PHP and TPL files.  If you configure your include path correctly, you should have code insight on your PHP classes and functions.</p>
]]></content:encoded>
			<wfw:commentRss>http://verysimple.com/2010/02/18/install-pdt-plugin-in-flexbuilder-3/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>sqlite lpad and rpad functionality</title>
		<link>http://verysimple.com/2010/01/12/sqlite-lpad-rpad-function/</link>
		<comments>http://verysimple.com/2010/01/12/sqlite-lpad-rpad-function/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 04:23:30 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[SQLite]]></category>

		<guid isPermaLink="false">http://www.verysimple.com/blog/?p=483</guid>
		<description><![CDATA[sqlite is missing several basic database features compared to typical SQL servers and unfortunately padding is one of them.  For a most situations though, you can use a simple hack to get the same functionality.   This trick uses a combination of concatenation and substr: -- the statement below is almost the same as -- select [...]]]></description>
			<content:encoded><![CDATA[<p>sqlite is missing several basic database features compared to typical SQL servers and unfortunately padding is one of them.  For a most situations though, you can use a simple hack to get the same functionality.   This trick uses a combination of concatenation and substr:</p>
<pre>-- the statement below is almost the same as
-- select lpad(mycolumn,'0',10) from mytable

select substr('0000000000' || mycolumn, -10, 10) from mytable

-- the statement below is almost the same as
-- select rpad(mycolumn,'0',10) from mytable

select substr(mycolumn || '0000000000', 1, 10) from mytable
</pre>
<p>The statement is fairly self-explanatory, but in case it doesn&#8217;t make sense we&#8217;re simply adding a big long string of characters to the original value and then truncating it down to the desired length.  The string used for concatenation has to be at least the same length that you are padding &#8211; 10 characters is used in this example (&#8217;0000000000&#8242;).</p>
<p>In most cases this workaround produces the same results as lpad/rpad except in the case where the length of your original value is greater than the length that you are padding.  In which case the original value would get truncated.  Usually when you are padding you know what the maximum length of the column anyway.</p>
<p>If you know of a more efficient technique, please post a comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://verysimple.com/2010/01/12/sqlite-lpad-rpad-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
