<?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>cpradio's tidbits of information</title>
	<atom:link href="http://cpradio.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://cpradio.org</link>
	<description>my life experience and information that may help others find what they need</description>
	<lastBuildDate>Sat, 06 Jun 2009 23:06:24 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Wilkin Baby Email Announcement</title>
		<link>http://cpradio.org/personal/wilkin-baby-email-announcement/</link>
		<comments>http://cpradio.org/personal/wilkin-baby-email-announcement/#comments</comments>
		<pubDate>Sat, 06 Jun 2009 23:06:23 +0000</pubDate>
		<dc:creator>cpradio</dc:creator>
				<category><![CDATA[Family]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[announcement]]></category>
		<category><![CDATA[baby]]></category>

		<guid isPermaLink="false">http://cpradio.org/?p=174</guid>
		<description><![CDATA[Here is a copy of the email we sent out as an announcement to all friends and family members.
Read First, open the Attachment second    No peeking!  We mean it!
We recently received news that is going to not only change our lives but
likely everyone who is included in this email.  Due [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a copy of the email we sent out as an announcement to all friends and family members.</p>
<blockquote><p>Read First, open the Attachment second <img src='http://cpradio.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   No peeking!  We mean it!</p>
<p>We recently received news that is going to not only change our lives but<br />
likely everyone who is included in this email.  Due to it we have had to<br />
cancel future plans we had on weekends and even a wedding in December.</p>
<p>It&#8217;s hard to understand what news could be so good, err great, that we can<br />
be excited about even if it means having to miss a wedding in December.<br />
To find out you will just have to look at the attachment (yes, we give you<br />
permission, go ahead and look&#8230;wait! Just kidding, go ahead and look).</p>
<p>After opening the attachment, please scroll down below and read the rest.</p>
<p>With this wonderful news, we want to give everyone the opportunity to<br />
receive announcements from us during this time.  We also want to be able<br />
to give everyone the control of whether or not they receive announcements<br />
from us, so please, if you want to receive them sign up at<br />
http://www.wilkin-family.net/announcements/signup.html</p>
<p>Likewise, you can unsubscribe at your convenience too.  Bonus points go to<br />
the first person to figure out why we selected the From Address we did for<br />
the announcement emails (you&#8217;ll understand when you get your subscription<br />
confirmation email from us).</p>
<p>Feel free to forward this email to any friends, family members, etc. so<br />
that they too may receive the great news and be given the option to<br />
subscribe to our announcements.</p>
<p>Thanks all,<br />
Kami, Matt, Spunky, and Baby Wilkin</p></blockquote>
<div id="attachment_175" class="wp-caption alignnone" style="width: 310px"><a href="http://cpradio.org/personal/wilkin-baby-email-announcement/attachment/babyannouncement/" rel="attachment wp-att-175"><img src="http://cpradio.org/wp-content/uploads/2009/06/babyannouncement-300x200.png" alt="Baby Announcement" title="Baby Announcement" width="300" height="200" class="size-medium wp-image-175" style="border: 1px solid #000;" /></a><p class="wp-caption-text">Baby Announcement</p></div>
]]></content:encoded>
			<wfw:commentRss>http://cpradio.org/personal/wilkin-baby-email-announcement/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Local Printer Support via RDP (Remote Desktop)</title>
		<link>http://cpradio.org/personal/local-printer-support-via-rdp-remote-desktop/</link>
		<comments>http://cpradio.org/personal/local-printer-support-via-rdp-remote-desktop/#comments</comments>
		<pubDate>Wed, 28 Jan 2009 00:39:27 +0000</pubDate>
		<dc:creator>cpradio</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Kubuntu]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[printer]]></category>
		<category><![CDATA[rdesktop]]></category>

		<guid isPermaLink="false">http://cpradio.org/?p=165</guid>
		<description><![CDATA[For those wanting to support a local printer connected to their Linux system via RDP (Remote Desktop) connecting to a Windows server, here is a quick how-to.

First look up the Printer Name on your Linux box, it is best if it is a single word and under 20 characters.  You can typically find this [...]]]></description>
			<content:encoded><![CDATA[<p>For those wanting to support a local printer connected to their Linux system via RDP (Remote Desktop) connecting to a Windows server, here is a quick how-to.</p>
<ol>
<li>First look up the Printer Name on your Linux box, it is best if it is a single word and under 20 characters.  You can typically find this by opening a document, selecting Print and it should be the name in the drop down.</li>
<li>Next you will have a script that call rdesktop like so:<br />
<code>rdesktop -r printer:&lt;YOUR PRINTER NAME ON LINUX&gt;="WINDOWS DRIVER NAME AS IT APPEARS IN ADD PRINTER" &lt;YOUR SERVER IP ADDRESS&gt;</code></li>
<li>Run the rdesktop script and login</li>
<li>Go to Printers and Faxes</li>
<li>Right-click on the Printer that matches your Linux printer&#8217;s name and choose Properties</li>
<li>Print a test page!</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://cpradio.org/personal/local-printer-support-via-rdp-remote-desktop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using rdiff-backup/rsync with your LinkStation Pro Duo</title>
		<link>http://cpradio.org/personal/using-rdiff-backup-with-your-linkstation-pro-duo/</link>
		<comments>http://cpradio.org/personal/using-rdiff-backup-with-your-linkstation-pro-duo/#comments</comments>
		<pubDate>Fri, 05 Dec 2008 03:38:42 +0000</pubDate>
		<dc:creator>cpradio</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[linkstation pro duo]]></category>

		<guid isPermaLink="false">http://cpradio.org/?p=150</guid>
		<description><![CDATA[I wanted to use rdiff-backup with my LinkStation Pro Duo as it makes incremental backups and the retrieving of backups just dead easy.  Unfortunately, its a pain in the *** to install rdiff-backup on the LinkStation Pro Duo.  So I wrote a work-around.  
Note: This only works if you are using a [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to use rdiff-backup with my LinkStation Pro Duo as it makes incremental backups and the retrieving of backups just dead easy.  Unfortunately, its a pain in the *** to install rdiff-backup on the LinkStation Pro Duo.  So I wrote a work-around.  </p>
<p><em>Note: This only works if you are using a public/private key for authentication via SSH and on a user by user basis.  To do this read my post titled, <a href="http://cpradio.org/personal/linkstation-pro-duo-enabling-ssh/">LinkStation Pro Duo, enabling SSH</a>.</em></p>
<p>To get this to work from a Client machine that runs Linux, you need to install &#8220;sshfs&#8221;.  In short, this allows you to mount a drive/share on your LinkStation Pro Duo onto your client machine.  This in turn gives you the opportunity to run rdiff-backup locally which DOES NOT require rdiff-backup &#8211;server to be installed on the LinkStation.</p>
<p>Once you have sshfs installed, you will need to create a startup script for your username.  Now this will vary depending on the distribution you use, but if you use Ubuntu or one of its derivatives, you can do the following:</p>
<ol>
<li>
<strong>Setup Directory for Mount Detection</strong><br />
We need a directory setup on the NAS so that we can tell if the share has already been mounted.  This is needed because every time you login via SSH, it will try to mount this drive, and if you are like me and you run your PC 24/7, this could be a problem.</p>
<ol>
<li>Remote into your NAS via SSH, using <code>ssh &lt;username&gt;@&lt;nas_ip_address&gt;</code></li>
<li>Create a directory on your NAS that you will put in as the CHECK_FOLDER value in the below script by running<br />
<code>mkdir &lt;path_to_your_new_folder&gt;</code></li>
</ol>
</li>
<li>
<strong>Create a .bash_login script</strong></p>
<ol>
<li>Open your favorite editor (gui, graphical user interface or cli, command line is fine), name it &#8220;.bash_login&#8221;</li>
<li>Copy the following into the file:<br />
<code>#!/bin/bash</code></p>
<p><code>CHECK_FOLDER=/mnt/nas-backup/<username><br />
REMOTE_FOLDER=&lt;username&gt;@&lt;nas_ip_address&gt;:/mnt/array1/Backup<br />
LOCAL_FOLDER=/mnt/nas-backup</username></code></p>
<p><code># Check if the NAS Backup Share has been Mounted, if it hasn't mount it<br />
if [ ! -d $CHECK_FOLDER ]; then<br />
        sshfs $REMOTE_FOLDER $LOCAL_FOLDER<br />
fi</code></li>
<li>Replace the values of CHECK_FOLDER, REMOTE_FOLDER, and LOCAL_FOLDER so it suites your setup.</li>
<li>Save the file</li>
</ol>
</li>
<li><strong>Logout and log back in</strong><br />
Your NAS share should be mounted automatically so long as you have a public/private key authentication setup.</li>
<li><strong>Setting up your rdiff-backup</strong><br />
For rdiff-backup, I simply run<br />
<code>rdiff-backup --exclude-special-files &lt;path_to_directory_to_backup&gt; &lt;mount_location_of_nas_share&gt;</code><br />
<br />
To automate it, I put it as a <a href="http://en.wikipedia.org/wiki/Cron">cronjob that runs every night</a>.</li>
</ol>
<p><em>Note on 12/08/2008: I have now started to use rsync as it does not require me to mount the NAS Shares onto my personal computer.  It also supports public/private keys allowing me to run it via cronjob daily.</em></p>
<p>That&#8217;s it!</p>
]]></content:encoded>
			<wfw:commentRss>http://cpradio.org/personal/using-rdiff-backup-with-your-linkstation-pro-duo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LinkStation Pro Duo, enabling SSH</title>
		<link>http://cpradio.org/personal/linkstation-pro-duo-enabling-ssh/</link>
		<comments>http://cpradio.org/personal/linkstation-pro-duo-enabling-ssh/#comments</comments>
		<pubDate>Wed, 03 Dec 2008 21:31:20 +0000</pubDate>
		<dc:creator>cpradio</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[linkstation pro duo]]></category>

		<guid isPermaLink="false">http://cpradio.org/?p=145</guid>
		<description><![CDATA[What I did to enable SSH on my LinkStation Pro Duo:
IMPORTANT NOTE:  I made a few corrections to the below by adding item 3.6, and updating items 4.4, 5.11, and 5.12.  Please read those items over again.  If you needed to perform items 5.11 and 5.12 for two PCs, it is important [...]]]></description>
			<content:encoded><![CDATA[<p>What I did to enable SSH on my LinkStation Pro Duo:</p>
<p><em>IMPORTANT NOTE:  I made a few corrections to the below by adding item 3.6, and updating items 4.4, 5.11, and 5.12.  Please read those items over again.  If you needed to perform items 5.11 and 5.12 for two PCs, it is important that you use the updated commands.</em></p>
<ol>
<li>
<strong>Enable Telnet (temporarily)</strong></p>
<ol>
<li>Download the <a href="http://buffalo.nas-central.org/index.php/Open_Stock_Firmware">acp-commander</a></li>
<li>Run the .jar file by running<br />
<code>java -jar acp_commander.jar -t &lt;IP ADDRESS&gt; -o</code></li>
<li>Login to your LinkStation Pro Duo using (username and password are found on the above link)<br />
<code>telnet &lt;IP ADDRESS&gt;</code></li>
</ol>
</li>
<li>
<strong>Enable SSH at Startup</strong></p>
<ol>
<li>Create an SSH Startup script by typing <code>vi /etc/init.d/sshd.sh</code></li>
<li>Type &#8216;i&#8217; to enter Interactive Mode (this enables you to type), then proceed to type the following code:<br />
<code>#!/bin/sh<br />
test -f /usr/local/sbin/sshd || exit 0</code></p>
<p><code>ACTIVE_FILE=/var/run/active_sshd</code></p>
<p><code>case "$1" in<br />
start)   echo -n "Start services: sshd"<br />
                 /usr/local/sbin/sshd -f /etc/sshd_config 2>/dev/null &#038;<br />
                 touch $ACTIVE_FILE<br />
                 ;;<br />
stop)    echo -n "Stop services: sshd"<br />
                 killall sshd<br />
                 rm -f $ACTIVE_FILE<br />
                 ;;<br />
restart) $0 stop<br />
         $0 start<br />
         ;;<br />
