<?xml version="1.0" encoding="utf-8"?>
			
			<rss version="2.0">
			<channel>
			<title>WebDH blog</title>
			<link>http://blog.webdh.com/index.cfm</link>
			<description>This is Troy&apos;s blog for WebDH.com LLC.</description>
			<language>en-us</language>
			<pubDate>Thu, 23 May 2013 18:01:15 -0700</pubDate>
			<lastBuildDate>Wed, 18 Jul 2012 20:44:00 -0700</lastBuildDate>
			<generator>BlogCFC</generator>
			<docs>http://blogs.law.harvard.edu/tech/rss</docs>
			<managingEditor>webdh.com@gmail.com</managingEditor>
			<webMaster>webdh.com@gmail.com</webMaster>
			
			<item>
				<title>Dynamic RSS Feed from ColdFusion and bad characters like &#xc2;</title>
				<link>http://blog.webdh.com/index.cfm/2012/7/18/Dynamic-RSS-Feed-from-ColdFusion-and-bad-characters-like-</link>
				<description>
				
				Are you creating a dynamic RSS Feed in ColdFusion? Maybe you learned some tips from &lt;a href=&quot;http://www.petefreitag.com/item/465.cfm&quot;&gt;Pete Freitag&apos;s blog article&lt;/a&gt;.  Maybe you have a feed that has worked fine then one day you encounter an issue where bad character(s) are throwing an error in the RSS feed. If you use Internet Explorer, you may see an error like this: An invalid character was found in text content. Line: 71 Character: 271


At the end of this blog I&apos;ll describe a simple fix that helped me and hopefully will help you too. Let&apos;s say you work at a fictious company and are responsible for publishing news content to the website. Today, each news release is saved as a content record in your CMS database; title, publish date, keywords, content. For the content, each news release contains a text file saved to the web server&apos;s file system, and the path to that file is saved in the database. The content file originated in MS Word from your company&apos;s communications department. You create a HTML version of the file, mainly using some simple HTML tags; paragraphs, italics, bold, etc. The website&apos;s news.cfm page queries the CMS database for a list of news titles, showing the most recent at the top. If a user clicks a news title, they visit the page newsdetail.cfm which does a &lt;cfinclude&gt; to display the content file. Maybe this has been working fine for years but now your company wants to offer a RSS Feed of the last 10 news releases. No problem, you read Pete&apos;s blog and whip out the page newsrss.cfm coded like this.

&lt;code&gt;
&lt;cfset currentoffset = getTimeZoneInfo().utcHourOffset&gt;
&lt;cfquery name=&quot;qNews&quot; datasource=&quot;CMS&quot; maxrows=&quot;10&quot;&gt;
  select id,title,pubdate,contentpath
  from news_table
  order by pubdate desc
