<?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>ramblings &#187; programming</title>
	<atom:link href="http://techore.com/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://techore.com</link>
	<description>come to your own conclusions</description>
	<lastBuildDate>Mon, 30 Aug 2010 15:08:25 +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>excluding files from tar</title>
		<link>http://techore.com/2010/06/excluding-files-from-tar/</link>
		<comments>http://techore.com/2010/06/excluding-files-from-tar/#comments</comments>
		<pubDate>Wed, 02 Jun 2010 14:04:05 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[exclude]]></category>
		<category><![CDATA[gzip]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[tar]]></category>
		<category><![CDATA[tarball]]></category>

		<guid isPermaLink="false">http://techore.com/?p=271</guid>
		<description><![CDATA[For the website I work on for my company I have a very large number of files in a single folder that is strictly data for the clients and not data I have to regularly modify.  So when I'm doing a tarball/gzip of my files on the server I need to exclude that folder and all it's subfolders from the process, here it is:

	~# tar -czf /home/test/download.tgz ./ --exclude="*/events/auto/*" --exclude="*/images/waveforms/*"

Till Next Time]]></description>
			<content:encoded><![CDATA[<p>For the website I work on for my company I have a very large number of files in a single folder that is strictly data for the clients and not data I have to regularly modify.  So when I&#8217;m doing a tarball/gzip of my files on the server I need to exclude that folder and all it&#8217;s subfolders from the process, here it is:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">~<span style="color: #666666; font-style: italic;"># tar -czf /home/test/download.tgz ./ --exclude=&quot;*/events/auto/*&quot; --exclude=&quot;*/images/waveforms/*&quot;</span></pre></div></div>

<p>Till Next Time</p>
]]></content:encoded>
			<wfw:commentRss>http://techore.com/2010/06/excluding-files-from-tar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress theme hacked?</title>
		<link>http://techore.com/2010/02/wordpress-theme-hacked/</link>
		<comments>http://techore.com/2010/02/wordpress-theme-hacked/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 16:47:03 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jorge gomez]]></category>
		<category><![CDATA[swithroyale.com]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress theme]]></category>
		<category><![CDATA[wp]]></category>
		<category><![CDATA[wp theme]]></category>

		<guid isPermaLink="false">http://techore.com/wp/?p=254</guid>
		<description><![CDATA[I've been using a theme created by Jorge Gomez at switchroyale.com and have been very happy with it.  I logged on today to get a bit of info from one of my earlier posts and noticed that after ~5 seconds my site was redirecting to a seemingly random website.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using a WordPress theme created by Jorge Gomez at <a title="switchroyale.com" href="http://switchroyale.com" target="_blank">switchroyale.com</a> and have been very happy with it.  I logged on today to get a bit of info from one of my earlier posts and noticed that after ~5 seconds after the page loaded my site was redirecting to a seemingly random website.</p>
<p>I started some debugging and first deactivated my AdSense plugin thinking that was the culprit.  It turns out that the theme was loading some javascript from an external site and was executing the redirect.</p>
<p>I was using Azul 1.4 and noticed there was an upgrade available and I updated my site to Azul 1.51.  This did not solve my problem.  I&#8217;ve reverted back to an old WordPress default theme and the problem went away.  I&#8217;ve sent an email to Mr. Gomez to let him know about the issue.  I hope that it&#8217;s either a simple error or that his site was hacked (I&#8217;m not being mean).  I&#8217;d much rather believe that his site got hacked than if he decided to start screwing with people themes out of malicious intent.</p>
<p>I&#8217;m happy to give him the benefit of the doubt until I learn otherwise.  I&#8217;ve included the email that I sent him below:</p>
<blockquote><p>Hey I just wanted to let you know that I&#8217;ve been using your theme for awhile and have enjoyed it, but today I noticed that there is some javascript coming through on your theme that is causing my site to redirect to a seemingly random website after the site is loaded for ~5 seconds.</p>
<p>I had been using Azul 1.4, but after noticing this issue I upgraded to Azul 1.51 and am still getting this issue.  I&#8217;ve reverted back to an old default WP theme and the issue went away and when I reactivated your theme the issue came back.</p>
<p>I don&#8217;t know if you are aware of this issue or whether your site might have gotten hacked.</p>
<p>Just wanted to let you know.</p>
<p>Hope this gets resolved.</p></blockquote>
<p>I&#8217;ll update this post as needed.</p>
<p>Till Next Time</p>
]]></content:encoded>
			<wfw:commentRss>http://techore.com/2010/02/wordpress-theme-hacked/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>quickie: creating symfony delete button</title>
		<link>http://techore.com/2010/01/quickie-creating-symfony-delete-button/</link>
		<comments>http://techore.com/2010/01/quickie-creating-symfony-delete-button/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 17:59:47 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[delete button]]></category>
		<category><![CDATA[delete link]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[quickie]]></category>
		<category><![CDATA[symfony]]></category>
		<category><![CDATA[symfony 1.2]]></category>

		<guid isPermaLink="false">http://techore.com/wp/?p=246</guid>
		<description><![CDATA[Many months ago I had asked for help on the symfony forums on how to create a delete button using either the link_to() or button_to() method. I had tried but was always getting validation errors. Today a person asked whether anyone had figured out a solution. It prompted me to do more research into symfony's core code and found a solution (though the solution wasn't in the core code).

Original delete text link code:

echo link_to('Delete', 'state/delete?id='.$form->getObject()->getId(), array('method' => 'delete', 'confirm' => 'Are you sure?'));
New delete BUTTON link code:

echo link_to('Delete', 'state/delete?id='.$form->getObject()->getId(), array('method' => 'delete', 'confirm' => 'Are you sure?'));
Till Next Time]]></description>
			<content:encoded><![CDATA[<p>Many months ago I had asked for help on the symfony forums on how to create a delete button using either the link_to() or button_to() method.  I had tried but was always getting validation errors.  Today a person asked whether anyone had figured out a solution.  It prompted me to do more research into symfony&#8217;s core code and found a solution (though the solution wasn&#8217;t in the core code).</p>
<p>Original delete text link code:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">echo</span> link_to<span style="color: #009900;">&#40;</span>
	<span style="color: #0000ff;">'Delete'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'state/delete?id='</span><span style="color: #339933;">.</span><span style="color: #000088;">$form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getObject</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
	<span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'method'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'delete'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'confirm'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Are you sure?'</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>New delete BUTTON link code:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">echo</span> link_to<span style="color: #009900;">&#40;</span>
	<span style="color: #0000ff;">'&lt;button&gt;Delete&lt;/button&gt;'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'state/delete?id='</span><span style="color: #339933;">.</span><span style="color: #000088;">$form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getObject</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
	<span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'method'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'delete'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'confirm'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Are you sure?'</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Till Next Time</p>
]]></content:encoded>
			<wfw:commentRss>http://techore.com/2010/01/quickie-creating-symfony-delete-button/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>quickie: setting symfony datetime default</title>
		<link>http://techore.com/2010/01/quickie-setting-symfony-datetime-default/</link>
		<comments>http://techore.com/2010/01/quickie-setting-symfony-datetime-default/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 20:23:23 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[datetime]]></category>
		<category><![CDATA[fields]]></category>
		<category><![CDATA[form fields]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[quickie]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://techore.com/wp/?p=243</guid>
		<description><![CDATA[Setting the default value for a symfony form field is one of those tasks so simple that it's impossible to find out how to do it without a good bit of trial and error.  So without further ado, here is how to set a DateTime field's default value:
$this->widgetSchema['start_time']->setDefault(date("m/d/Y", now()));]]></description>
			<content:encoded><![CDATA[<p>Setting the default value for a symfony form field is one of those tasks so simple that it&#8217;s impossible to find out how to do it without a good bit of trial and error.  So without further ado, here is how to set a DateTime field&#8217;s default value:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">widgetSchema</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'start_time'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setDefault</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;m/d/Y&quot;</span><span style="color: #339933;">,</span> now<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Till Next Time</p>
]]></content:encoded>
			<wfw:commentRss>http://techore.com/2010/01/quickie-setting-symfony-datetime-default/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>updating symfony form values after submitting</title>
		<link>http://techore.com/2010/01/updating-symfony-form-values-after-submitting/</link>
		<comments>http://techore.com/2010/01/updating-symfony-form-values-after-submitting/#comments</comments>
		<pubDate>Fri, 01 Jan 2010 21:46:36 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[form update]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[gps]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[sfForms]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://techore.com/wp/?p=240</guid>
		<description><![CDATA[One thing that's made programming on symfony very aggravating has been dealing with the forms.  Some sections of the forms are not well documented.  The main issue that I have with this at work is that we deal with GPS coordinates and the users enter their coordinates in degree-minute-seconds format but the database saves them in degree-decimal format.]]></description>
			<content:encoded><![CDATA[<p>One thing that&#8217;s made programming on symfony very aggravating has been dealing with the forms.  Some sections of the forms are not well documented.  The main issue that I have with this at work is that we deal with GPS coordinates and the users enter their coordinates in degree-minute-seconds format but the database saves them in degree-decimal format.</p>
<p>I had googled for a solution to this problem before, but had not found anything to guide me to the answer.  The couple answers I had found were not very clear on getting it to work.  Till I found <a title="jamescharlesworth.com" href="http://bit.ly/5YpPpu" target="_blank">this</a>.  Following these guidelines I got it to work on a test deployment of symfony.  Code below:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> Blog <span style="color: #000000; font-weight: bold;">extends</span> BaseBlog <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #009933; font-style: italic;">/**
	 * Initializes internal state of Blog object.
	 * @see        parent::__construct()
	 */</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">// Make sure that parent constructor is always invoked, since that</span>
		<span style="color: #666666; font-style: italic;">// is where any default values for this object are set.</span>
		parent<span style="color: #339933;">::</span>__construct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #666666; font-style: italic;">/*
	 * this function overrides the BaseBlog::save function to allow
	 * changes to be made to the object before saving to the database
	 */</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> save<span style="color: #009900;">&#40;</span>PropelPDO <span style="color: #000088;">$con</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setCommentCount</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'11'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">return</span> parent<span style="color: #339933;">::</span><span style="color: #004000;">save</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$con</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Till Next Time</p>
]]></content:encoded>
			<wfw:commentRss>http://techore.com/2010/01/updating-symfony-form-values-after-submitting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>updating centOS 5 PHP install with mbstring &amp; APC</title>
		<link>http://techore.com/2009/12/updating-centos-5-php-install-with-mbstring-apc/</link>
		<comments>http://techore.com/2009/12/updating-centos-5-php-install-with-mbstring-apc/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 18:17:22 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[a2hosting]]></category>
		<category><![CDATA[alternative php cache]]></category>
		<category><![CDATA[apc]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[centos 5]]></category>
		<category><![CDATA[howtoforge]]></category>
		<category><![CDATA[httpd]]></category>
		<category><![CDATA[httpd-dev]]></category>
		<category><![CDATA[mbstring]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php-dev]]></category>
		<category><![CDATA[php5]]></category>
		<category><![CDATA[virtual private server]]></category>
		<category><![CDATA[vps]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://techore.com/wp/?p=229</guid>
		<description><![CDATA[The default install on A2hosting's VPS does not have mbstring or APC installed by default.  I became aware of this as I was setting up symfony on the new server.  I googled around looking for a quick guide to install them.]]></description>
			<content:encoded><![CDATA[<p>The default install on <a title="A2hosting.com" href="http://www.a2hosting.com" target="_blank">A2hosting&#8217;s</a> <a title="techore.com" href="http://techore.com/wp/about/#VPS" target="_blank">VPS</a> does not have mbstring or APC installed by default.  I became aware of this as I was setting up symfony on the new server.  I googled around looking for a quick guide to install them.</p>
<p>mbstring is a straight-forward install:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">yum <span style="color: #c20cb9; font-weight: bold;">install</span> php-mbstring</pre></div></div>

<p>Easy.</p>
<p>Installing APC is a pretty simple affair with one big caveat at the end.  The guide that I found for installing APC is on <a title="howtoforge.com" href="http://bit.ly/4MkeRy" target="_blank">HowToForge</a>. The last two steps are particular to CentOS on A2hosting&#8217;s platform.</p>
<p>1.  Install PEAR.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">yum <span style="color: #c20cb9; font-weight: bold;">install</span> php-pear</pre></div></div>

<p>2.  Install php-dev &amp; httpd-dev.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">yum <span style="color: #c20cb9; font-weight: bold;">install</span> php-devel httpd-devel</pre></div></div>

<p>3.  Install group Development Tools</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">yum groupinstall <span style="color: #ff0000;">'Development Tools'</span></pre></div></div>

<p>4.  Install group Development Libraries</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">yum groupinstall <span style="color: #ff0000;">'Development Libraries'</span></pre></div></div>

<p>5.  Install APC</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">pecl <span style="color: #c20cb9; font-weight: bold;">install</span> apc</pre></div></div>

<p>6.  Reboot Apache</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">httpd <span style="color: #660033;">-k</span> restart</pre></div></div>

<p>7.  Error alerts you to SSLRandomSeed error.</p>
<p style="text-align: center;">
<div id="attachment_231" class="wp-caption aligncenter" style="width: 475px"><a href="http://techore.otterwedding.com/wp-content/uploads/2009/12/sslrandomseed_error.png" target="_blank"><img class="size-full wp-image-231 " title="sslrandomseed_error" src="http://techore.otterwedding.com/wp-content/uploads/2009/12/sslrandomseed_error.png" alt="SSLRandomSeed Error" width="465" height="114" /></a><p class="wp-caption-text">SSLRandomSeed Error</p></div>
<p>8.  Fix Centos Dev</p>
<p style="text-align: left;">
<div id="attachment_232" class="wp-caption aligncenter" style="width: 616px"><a href="http://techore.otterwedding.com/wp-content/uploads/2009/12/fix_centos_dev.png" target="_blank"><img class="size-full wp-image-232  " title="fix_centos_dev" src="http://techore.otterwedding.com/wp-content/uploads/2009/12/fix_centos_dev.png" alt="" width="606" height="310" /></a><p class="wp-caption-text">Fix CentOS Dev on A2hosting</p></div>
<p style="text-align: left;">It took me an hour last night to figure out the last step.  Without the last step there is no authentication so there is no SSH access.</p>
<p style="text-align: left;">Till Next Time</p>
]]></content:encoded>
			<wfw:commentRss>http://techore.com/2009/12/updating-centos-5-php-install-with-mbstring-apc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>setting up a domain-nameless domain</title>
		<link>http://techore.com/2009/12/setting-up-a-domain-nameless-domain/</link>
		<comments>http://techore.com/2009/12/setting-up-a-domain-nameless-domain/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 22:03:59 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[a2]]></category>
		<category><![CDATA[a2hosting]]></category>
		<category><![CDATA[cent os]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[centos 5]]></category>
		<category><![CDATA[domain]]></category>
		<category><![CDATA[domain name]]></category>
		<category><![CDATA[kloxo]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[virtual private server]]></category>
		<category><![CDATA[vps]]></category>

		<guid isPermaLink="false">http://techore.com/wp/?p=217</guid>
		<description><![CDATA[My company's website is being completely rewritten from scratch and I chose to move to A2hosting.com.  We are going with a Virtual Private Server (VPS) from them and have found a little difficulty setting up web access to it.]]></description>
			<content:encoded><![CDATA[<p>My company&#8217;s website is being completely rewritten from scratch and I chose to move to A2hosting.com.  We are going with a Virtual Private Server (VPS) from them and have found a little difficulty setting up web access to it.</p>
<p>The main issue is that since the website is already up and running, I can&#8217;t just transfer the domain name to the new server and be done with it.  I need to be able to access the new website by just the IP address for a while, until we move the production site over to it.  This is not documented anywhere on A2hosting&#8217;s site that I could find.</p>
<p>The issue resides in the setup of IP address of the server through Kloxo.  I am unable to configure the domain to default to the domain of my choice.  The error checking of this function disallows the assigning of that domain name since the domain name does not currently resolve to the server&#8217;s IP address.The solution resides in the /etc/hosts file.  I had to set the IP to equate to the domain name that WILL be the correct name once the production site is moved over.</p>
<p style="text-align: center;">A quick little walkthrough:</p>
<p style="text-align: center;">
<div id="attachment_226" class="wp-caption aligncenter" style="width: 504px"><a href="http://techore.otterwedding.com/wp-content/uploads/2009/12/etc_hosts.png" target="_blank"><img class="size-full wp-image-226 " title="etc_hosts" src="http://techore.otterwedding.com/wp-content/uploads/2009/12/etc_hosts.png" alt="" width="494" height="386" /></a><p class="wp-caption-text">Set the /etc/hosts file</p></div>
<p style="text-align: center;">
<div id="attachment_221" class="wp-caption aligncenter" style="width: 620px"><a href="http://techore.otterwedding.com/wp-content/uploads/2009/12/ipaddresses.png" target="_blank"><img class="size-full wp-image-221   " title="ipaddresses" src="http://techore.otterwedding.com/wp-content/uploads/2009/12/ipaddresses.png" alt="" width="610" height="375" /></a><p class="wp-caption-text">IP Addresses link in Kloxo admin</p></div>
<p style="text-align: center;">
<div id="attachment_220" class="wp-caption aligncenter" style="width: 635px"><a href="http://techore.otterwedding.com/wp-content/uploads/2009/12/ipaddress_table.png" target="_blank"><img class="size-full wp-image-220   " title="ipaddress_table" src="http://techore.otterwedding.com/wp-content/uploads/2009/12/ipaddress_table.png" alt="" width="625" height="309" /></a><p class="wp-caption-text">IP Address table</p></div>
<p style="text-align: center;">
<div id="attachment_219" class="wp-caption aligncenter" style="width: 582px"><a href="http://techore.otterwedding.com/wp-content/uploads/2009/12/ipaddress_info.png" target="_blank"><img class="size-full wp-image-219   " title="ipaddress_info" src="http://techore.otterwedding.com/wp-content/uploads/2009/12/ipaddress_info.png" alt="" width="572" height="278" /></a><p class="wp-caption-text">IP Address info</p></div>
<p style="text-align: center;">
<div id="attachment_218" class="wp-caption aligncenter" style="width: 601px"><a href="http://techore.otterwedding.com/wp-content/uploads/2009/12/ipdomain.png" target="_blank"><img class="size-full wp-image-218  " title="ipdomain" src="http://techore.otterwedding.com/wp-content/uploads/2009/12/ipdomain.png" alt="" width="591" height="282" /></a><p class="wp-caption-text">Select the proper domain name for the IP Address</p></div>
<p style="text-align: left;">Hope this helps.</p>
<p style="text-align: left;">
<p style="text-align: left;">Till Next Time</p>
]]></content:encoded>
			<wfw:commentRss>http://techore.com/2009/12/setting-up-a-domain-nameless-domain/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding javascript to symfony form field</title>
		<link>http://techore.com/2009/11/adding-javascript-to-symfony-form-field/</link>
		<comments>http://techore.com/2009/11/adding-javascript-to-symfony-form-field/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 21:27:25 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[onchange]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[sfWidget]]></category>
		<category><![CDATA[symfony]]></category>
		<category><![CDATA[widgets]]></category>

		<guid isPermaLink="false">http://techore.com/wp/?p=194</guid>
		<description><![CDATA[In the users table at my company's website there are fields for company, division, region, and location.  Since each level of the company organization affects all the lower categories I have to filter out the invalid choices when a higher level choice is selected.]]></description>
			<content:encoded><![CDATA[<p>In the users table at my company&#8217;s website there are fields for company, division, region, and location.  Since each level of the company organization affects all the lower categories I have to filter out the invalid choices when a higher level choice is selected.</p>
<p>I&#8217;ve implemented this on some forms that I&#8217;ve created manually on the site but not in any forms that I haven&#8217;t heavily modified from the stock symfony creation.  I started googling around to find a solution but could not find a simple explanation of how to do it.  I expected to find at least some information in one of symfony&#8217;s otherwise excellent tutorials, but alas, no.</p>
<p>I had a minor epiphany and went digging through the forms API that symfony provides and realized that I should easily be able to do this through the sfWidgetFormPropelChoice method.  The second parameter passed is the html attributes for the form field.  I thought I had seen a form post <a title="symfony forum" href="http://bit.ly/3f9j24" target="_blank">here</a> that said that I could add javascript code to the html attributes and not have it get converted into html entities.</p>
<p>I tried throwing a simple alert() inside the onchange attribute for my company box and wham! it worked!  So simple.  Code below:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">new</span> sfWidgetFormPropelChoice<span style="color: #009900;">&#40;</span>
	<span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
		<span style="color: #0000ff;">'model'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Company'</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">'add_empty'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">true</span>
	<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
	<span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
		<span style="color: #0000ff;">'onchange'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;filterBy('company', 'division', this.value, 'sf_guard_user_user_division_id');&quot;</span> <span style="color: #339933;">.</span>
			<span style="color: #0000ff;">&quot;filterBy('company', 'region', this.value, 'sf_guard_user_user_region_id');&quot;</span> <span style="color: #339933;">.</span>
			<span style="color: #0000ff;">&quot;filterBy('company', 'location', this.value, 'sf_guard_user_user_location_id');&quot;</span>
	<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#41;</span></pre></div></div>

<p>Till Next Time</p>
]]></content:encoded>
			<wfw:commentRss>http://techore.com/2009/11/adding-javascript-to-symfony-form-field/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>IE 7 javascript bug</title>
		<link>http://techore.com/2009/11/ie-7-javascript-bug/</link>
		<comments>http://techore.com/2009/11/ie-7-javascript-bug/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 17:18:19 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[Developer Tools]]></category>
		<category><![CDATA[experts-exchange]]></category>
		<category><![CDATA[experts-exchange.com]]></category>
		<category><![CDATA[Firebug]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[select options filtering]]></category>

		<guid isPermaLink="false">http://techore.com/wp/?p=191</guid>
		<description><![CDATA[In a form that I administer at work I have a javascript filtering function for a few select boxes.  It is called whenever the first select box changes and removes the ineligible options from the second select box.  Simple.  Straight-forward.

It doesn't work in IE 7, works fine in IE 8, Firefox, Chrome.  But we have many clients that are stuck in IE 7 or even IE 6.  I sat down to figure this out and realized that my IE debugging tools aren't nearing as good as my Firefox debugging.  In Firefox I use Firebug, but in IE I use the built in Developer Tools (DT).]]></description>
			<content:encoded><![CDATA[<p>In a form that I administer at work I have a javascript filtering function for a few select boxes.  It is called whenever the first select box changes and removes the ineligible options from the second select box.  Simple.  Straight-forward.</p>
<p>It doesn&#8217;t work in IE 7, works fine in IE 8, Firefox, Chrome.  But we have many clients that are stuck in IE 7 or even IE 6.  I sat down to figure this out and realized that my IE debugging tools aren&#8217;t nearing as good as my Firefox debugging.  In Firefox I use Firebug, but in IE I use the built in Developer Tools (DT).</p>
<p>The one big difference between these two plug-ins for this particular problem is that DT doesn&#8217;t live update the code of the page when it is changed with javascript.  You must manually refresh the code inside of DT.  Once I discovered this I was much more productive.</p>
<p>But onto the problem.  I discovered that when I was creating the &#8216;filtered&#8217; select box, I was actually just wiping the original box out and creating a new one from scratch.  In this new select box all the attributes were correct except for the name.  Instead of the attribute being called &#8216;name&#8217; it was being called &#8216;submitName&#8217;.</p>
<p>I googled that and the only relevant thing that I could get was an experts-exchange link that I refuse to use.  I have a problem with a website charging people for solutions to simple code problems.  Whenever I get google results for that site I remove it from my results.</p>
<p>I ended up reworking my code to actually filter out the unwanted options when the first select box is changed.  But in case someone else has had the problem that I&#8217;m having and knows the solution, I will post the code that I was using to create the select box.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> createSelect<span style="color: #009900;">&#40;</span>parent_cell<span style="color: #339933;">,</span> <span style="color: #000066;">name</span><span style="color: #339933;">,</span> id<span style="color: #339933;">,</span> options<span style="color: #339933;">,</span> option_values<span style="color: #339933;">,</span> classs<span style="color: #339933;">,</span> onchange<span style="color: #339933;">,</span> removeChildren<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #006600; font-style: italic;">// classs is misspelled cause otherwise IE thinks it is a Class</span>
	<span style="color: #000066; font-weight: bold;">try</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> par_cell <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span>parent_cell<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> sel_box <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'select'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		sel_box.<span style="color: #660066;">setAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'name'</span><span style="color: #339933;">,</span> <span style="color: #000066;">name</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		sel_box.<span style="color: #660066;">setAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'id'</span><span style="color: #339933;">,</span> id<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		sel_box.<span style="color: #660066;">setAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'onchange'</span><span style="color: #339933;">,</span> onchange<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		sel_box.<span style="color: #660066;">setAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'class'</span><span style="color: #339933;">,</span> classs<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #003366; font-weight: bold;">var</span> first_opt <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'option'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		first_opt.<span style="color: #660066;">value</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span>
		first_opt.<span style="color: #660066;">text</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'Select an Option'</span><span style="color: #339933;">;</span>
		sel_box.<span style="color: #660066;">options</span>.<span style="color: #660066;">add</span><span style="color: #009900;">&#40;</span>first_opt<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>i<span style="color: #339933;">&lt;</span>options.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #003366; font-weight: bold;">var</span> opt <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'option'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			opt.<span style="color: #660066;">value</span> <span style="color: #339933;">=</span> option_values<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
			opt.<span style="color: #660066;">text</span> <span style="color: #339933;">=</span> options<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
			sel_box.<span style="color: #660066;">options</span>.<span style="color: #660066;">add</span><span style="color: #009900;">&#40;</span>opt<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>removeChildren<span style="color: #009900;">&#41;</span>
			removeAllChildren<span style="color: #009900;">&#40;</span>parent_cell<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		par_cell.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>sel_box<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000066; font-weight: bold;">catch</span><span style="color: #009900;">&#40;</span>err<span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;There was an error creating the options menu: &quot;</span> <span style="color: #339933;">+</span> err<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Till Next Time</p>
]]></content:encoded>
			<wfw:commentRss>http://techore.com/2009/11/ie-7-javascript-bug/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ahhh, cronjobs!</title>
		<link>http://techore.com/2009/05/ahhh-cronjobs/</link>
		<comments>http://techore.com/2009/05/ahhh-cronjobs/#comments</comments>
		<pubDate>Tue, 26 May 2009 16:20:59 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[cronjob]]></category>
		<category><![CDATA[crontab]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[symfony]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://techore.com/wp/?p=176</guid>
		<description><![CDATA[So I have a script designed to run whenever I need it to automatically get any new activities and save them to the local database waiting for the end-user.  I set it up to run every 15 minutes until I got the multitudes of old data into the new platform.  I'm talking ~170,000 activities, and each activity takes about 45-90 seconds to process.]]></description>
			<content:encoded><![CDATA[<p>One of the features of the new platform that I am working on is the ability to automatically retrieve all new seismic activities before the end-user posts that there has been an activity.  This will make the data transfer appear instantaneous to our clients and make us look all-around awesome.</p>
<p>So I have a script designed to run whenever I need it to automatically get any new activities and save them to the local database waiting for the end-user.  I set it up to run every 15 minutes until I got the multitudes of old data into the new platform.  I&#8217;m talking ~170,000 activities, and each activity takes about 45-90 seconds to process.</p>
<p>So below is my simple cronjob command to have it run every 15 minutes 24/7/365.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">*/</span><span style="color: #000000;">15</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> php <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>symfony<span style="color: #000000; font-weight: bold;">/</span>cron<span style="color: #000000; font-weight: bold;">/</span>runcron.php <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>symfony<span style="color: #000000; font-weight: bold;">/</span>cron<span style="color: #000000; font-weight: bold;">/</span>test_cron_log.log</pre></div></div>

<p>Till Next Time</p>
]]></content:encoded>
			<wfw:commentRss>http://techore.com/2009/05/ahhh-cronjobs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
