<?xml version="1.0" encoding="utf-8"?>
			
			<rss version="2.0">
			<channel>
			<title>MissionDesign - Coldfusion</title>
			<link>http://www.missiondesign.net/yikes/index.cfm</link>
			<description>Yikes! I have a blog.</description>
			<language>en-us</language>
			<pubDate>Sun, 05 Sep 2010 22:29:43 -0500</pubDate>
			<lastBuildDate>Wed, 07 May 2008 22:52:00 -0500</lastBuildDate>
			<generator>BlogCFC</generator>
			<docs>http://blogs.law.harvard.edu/tech/rss</docs>
			<managingEditor>blogmaster@missiondesign.net</managingEditor>
			<webMaster>blogmaster@missiondesign.net</webMaster>
			
			<item>
				<title>Coldfusion and Geocoding with Google &amp; Yahoo Map API&apos;s</title>
				<link>http://www.missiondesign.net/yikes/index.cfm/2008/5/7/Coldfusion-and-Geocoding-with-Google--Yahoo-Map-APIs</link>
				<description>
				
				&lt;p&gt;&lt;font size=&quot;3&quot;&gt;Recently I needed to create a Google map driven solution that required geocoded addresses. After poking around the Google Maps API and looking at other solutions I decided that I&apos;d batch geocode the address I needed and store the coordinates in the database with the address data. This would prevent numerous geocode call to the API and should make things run a bit faster. While looking for examples of Coldfusion and Google maps I really didn&apos;t find anything that met my needs so I started from scratch. Here&apos;s what I did:&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size=&quot;3&quot;&gt;&amp;nbsp;First thing that you&apos;ll need is a Google maps key. Get one &lt;a href=&quot;http://code.google.com/apis/maps/signup.html&quot; target=&quot;_blank&quot;&gt;here.&lt;/a&gt;&lt;/font&gt;&lt;/p&gt;