&lt;/cfquery&gt;
&lt;cfsavecontent variable=&quot;xmldata&quot;&gt;&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;rss version=&quot;2.0&quot;&gt;
&lt;channel&gt;
&lt;title&gt;Company ABC News Releases&lt;/title&gt;
&lt;link&gt;http://www.companyabc.com/&lt;/link&gt;
&lt;description&gt;Company ABC is a worldwide leader in making news that people like to read.&lt;/description&gt;
&lt;lastBuildDate&gt;#DateFormat(Now(),&apos;#ddd, d mmm yyyy&apos;)# #TimeFormat(DateAdd(&apos;h&apos;,variables.currentoffset,Now()),&apos;h:mm:ss&apos;)# GMT&lt;/lastBuildDate&gt;
&lt;language&gt;en-us&lt;/language&gt;
&lt;cfloop query=&quot;qNews&quot;&gt;
&lt;item&gt;
&lt;title&gt;#title#&lt;/title&gt;
&lt;link&gt;http://www.companyabc.com/newsdetail.cfm?id=#id#&lt;/link&gt;
&lt;pubDate&gt;#DateFormat(pubdate,&apos;#ddd, d mmm yyyy&apos;)# #TimeFormat(DateAdd(&apos;h&apos;,variables.currentoffset,pubdate),&apos;h:mm:ss&apos;)# GMT&lt;/pubDate&gt;
&lt;content:encoded&gt;&lt;![CDATA[&lt;cfinclude template=&quot;#contentpath#&quot;&gt;]]&gt;&lt;/content:encoded&gt;
&lt;/item&gt;
&lt;/cfloop&gt;
&lt;/channel&gt;
&lt;/rss&gt;
&lt;/cfsavecontent&gt;
&lt;cfcontent type=&quot;text/xml&quot; reset=&quot;yes&quot; /&gt;&lt;cfoutput&gt;#variables.xmldata#&lt;/cfoutput&gt;
&lt;/code&gt;


If your content source is MS Word, it may contain special characters that are not UTF-8 friendly. Examples:

2010?2012  [long/short dash - you are seeing: 2010&#xe2;?&quot;2012]

?110 bn  [Euro - you are seeing: &#xe2;?&#xac;110 bn]

Castaeda  [foreign alpha character - you are seeing: Casta&#xc3;&#xb1;eeda]

value of ?  [greek character - you are seeing: value of &#xce;&#xb8;]

  [angled quotes - you are seeing: &#xe2;??my quote&#xe2;??]

rental.  Minneapolis  [double space - you may see nothing obvious or maybe you are seeing: rental. &#xc2; Minneapolis]


The fix is very simple, just append charset=utf-8 in this line at bottom of page: 

&lt;code&gt;
&lt;cfcontent type=&quot;text/xml; charset=utf-8&quot; reset=&quot;yes&quot; /&gt;
&lt;/code&gt;


For some reason, even though you have &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; the browser does not always interpret it that way. &lt;a href=&quot;http://www.thickpaddy.com/2009/8/10/coldfusion-is-not-utf-8-encoded&quot;&gt;Read this blog to learn more&lt;/a&gt; 
				</description>
				
				<category>ColdFusion</category>				
				
				<category>RSS</category>				
				
				<pubDate>Wed, 18 Jul 2012 20:44:00 -0700</pubDate>
				<guid>http://blog.webdh.com/index.cfm/2012/7/18/Dynamic-RSS-Feed-from-ColdFusion-and-bad-characters-like-</guid>
				
			</item>
			
			<item>
				<title>My page scraper and Twitterfeed</title>
				<link>http://blog.webdh.com/index.cfm/2012/3/10/My-page-scraper-and-Twitterfeed</link>
				<description>
				
				I recently built a small CF app to scrape the Minnesota Twins website. They have a &lt;a href=&quot;http://mlb.com/min/ticketing/sth/gen/sth_of_week.jsp&quot;&gt;page&lt;/a&gt; that is updated once a week (usually Monday) with a new winner of a special prize given to a Season Ticket Holder (STH). I didn&apos;t want to remember to check the page every week, so an automated solution was in order.

I created a page scraping template which makes a cfhttp call to the Twins site and parses the HTML for the winner&apos;s name and prize.  I then check the winner&apos;s name against the previous week&apos;s winner, and if it differs it saves the new data into the database and emails me the new winner and prize. To make it automated, I created a CF scheduled task that runs once a day and calls the scraping template.

To spread the app to other STH peeps, I expanded it further:
1) Email to subscribers each time a new winner is updated
2) Tweet by &lt;a href=&quot;http://twitter.com/faninmn&quot;&gt;@FanInMN&lt;/a&gt; each time a new winner is updated
3) RSS feed of the winners

To achieve 2 and 3, the scraping template also updates a RSS feed. This feed is used by Twitterfeed, which automatically tweets the new winner. Thanks to &lt;a href=&quot;http://blog.joshuaadams.com/index.cfm/2012/2/25/Twitterfeed&quot;&gt;Josh Adam&apos;s blog&lt;/a&gt; for the tip Twitterfeed, it was very easy to setup.

If you are a Twins STH, you can &lt;a href=&quot;http://www.webdh.com/sthprize/subscribe.cfm&quot;&gt;subscribe here&lt;/a&gt;. Go Twins! 
				</description>
				
				<category>Twitter</category>				
				
				<category>ColdFusion</category>				
				
				<pubDate>Sat, 10 Mar 2012 10:36:00 -0700</pubDate>
				<guid>http://blog.webdh.com/index.cfm/2012/3/10/My-page-scraper-and-Twitterfeed</guid>
				
			</item>
			
			<item>
				<title>Using ColdFusion to Deflate compress a SAML XML authentication message</title>
				<link>http://blog.webdh.com/index.cfm/2010/9/17/Using-ColdFusion-to-Deflate-compress-a-SAML-XML-authentication-message</link>
				<description>
				
				I am working on a ColdFusion project that uses SAML to authenticate users. I won&apos;t get into all the specific application details as they are quite complicated. However, the point of this blog post is to explain the components of the authentication request XML message that gets DEFLATE compressed, Base64 encoded and URL encoded.  I hope some of this can help others dealing with SAML and/or Deflate compression in their projects.

To implement &quot;DEFLATE compressed&quot; I knew Java would come into play and I found this resource which explained the &lt;a href=&quot;http://download.oracle.com/javase/6/docs/api/java/util/zip/Deflater.html&quot;&gt;Java Deflater class&lt;/a&gt;. 

This is the example Java code I needed to represent in ColdFusion.
&lt;code&gt;
/* Encode a String into bytes */
String inputString = &quot;blahblahblah??&quot;;
byte[] input = inputString.getBytes(&quot;UTF-8&quot;);

/* Compress the bytes */
byte[] output = new byte[100];
Deflater compresser = new Deflater();
compresser.setInput(input);
compresser.finish();
int compressedDataLength = compresser.deflate(output);
&lt;/code&gt;

I had a hard time finding any help on how I could create the Java byte array &lt;strong&gt;&quot;output&quot;&lt;/strong&gt; variable in ColdFusion. Luckily, I came across this old 2004 &lt;a href=&quot;http://blogs.adobe.com/cantrell/archives/2004/01/byte_arrays_and_1.html&quot;&gt;blog post from Christian Cantrell&lt;/a&gt;. This find was a life saver, thanks Christian!  Here is Christian&apos;s code:
&lt;code&gt;
&lt;cffunction name=&quot;getByteArray&quot; access=&quot;private&quot; returnType=&quot;binary&quot; output=&quot;no&quot;&gt;
&lt;cfargument name=&quot;size&quot; type=&quot;numeric&quot; required=&quot;true&quot;/&gt;
&lt;cfset var emptyByteArray = createObject(&quot;java&quot;, &quot;java.io.ByteArrayOutputStream&quot;).init().toByteArray()/&gt;
&lt;cfset var byteClass = emptyByteArray.getClass().getComponentType()/&gt;
&lt;cfset var byteArray = createObject(&quot;java&quot;,&quot;java.lang.reflect.Array&quot;).newInstance(byteClass, arguments.size)/&gt;
&lt;cfreturn byteArray/&gt;
&lt;/cffunction&gt;
&lt;/code&gt;

Here is my final ColdFusion code that represents the original Java example above.
&lt;code&gt;
&lt;!--- setup ColdFusion/Java bytearray variable  ---&gt;
&lt;cfset emptyByteArray = createObject(&quot;java&quot;, &quot;java.io.ByteArrayOutputStream&quot;).init().toByteArray()/&gt;
&lt;cfset byteClass = emptyByteArray.getClass().getComponentType()/&gt;
&lt;cfset output = createObject(&quot;java&quot;,&quot;java.lang.reflect.Array&quot;).newInstance(byteClass, 500)/&gt;

&lt;!--- perform Deflate, Base64 encode, and URL encode ---&gt;
&lt;cfscript&gt;
saml_deflate = createObject(&quot;java&quot;, &quot;java.util.zip.Deflater&quot;);
saml_deflate.init(9,true);
saml_deflate.setInput(saml_xml.getBytes(&quot;UTF-8&quot;));
saml_deflate.finish();
compressedDataLength = saml_deflate.deflate(output);
data64 = toBase64(output,&quot;UTF-8&quot;);
data64url = urlencodedformat(data64);
&lt;/cfscript&gt;
&lt;/code&gt;

Before the ColdFusion code above, you start with the SAML XML message like this, which is saved in the CF variable &lt;strong&gt;&quot;saml_xml&quot;&lt;/strong&gt;, and the final result is in the CF variable &lt;strong&gt;&quot;data64url&quot;&lt;/strong&gt;.
&lt;code&gt;
&lt;cfsavecontent variable=&quot;saml_xml&quot;&gt;&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;samlp:AuthnRequest xmlns:saml=&quot;urn:oasis:names:tc:SAML:2.0:assertion&quot;
xmlns:samlp=&quot;urn:oasis:names:tc:SAML:2.0:protocol&quot;
ID=&quot;a966242f393474b7d95f4581ff7db131d&quot; Version=&quot;2.0&quot;
IssueInstant=&quot;2010-05-10T16:24:33.525Z&quot;&gt;
&lt;saml:Issuer&gt;http://theissuer.domain.org/app/&lt;/saml:Issuer&gt;
&lt;/samlp:AuthnRequest&gt;&lt;/cfsavecontent&gt;
&lt;/code&gt; 
				</description>
				
				<category>ColdFusion</category>				
				
				<pubDate>Fri, 17 Sep 2010 11:16:00 -0700</pubDate>
				<guid>http://blog.webdh.com/index.cfm/2010/9/17/Using-ColdFusion-to-Deflate-compress-a-SAML-XML-authentication-message</guid>
				
			</item>
			
			<item>
				<title>Using ColdFusion with a stubborn MS Access Date/Time field</title>
				<link>http://blog.webdh.com/index.cfm/2010/3/20/Using-ColdFusion-with-a-stubborn-MS-Access-DateTime-field</link>
				<description>
				
				I have a small application using a MS Access database. Yes, I know all the reasons why it shouldn&apos;t be used, let&apos;s not go there. Fact is, many developers still use Access for small apps, prototyping, etc, and may come across the same roadblock in which I figured out a solution. For reference, today&apos;s date is &lt;strong&gt;3/19/2010&lt;/strong&gt; which was used in the query examples shown.
&lt;br /&gt;&lt;br /&gt;

&lt;strong&gt;Requirement:&lt;/strong&gt; Query a table of Jobs (JobTitle, Dept, Salary, etc) that contains a Date/Time field named PostingEndDate. This field is configured as Required = No. That means the admin user who populates records in the table will either supply a date, or may leave the date blank.  Think of it as a field that allows NULL in MS SQL. On the end-user side, the query needs to list only current jobs by filtering the records where:&lt;br /&gt;
1) PostingEndDate has not passed today&apos;s date&lt;br /&gt;
OR&lt;br /&gt;
2) PostingEndDate is empty (blank value means the Job can be displayed to the user indefinitely)

Here is a cfdump (jobList_raw) of all records:
&lt;code&gt;
SELECT   JobID, DeptID, JobTitle, Salary, PostingEndDate
FROM     tblJob 
WHERE 	 ActiveJob = 1
ORDER BY JobTitle
&lt;/code&gt;
&lt;img src=&quot;/images/posts/1_rawdata.jpg&quot;&gt;
&lt;br /&gt;&lt;br /&gt;

&lt;strong&gt;Problem:&lt;/strong&gt; no easy way to write the WHERE clause. Here are some attempts:&lt;br /&gt;
1) Len(PostingEndDate) = 0&lt;br /&gt;
No error, but does not pick up those with blank dates:
&lt;code&gt;
SELECT   JobID, DeptID, JobTitle, Salary, PostingEndDate
FROM     tblJob 
WHERE 	 ActiveJob = 1
AND   (Now() &lt;= PostingEndDate OR Len(PostingEndDate) = 0)
ORDER BY JobTitle
&lt;/code&gt;

2) PostingEndDate = &apos;&apos;&lt;br /&gt;
Generates error: [Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression. &lt;br /&gt;
We can&apos;t compare the date field to an empty string.
&lt;code&gt;
SELECT   JobID, DeptID, JobTitle, Salary, PostingEndDate
FROM     tblJob 
WHERE 	 ActiveJob = 1
AND   (Now() &lt;= PostingEndDate OR PostingEndDate = &apos;&apos;)
ORDER BY JobTitle
&lt;/code&gt;

3) Cstr(PostingEndDate) = &apos;&apos;&lt;br /&gt;
Generates error: [Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Invalid use of Null&lt;br /&gt; 
This was my attempt to Cast the date to a string using an Access function. Guess not.
&lt;code&gt;
SELECT   JobID, DeptID, JobTitle, Salary, PostingEndDate
FROM     tblJob 
WHERE 	 ActiveJob = 1
AND   (Now() &lt;= PostingEndDate OR Cstr(PostingEndDate) = &apos;&apos;)
ORDER BY JobTitle
&lt;/code&gt;
&lt;br /&gt;

&lt;strong&gt;Solution:&lt;/strong&gt; write a ColdFusion Query of Query (QoQ) to UNION the two conditions into one resultset. Here are the steps that lead to the final solution.&lt;br /&gt;
1) I still need a way to get a string representation (varchar) of the date field. So I added another column (PostingEndDate_str) to the Query object.
&lt;code&gt;
&lt;cfset QueryAddColumn(jobList_raw,&quot;PostingEndDate_str&quot;,&quot;varchar&quot;,Arraynew(1))&gt;
&lt;/code&gt;

2) Loop query and populate the new varchar field. This was intended to produce a blank string for what cfdump showed as [empty string]. Then I should be able to use: PostingEndDate = &apos;&apos; 
&lt;code&gt;
&lt;cfloop query=&quot;jobList_raw&quot;&gt;
	&lt;cfset QuerySetCell(jobList_raw, &quot;PostingEndDate_str&quot;, &quot;#PostingEndDate#&quot;,currentrow)&gt;
&lt;/cfloop&gt;
&lt;/code&gt;
NOPE! Still see [empty string] in the new field, THIS BECAME THE HAIR PULLING MOMENT OF THE SOLUTION AT THIS POINT, SO I STARTED GOOGLE SEARCHING.&lt;br /&gt;
&lt;img src=&quot;/images/posts/2_str_empty.jpg&quot;&gt;

I decided to try using &apos;-&apos; before and after the value, a trick I noticed in &lt;a href=&quot;http://www.bennadel.com/blog/379-ColdFusion-Query-of-Queries-Unexpected-Data-Type-Conversion.htm&quot;&gt;Ben Nadel&apos;s blog&lt;/a&gt;:
&lt;code&gt;
&lt;cfloop query=&quot;jobList_raw&quot;&gt;
	&lt;cfset QuerySetCell(jobList_raw, &quot;PostingEndDate_str&quot;, &quot;-#PostingEndDate#-&quot;,currentrow)&gt;
&lt;/cfloop&gt;
&lt;/code&gt;
Now I see &quot;--&quot; for all those [empty string] values, much better. I can work with that in the QoQ.&lt;br /&gt;
&lt;img src=&quot;/images/posts/3_str_dashes.jpg&quot;&gt;

3) Last is the Query of Query UNION.
&lt;code&gt;
SELECT	JobID, DeptID, JobTitle, Salary, PostingEndDate
FROM    jobList_raw 
WHERE   #ParseDateTime(DateFormat(Now(),&apos;mm/dd/yyyy&apos;))# &lt;= PostingEndDate  &lt;!--- Lefthand expression will format Now() as: 2010-03-19 00:00:00.0 ---&gt;
UNION
SELECT	JobID, DeptID, JobTitle, Salary, PostingEndDate
FROM    jobList_raw 
WHERE 	 PostingEndDate_str = &apos;--&apos;  &lt;!--- [empty string] dates will contain this value from the QuerySetCell loop executed above ---&gt;
ORDER BY JobTitle
&lt;/code&gt;

Here is the final recordset. It correctly leaves the Architect job filtered out because its PostingEndDate of Mar 9, 2010 has passed. The Mortgage Processor and Supervisor jobs with blank dates are kept in the results!&lt;br /&gt;
&lt;img src=&quot;/images/posts/4_no_architect.jpg&quot;&gt; 
				</description>
				
				<category>ColdFusion</category>				
				
				<category>SQL</category>				
				
				<pubDate>Sat, 20 Mar 2010 17:16:00 -0700</pubDate>
				<guid>http://blog.webdh.com/index.cfm/2010/3/20/Using-ColdFusion-with-a-stubborn-MS-Access-DateTime-field</guid>
				
			</item>
			
			<item>
				<title>Excited for special ColdFusion Builder event in St. Paul on March 23</title>
				<link>http://blog.webdh.com/index.cfm/2010/3/17/Excited-for-special-ColdFusion-Builder-event-in-St-Paul-on-March-23</link>
				<description>
				
				Josh Adams, Adobe Senior Solutions Engineer for ColdFusion, will be presenting live as part of a special CFUG tour. Josh will bring us the latest details and demonstration of the new Eclipse based IDE, ColdFusion Builder. We are planning for a fun event hosted at our usual user group location, &lt;a href=&quot;http://www.easeltraining.com/locations.htm&quot;&gt;Easel Solutions&lt;/a&gt;. Adobe is shipping us some special event swag as well, so be there for chance to take home a unique prize. Hope to see a packed house, register now!

&lt;a href=&quot;http://www.colderfusion.com/CFBuilder10.cfm&quot;&gt;www.colderfusion.com/CFBuilder10.cfm&lt;/a&gt;

Date: Tuesday, March 23, 2010

Agenda:&lt;br /&gt;
5:45 Food and Social&lt;br /&gt;
6:30 Presentation begins&lt;br /&gt;
8:15 Q &amp; A - Prizes&lt;br /&gt;
8:30 After party at local bar TBD

Location: Easel Solutions, St. Paul, MN

Updated 3/24/2010&lt;br /&gt;
We had a great event, here are some pics!
&lt;table style=&quot;width:194px;&quot;&gt;&lt;tr&gt;&lt;td align=&quot;center&quot; style=&quot;height:194px;background:url(http://picasaweb.google.com/s/c/transparent_album_background.gif) no-repeat left&quot;&gt;&lt;a href=&quot;http://picasaweb.google.com/tccfug/ColdFusionBuilderJoshAdamsMarch2010?feat=embedwebsite&quot;&gt;&lt;img src=&quot;http://lh3.ggpht.com/_8EIHSD0NziE/S6oCy9g-XUE/AAAAAAAAAUQ/6yYOWWZdFx8/s160-c/ColdFusionBuilderJoshAdamsMarch2010.jpg&quot; width=&quot;160&quot; height=&quot;160&quot; style=&quot;margin:1px 0 0 4px;&quot;&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;text-align:center;font-family:arial,sans-serif;font-size:11px&quot;&gt;&lt;a href=&quot;http://picasaweb.google.com/tccfug/ColdFusionBuilderJoshAdamsMarch2010?feat=embedwebsite&quot; style=&quot;color:#4D4D4D;font-weight:bold;text-decoration:none;&quot;&gt;ColdFusion Builder - Josh Adams - March 2010&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt; 
				</description>
				
				<category>ColdFusion</category>				
				
				<pubDate>Wed, 17 Mar 2010 21:56:00 -0700</pubDate>
				<guid>http://blog.webdh.com/index.cfm/2010/3/17/Excited-for-special-ColdFusion-Builder-event-in-St-Paul-on-March-23</guid>
				
			</item>
			
			<item>
				<title>ColdFusion UG Tour coming to St. Paul June 11</title>
				<link>http://blog.webdh.com/index.cfm/2009/5/31/ColdFusion-UG-Tour-coming-to-St-Paul-June-11</link>
				<description>
				
				I&apos;m thrilled to report that &lt;a href=&quot;http://www.forta.com&quot;&gt;Ben Forta&lt;/a&gt; is visiting the Twin Cities again as part of the Adobe &lt;a href=&quot;http://groups.adobe.com/resources/3cfaadbc5e/summary&quot;&gt;worldwide user group tour&lt;/a&gt; for the upcoming versions of ColdFusion and Flex.  I got the official word a few weeks ago and have been head down in planning mode ever since. Figuring attendance will bust down the doors at Easel Solutions, we needed a bigger venue, so I made a bunch of calls, sent emails, and even visited one potential location. In the end we choose the University of St. Thomas, St. Paul Campus and I think it is going to work out great.

I want to thank the TCCFUG&apos;s co-manager, Ben Ellefson, for major work on the event registration website. It&apos;s now live and I urge you to get this on your calendar and &lt;a href=&quot;http://colderfusion.com/forta09.cfm&quot;&gt;register now&lt;/a&gt;. This is one user group meeting you will not want to miss, plus you&apos;ll be fed and could win an IPod touch to boot.

Hope to see you there!

Updated 6/12/2009&lt;br /&gt;
We had a great event, here are some pics!
&lt;table style=&quot;width:194px;&quot;&gt;&lt;tr&gt;&lt;td align=&quot;center&quot; style=&quot;height:194px;background:url(http://picasaweb.google.com/s/c/transparent_album_background.gif) no-repeat left&quot;&gt;&lt;a href=&quot;http://picasaweb.google.com/tccfug/AdobeCF9Flex4UGTourStPaul2009?feat=embedwebsite&quot;&gt;&lt;img src=&quot;http://lh6.ggpht.com/_8EIHSD0NziE/SjEt5--eMqE/AAAAAAAAANw/kUTyq24jp14/s160-c/AdobeCF9Flex4UGTourStPaul2009.jpg&quot; width=&quot;160&quot; height=&quot;160&quot; style=&quot;margin:1px 0 0 4px;&quot;&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;text-align:center;font-family:arial,sans-serif;font-size:11px&quot;&gt;&lt;a href=&quot;http://picasaweb.google.com/tccfug/AdobeCF9Flex4UGTourStPaul2009?feat=embedwebsite&quot; style=&quot;color:#4D4D4D;font-weight:bold;text-decoration:none;&quot;&gt;Adobe CF9/Flex4 UG Tour St. Paul 2009&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt; 
				</description>
				
				<category>Conferences</category>				
				
				<category>ColdFusion</category>				
				
				<pubDate>Sun, 31 May 2009 23:36:00 -0700</pubDate>
				<guid>http://blog.webdh.com/index.cfm/2009/5/31/ColdFusion-UG-Tour-coming-to-St-Paul-June-11</guid>
				
			</item>
			
			<item>
				<title>Completed my first Flash project</title>
				<link>http://blog.webdh.com/index.cfm/2009/4/30/Completed-my-first-Flash-project</link>
				<description>
				
				Over the past two months, I&apos;ve been working with a new client on a Flash project. She happens to be a former co-worker in my Creative Internet Solutions days back in 1999-2000. We reconnected on Facebook and I learned about a new &lt;a href=&quot;http://www.heddyfreddy.com/&quot;&gt;women&apos;s handbag system&lt;/a&gt; she was developing and needed a Flash demo for her website. We met for lunch so I could see the prototype handbags firsthand and she had a basic script on paper of how she wanted it to look and flow. From there I dove into some Lynda.com training and also picked up some best practices from a couple Flash gurus I know. After a few revisions, she had exactly what she wanted and was very happy with the end result.

&lt;a href=&quot;#&quot; onclick=&quot;JavaScript:window.open(&apos;http://www.webdh.com/clients/heddy_freddy/flash.html&apos;,&apos;flash&apos;,&apos;width=575,height=450,screenX=200,screeny=150,status=no,scrollbars=no,menubar=no,location=no,resizable=no&apos;)&quot;&gt;Heddy Freddy handbag system Flash demo&lt;/a&gt; 

Client quote: &quot;Thanks so much for the great animation, it&apos;s just what I imagined!&quot; 
				</description>
				
				<category>Flash</category>				
				
				<pubDate>Thu, 30 Apr 2009 13:19:00 -0700</pubDate>
				<guid>http://blog.webdh.com/index.cfm/2009/4/30/Completed-my-first-Flash-project</guid>
				
			</item>
			
			<item>
				<title>How to send a fax using Ooma</title>
				<link>http://blog.webdh.com/index.cfm/2009/3/9/How-to-send-a-fax-using-Ooma</link>
				<description>
				
				We just got an &lt;a href=&quot;http://www.ooma.com&quot; target=&quot;_blank&quot;&gt;Ooma&lt;/a&gt; VOIP phone system ($220 deal right now at Costco) and I&apos;ve been testing exactly how I&apos;ll position the Hub and Scout in our house. I also wanted to make sure our fax machine will work. We don&apos;t fax very often, but it&apos;s sure nice to have when when needed (usually about once a month.)  Ooma says to position a fax machine with direct phone line connection to the Hub.  I tried this, but it wasn&apos;t working. I could hear the high pitch &quot;faxing sound&quot;, but after that, the connection would fail.  I found a web forum with an easy solution, simply prefix the number you are dialing with *99 and it works!  Here is the &lt;a href=&quot;http://forums.ooma.com/viewtopic.php?f=6&amp;t=114&quot; target=&quot;_blank&quot;&gt;Ooma forum link&lt;/a&gt;. Ok, now I just need to get our home phone number ported and it will be time to drop Comcast phone service and save $40 per month! 
				</description>
				
				<category>Ooma</category>				
				
				<pubDate>Mon, 09 Mar 2009 14:15:00 -0700</pubDate>
				<guid>http://blog.webdh.com/index.cfm/2009/3/9/How-to-send-a-fax-using-Ooma</guid>
				
			</item>
			
			<item>
				<title>ColdFusion page added to SalesForce wiki</title>
				<link>http://blog.webdh.com/index.cfm/2009/3/3/ColdFusion-page-added-to-SalesForce-wiki</link>
				<description>
				
				Today I added a section for &lt;b&gt;Adobe ColdFusion&lt;/b&gt; to the SalesForce Developer Wiki under the &lt;a href=&quot;http://wiki.apexdevnet.com/index.php/Web_Services_API&quot; target=&quot;_blank&quot;&gt;Web Services API&lt;/a&gt; section. 

I then added the first code sample article, showing how to do a &lt;a href=&quot;http://wiki.apexdevnet.com/index.php/Basic_Web2Lead_Implementation&quot; target=&quot;_blank&quot;&gt;Basic Web2Lead Implementation&lt;/a&gt;. I looked at a similar PHP sample done by Wayne Abbott as the basis for my article.

Hopefully this will spur others in the CF Community to start adding more content to this wiki and spread the knowledge of CF as a viable web development platform. 
				</description>
				
				<category>SalesForce</category>				
				
				<pubDate>Tue, 03 Mar 2009 16:02:00 -0700</pubDate>
				<guid>http://blog.webdh.com/index.cfm/2009/3/3/ColdFusion-page-added-to-SalesForce-wiki</guid>
				
			</item>
			
			<item>
				<title>Tips for testing web-to-lead on SalesForce sandbox server</title>
				<link>http://blog.webdh.com/index.cfm/2009/3/3/Tips-for-testing-webtolead-on-SalesForce-sandbox-server</link>
				<description>
				
				The SalesForce Web-to-Lead URL is well known to be: 
https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8

If you have access to a Sandbox server to do your development, you may want to test Web-to-Lead against it. You first should go into the setup area to find your OID (Organization ID) which will differ from your production OID. Find this from SalesForce&apos;s top &quot;Setup&quot; link. Then drill down into the left navigation menu:&lt;br&gt;
App Setup / Customize / Leads / Web-to-Lead&lt;br&gt;
Make sure the checkbox for Web-to-Lead Enabled is checked. Then click the &quot;Create Web-to-Lead Form&quot; button. On the next page, keep all selected fields as defaults and click the &quot;Generate&quot; button. Look in the generated HTML output for your unique OID which is given in the first hidden form field. You should see lines of code like this:

&lt;code&gt;
&lt;!--  ----------------------------------------------------------------------  --&gt;
&lt;!--  NOTE: Please add the following &lt;META&gt; element to your page &lt;HEAD&gt;.      --&gt;
&lt;!--  If necessary, please modify the charset parameter to specify the        --&gt;
&lt;!--  character set of your HTML page.                                        --&gt;
&lt;!--  ----------------------------------------------------------------------  --&gt;

&lt;META HTTP-EQUIV=&quot;Content-type&quot; CONTENT=&quot;text/html; charset=UTF-8&quot;&gt;

&lt;!--  ----------------------------------------------------------------------  --&gt;
&lt;!--  NOTE: Please add the following &lt;FORM&gt; element to your page.             --&gt;
&lt;!--  ----------------------------------------------------------------------  --&gt;

&lt;form action=&quot;https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8&quot; method=&quot;POST&quot;&gt;

&lt;input type=hidden name=&quot;oid&quot; value=&quot;youroidhere&quot;&gt;
&lt;/code&gt;

Remember, you are developing for tests against the Sandbox server, so you will need to modify the Form action to match the URL of your Sandbox homepage. Look at your Sandbox url and replace &quot;www&quot; with the proper subdomain, such as &quot;cs2&quot; in this example. &lt;br&gt;
Example Sandbox homepage: https://cs2.salesforce.com/home/home.jsp &lt;br&gt;
New Web-to-Lead Form action: https://cs2.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8 
				</description>
				
				<category>SalesForce</category>				
				
				<pubDate>Tue, 03 Mar 2009 14:14:00 -0700</pubDate>
				<guid>http://blog.webdh.com/index.cfm/2009/3/3/Tips-for-testing-webtolead-on-SalesForce-sandbox-server</guid>
				
			</item>
			
			<item>
				<title>Update your Twitter status from ColdFusion using a JSP tag library</title>
				<link>http://blog.webdh.com/index.cfm/2009/2/4/Update-your-Twitter-status-from-ColdFusion-using-a-JSP-tag-library</link>
				<description>
				
				Today I wanted to find an easy way to put a status update into my Twitter account using ColdFusion. I went searching the API docs, and found this page.

&lt;a href=&quot;http://apiwiki.twitter.com/Libraries&quot; target=&quot;_blank&quot;&gt;http://apiwiki.twitter.com/Libraries&lt;/a&gt;

Unfortunately, there are no CF examples listed, boo! However, there are some for Java, so I continued my search in that direction. Eventually I found this JSP taglib, and decided to give it a &quot;Twirl&quot; :)

&lt;a href=&quot;http://www.servletsuite.com/servlets/twittertag.htm&quot; target=&quot;_blank&quot;&gt;http://www.servletsuite.com/servlets/twittertag.htm&lt;/a&gt;

To use any JSP taglib, you simply drop the .jar file into your /webroot/WEB-INF/lib/ directory. I believe it also requires the Enterprise edition of ColdFusion. A &lt;a href=&quot;http://coldfusion.sys-con.com/node/41747&quot; target=&quot;_blank&quot;&gt;good article&lt;/a&gt; that fully explains their usage was done by Charlie Arehart back in May 2002.

After copying the file, you must then restart ColdFusion. This is a must or you will get an error when attempting to import the library. 

That&apos;s it, I was now ready to test a Twitter post. Here is the sample code I used that will put a new status message in my Twitter account. I saved this in a file twitter.cfm, then browsed to the page on my local machine as http://localhost/twitter.cfm 
&lt;code&gt;
&lt;cfimport taglib=&quot;/WEB-INF/lib/twittertag.jar&quot; prefix=&quot;twitter&quot;&gt; 
&lt;twitter:update user=&quot;your_username_here&quot; password=&quot;your_password_here&quot; id=&quot;result&quot;&gt;
My posting to Twitter from CF &lt;cfoutput&gt;#now()#&lt;/cfoutput&gt; 
&lt;/twitter:update&gt; 
&lt;/code&gt;

Upon success, an XML dataset is returned in the &quot;result&quot; variable. If you cfdump it, looks like this.
&lt;code&gt;
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; &lt;status&gt; &lt;created_at&gt;Wed Feb 04 21:29:26 +0000 2009&lt;/created_at&gt; &lt;id&gt;1177644114&lt;/id&gt; &lt;text&gt;My posting to Twitter from CF {ts &apos;2009-02-04 15:29:28&apos;}&lt;/text&gt; &lt;source&gt;web&lt;/source&gt; &lt;truncated&gt;false&lt;/truncated&gt; &lt;in_reply_to_status_id&gt;&lt;/in_reply_to_status_id&gt; &lt;in_reply_to_user_id&gt;&lt;/in_reply_to_user_id&gt; &lt;favorited&gt;false&lt;/favorited&gt; &lt;in_reply_to_screen_name&gt;&lt;/in_reply_to_screen_name&gt; &lt;user&gt; &lt;id&gt;20062919&lt;/id&gt; &lt;name&gt;Twin Cities CFUG&lt;/name&gt; &lt;screen_name&gt;TCCFUG&lt;/screen_name&gt; &lt;location&gt;St. Paul, MN USA&lt;/location&gt; &lt;description&gt;Adobe ColdFusion User Group -of Minneapolis / St. Paul, Minnesota&lt;/description&gt; &lt;profile_image_url&gt;http://s3.amazonaws.com/twitter_production/profile_images/75391930/colderfusion_twitter_normal.jpg&lt;/profile_image_url&gt; &lt;url&gt;http://groups.adobe.com/groups/bd9082a926/&lt;/url&gt; &lt;protected&gt;false&lt;/protected&gt; &lt;followers_count&gt;0&lt;/followers_count&gt; &lt;/user&gt; &lt;/status&gt;
&lt;/code&gt;

If you fail to restart CF, you will see this TagExtraInfo error message:
&lt;code&gt;
The TagExtraInfo class com.cj.twitter.strVariable for the update tag could not be found.

The CFML compiler was processing:
    * A cfimport tag beginning on line 1, column 2.
&lt;/code&gt;

This is not the best solution if you are in a shared hosting environment, as they may not install the twittertag.jar file for you. I&apos;m curious what other methods developers have found to accomplish status posts to Twitter. 
				</description>
				
				<category>Twitter</category>				
				
				<category>ColdFusion</category>				
				
				<pubDate>Wed, 04 Feb 2009 15:35:00 -0700</pubDate>
				<guid>http://blog.webdh.com/index.cfm/2009/2/4/Update-your-Twitter-status-from-ColdFusion-using-a-JSP-tag-library</guid>
				
			</item>
			
			<item>
				<title>ColdFusion UDFs long2ip() and ip2long()</title>
				<link>http://blog.webdh.com/index.cfm/2009/1/6/ColdFusion-UDFs-long2ip-and-ip2long</link>
				<description>
				
				Yesterday I was working on porting some PHP code into ColdFusion. The PHP code was using a function called long2ip(), and I researched this &lt;a href=&quot;http://us3.php.net/manual/en/function.long2ip.php&quot;&gt;PHP Manual&lt;/a&gt; website to learn more about it.  I needed this function in CF, but couldn&apos;t find it at cflib or anywhere else doing a few Google searches. The closest I came was this &lt;a href=&quot;http://www.bpurcell.org/blog/index.cfm?mode=entry&amp;entry=1078&quot;&gt;blog post by Brandon Purcell&lt;/a&gt;, which got me started in the right direction. I learned from what Brandon wrote, along with the comments input by Gabriel Malca (if the function doesn&apos;t exist) at the PHP Manual site and came up with the logic for my CF version of the function.  After I had this working, I figured I better implement the opposite conversion function as well, so I also created ip2long(). Again I found a user comment for when the function doesn&apos;t exist to base my function&apos;s logic. I submitted these to &lt;a href=&quot;http://www.cflib.org&quot;&gt;cflib.org&lt;/a&gt; today, so look for them soon.  

Examples:&lt;br&gt;
long2ip(3401190660) = 202.186.13.4&lt;br&gt;
ip2long(202.186.13.4) = 3401190660

Here is the code for UDFs below:
&lt;code&gt;
&lt;cfscript&gt;
/**
 * Generates an (IPv4) Internet Protocol dotted address (aaa.bbb.ccc.ddd) from the proper address representation. Returns 0 if error occurs.
 * 
 * @param longip Numeric value of the address you want to convert. (Required)
 * @return Returns a String. 
 * @author Troy Pullis (tpullis@yahoo.com) 
 * @version 1, Jan 5, 2009 
 */
function long2ip(longip)
{
	var ip = &quot;&quot;;
	var i = &quot;&quot;;
    if (longip &lt; 0 || longip &gt; 4294967295) 
		return 0;
    for (i=3;i&gt;=0;i--) {
        ip = ip &amp; int(longip / 256^i);
        longip = longip - int(longip / 256^i) * 256^i;
        if (i&gt;0) 
			ip = ip &amp; &quot;.&quot;;
    }
    return ip;
}

/**
 * Converts a string containing an (IPv4) Internet Protocol dotted address (aaa.bbb.ccc.ddd) into a proper address representation.  Returns 0 if error occurs.
 * 
 * @param ip Dotted address value you want to convert. (Required)
 * @return Returns a String. 
 * @author Troy Pullis (tpullis@yahoo.com) 
 * @version 1, Jan 5, 2009 
 */
function ip2long(ip) {
	var iparr = ListToArray(ip,&quot;.&quot;);
	if (ArrayLen(iparr) != 4)
		return 0;
	else 
	 	return iparr[1]*256^3 + iparr[2]*256^2 + iparr[3]*256 + iparr[4];
}
&lt;/cfscript&gt;
&lt;/code&gt; 
				</description>
				
				<category>PHP</category>				
				
				<category>ColdFusion</category>				
				
				<pubDate>Tue, 06 Jan 2009 11:57:00 -0700</pubDate>
				<guid>http://blog.webdh.com/index.cfm/2009/1/6/ColdFusion-UDFs-long2ip-and-ip2long</guid>
				
			</item>
			
			<item>
				<title>CFC for Building a Zip Code Proximity Search with ColdFusion</title>
				<link>http://blog.webdh.com/index.cfm/2008/11/7/CFC-for-Building-a-Zip-Code-Proximity-Search-with-ColdFusion</link>
				<description>
				
				Back in Oct 2005, SysCon &lt;a href=&quot;http://coldfusion.sys-con.com/node/154258&quot; target=&quot;_blank&quot;&gt;published an article&lt;/a&gt; I wrote in CFDJ magazine. Unfortunately, the &lt;a href=&quot;http://www.webmonkey.com/webmonkey/05/32/index4a.html?tw=programming&quot; target=&quot;_blank&quot;&gt;Webmonkey.com&lt;/a&gt; tutorial I originally based my article on has been removed by Wired. I contacted them and hopefully they&apos;ll dig it up and repost it under their new wiki site. In the meantime, here is a link to the CFC file &lt;a href=&quot;http://blog.webdh.com/demos/zipfinder.zip&quot; target=&quot;_blank&quot;&gt;zipfinder.cfc&lt;/a&gt; used in that article. 

One more note... if you make use of my code examples from the CFDJ article, please write your queries using cfqueryparam, which I should have done in the first place. 
				</description>
				
				<category>ColdFusion</category>				
				
				<pubDate>Fri, 07 Nov 2008 15:46:00 -0700</pubDate>
				<guid>http://blog.webdh.com/index.cfm/2008/11/7/CFC-for-Building-a-Zip-Code-Proximity-Search-with-ColdFusion</guid>
				
			</item>
			
			<item>
				<title>Twin Cities CFUG November meeting taking shape</title>
				<link>http://blog.webdh.com/index.cfm/2008/10/28/Twin-Cities-CFUG-November-meeting-taking-shape</link>
				<description>
				
				We have a great meeting planned for both intermediate as well as brand new CF developers. This meeting is Wednesday, Nov 5th at Easel Training.

Room 1) Kurt Wiersma - BlazeDS&lt;br&gt;
Have you ever wondered what BlazeDS is and what it can do? If so this session is for you. We will cover how you can install BlazeDS inside of CF and how CF can communicate with BlazeDS to make Flex applications get real time messages from ColdFusion.

Room 2) Jason Dean - New Developer Breakout Session&lt;br&gt;
This break out session will be an informal meeting for new developers and for developers who are new to CFML. Bring your questions or just learn the basics of ColdFusion.