*)       echo "Usage: $0 start | stop | restart"<br />
         exit 1<br />
         ;;<br />
esac<br />
exit 0</code></li>
<li>Press the ESC key and type &#8220;:wq&#8221; to Save and Exit</li>
<li>Make the file executable by running<br />
<code>chmod +x /etc/init.d/sshd.sh</code></li>
<li>Backup the original script startup file by running<br />
<code>cp /etc/init.d/rcS /etc/init.d/rcS.bak</code></li>
<li>Modify the rcS file to contain the SSH startup script by typing the following:<br />
<code>vi /etc/init.d/rcS</code></li>
<li>Press &#8220;i&#8221; to enter Interactive Mode</li>
<li>Page Down till you see<br />
<code>echo "** step3 **"</code></li>
<li>At the end of the next line, add<br />
<code> sshd.sh</code></li>
<li>Your change should now look similar to the following:<br />
<code>for cmd in diskmon.sh drivecheck.sh ftpd.sh atalk.sh httpd.sh smb.sh clientUtil_servd.sh bonjour.sh lsprcvd.sh daemonwatch.sh logrotate_init.sh cron.sh checkconfig.sh ups.sh pwrmgr.sh sshd.sh</code></li>
<li>Save your changes and exit by pressing the ESC key and typing <code>:wq</code></li>
<li>Add your SSH script to the Daemon Watch, so if it crashes/closes, it will be started again automatically.  Run the following code to edit the list<br />
<code>vi /etc/daemonwatch.list</code></li>
<li>Type &#8220;i&#8221; to enter Interactive Mode</li>
<li>Add the following line to the file<br />
<code>/var/run/sshd.pid               /var/run/active_sshd            /etc/init.d/sshd.sh restart</code></li>
<li>Save your changes and exit bt pressing the ESC key and typing <code>:wq</code></li>
</ol>
</li>
<li>
<strong>Configure SSH</strong></p>
<ol>
<li>Backup your original sshd_config file by typing<br />
<code>cp /etc/sshd_config /etc/sshd_config.bak</code></li>
<li>Modify the sshd_config file by typing<br />
<code>vi /etc/sshd_config</code></li>
<li>Press &#8220;i&#8221; to enter Interactive Mode</li>
<li>Remove the # in front of the following lines (you need to use the backspace key to do this; you may also need to change some of the &#8216;no&#8217; values to &#8216;yes&#8217;)<br />
<code>Port 22<br />
Protocol 2,1</code></p>
<p><code>HostKey /etc/ssh_host_key<br />
HostKey /etc/ssh_host_rsa_key<br />
HostKey /etc/ssh_host_dsa_key</code></p>
<p><code>PermitRootLogin yes<br />
StrictModes yes</code></p>
<p><code>RSAAuthentication yes<br />
PubkeyAuthentication yes</code></li>
<li>Save the file by pressing the ESC key then typing <code>:wq</code></li>
<li>Start the SSH Server by running <code>/etc/init.d/sshd.sh start</code></li>
</ol>
</li>
<li>
<strong>Create new Home folders for each user</strong><br />
<em>You will need to do the following for every user you have created!</em></p>
<ol>
<li>Create the users via the Web Interface first, once the users are created, start Step 2 for each user</li>
<li>Create a directory for the user by typing (replace &lt;username&gt; with the actual username)<br />
<code>mkdir /home/&lt;username&gt;</code></li>
<li>Give the user permission to that folder by typing<br />
<code>chown &lt;username&gt;.&lt;group&gt; /home/&lt;username&gt;</code><br />
Now this is a bit tricky, depending how you setup the groups.  You want to give the permission to a valid user and a group the user is part of.  For example, if you have a user named &#8220;matt&#8221; and a group named &#8220;contributor&#8221;, then your command would be<br />
<code>chown matt.contributor /home/matt</code></li>
<li>Finally, make sure the directory has the correct permissions by running the following command<br />
<code>chmod 0755 /home/&lt;username&gt;</code></li>
<li>Set the user&#8217;s home directory by running<br />
<code>usermod -d /home/&lt;username&gt; &lt;username&gt;</code></li>
</ol>
</li>
<li>
<strong>Create public/private key pairs for each user</strong><br />
<em>You will need to do the following for every user you have created!</em><br />
I am only going to go over the commands you would use in Linux as I haven&#8217;t tried this with PuTTY yet.  You will need to do these steps as &#8220;each user&#8221;.  In other words, you will have to logout on your PC, login as the next user and repeat the commands (advanced users can use su &lt;username&gt; to login as an additional user without logging out as their own).</p>
<ol>
<li>Run the following command in Terminal or Konsole on YOUR PC<br />
<code>ssh-keygen</code></li>
<li>Leave the file name as &#8220;id_rsa&#8221;</li>
<li>If you want a passphrase enter it here, otherwise, leave it blank (I left mine blank)</li>
<li>Next run the following command to generate a SSH 2 key<br />
<code>ssh-keygen -t dsa</code></li>
<li>Leave the file name as &#8220;id_dsa&#8221;</li>
<li>If you want a passphrase enter it here, otherwise, leave it blank (I left mine blank)</li>
<li>Next copy the files to your LinkStation by running<br />
<code>scp .ssh/*.pub &lt;username&gt;@&lt;IP ADDRESS&gt;:/home/&lt;username&gt;</code></li>
<li>Next login to the LinkStation via SSH using<br />
<code>ssh &lt;username&gt;@&lt;IP ADDRESS&gt;</code></li>
<li>Once login run the following command to create your SSH key directory<br />
<code>mkdir .ssh</code></li>
<li>Make sure the permissions are set properly by running<br />
<code>chmod 0700 .ssh</code></li>
<li>Load the public key for SSH 1 by running<br />
<code>cat id_rsa.pub &gt;&gt; .ssh/authorized_keys</code></li>
<li>Load the public key for SSH 2 by running<br />
<code>cat id_dsa.pub &gt;&gt; .ssh/authorized_keys2</code></li>
<li>Make sure the public key entries for SSH have the correct permissions by running<br />
<code>chmod 0600 .ssh/authorized_keys*</code></li>
<li>Exit out of the LinkStation by typing &#8220;exit&#8221;</li>
<li>Try step 8 again and make sure it did not ask for your password this time (if you entered a passphrase, you will be prompted for your passphrase)</li>
</ol>
</li>
</ol>
<p>Download the <a href='http://cpradio.org/personal/linkstation-pro-duo-enabling-ssh/attachment/sshd_config/' rel='attachment wp-att-171'>sshd_config.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://cpradio.org/personal/linkstation-pro-duo-enabling-ssh/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Flex and Flex Builder 3</title>
		<link>http://cpradio.org/personal/flex-and-flex-builder-3/</link>
		<comments>http://cpradio.org/personal/flex-and-flex-builder-3/#comments</comments>
		<pubDate>Sun, 09 Mar 2008 00:39:42 +0000</pubDate>
		<dc:creator>cpradio</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://cpradio.org/personal/flex-and-flex-builder-3/</guid>
		<description><![CDATA[I just have to tell everyone how cool Flex really is!  When I did flash work several years ago it was a real pain developing an entire site in Flash especially if you wanted to incorporate any backend to it.  This is definitely not the case with Flex and I have to give [...]]]></description>
			<content:encoded><![CDATA[<p>I just have to tell everyone how cool Flex really is!  When I did flash work several years ago it was a real pain developing an entire site in Flash especially if you wanted to incorporate any backend to it.  This is definitely not the case with Flex and I have to give Adobe its&#8217; props on this.</p>
<p>However, let me state, that I do want to see Flex Builder 3 ported to Linux.  I could then ditch my Windows Virtual Machine and run things natively, but that is my only complaint at this moment.</p>
<p><strong>So why do I love Flex?</strong><br />
Flex is just easy to use, the components built it are amazing and you have the ability to build components on your own too!  Much like Server Controls in .NET, .NET gives you a TON to begin with and you can create your own as well.  However, this is for Flash!  That is extremely important to acknowledge, as I do not have to have Macromedia Flash MX or whatever the latest version is on my PC to build a Flash application now.</p>
<p>Not only do I love being able to build a Flash application without Macromedia Flash, but I also love how it can work with an infinite number of backends without a lot of effort.  Got a web service you want to plugin to?  No problem, how about an RSS feed?  Again, No problem.  Well how about just a plain HTTP stream with a custom format?  No Problem!  I mean literally, you can plugin to any service that can send back a response.  If it is a custom type of response, then you can write a routine to read your custom format.  However, if you are using a Web Service, be in written in .NET and it returns an XML stream, then you literally have to do nothing!  It will read it without any custom code from you, the developer.  And that my friends is the &#8220;cream of the crop&#8221;.</p>
<p><strong>So where do we go from here?</strong><br />
I am going to be doing a lot of things with Flex fromt his point on.  I was just totally amazed by the simplicity and yet the complexity you can have within it.  I still have a lot to test.  Updating the grid&#8217;s data when it has changed, and similar events.  But time will tell and so far Adobe has bought me back with this wonderful technology.  Just bring it to Linux and I will move right next to your head-quarters Adobe!</p>
]]></content:encoded>
			<wfw:commentRss>http://cpradio.org/personal/flex-and-flex-builder-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Let the code work for you.</title>
		<link>http://cpradio.org/work/let-the-code-work-for-you/</link>
		<comments>http://cpradio.org/work/let-the-code-work-for-you/#comments</comments>
		<pubDate>Tue, 23 Oct 2007 02:03:02 +0000</pubDate>
		<dc:creator>cpradio</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[dynamic output]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://cpradio.org/work/let-the-code-work-for-you/</guid>
		<description><![CDATA[The past two/three days (work days), I have been plagued with the task of working on a complex portion of a project.  The piece I am working on, I did not start, but I did write the foundation of it for 5 other projects and its&#8217; success and easy maintenance was largely due to [...]]]></description>
			<content:encoded><![CDATA[<p>The past two/three days (work days), I have been plagued with the task of working on a complex portion of a project.  The piece I am working on, I did not start, but I did write the foundation of it for 5 other projects and its&#8217; success and easy maintenance was largely due to how I designed it.</p>
<p>To keep a long story short, the architecture I used was not followed in this piece and now I am paying the price for something I didn&#8217;t do.  The original code was developed so the code would do 50-70% of the work for me dynamically.  Yes, this has performance cost implications but they were minimal (1-2 seconds at best), but the time it saves is nearly 60-75% of development time.</p>
<p>Now the particular piece I am referring to does a lot of output work.  It takes the data inputted by the user and develops a results page to the user describing the information the user typed.  Now, to make my life easier, I build a hash table of the user&#8217;s values and associate them with a code.  The code is related to a table that defines the text to display regarding that entry.</p>
<p>By creating code to associate the hash table data with the database table, the results page can be generated dynamically saving me the countless time of programming each possibility the user can come up with.</p>
<p>Thus, sometimes it is smarter to go a dynamic route at the cost of performance, than it is to develop the most efficient masterpiece you can imagine.</p>
<p>That is my food for thought.</p>
]]></content:encoded>
			<wfw:commentRss>http://cpradio.org/work/let-the-code-work-for-you/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Dual Monitors and window.open(): Part 2</title>
		<link>http://cpradio.org/code/javascript/dual-monitors-and-windowopen-part-2/</link>
		<comments>http://cpradio.org/code/javascript/dual-monitors-and-windowopen-part-2/#comments</comments>
		<pubDate>Fri, 05 Oct 2007 23:54:26 +0000</pubDate>
		<dc:creator>cpradio</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[dual monitors]]></category>
		<category><![CDATA[window.open]]></category>

		<guid isPermaLink="false">http://cpradio.org/work/dual-monitors-and-windowopen-part-2/</guid>
		<description><![CDATA[What? There is more?!  Of course.  Previously I tackled the horizontal setup of dual monitors, now we tackle the vertical!
So just like window.screenLeft versus window.screenX, window.screenTop only works in IE and window.screenY works in everything else.  So here is the code I used to setup a window.*property*:

// Find Top Boundary of current [...]]]></description>
			<content:encoded><![CDATA[<p>What? There is more?!  Of course.  Previously I tackled the horizontal setup of dual monitors, now we tackle the vertical!</p>
<p>So just like <code>window.screenLeft</code> versus <code>window.screenX</code>, <code>window.screenTop</code> only works in IE and <code>window.screenY</code> works in everything else.  So here is the code I used to setup a window.*property*:</p>
<pre class="js">
// Find Top Boundary of current Window
function FindTopWindowBoundary()
{
	// In Internet Explorer window.screenTop is the window's top boundry
	if (window.screenTop)
	{
		return window.screenTop;
	}

	// In Firefox window.screenY is the window's top boundry
	if (window.screenY)
		return window.screenY;

	return 0;
}

window.topWindowBoundary  = FindTopWindowBoundary;
</pre>
<p>Then just like the horizontal setup, I needed to find the Monitor&#8217;s Top Border.  Like the horizontal counter-part, you need to check the negative y-axis scenario, which left me with this code:</p>
<pre class="js">
// Find Top Boundary of the Screen/Monitor
function FindTopScreenBoundary()
{
	// Check if the window is off the primary monitor in a positive axis
	// X,Y                 S = Screen, W = Window
	// 0,0     ----------
	//        |          |
	//        |          |
	//        |        S |
	//         ----------
	// X,Y
	// 0,1280  ----------
	//        |  ---     |
	//        | | W |    |
	//        |  ---   S |
	//         ----------
	if (window.topWindowBoundary() > window.screen.height)
	{
		return window.topWindowBoundary() - (window.topWindowBoundary() - window.screen.height);
	}

	// Check if the window is off the primary monitor in a negative axis
	// X,Y                   S = Screen, W = Window
	// 0,-1024   ----------
	//          |  ---     |
	//          | | W |    |
	//          |  ---   S |
	//           ----------
	// X,Y
	// 0,0       ----------
	//          |          |
	//          |          |
	//          |        S |
	//           ----------
	// This only works in Firefox at the moment due to a bug in Internet Explorer opening new windows into a negative axis
	// However, you can move opened windows into a negative axis as a workaround
	if (window.topWindowBoundary() < 0 &#038;&#038; window.topWindowBoundary() > (window.screen.height * -1))
	{
		return (window.screen.height * -1);
	}

	// If neither of the above, the monitor is on the primary monitor whose's screen Y should be 0
	return 0;
}
</pre>
<p>So now that we have the Top and Left boundaries written, we can open a window in any setup (2 monitors to 4 monitors to X monitors) using the following and be guaranteed that the new window will open in the same monitor as the parent window (except for IE where IE will not open windows in a negative axis).</p>
<pre class="js">window.open(thePage, 'windowName', 'resizable=1, scrollbars=1, fullscreen=0, height=200, width=650, screenX=' + window.leftScreenBoundary() + ' , left=' + window.leftScreenBoundary() + ',screenY=' + window.topScreenBoundary() + ',top=' + window.topScreenBoundary() + ', toolbar=0, menubar=0, status=1');</pre>
<p>And thus the finale of opening a child window in a dual, quad, whatever monitor setup.</p>
]]></content:encoded>
			<wfw:commentRss>http://cpradio.org/code/javascript/dual-monitors-and-windowopen-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dual Monitors and window.open()</title>
		<link>http://cpradio.org/code/javascript/dual-monitors-and-windowopen/</link>
		<comments>http://cpradio.org/code/javascript/dual-monitors-and-windowopen/#comments</comments>
		<pubDate>Wed, 26 Sep 2007 23:43:10 +0000</pubDate>
		<dc:creator>cpradio</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[dual monitors]]></category>
		<category><![CDATA[window.open]]></category>

		<guid isPermaLink="false">http://cpradio.org/code/javascript/dual-monitors-and-windowopen/</guid>
		<description><![CDATA[Lately, I have been plagued with the complicated tasks of solving problems at work that require dual monitors.  However, I only have a single monitor.  Until Today!
Today, I got my PC setup with Dual Monitors and was asked to solve the following problem:
&#8220;When the user clicks on a link that opens a new [...]]]></description>
			<content:encoded><![CDATA[<p>Lately, I have been plagued with the complicated tasks of solving problems at work that require dual monitors.  However, I only have a single monitor.  Until Today!</p>
<p>Today, I got my PC setup with Dual Monitors and was asked to solve the following problem:</p>
<blockquote><p>&#8220;When the user clicks on a link that opens a new window using window.open.  Make the window appear on the same monitor as its&#8217; parent.&#8221;</p></blockquote>
<p>So I got started.  Quickly I discovered that <code>window.screenLeft</code> (for IE) and <code>window.screenX</code> (for everyone else) will tell me where the window&#8217;s border is on the desktop.  So what better to do than to throw that in a window.*property* which gave me this code:</p>
<pre class="js">
// Find Left Boundry of current Window
function FindLeftWindowBoundry()
{
	// In Internet Explorer window.screenLeft is the window's left boundry
	if (window.screenLeft)
	{
		return window.screenLeft;
	}

	// In Firefox window.screenX is the window's left boundry
	if (window.screenX)
		return window.screenX;

	return 0;
}

window.leftWindowBoundry = FindLeftWindowBoundry;
</pre>
<p>Next, I needed to find the monitor&#8217;s left border.  Soon after, I figured out that there is no property currently for this, however, you can get the width of the current monitor your window is on by using <code>window.screen.width</code>.  There is a big pitfall that needs to be considered, you can have a monitor whose left border starts with a negative X-axis (ie: -1024&#215;0 to 0&#215;768).</p>
<p>So that left with me the following code:</p>
<pre class="js">
// Find Left Boundry of the Screen/Monitor
function FindLeftScreenBoundry()
{
	// Check if the window is off the primary monitor in a positive axis
	// X,Y                  X,Y                    S = Screen, W = Window
	// 0,0  ----------   1280,0  ----------
	//     |          |         |  ---     |
	//     |          |         | | W |    |
	//     |        S |         |  ---   S |
	//      ----------           ----------
	if (window.leftWindowBoundry() > window.screen.width)
	{
		return window.leftWindowBoundry() - (window.leftWindowBoundry() - window.screen.width);
	}

	// Check if the window is off the primary monitor in a negative axis
	// X,Y                  X,Y                    S = Screen, W = Window
	// 0,0  ----------  -1280,0  ----------
	//     |          |         |  ---     |
	//     |          |         | | W |    |
	//     |        S |         |  ---   S |
	//      ----------           ----------
	// This only works in Firefox at the moment due to a bug in Internet Explorer opening new windows into a negative axis
	// However, you can move opened windows into a negative axis as a workaround
	if (window.leftWindowBoundry() < 0 &#038;&#038; window.leftWindowBoundry() > (window.screen.width * -1))
	{
		return (window.screen.width * -1);
	}

	// If neither of the above, the monitor is on the primary monitor whose's screen X should be 0
	return 0;
}

window.leftScreenBoundry = FindLeftScreenBoundry;
</pre>
<p>Now that the code is written, you can now use <code>window.open</code> to open a window on the monitor the parent window is on.</p>
<pre class="js">window.open(thePage, 'windowName', 'resizable=1, scrollbars=1, fullscreen=0, height=200, width=650, screenX=' + window.leftScreenBoundry() + ' , left=' + window.leftScreenBoundry() + ', toolbar=0, menubar=0, status=1');</pre>
<p>Oh yeah, IE has a bug in it that prevents opening windows with <code>window.open</code> in the negative X-axis.  You have to use <code>windowName.moveTo(-1024, 0);</code> to move it to the negative X-axis.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://cpradio.org/code/javascript/dual-monitors-and-windowopen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JSON versus XML</title>
		<link>http://cpradio.org/work/json-versus-xml/</link>
		<comments>http://cpradio.org/work/json-versus-xml/#comments</comments>
		<pubDate>Wed, 26 Sep 2007 00:01:00 +0000</pubDate>
		<dc:creator>cpradio</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://cpradio.org/work/json-versus-xml/</guid>
		<description><![CDATA[There has been much debate on using XML or JSON with your AJAX, but in my mind, the debate is pointless.  Both are nice, one is quicker, one is slower.  However, when it comes to development pick what you know best and what you can implement/maintain easiest.
If you do this, you are guaranteed [...]]]></description>
			<content:encoded><![CDATA[<p>There has been much debate on using XML or JSON with your AJAX, but in my mind, the debate is pointless.  Both are nice, one is quicker, one is slower.  However, when it comes to development pick what you know best and what you can implement/maintain easiest.</p>
<p>If you do this, you are guaranteed the following:</p>
<ol>
<li>It is easy to maintain and understand the code you wrote months later</li>
<li>Chances are your application will not be the quickest in response</li>
<li>You will make use of techniques you fully understand than trying to adapt ones that you are unfamiliar with and may implement wrong</li>
</ol>
<p>So how does JSON differ from returning XML in your AJAX requests?  Lets first look at the advantages of XML.</p>
<ol>
<li>Standardized and easily serialized into via .NET</li>
<li>The XML is easy to read all within itself</li>
<li>You can make use of XSLT, DTDs, etc</li>
</ol>
<p>How about disadvantages of XML?</p>
<ol>
<li>It is slow in comparison to JSON</li>
<li>It can be clumsy when not designed properly</li>
</ol>
<p>Now for the advantages of JSON:</p>
<ol>
<li>It is faster than XML to parse in JavaScript</li>
<li>There are addin&#8217;s you can install in .NET or a library in PHP to serialize a JSON string from an object</li>
<li>It is hard to make this clumsy as it is based on the Object Design</li>
</ol>
<p>And the disadvantages of JSON:</p>
<ol>
<li>It is harder to read the serialized output</li>
<li>You can&#8217;t use XSLT, DTDs, or something of the sort to validate or style the request</li>
</ol>
<p>As for myself, I am a JSON person.  I didn&#8217;t used to be though.  My original AJAX applications were focused around XML primarily because I could make use of an XSLT and I always validated against a schema.  However, JSON has won me over due to speed.  JSON&#8217;s speed is just ridiculously fast and it showed when I converted a major application over to it.  I saved nearly a third of the time it took to do a fairly simple task.</p>
<p>However, pick the poison that you understand most, otherwise, it could have detrimental affects.</p>
]]></content:encoded>
			<wfw:commentRss>http://cpradio.org/work/json-versus-xml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Refactoring &#8211; What a time-saver</title>
		<link>http://cpradio.org/work/refactoring-saves-you-time-in-many-ways/</link>
		<comments>http://cpradio.org/work/refactoring-saves-you-time-in-many-ways/#comments</comments>
		<pubDate>Mon, 17 Sep 2007 02:52:52 +0000</pubDate>
		<dc:creator>cpradio</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[kiosk]]></category>

		<guid isPermaLink="false">http://cpradio.org/work/refactoring-saves-you-time-in-many-ways/</guid>
		<description><![CDATA[This weekend has been a nice relaxing weekend for me and so when I got back home this afternoon (on Sunday the 16th), I was in a great mood to refactor some of my kiosk code base.  Now, I should start by saying, I decided to refactor code instead of write new code tonight [...]]]></description>
			<content:encoded><![CDATA[<p>This weekend has been a nice relaxing weekend for me and so when I got back home this afternoon (on Sunday the 16th), I was in a great mood to refactor some of my kiosk code base.  Now, I should start by saying, I decided to refactor code instead of write new code tonight because I wanted to lessen the number of files that needed to load in the Ajax functionality.</p>
<p>Kiosk, uses Ajax in interesting ways to provide a better experience, but with that, the Ajax applications were built as each page was assembled.  This caused functionality across pages to get a bit messy or functionality shared across pages to get thrown into individual files.  Well the problem with individual files, is that is yet another file for the browser to download.</p>
<p>So before I get any further, let me discuss refactoring and how it can solve many performance binds your application may be experiencing.</p>
<p>To start off, refactoring is taking common code, or code that is used across pages or frequently and moving it to a more global location so it can be called easier and the code only has to be written once.</p>
<p>So where can this help?</p>
<ul>
<li>First of all, by refactoring code into a single global file, you can limit the number of HTTP requests if that file is accessible via the web.  Since your common code is in a single file, the browser only has to fetch that code once, and will then likely cache that file for each page after, giving you even better performance.</li>
<li>Secondly, by placing the common code in a global method/function, you are writing less code.  As now when you need to call that code on your second page, it is already written, so just call the function.  Otherwise, you would need to write the code all over again.</li>
<li>Thirdly, less code equals smaller files.  By refactoring your code, you can have smaller file sizes and in turn that is quicker to download, quicker to parse, and quicker to execute.</li>
</ul>
<p>Now in my situation, I took about 4 JavaScript files and combined them into a single file adequately named &#8220;general.js&#8221;.  The file contained code to automatically log the user out after a set amount of inactivity in the UI (User Interface).  Secondly, it contained the version checking mechanism calls that see if they are running the latest version of the software.  Unfortunately, those are the only two things it does right now, but as the project progresses, I am sure more utilities will get added in this file.</p>
<p>My next task is to refactor the Data Grid functionality so it is 1) XHTML, 2) easy to build complex columns with complex rows, 3) customizable by identifying StyleSheet classes for the columns and rows.  Hopefully, I can get my head around this idea and get it working with little trouble to the programmer.</p>
<p>So what can you think of that you need to refactor?  What performance gains do you suspect you will achieve with the refactoring you do?  Any performance markers?</p>
]]></content:encoded>
			<wfw:commentRss>http://cpradio.org/work/refactoring-saves-you-time-in-many-ways/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 4.322 seconds -->
<!-- Cached page served by WP-Cache -->
