<rss version="2.0"><channel><title>RSS feed for InstantSpot site Dave Shuck&apos;s InstantSpot</title><link>http://daveshuck.instantspot.com</link><language>en-us</language><copyright>This work is Copyright &#xA9; 2008 by Dave Shuck&apos;s InstantSpot</copyright><generator>RSSVille ColdFusion FeedMaker, version 1.0</generator><pubDate>Fri, 25 Jul 2008 11:35:12 GMT</pubDate><item><title>Related checkbox validation with JQuery</title><link>http://daveshuck.instantspot.com/blog/2008/07/16/Related-checkbox-validation-with-JQuery</link><description>&lt;p&gt;I was given a problem yesterday where I needed to do the following client-side validation.  If a user selects a checkbox that they wish to enable credit card transactions, I need to display a panel of specific credit card companies and they need to select at least one before submitting.&lt;/p&gt;
&lt;p&gt;If you think about writing the JS to do this without a library it is a somewhat lengthy task.  In essence, you would need to do some type of an onsubmit function on your form, check the value of the key checkbox.  If it was checked, check the value of each credit card checkbox to see if the user had selected one of the children.  After writing this in JQuery, I thought it might be worth demonstrating what an easy task this is.&lt;/p&gt;
&lt;p&gt;Let&apos;s start with the specific part of my form that has my checkboxes:&lt;div class=&quot;code&quot; &gt;&lt;pre&gt;&amp;lt;label for=&amp;quot;RequireCCInfo&amp;quot;&amp;gt;Require Credit Card Information?&amp;lt;/label&amp;gt;
&amp;lt;input name=&amp;quot;RequireCCInfo&amp;quot; id=&amp;quot;RequireCCInfo&amp;quot; value=&amp;quot;1&amp;quot; type=&amp;quot;checkbox&amp;quot;&amp;gt;
&amp;lt;div id=&amp;quot;CreditCardCompanyPanel&amp;quot;&amp;gt;
	&amp;lt;div&amp;gt;
		&amp;lt;input id=&amp;quot;ccAmex&amp;quot; class=&amp;quot;ccCheckBox&amp;quot; value=&amp;quot;1&amp;quot; type=&amp;quot;checkbox&amp;quot;&amp;gt;
		&amp;lt;label for=&amp;quot;ccAmex&amp;quot;&amp;gt;American Express&amp;lt;/label&amp;gt;
	&amp;lt;/div&amp;gt;
	&amp;lt;div&amp;gt;
		&amp;lt;input id=&amp;quot;ccVisa&amp;quot; class=&amp;quot;ccCheckBox&amp;quot; value=&amp;quot;1&amp;quot; type=&amp;quot;checkbox&amp;quot;&amp;gt;
		&amp;lt;label for=&amp;quot;ccVisa&amp;quot;&amp;gt;Visa&amp;lt;/label&amp;gt;
	&amp;lt;/div&amp;gt;
	&amp;lt;div&amp;gt;
		&amp;lt;input id=&amp;quot;ccDiscover&amp;quot; class=&amp;quot;ccCheckBox&amp;quot; value=&amp;quot;1&amp;quot; type=&amp;quot;checkbox&amp;quot;&amp;gt;
		&amp;lt;label for=&amp;quot;ccDiscover&amp;quot;&amp;gt;Discover&amp;lt;/label&amp;gt;
	&amp;lt;/div&amp;gt;
	&amp;lt;div&amp;gt;
		&amp;lt;input id=&amp;quot;ccMc&amp;quot; class=&amp;quot;ccCheckBox&amp;quot; value=&amp;quot;1&amp;quot; type=&amp;quot;checkbox&amp;quot;&amp;gt;
		&amp;lt;label for=&amp;quot;ccMc&amp;quot;&amp;gt;Master Card&amp;lt;/label&amp;gt;						
	&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;&lt;/pre&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There is nothing too notable in all of that other than the fact that you should notice that I have added a class &amp;quot;ccCheckBox&amp;quot; to all of my dependent checkboxes.  I will explain more on that in a bit, but I wanted to point out that it is there.  You will also notice that I am not doing anything in the way of hiding the &amp;quot;CreditCardCompanyPanel&amp;quot; div.  We need to determine at request time whether that will be hidden or not based on whether the &amp;quot;RequireCCInfo&amp;quot; checkbox is checked.&lt;/p&gt;