Both topics will be presented simultaneously in different rooms. Learn more at &lt;a href=&quot;http://colderfusion.com/&quot;&gt;colderfusion.com&lt;/a&gt; 
				</description>
				
				<category>ColdFusion</category>				
				
				<pubDate>Tue, 28 Oct 2008 09:08:00 -0700</pubDate>
				<guid>http://blog.webdh.com/index.cfm/2008/10/28/Twin-Cities-CFUG-November-meeting-taking-shape</guid>
				
			</item>
			
			<item>
				<title>Dispute with web host gisol.com</title>
				<link>http://blog.webdh.com/index.cfm/2008/10/15/Dispute-with-web-host-gisolcom</link>
				<description>
				
				Today I got into a financial dispute with my hosting provider of the last 8 months, Global Internet Solutions, gisol.com. They totally misrepresented a special rebate offer, whereby I was supposed to get my hosting plan at only $3.57/month. Apparently, they&apos;ve done this to countless others, as this &quot;&lt;a href=&quot;http://www.report-gisol.com/&quot;&gt;report-gisol.com&lt;/a&gt;&quot; website I found today has documented. Warning to all CF developers, never host with this company, they are crooks!

Therefore, this blog is probably going away for the short term until I get going with another host. If/when they shut me down, you can visit my site &lt;a href=&quot;http://home.comcast.net/~webdh/&quot;&gt;here&lt;/a&gt;, setup under my Comcast ISP hosting. Hopefully I&apos;ll be back soon. 
				</description>
				
				<category>Other</category>				
				
				<pubDate>Wed, 15 Oct 2008 23:23:00 -0700</pubDate>
				<guid>http://blog.webdh.com/index.cfm/2008/10/15/Dispute-with-web-host-gisolcom</guid>
				
			</item>
			</channel></rss>