&lt;pre&gt;&lt;font size=&quot;3&quot;&gt;{code}&amp;lt;cfset ghostKey = &amp;quot;yourKeyGoesHere&amp;quot;&amp;gt;{/code}&lt;/font&gt;&lt;/pre&gt;
&lt;p&gt;&lt;font size=&quot;3&quot;&gt;Next make the http call to Google. You pass in three parameters: q=&apos;address to geocode&apos; output=&apos;xml&apos; key=&apos;hostkey&apos;. So your request is formatted as:&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;{code}  &amp;lt;cfset address2geocode = &amp;quot;4151 N. Atlantic Ave., Cocoa Beach, Fl, 32931&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;cfhttp url=&amp;quot;http://maps.google.com/maps/geo?q=#address2geocode#&amp;amp;output=xml&amp;amp;key=#ghostKey#&amp;quot; resolveurl=&amp;quot;no&amp;quot; /&amp;gt;  {/code}&lt;/p&gt;
&lt;p&gt;&lt;font size=&quot;3&quot;&gt;I chose xml as output and was easy to work with. You can choose XML, KML or JSON. Look at the Google API for more info.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size=&quot;3&quot;&gt;You can view the http results here: &lt;a target=&quot;_blank&quot; href=&quot;/UserFiles/File/result.xml&quot;&gt;results.xml&lt;/a&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size=&quot;3&quot;&gt;Cool, two lines of code so far and we have a result. As you can see the XML is well formatted and easy to parse at this point. There are a view &apos;gotcha&apos;s&apos; as well. First check to see if XML was returned.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;{code} &amp;lt;cfif isXML(cfhttp.filecontent)&amp;gt; {/code}&lt;/p&gt;
&lt;p&gt;&lt;font size=&quot;3&quot;&gt;If so, xmlParse it:&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;{code}&amp;lt;cfset geocodedXML = #xmlParse(cfhttp.filecontent)#&amp;gt;{/code}&lt;/p&gt;
&lt;p&gt;&lt;font size=&quot;3&quot;&gt;Next you want to make sure you&apos;re getting a response code  of 200, walk the XML to find Status.code:&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;{code}&amp;lt;cfset curResponse = #geocodedXML.kml.Response.Status.code.xmlText#&amp;gt;&lt;br /&gt;
&amp;lt;cfif curResponse is &amp;quot;200&amp;quot;&amp;gt;{/code}&lt;/p&gt;
&lt;p&gt;&lt;font size=&quot;3&quot;&gt;Great! we can proceed. If you look at the result.xml file you&apos;ll see an node for Accuracy. For my application I needed an accuracy of 8.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;{code} &amp;lt;cfif geocodedXML.kml.Response.Placemark.AddressDetails.XmlAttributes.Accuracy eq 8&amp;gt;&amp;lt;!--- if not try Yahoo to geocode ---&amp;gt; {/code}&lt;/p&gt;
&lt;p&gt;&lt;font size=&quot;3&quot;&gt;Now I can grab the Longitude and Latitude to update the database:&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;{code} &amp;lt;cfset coords = #geocodedXML.kml.Response.Placemark.Point.coordinates.xmlText#&amp;gt;&lt;br /&gt;
&amp;lt;cfset accuracy = #geocodedXML.kml.Response.Placemark.AddressDetails.XmlAttributes.Accuracy#&amp;gt;&lt;br /&gt;
&amp;lt;cfset longitude = listFirst(coords)&amp;gt;&lt;br /&gt;
&amp;lt;cfset latitude = listGetAt(coords, 2)&amp;gt;&lt;br /&gt;
&amp;lt;cfquery datasource=&amp;quot;dsn&amp;quot; name=&amp;quot;updateCoords&amp;quot;&amp;gt;&lt;br /&gt;
update myTable&lt;br /&gt;
set longitude = &apos;#longitude#&apos;,&lt;br /&gt;
latitude = &apos;#latitude#&apos;,&lt;br /&gt;
geocode_accuracy = #accuracy#&lt;br /&gt;
where pk = #pk#&lt;br /&gt;
&amp;lt;/cfquery&amp;gt;&lt;br /&gt;
{/code}&lt;/p&gt;
&lt;p&gt;&lt;font size=&quot;3&quot;&gt;Pretty straight forward. But, if you remember I had a cfif that wanted an accuracy of 8, if not try Yahoo. No problem...just as easy as Googles...pretty much, just different. You guess it! you&apos;ll need a Yahoo API key too.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;{code}&amp;lt;cfelse&amp;gt;&lt;br /&gt;
&amp;lt;cfset yahooAppID = &amp;quot;yourYahooAPIKeyGoesHere&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;cfhttp url=&amp;quot;http://local.yahooapis.com/MapsService/V1/geocode?appid=#yahooAppID#&amp;amp;street=#address#&amp;amp;city=#city#&amp;amp;state=#state#&amp;quot; resolveurl=&amp;quot;no&amp;quot; /&amp;gt;{/code}&lt;/p&gt;
&lt;p&gt;&lt;font size=&quot;3&quot;&gt;Do the neccesary check for good reponse &lt;a href=&quot;/UserFiles/File/resultyahoo.xml&quot; target=&quot;_blank&quot;&gt;Yahoo&apos;s XML Result&lt;/a&gt;:&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;{code}&amp;lt;cfif isXML(cfhttp.filecontent)&amp;gt;&lt;br /&gt;
&amp;lt;cfset geocodedXML = #xmlParse(cfhttp.filecontent)#&amp;gt;{/code}&lt;/p&gt;
&lt;p&gt;&lt;font size=&quot;3&quot;&gt;Yahoo deosn&apos;t have a &apos;Accruacy node, they have precision and the best &apos;precision&apos; you can have is address level. Any way, walk the XML grab the coords and off you go.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;{code}&amp;lt;cfset longitude = &amp;quot;#geocodedXML.ResultSet.Result.Longitude.XmlText#&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;cfset latitude = &amp;quot;#geocodedXML.ResultSet.Result.Latitude.XmlText#&amp;quot;&amp;gt;{/code}&lt;/p&gt;
&lt;p&gt;&lt;font size=&quot;3&quot;&gt;That&apos;s it. simple geocoding using Coldfusion and/or Yahoo! I don&apos;t blog much, but hope to get a post on how to create dynamic Google maps using Coldfusion.&lt;/font&gt;&lt;/p&gt;
&lt;pre&gt;&lt;font size=&quot;3&quot;&gt;&amp;nbsp;&lt;/font&gt;&lt;/pre&gt; 
				</description>
				
				<category>Coldfusion</category>				
				
				<pubDate>Wed, 07 May 2008 22:52:00 -0500</pubDate>
				<guid>http://www.missiondesign.net/yikes/index.cfm/2008/5/7/Coldfusion-and-Geocoding-with-Google--Yahoo-Map-APIs</guid>
				
			</item>
			
			<item>
				<title>CFDoument and Eolas patent</title>
				<link>http://www.missiondesign.net/yikes/index.cfm/2006/11/27/CFDoument-and-Eolas-patent</link>
				<description>
				
				I finally got brave enough to publish some functionality utilizing &lt;a href=&quot;http://livedocs.macromedia.com/coldfusion/7/htmldocs/00000236.htm&quot; target=&quot;_blank&quot;&gt;cfdoument tags&lt;/a&gt;. Guess what? IE 6 and it&apos;s freaking Eolas patent patch starts breaking my delivered pdfs. I was getting a dialog box promting my to &apos;open&apos;&apos;save&apos;&apos;canel&apos; the *.cfm file that was generating the pdf. You could save the pdf...I mean .cfm file then change it to a .pdf, poof file opens as expected. 