&lt;p&gt;Now, here is the fun part...  I am including the JS that I use for this task below:&lt;div class=&quot;code&quot; &gt;&lt;pre&gt;&amp;lt;script language=&amp;quot;javascript&amp;quot;&amp;gt;	
(document).ready(function(){
	$(&amp;quot;#RequireCCInfo&amp;quot;).change(function(){
		toggleCreditCardCompanyPanel();
	}); 	
	function toggleCreditCardCompanyPanel()	{
		if ($(&amp;quot;#RequireCCInfo&amp;quot;).attr(&amp;quot;checked&amp;quot;) == true) 	$(&amp;quot;#CreditCardCompanyPanel&amp;quot;).show();	
		else $(&amp;quot;#CreditCardCompanyPanel&amp;quot;).hide();
	}
	$(&amp;quot;#SaveButton&amp;quot;).click(function(){
		var pass = false;
		if ($(&amp;quot;#RequireCCInfo&amp;quot;).attr(&amp;quot;checked&amp;quot;) == true){
			$(&amp;quot;.ccCheckBox&amp;quot;).each(function() {
               			if ($(this).attr(&amp;quot;checked&amp;quot;) == true) pass = true;
            		});
		}
		else pass = true;
		if (pass) $(&amp;quot;#frmMyForm&amp;quot;).submit();
		else alert(&apos;You must select at least on credit card company if &amp;quot;Require Credit Card Information&amp;quot; is checked.&apos;);
	}); 
	toggleCreditCardCompanyPanel();
});
&amp;lt;/script&amp;gt;&lt;/pre&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;First, by using the $(document).ready() function we are telling JQuery to run this JS once the DOM has been completely loaded.  Let&apos;s look at each section within that ready() block...&lt;/p&gt;
&lt;p&gt;The first thing you will see is the $(&amp;quot;#RequireCCInfo&amp;quot;).change() method.  JQuery gives us the concept of binding a listener to an element.  For our example, this listener says that anytime that an element with an ID of &amp;quot;RequireCCInfo&amp;quot; is changed, that we will run the code in its function().  You will see that anytime our &amp;quot;RequireCCInfo&amp;quot; checkbox is changed we are going to run a function called toggleCreditCardCompanyPanel().   As you can see we have that method defined immediately after our &amp;quot;RequireCCInfo&amp;quot; checkbox.&lt;/p&gt;
&lt;p&gt;In our toggleCreditCardCompanyPanel() method, we are making the decision as to whether or not our &amp;quot;CreditCardCompanyPanel&amp;quot; will be displayed based on whether our user has decided to check the box labeled &amp;quot;Require Credit Card Information?&amp;quot;.   By using the JQuery selectors we are in essence saying:  If a checkbox with an ID of &amp;quot;RequireCCInfo&amp;quot; is checked, display an element with the ID &amp;quot;CreditCardCompanyPanel&amp;quot;.  Otherwise we will hide this element.&lt;/p&gt;
&lt;p&gt;Next comes our validation on form submit... and pretty cool stuff!&lt;/p&gt;
&lt;p&gt;Basically I have added a listener which is bound to our submit button with the ID of &amp;quot;SaveButton&amp;quot; which will submit our form &amp;quot;frmMyForm&amp;quot;.   Anytime that this button is clicked, we will run the code in the function() block.   We start this function by setting a value pass=false.  We will use this variable to determine whether our form has passed validation.  Next we get just a small taste of the magic of JQuery selectors.    First, as we did in the toggleCreditCardCompanyPanel() function, we are determining if the element with the ID of &amp;quot;RequireCCInfo&amp;quot; is checked.  If so, by using the each() function, we are going to loop through all elements on the page with the class &amp;quot;ccCheckBox&amp;quot; (remember that from above?).  In each iteration of the loop we are going to determine if the element has been checked.  If so, we are going to set pass=true since we know that our validation has passed.&lt;/p&gt;
&lt;p&gt;Lastly, now that we have determined that our form is either going to pass/fail, we take the appropriate action.  If pass==fail, we are simply going to alert a message telling the user that if they are going to enable credit cards that they have to choose at least one credit card company.  Otherwise, we are going to call the submit() method on our form.&lt;/p&gt;
&lt;p&gt;I almost took the time to write out the equivalent of this in POJS (plain old JavaScript) to show how much easier life is with JQuery, but I realized I didn&apos;t have the time, patience, or will.  JQuery has spoiled me!&lt;/p&gt;</description><pubDate>Wed, 16 Jul 2008 14:41:00 GMT</pubDate><guid>http://daveshuck.instantspot.com/blog/2008/07/16/Related-checkbox-validation-with-JQuery</guid><category>ColdFusion,Javascript,Tips and Tricks</category></item><item><title>ColdFusion in odd places - using the directory watcher on my desktop</title><link>http://daveshuck.instantspot.com/blog/2008/04/21/ColdFusion-in-odd-places--using-the-directory-watcher-on-my-desktop</link><description>&lt;p&gt;Since recently installling yet another distro on my laptop, I was unable to get the FTP functionality of my webcam software (Camorama) to work properly.  The program will save snapshots locally, but bombs on transfer.   Rather than troubleshoot it to death, I decided to whip out a quick and dirty ColdFusion directory watcher event gateway and have it watch for updated images, and then push them to my webserver via FTP.&lt;/p&gt;
&lt;p&gt;For anyone interested in this non-earth shattering bit of code, here it is.  First I created a config file:&lt;/p&gt;
&lt;p&gt;WebcamWatcher.cfg&lt;div class=&quot;code&quot; &gt;&lt;pre&gt;# The directory we want to watch. 
directory=/home/dshuck/Webcam_Pictures

# Do we want to recurse the directories?
recurse=no

# miliseconds between checks
interval=6000

# The comma separated list of extensions to match.
extensions=*

# component method for change events
changeFunction=onChange

# component method for add events
addFunction=onAdd

# no delete events for now
deleteFunction= &lt;/pre&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;Now to create the methods in our WebcamWatcher.cfc.  In short, either a changed file or an added file will trigger the putImage function which first creates the FTP connection, changes directories to my webcam directory, then pushes the file to the server.  Here is the code:&lt;/p&gt;
&lt;p&gt;WebcamWatcher.cfc&lt;div class=&quot;code&quot; &gt;&lt;pre&gt;&amp;lt;cfcomponent output=&amp;quot;false&amp;quot;&amp;gt;
	&amp;lt;cffunction name=&amp;quot;onAdd&amp;quot; output=&amp;quot;false&amp;quot;&amp;gt;
		&amp;lt;cfargument name=&amp;quot;CFEvent&amp;quot; type=&amp;quot;struct&amp;quot; required=&amp;quot;yes&amp;quot;&amp;gt;
		&amp;lt;cfset var Data=CFEvent.data /&amp;gt;
	  	&amp;lt;cflog file=&amp;quot;DirectoryWatcher&amp;quot; application=&amp;quot;No&amp;quot; 
	     	text=&amp;quot; ACTION: #data.type#;  FILE: #data.filename#;  calling putImage()&amp;quot; /&amp;gt;
		&amp;lt;cfset putImage() /&amp;gt;
	&amp;lt;/cffunction&amp;gt;
	

	&amp;lt;cffunction name=&amp;quot;onChange&amp;quot; output=&amp;quot;false&amp;quot;&amp;gt;
	  	&amp;lt;cfargument name=&amp;quot;CFEvent&amp;quot; type=&amp;quot;struct&amp;quot; required=&amp;quot;yes&amp;quot;&amp;gt;
	  	&amp;lt;cfset var data=CFEvent.data&amp;gt;
	  	&amp;lt;cflog file=&amp;quot;DirectoryWatcher&amp;quot; application=&amp;quot;No&amp;quot; 
	      text=&amp;quot; ACTION: #data.type#;  FILE: #data.filename#; TIME: #timeFormat(data.lastmodified)# calling putImage();&amp;quot; /&amp;gt;
		&amp;lt;cfset putImage() /&amp;gt;
	&amp;lt;/cffunction&amp;gt;

	&amp;lt;cffunction name=&amp;quot;putImage&amp;quot; access=&amp;quot;private&amp;quot; output=&amp;quot;false&amp;quot; returntype=&amp;quot;void&amp;quot;&amp;gt;
		&amp;lt;cfftp action = &amp;quot;open&amp;quot;
	   		username = &amp;quot;joeuser&amp;quot;
	  		connection = &amp;quot;MyConnection&amp;quot;
	   		password = &amp;quot;mycoolpassword&amp;quot;
	   		server = &amp;quot;www.mywebserver.com&amp;quot;
	   		stopOnError = &amp;quot;true&amp;quot; /&amp;gt;
		
		&amp;lt;cfif cfftp.Succeeded&amp;gt;
			&amp;lt;cfftp 
				connection=&amp;quot;MyConnection&amp;quot; 
				action=&amp;quot;changedir&amp;quot; 
				directory=&amp;quot;htdocs/mywebcamdirectory&amp;quot; /&amp;gt;
			
			&amp;lt;cfif cfftp.Succeeded&amp;gt;
				&amp;lt;cfftp 
					connection = &amp;quot;MyConnection&amp;quot;
					action = &amp;quot;putFile&amp;quot; 
					name = &amp;quot;uploadFile&amp;quot; 
					transferMode = &amp;quot;binary&amp;quot; 
					localFile = &amp;quot;/home/dshuck/Webcam_Pictures/webcam.jpeg&amp;quot; 
					remoteFile = &amp;quot;DaveWebcam.jpg&amp;quot; /&amp;gt;
			&amp;lt;/cfif&amp;gt;
	
		&amp;lt;/cfif&amp;gt;
		&amp;lt;cflog file=&amp;quot;DirectoryWatcher&amp;quot; application=&amp;quot;false&amp;quot; text=&amp;quot;file push to webserver...#cfftp.Succeeded#&amp;quot; /&amp;gt;
	&amp;lt;/cffunction&amp;gt;
&amp;lt;/cfcomponent&amp;gt;&lt;/pre&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;So, now the internet can yet again be graced with my &amp;quot;almost live&amp;quot; presence.   I can almost hear the selective sigh of relief.&lt;/p&gt;
&lt;p&gt;I have to consider this to be a somewhat odd place for ColdFusion and it got me thinking... What kinds of odd places do you or have you used ColdFusion?&lt;/p&gt;</description><pubDate>Mon, 21 Apr 2008 05:02:00 GMT</pubDate><guid>http://daveshuck.instantspot.com/blog/2008/04/21/ColdFusion-in-odd-places--using-the-directory-watcher-on-my-desktop</guid><category>ColdFusion,InstantSpot,Tips and Tricks</category></item><item><title>Adding spell checking to Evolution mail client</title><link>http://daveshuck.instantspot.com/blog/2008/04/01/Adding-spell-checking-to-Evolution-mail-client</link><description>&lt;p&gt;I am not sure why I have never pusued this until today, but I for some reason have never spent the time to figure out why I didn&apos;t have spell checking in my Evolution mail client. I knew that Evolution used the packages aspell and gnome-spell, which I already had installed, so why wasn&apos;t it working?&lt;/p&gt;
&lt;p&gt;When I went into my composer settings in the Evolution preferences, I saw a big empty box that was the list of dictionaries that Evolution was using.&amp;nbsp; You would think there would be some method of adding them from there, but unfortunately it isn&apos;t quite that obvious. To add the English dictionary I had to install the package aspell-en. Once I added this I reopened Evolution and Bamn!&lt;/p&gt;
&lt;p&gt;There it is. For the copy/paste inclined, try the following:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;#sudo apt-get install aspell gnome-spell aspell-en&lt;/code&gt;&lt;/p&gt;</description><pubDate>Tue, 01 Apr 2008 13:41:00 GMT</pubDate><guid>http://daveshuck.instantspot.com/blog/2008/04/01/Adding-spell-checking-to-Evolution-mail-client</guid><category>Ubuntu,Tips and Tricks</category></item><item><title>Publishing blog entries with ScribeFire using XMLRPC API</title><link>http://daveshuck.instantspot.com/blog/2008/01/29/Publishing-blog-entries-with-ScribeFire-using-XMLRPC-API</link><description>&lt;p&gt;On the most recent release of InstantSpot, we added in XMLRPC support so that blog administration can happen anywhere, using any client that supports XMLRPC.  We are thinking it might be fun to create an AIR app for this purpose down the line (or better yet... someone else! hint...hint...), but until that time, there are a variety of clients that can be used, since we followed the MetaWeblog API standards.&lt;br /&gt;
&lt;br /&gt;
I am actually trying this out for the first time on our live instance with this blog entry by using a *sweet* Firefox plugin called ScribeFire.  Considering that we haven&apos;t really published this ability, I thought it might make sense to do a walk through of setting it up and using it.&lt;br /&gt;
&lt;br /&gt;
First, let&apos;s walk through the ScribeFire Account Wizard.  One you have installed the ScribeFire plugin (&lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/1730&quot;&gt;available here&lt;/a&gt;), click on the little text pad icon in the bottom corner of your browser window and start the Account Wizard.  You should see a window that looks like the one below.  Choose &amp;quot;Manually Configure&amp;quot; and continue.&lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://daveshuck.instantspot.com/userfiles/073006/91/ScribeFireWizard01.png&quot; style=&quot;border: 1px solid rgb(48, 48, 48);&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
You will then be presented with a number of options of various &lt;ahem&gt;inferior&lt;/ahem&gt; blogging services.  Choose  &amp;quot;Custom Blog&amp;quot; and continue.&lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://daveshuck.instantspot.com/userfiles/073006/91/ScribeFireWizard02.png&quot; style=&quot;border: 1px solid rgb(48, 48, 48);&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
On the screen you see below, choose &amp;quot;MetaWeblog API&amp;quot; and enter this URL into the Server API URL input box:  &lt;strong&gt;http://www.instantspot.com/gospot/remote.metaweblogAPI&lt;/strong&gt; &lt;br /&gt;
Leave &amp;quot;Advanced Settings&amp;quot; unchecked and continue.&lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://daveshuck.instantspot.com/userfiles/073006/91/ScribeFireWizard03.png&quot; style=&quot;border: 1px solid rgb(48, 48, 48);&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
On the following screen you will be prompted for your username and password.  Since the new release of InstantSpot, your email address is now used as your username.  &lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://daveshuck.instantspot.com/userfiles/073006/91/ScribeFireWizard04.png&quot; style=&quot;border: 1px solid rgb(48, 48, 48);&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
That&apos;s it!  If you did this correctly you should see your blog listed in the following screen like this:&lt;br /&gt;
&lt;img src=&quot;http://daveshuck.instantspot.com/userfiles/073006/91/ScribeFireWizard05.png&quot; style=&quot;border: 1px solid rgb(48, 48, 48);&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
Now, you should see a list of your categories (labeled in the interface as &amp;quot;tags&amp;quot;), blogposts, and in the future, saved &amp;quot;Notes&amp;quot; which are drafts stored locally by ScribeFire to the right of the ScribeFire window like this:&lt;br /&gt;
&lt;img src=&quot;http://daveshuck.instantspot.com/userfiles/073006/91/ScribeFireInterface01.png&quot; style=&quot;border: 1px solid rgb(48, 48, 48);&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
From here, the interface is pretty simple.  One thing that is noteworthy is that we even support the ability for you to upload and insert images through ScribeFire.  When you click on the image icon on the editor, you will see a window that looks like this:&lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://daveshuck.instantspot.com/userfiles/073006/91/ScribeFireImageUpload.png&quot; style=&quot;border: 1px solid rgb(48, 48, 48);&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
Choose &amp;quot;Image Upload&amp;quot;, then after browsing to your file, select &amp;quot;Upload Via API&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://daveshuck.instantspot.com/userfiles/073006/91/ScribeFireImage%20UploadWait.png&quot; style=&quot;border: 1px solid rgb(48, 48, 48);&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
When it completes you will see the following window.  Choose &amp;quot;Insert Image&amp;quot; and you will see your image inserted into your text.&lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://daveshuck.instantspot.com/userfiles/073006/91/ScribeFireUploadComplete.png&quot; style=&quot;border: 1px solid rgb(48, 48, 48);&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
Now you can start posting away to your heart&apos;s content!&lt;/p&gt;
&lt;p class=&quot;poweredbyperformancing&quot;&gt;Powered by &lt;a href=&quot;http://scribefire.com/&quot;&gt;ScribeFire&lt;/a&gt;.&lt;/p&gt;</description><pubDate>Tue, 29 Jan 2008 15:37:00 GMT</pubDate><guid>http://daveshuck.instantspot.com/blog/2008/01/29/Publishing-blog-entries-with-ScribeFire-using-XMLRPC-API</guid><category>InstantSpot,Tips and Tricks</category></item><item><title>Gmail Tip: Muting and Unmuting conversation threads</title><link>http://daveshuck.instantspot.com/blog/2006/11/17/Gmail-Tip-Muting-and-Unmuting-conversation-threads</link><description>I accidentally learned a new Gmail trick today.  I was viewing an email and accidentally hit the &amp;#39;m&amp;#39; key on my keyboard.  This apparently mutes the conversation making that thread disappear from your inbox.   This is a cool trick on its own, but what happens if you want to unmute it?    In your Gmail search you can enter: &lt;strong&gt;is:muted&lt;/strong&gt;, and you will see a list of all muted threads.  To unmute, click into one and choose &amp;quot;Move to Inbox&amp;quot; in the select box at the top.  
</description><pubDate>Fri, 17 Nov 2006 23:41:01 GMT</pubDate><guid>http://daveshuck.instantspot.com/blog/2006/11/17/Gmail-Tip-Muting-and-Unmuting-conversation-threads</guid><category>Tips and Tricks</category></item><item><title>We have landed</title><link>http://daveshuck.instantspot.com/blog/2005/07/10/We-have-landed</link><description>&lt;font size=&quot;2&quot; face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;&gt;Well, I have installed my blogging software.&amp;nbsp; Time to play. :)&lt;br/&gt;
&lt;/font&gt;</description><pubDate>Sun, 10 Jul 2005 05:00:00 GMT</pubDate><guid>http://daveshuck.instantspot.com/blog/2005/07/10/We-have-landed</guid><category>ColdFusion</category></item></channel></rss>