The &lt;a href=
&quot;http://www.adobe.com/support/documentation/en/coldfusion/mx702/cf702_releasenotes.html&quot; target=&quot;_blank&quot;&gt;CFMX 7.0.2 updater&lt;/a&gt; fixes this issue. It&apos;s not documented well if this is actually what fixed my issue...anyway, it fixed it.

My dev environment was 7.0.2 so I didn&apos;t notice issues until it was published to prod. I guess I just felt like ranting a bit. I still love CF! Microsoft....not so much. 
				</description>
				
				<category>Coldfusion</category>				
				
				<pubDate>Mon, 27 Nov 2006 17:26:00 -0500</pubDate>
				<guid>http://www.missiondesign.net/yikes/index.cfm/2006/11/27/CFDoument-and-Eolas-patent</guid>
				
			</item>
			
			<item>
				<title>What&apos;s a blog?</title>
				<link>http://www.missiondesign.net/yikes/index.cfm/2006/11/21/Whats-a-blog</link>
				<description>
				
				I think it&apos;s like having a pet. You have to feed it (with entries and comments) or it will die. You have to protect it (deleted spam trackbacks) or it will die. If you go on vacation you have to update it about your vacation, or it will die.

My blog has never chewed my slippers, soiled my carpet or aggravated my allergies. Good blog.

Will my blog make it? doubtful. 
				</description>
				
				<category>Coldfusion</category>				
				
				<pubDate>Tue, 21 Nov 2006 12:52:00 -0500</pubDate>
				<guid>http://www.missiondesign.net/yikes/index.cfm/2006/11/21/Whats-a-blog</guid>
				
			</item>
			
			<item>
				<title>Certified</title>
				<link>http://www.missiondesign.net/yikes/index.cfm/2006/11/21/Certified</link>
				<description>
				
				I been trying to get around to taking this exam for three years now. Since then I had to migrate from Coldfusion 5.5, to ver 6, then to ver 7. This would have been lots easier if I had taken it three years ago as the functionality of CF has continued to grow. Anyway, I took the exam at Adobe MAX conference in Las Vegas and I got an 86%....Yahoooo!!! 1 % higher than I need to get &apos;Advanced&apos; developer status. What does this mean now? Now that I&apos;m all certified and everything? I dunno. So, three cheers for me!

&lt;img src=&quot;http://www.missiondesign.net/yikes/images/ACP.gif&quot;&gt; 
				</description>
				
				<category>Coldfusion</category>				
				
				<pubDate>Tue, 21 Nov 2006 12:17:00 -0500</pubDate>
				<guid>http://www.missiondesign.net/yikes/index.cfm/2006/11/21/Certified</guid>
				
			</item>
			</channel></rss>