<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><!-- generator="wordpress/2.0.3" --><rss 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/" version="2.0">

<channel>
	<title>epiphantastic</title>
	<link>http://www.epiphantastic.com</link>
	<description>Just another WordPress weblog</description>
	<pubDate>Wed, 20 Feb 2008 07:33:07 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.3</generator>
	<language>en</language>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/epiphantastic" type="application/rss+xml" /><item>
		<title>CFJSON 1.9, about time</title>
		<link>http://www.epiphantastic.com/?p=26</link>
		<comments>http://www.epiphantastic.com/?p=26#comments</comments>
		<pubDate>Wed, 20 Feb 2008 07:28:56 +0000</pubDate>
		<dc:creator>Thomas</dc:creator>
		
	<category>CFJSON</category>
		<guid isPermaLink="false">http://www.epiphantastic.com/?p=26</guid>
		<description><![CDATA[
It&#8217;s been way too long I&#8217;ve owed an update of CFJSON. There were a few nagging bugs that needed to be addressed and I did my best to fix them. Another notable improvement was related to performance. Ray Camden pointed out that string concatenation wasn&#8217;t using the Java StringBuffer object. Doug Boude provided me with [...]]]></description>
			<content:encoded><![CDATA[<p>
It&#8217;s been way too long I&#8217;ve owed an update of CFJSON. There were a few nagging bugs that needed to be addressed and I did my best to fix them. Another notable improvement was related to performance. <a href="http://www.coldfusionjedi.com/">Ray Camden</a> pointed out that string concatenation wasn&#8217;t using the Java StringBuffer object. <a href="http://www.dougboude.com">Doug Boude</a> provided me with some code and I plugged it in, so encoding should be considerably faster when dealing with a lot of data.
</p>
<p>
Apologies to those who submitted other fixes/suggestions that are not addressed by this release. Either I found problems with the submission or including it would have further delayed a long-overdue release, so I figured I&#8217;d keep it for the next one. Either way, thanks for all the comments and code contributed.
</p>
<p>
For more details on the changes and to download the latest version, go to the <a href="/cfjson/downloads.php">CFJSON site<a/>.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.epiphantastic.com/?feed=rss2&amp;p=26</wfw:commentRSS>
		</item>
		<item>
		<title>CFJSON 1.8 is out</title>
		<link>http://www.epiphantastic.com/?p=25</link>
		<comments>http://www.epiphantastic.com/?p=25#comments</comments>
		<pubDate>Sat, 12 May 2007 19:21:20 +0000</pubDate>
		<dc:creator>Thomas</dc:creator>
		
	<category>CFJSON</category>
		<guid isPermaLink="false">http://www.epiphantastic.com/?p=25</guid>
		<description><![CDATA[
It&#8217;s been a while I&#8217;ve updated CFJSON, I just finished looking over some suggestions I&#8217;d received by email and took a little time to implement and test them. One fix could be considered critical depending on your needs. Ray Camden pointed out that Yahoo&#8217;s JSON feeds escaped the forward-slash character, so a url was coming [...]]]></description>
			<content:encoded><![CDATA[<p>
It&#8217;s been a while I&#8217;ve updated CFJSON, I just finished looking over some suggestions I&#8217;d received by email and took a little time to implement and test them. One fix could be considered critical depending on your needs. <a href="http://ray.camdenfamily.com/">Ray Camden</a> pointed out that Yahoo&#8217;s JSON feeds escaped the forward-slash character, so a url was coming up as http:\/\/someURL.com . This was not being decoded correctly by CFJSON, which I fixed for this release. For consistency, I also modified the encode function to escape the forward-slash.
</p>
<p>
The next two changes are some optional features that might make your life easier. The first was a suggestion by Carl Anderson for the handling of numeric fields. He was having problems because he had some project codes like &#8220;5.10000&#8243; which javascript would convert to 5.1. He recommended that numbers be converted to strings by default in JSON. Because So he added a <em>stringNumbers</em> argument to the <em>encode()</em> function, when set to true it will encode numbers as strings. Because I don&#8217;t like to tamper with data unless necessary, I preferred to set the default to false.
</p>
<p>
Next up was the handling of dates. Thomas Jaworski pointed out that dates in an ODBC format like {ts &#8216;2007-04-15 16:03:25&#8242;} would be troublesome to parse, so he provided some code for the <em>encode()</em> function to format dates in a way that was friendly to javascript&#8217;s <em>new Date()</em> constructor. Again, because I don&#8217;t like to tamper with data I preferred to implement this as an option that is false by default. The <em>encode()</em> function takes an optional <em>formatDates</em> boolean argument which will format dates as follows: May 12, 2007 3:00:45 PM .
</p>
<p>
Hopefully these features will come in handy. As always, your feedback is welcome, keep the requests/suggestions coming!
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.epiphantastic.com/?feed=rss2&amp;p=25</wfw:commentRSS>
		</item>
		<item>
		<title>Making ColdFusion report fields stretch without messing everything up</title>
		<link>http://www.epiphantastic.com/?p=24</link>
		<comments>http://www.epiphantastic.com/?p=24#comments</comments>
		<pubDate>Tue, 24 Apr 2007 18:08:21 +0000</pubDate>
		<dc:creator>Thomas</dc:creator>
		
	<category>ColdFusion</category>
		<guid isPermaLink="false">http://www.epiphantastic.com/?p=24</guid>
		<description><![CDATA[
The ColdFusion Report Builder was a welcome addition to CF, allowing for report generation without using third-party software like Crystal Reports. The problem with it is that documentation and examples are sparse. And the CFREPORT site doesn&#8217;t seem to have a lot of activity lately (in all fairness, I did not contact the site owner, [...]]]></description>
			<content:encoded><![CDATA[<p>
The ColdFusion Report Builder was a welcome addition to CF, allowing for report generation without using third-party software like Crystal Reports. The problem with it is that documentation and examples are sparse. And the <a href="http://www.cfreport.org">CFREPORT site</a> doesn&#8217;t seem to have a lot of activity lately (in all fairness, I did not contact the site owner, maybe he&#8217;d have a solution for me). Granted, it&#8217;s not really that complicated to pick up, but there are some cases that leave you scratching your head. I recently ran into one such case.
</p>
<p>
Basically, the report builder allows you to put some fields on your report and you can make them a certain size. But what if you have text of variable size and you&#8217;re not sure how long it&#8217;ll be? No problem, you can just set it to whatever width you want and then set the &#8220;Stretch With Overflow&#8221; field to true. That way when the text is too long to fit within the pre-defined width it&#8217;ll wrap to the next line. That&#8217;ll solve all your problems, right? Nope&#8230;
</p>
<p>
This solution will work if your report is a simple table, with a single row of fields put one next to the other. If you have a field that requires more space, the text will wrap and push down thenext record. But what if you have something like the following?
</p>
<p>
<a href="images/report1.jpg" target="_blank"><img src="images/report1.jpg" width="450" height="193" /></a>
</p>
<p>
Suppose the Office field got long and you set its &#8220;Stretch With Overflow&#8221; property to true, guess what would happen? Yeah, the text would wrap alright, but it wouldn&#8217;t push the stuff below it down, instead it would overlap it, and that&#8217;s obviously not good. I searched around and didn&#8217;t really find an answer to my problem. So either I didn&#8217;t search enough and wasted my time with a hack when there&#8217;s a built-in solution, or else I&#8217;m very clever and came up with a brilliant hack. I hope the latter is true!
</p>
<p>
I figured the way to make things stretch properly would be to put things in different bands. But you can&#8217;t randomly insert bands. So to get an extra band, we need a hack. I did it using groups. Basically, whenever you add a group you get a new band for that group. So my idea was to add groups on a field that is unique. That way you get extra bands but they actually aren&#8217;t grouping anything. I just used the primary key of my records as the group by field. And to be able to get more bands, I modified my query and to something like this:</p>
<pre>
SELECT
	JournalID,
	JournalID AS StretchHack1,
	JournalID AS StretchHack2,
	...
FROM Journals
</pre>
</p>
<p>
Then you go under &#8220;Report > Group Management&#8221; and use those fields for Groups. You can put in as many groups as you need bands and then break down your fields/labels into the different bands. Here&#8217;s the result for my example:
</p>
<p>
<a href="images/report2.jpg" target="_blank"><img src="images/report2.jpg" width="450" height="203" /></a>
</p>
<p>
I set the &#8220;Stretch With Overflow&#8221; property to true for Office, Contacts, Categories, and text. Because they are all in separate bands, if their content is too long to fit on one line it&#8217;ll wrap to the next line and push down the content below. Neat huh?
</p>
<p>
I&#8217;m sure this is not a bulletproof solution and there are certain types of layouts where this might either not work or be a real pain in the ass to use. But I think it should come in handy in cases resembling the one I illustrated above.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.epiphantastic.com/?feed=rss2&amp;p=24</wfw:commentRSS>
		</item>
		<item>
		<title>Comments from design experts</title>
		<link>http://www.epiphantastic.com/?p=23</link>
		<comments>http://www.epiphantastic.com/?p=23#comments</comments>
		<pubDate>Fri, 20 Apr 2007 17:06:01 +0000</pubDate>
		<dc:creator>Thomas</dc:creator>
		
	<category>Miscellaneous</category>
		<guid isPermaLink="false">http://www.epiphantastic.com/?p=23</guid>
		<description><![CDATA[
Here&#8217;s an article from Smashing Magazine where they asked 35 designers 5 questions. For those who like myself are not as design-inclined, there can be some small useful nuggets of information in there:


http://www.smashingmagazine.com/2007/04/20/35-designers-x-5-questions/

]]></description>
			<content:encoded><![CDATA[<p>
Here&#8217;s an article from <a href="http://www.smashingmagazine.com">Smashing Magazine</a> where they asked 35 designers 5 questions. For those who like myself are not as design-inclined, there can be some small useful nuggets of information in there:
</p>
<p>
<a href="http://www.smashingmagazine.com/2007/04/20/35-designers-x-5-questions/">http://www.smashingmagazine.com/2007/04/20/35-designers-x-5-questions/</a>
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.epiphantastic.com/?feed=rss2&amp;p=23</wfw:commentRSS>
		</item>
		<item>
		<title>JSON schemas/validation with CFJSON</title>
		<link>http://www.epiphantastic.com/?p=22</link>
		<comments>http://www.epiphantastic.com/?p=22#comments</comments>
		<pubDate>Sun, 25 Mar 2007 22:12:00 +0000</pubDate>
		<dc:creator>Thomas</dc:creator>
		
	<category>ColdFusion</category>
	<category>CFJSON</category>
		<guid isPermaLink="false">http://www.epiphantastic.com/?p=22</guid>
		<description><![CDATA[
I&#8217;ve made it no secret that I&#8217;m not a fan of XML. However, one of the advantages of XML that is constantly brought up is the ability to validate XML documentes using an XML Schema or DTD. I haven&#8217;t had much use for them myself, but seeing as many people consider this important, I figured [...]]]></description>
			<content:encoded><![CDATA[<p>
I&#8217;ve made it no secret that I&#8217;m not a fan of XML. However, one of the advantages of XML that is constantly brought up is the ability to validate XML documentes using an XML Schema or DTD. I haven&#8217;t had much use for them myself, but seeing as many people consider this important, I figured there was no reason the same couldn&#8217;t be done in JSON. So I came up with a format for a JSON schema file (written in JSON, of course) and added a function to the <a href="cfjson/">CFJSON library</a> to validate a JSON document based on a schema.
</p>
<p>
While I don&#8217;t have docs written for this, it&#8217;s pretty self-explanatory. Here&#8217;s an example of a schema that shows pretty much all the features I&#8217;ve put in it so far:</p>
<pre>
{
   type: "struct",
   keys: ["title","body","categories","start_date","active"],
   items: {
      title: {
         type: "string", maxlength: 20, minlength: 8
      },
      body: {
         type: "string", minlength: 1
      },
      categories: {
         type: "array",
         minlength: 1,
         maxlength: 4,
         items: {
            type: "struct",
            items: {
               id: {
                  type: "number", min:6, max:10
               },
               name: {
                  type: "string"
               }
            }
         }
      },
      start_date: {
         type: "date", mask: "mm-dd-yyyy"
      },
      active: {
         type: "boolean"
      }
   }
}
</pre>
</p>
<p>
In a nutshell, your schema is always an object/struct and it must always have a &#8220;type&#8221; key set. Then you go on nesting more definitions under the &#8220;items&#8221; key if you have more complex data types like structs or arrays. The valid types right now are &#8220;struct&#8221;, &#8220;array&#8221;, &#8220;date&#8221;, &#8220;number&#8221;, &#8220;boolean&#8221;, and &#8220;string&#8221;. Each of these data types have some additional options, which are explained below.
</p>
<p>
<strong>struct</strong><br />
For a type &#8220;struct, you have two additional keys you can add. The first is &#8220;keys&#8221;, in which you can provide an array of the keys that this structure MUST have. The second is &#8220;items&#8221;, which is a structure with keys for each structure key you want to add validation rules for. The &#8220;keys&#8221; and &#8220;items&#8221; values are both optional. You can specify an array of keys without providing &#8220;items&#8221; and vice-versa.
</p>
<p>
<strong>array</strong><br />
An &#8220;array&#8221; type can take 3 additional parameters, &#8220;minlength&#8221;, &#8220;maxlength&#8221;, and &#8220;items&#8221;. The first two are pretty self-explanatory, they check for a certain array length. The last is similar to the &#8220;struct&#8221; type&#8217;s &#8220;items&#8221; key, except inside that structure you do not list validation individually for keys since arrays are just numeric. So you simply put in the structure you want for all the items in the array.
</p>
<p>
<strong>date</strong><br />
The only option for the &#8220;date&#8221; struck type is &#8220;mask&#8221;. In it you can specify a date mask that you want the date to conform to. The possible masks are the same as the ones used by ColdFusion&#8217;s DateFormat function, although this could change because JSON is a universal format not restricted to CF.
</p>
<p>
<strong>number</strong><br />
A &#8220;number&#8221; type provides additional options of &#8220;min&#8221; and &#8220;max&#8221;, which allows you to specify minimum and maximum values for a number. Note that right now the &#8220;number&#8221; type allows for floats too, this will eventually be updated to allow for validating for integers, floats, unsigned numbers, etc.
</p>
<p>
<strong>boolean</strong><br />
The boolean type has no additonal options, although eventually it&#8217;ll probably allow for choosing what can be considered a valid boolean.
</p>
<p>
<strong>string</strong><br />
The &#8220;string&#8221; type can specify a &#8220;maxlength&#8221; and &#8220;minlength&#8221; option that will make sure the string is not longer or shorter than the values specified. Note that the &#8220;string&#8221; type will actually accept booleans and numbers. Right now I&#8217;m not seeing a way around it given the way I implemented things, and I&#8217;m not sure it&#8217;s really a big deal.
</p>
<p>
After defining the JSON schema standard I added a validate() function to CFJSON that validates a JSON document based on a schema conforming to the format described above. I also made a small example, creating a JSON document that conforms to the schema above and running the validate function against it. There&#8217;s a link to download the example below, all you have to do is change some values in the document or in the schema to see the validation working. There are a few more options that are probably easy to figure out looking at the code, such as the &#8220;errorVar&#8221; and &#8220;stopOnError&#8221; arguments. If anybody has any feedback on this I&#8217;d love to hear it.
</p>
<p>
<a href="cfjson/downloads/schema_example.zip">DOWNLOAD CFJSON DOCUMENT VALIDATION EXAMPLE (includes the latest CFJSON)</a><br />
<a href="cfjson/">FIND OUT MORE ABOUT CFJSON</a>
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.epiphantastic.com/?feed=rss2&amp;p=22</wfw:commentRSS>
		</item>
		<item>
		<title>Finding Similar Text and Words</title>
		<link>http://www.epiphantastic.com/?p=21</link>
		<comments>http://www.epiphantastic.com/?p=21#comments</comments>
		<pubDate>Fri, 23 Mar 2007 20:07:52 +0000</pubDate>
		<dc:creator>Thomas</dc:creator>
		
	<category>Databases</category>
		<guid isPermaLink="false">http://www.epiphantastic.com/?p=21</guid>
		<description><![CDATA[
This is one of those times when I discover something that I probably should have known for a long time, and I certainly wish I had. And if you&#8217;re one of my friends and you knew about this and didn&#8217;t tell me, may you rot in hell lying in a bed of nails covered with [...]]]></description>
			<content:encoded><![CDATA[<p>
This is one of those times when I discover something that I probably should have known for a long time, and I certainly wish I had. And if you&#8217;re one of my friends and you knew about this and didn&#8217;t tell me, may you rot in hell lying in a bed of nails covered with black flies. Now that I got this out of the way, on with the article&#8230;
</p>
<p>
I decided to look for some kind of algorithm that would allow for matching words that are similar. This would inevitably be to retrieve records from a database based on some search criteria. So I search google and find something about a <a href="http://en.wikipedia.org/wiki/Soundex">Soundex algorithm</a>. The algorithm goes as follows (copied straight from Wikipedia):</p>
<ol>
<li>Retain the first letter of the string</li>
<li>Remove all occurrences of the following letters, unless it is the first letter: a, e, h, i, o, u, w, y</li>
<li>
Assign numbers to the remaining letters (after the first) as follows:</p>
<ul>
<li>b, f, p, v = 1</li>
<li>c, g, j, k, q, s, x, z = 2</li>
<li>d, t = 3</li>
<li>l = 4</li>
<li>m, n = 5</li>
<li>r = 6</li>
</ul>
</li>
<li>If two or more letters with the same number were adjacent in the original name (before step 1), or adjacent except for any intervening h and w (American census only), then omit all but the first.</li>
<li>Return the first four characters, right-padding with zeroes if there are fewer than four.</li>
</ol>
<p>
But that&#8217;s not the good part&#8230; The good part is that this algorithm is implemented in some DBMS systems. And apparently, you guessed it, it&#8217;s implemented in the most popular ones, SQL Server, Oracle, and MySQL. How does it work? It&#8217;s oh so difficult&#8230; Check out the code below:</p>
<pre>
SELECT *
FROM address
WHERE SOUNDEX(city) = SOUNDEX('Washgton')
</pre>
<p>If you have any records in the database for Washington (note in the query it&#8217;s missing the &#8220;i&#8221;) it will be returned. Wonderful! I could probably have used this before. And for those who have the possibility of adding UDFs to their DB server, there are implementations of other algorithms such as <a href="http://en.wikipedia.org/wiki/Metaphone">Metaphone</a> and Similar_text.
</p>
<p>
Note that Soundex is a phonetic algorithm, so it looks for words that would sound similar. So you might not always get the results you want. When I searched my person table using SOUNDEX(first_name) = SOUNDEX(&#8217;Tomas&#8217;) I did get a bunch of &#8220;Thomas&#8221; records back, but if I use SOUNDEX(&#8217;Thomas&#8217;) I did not, I got a bunch of &#8220;Tom&#8221;, &#8220;Tommy&#8221;, and even &#8220;Tony&#8221; records, but no &#8220;Thomas&#8221;. Oh well, still better than nothing. I bet that using a combination of different algorithms you can probably get some good results. More research to be done&#8230;
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.epiphantastic.com/?feed=rss2&amp;p=21</wfw:commentRSS>
		</item>
		<item>
		<title>Suppressing whitespace in ColdFusion</title>
		<link>http://www.epiphantastic.com/?p=20</link>
		<comments>http://www.epiphantastic.com/?p=20#comments</comments>
		<pubDate>Sat, 17 Mar 2007 01:10:01 +0000</pubDate>
		<dc:creator>Thomas</dc:creator>
		
	<category>ColdFusion</category>
		<guid isPermaLink="false">http://www.epiphantastic.com/?p=20</guid>
		<description><![CDATA[
One of the things about ColdFusion that I don&#8217;t like so much is its inability to conveniently suppress whitespace. It&#8217;s ridiculous, there are like 3 million tags/attributes/options that are related to whitespace, I seem to discover a new one all the time and it invariably fails to do what I want. First, there&#8217;s &#60;cfsilent&#62;. The [...]]]></description>
			<content:encoded><![CDATA[<p>
One of the things about ColdFusion that I don&#8217;t like so much is its inability to conveniently suppress whitespace. It&#8217;s ridiculous, there are like 3 million tags/attributes/options that are related to whitespace, I seem to discover a new one all the time and it invariably fails to do what I want. First, there&#8217;s &lt;cfsilent&gt;. The result is pretty straightforward, it kills all output found in between it. Then there&#8217;s &lt;cfsetting enablecfoutputonly=&#8221;Yes&#8221;&gt;. That supposedly suppresses things that aren&#8217;t inside of &lt;cfoutput&gt; tags, but my experience has shown that it doesn&#8217;t pick up everything. Then there&#8217;s &lt;cfprocessingdirective suppresswhitespace=&#8221;Yes&#8221;&gt;, which I never use, but I tried it recently for something and it was useless. Plus from what I read it&#8217;s the worse performance-wise.
</p>
<p>
Besides the tags, you can set output=&#8221;no&#8221; on both your &lt;cfcomponent&gt; and &lt;cffunction&gt; tags, and it&#8217;s often necessary to do so. Finally, there&#8217;s an option in the Settings section of the CF Administrator that you can use to let CF manage whitespace suppression.
</p>
<p>
So I had a whitespace problem the other day and I was trying to get rid of it by all means necessary. I have all these options right? Something&#8217;s gonna work, right? Wrong! None of these things did it for me. I had a function in a component that you pass some arguments to and it outputs a &lt;select&gt; field populated with &lt;option&gt; tags. So I was calling the function something like this</p>
<pre>
&lt;cfsetting enablecfoutputonly="yes" /&gt;

&lt;cfoutput&gt;Label: #selectBox(options)#&lt;/cfoutput&gt;

&lt;cfsetting enablecfoutputonly="no" /&gt;
</pre>
<p>This was part of a larger framework, but everything was wrapped in a &lt;cfsetting enablecfoutputonly=&#8221;Yes&#8221;&gt; and all components and functions had output=&#8221;no&#8221; where possible. I was really starting to get pissed when I had one of my Einstein moments. I took the code out of the &lt;cfoutput&gt; and changed it to the following and all was well:</p>
<pre>
&lt;cfsetting enablecfoutputonly="yes" /&gt;

&lt;cfoutput&gt;Label: &lt;/cfoutput&gt;&lt;cfset selectBox(options) /&gt;

&lt;cfsetting enablecfoutputonly="no" /&gt;
</pre>
<p>Presto! Like magic it worked. I&#8217;m glad I found a workaround, but I still think it&#8217;s pathetic that CF can&#8217;t handle this for me.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.epiphantastic.com/?feed=rss2&amp;p=20</wfw:commentRSS>
		</item>
		<item>
		<title>CFJSON version 1.7</title>
		<link>http://www.epiphantastic.com/?p=19</link>
		<comments>http://www.epiphantastic.com/?p=19#comments</comments>
		<pubDate>Sat, 03 Mar 2007 00:50:59 +0000</pubDate>
		<dc:creator>Thomas</dc:creator>
		
	<category>ColdFusion</category>
	<category>CFJSON</category>
		<guid isPermaLink="false">http://www.epiphantastic.com/?p=19</guid>
		<description><![CDATA[
Today I had some free time and decided to implement some bug fixes for CFJSON. Many thanks to Larry Reinhard who not only provided many fixes but actually built a unit test for them. Wow! That makes my work that much easier! Steve Nelson also contributed and I thank him for that.


After implementing Larry&#8217;s changes [...]]]></description>
			<content:encoded><![CDATA[<p>
Today I had some free time and decided to implement some bug fixes for CFJSON. Many thanks to Larry Reinhard who not only provided many fixes but actually built a unit test for them. Wow! That makes my work that much easier! Steve Nelson also contributed and I thank him for that.
</p>
<p>
After implementing Larry&#8217;s changes I so happened to read a post on <a href="http://www.bennadel.com">Ben Nadel&#8217;s blog</a> about a problem with a JSON string that had a carriage return. This incited me to go and check if special characters were properly handled, and I discovered that while they were as far as encoding, the decoding was not correct. In the process of fixing this I discovered a serious bug that caused errors when there was one double-quote in a string within a complex data type. I tracked it down to an inexplicable problem with a loop, whereby I incremented the loop&#8217;s index value to essentially skip an iteration, but for whatever reason on the next iteration the value of the index was reset to the original value it would have had if I hadn&#8217;t incremented it. Mystery&#8230; I just changed the loop to a conditional loop where I incremented values myself and that solved my problem.
</p>
<p>
So given the bugs mentioned above, this version of CFJSON is a must download. Hopefully there won&#8217;t be too many serious problems from now on, the transition from one owner to the next and implementation of accumulated code/bug fixes/features made it so some unpleasant stuff crept in, but it&#8217;s looking under control now. Thanks again to all the contributors!
</p>
<p>
<a href="http://www.epiphantastic.com/cfjson/downloads/cfjson-1.7.zip">DOWNLOAD CFJSON v1.7</a><br />
<a href="http://www.epiphantastic.com/cfjson/">GO TO THE CFJSON SITE</a>
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.epiphantastic.com/?feed=rss2&amp;p=19</wfw:commentRSS>
		</item>
		<item>
		<title>Getting familiar with ColdFusion frameworks</title>
		<link>http://www.epiphantastic.com/?p=18</link>
		<comments>http://www.epiphantastic.com/?p=18#comments</comments>
		<pubDate>Thu, 01 Mar 2007 13:22:46 +0000</pubDate>
		<dc:creator>Thomas</dc:creator>
		
	<category>ColdFusion</category>
		<guid isPermaLink="false">http://www.epiphantastic.com/?p=18</guid>
		<description><![CDATA[
I recently had a look at two of the most popular ColdFusion frameworks, Mach-II and Model-Glue. And since I got the latest Model-Glue, the Unity release (still in beta), I was also exposed to ColdSpring and Reactor. It was long-overdue on my part to have a look at those. I can&#8217;t say I&#8217;ve gone in-depth [...]]]></description>
			<content:encoded><![CDATA[<p>
I recently had a look at two of the most popular ColdFusion frameworks, Mach-II and Model-Glue. And since I got the latest Model-Glue, the Unity release (still in beta), I was also exposed to ColdSpring and Reactor. It was long-overdue on my part to have a look at those. I can&#8217;t say I&#8217;ve gone in-depth into each one of them, but I understand the basic principles and could write a simple app/site using those frameworks. The question is, would I want to? I&#8217;m actually a big fan of frameworks/APIs/Libraries because they allow you to concentrate on your specific problem while providing you with a context in which to solve it, along with an intelligent way of organizing your code. That&#8217;s wonderful. But it&#8217;s becoming clear to me that there&#8217;s no right way of doing this and what works for/appeals to somebody doesn&#8217;t necessarily work for somebody else.
</p>
<p>
Both Mach-II and Model-Glue don&#8217;t really turn me on, at least not at first glance. Maybe I have to let them grow on me. Right from the beginning, at the very core of them, there&#8217;s XML. I can&#8217;t stand XML, I just can&#8217;t help it. In both Mach-II and Model-Glue, there&#8217;s a considerable amount of stuff that gets set up in XML files, they&#8217;re a fundamental part of the frameworks, unfortunately for me. Essentially, you define events that broadcast messages heard by listeners that provoke some action to be taken, and possibly generating output to the screen. In essence, I like the principle, I guess I may just not like the implemementation.
</p>
<p>
So that I don&#8217;t come accross as a total framework hater, I have to say that I&#8217;m quite a fan of Ruby on Rails. I think the way they go about it is more intuitive to me, I think their approach of using a lot of naming conventions helps minimize the amount of configuration needed. Just follow the conventions and things get magically connected and meshed in the background. I like that. On the ColdFusion end of things, from my (very) limited experience with it, I&#8217;d say that I also like Reactor as a framework, although we&#8217;re talking about totally different kind of framework here.
</p>
<p>
Bottomline, I think I may have to come up with a real project to get a better feel for the existing ColdFusion frameworks. In my case I&#8217;d go with Model-Glue:Unity, with Reactor plugged in. That way I get the benefit of testing 3 frameworks at once. And I could also take the opportunity to throw YUI and YUI-Ext into the mix to get my javascript groove on. I don&#8217;t know where I&#8217;ll find the time, but hopefully I can sneak in a few minutes here and there for the sake of knowledge.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.epiphantastic.com/?feed=rss2&amp;p=18</wfw:commentRSS>
		</item>
		<item>
		<title>PayPal Web Payments</title>
		<link>http://www.epiphantastic.com/?p=17</link>
		<comments>http://www.epiphantastic.com/?p=17#comments</comments>
		<pubDate>Sat, 17 Feb 2007 03:27:12 +0000</pubDate>
		<dc:creator>Thomas</dc:creator>
		
	<category>eCommerce</category>
		<guid isPermaLink="false">http://www.epiphantastic.com/?p=17</guid>
		<description><![CDATA[
I needed to implement a payment module on a project and decided to use PayPal&#8217;s Web Payment Standard. I was pretty impressed with the simple approach and with the complete sandbox that PayPal provides to test out the solution. With very little effort I was able to code something that works, and even implemented the [...]]]></description>
			<content:encoded><![CDATA[<p>
I needed to implement a payment module on a project and decided to use PayPal&#8217;s Web Payment Standard. I was pretty impressed with the simple approach and with the complete sandbox that PayPal provides to test out the solution. With very little effort I was able to code something that works, and even implemented the Instant Payment Notification (IPN) part of the solution for something more robust. Here&#8217;s a quick overview of how things work.
</p>
<p>
Web Payment Standards accomodates a number of different scenarios, I&#8217;ll only describe mine. I wanted PayPal to handle only the payment part of the transaction, as I already had a shopping cart built. No problem, says PayPal&#8217;s documentation. Integrating basically consists in posting a form to a PayPal URL including a number of hidden fields. Among those hidden fields are required fields, like the account the payment is to be made to, the information for the items in the shopping cart, etc. You can also include some optional fields that allow you to customize the header of your payment page, background color, the URL the user will be returned to once they complete their payment, etc. It&#8217;s really that easy. Pass that information and PayPal will do the rest. While they collect a small percentage on transactions, I think the convenience of not having to look into merchant accounts as well as implement all the payment stuff is well worth it.
</p>
<p>
Now, for IPN. IPN is basically a good way for you to record the transaction on your end. Sure, you could just do that when PayPal returns the user to your page, but what if the user doesn&#8217;t go? I discovered that PayPal will NOT redirect the user to your page if they don&#8217;t have a PayPal account and just pay by credit card, which is a pretty common case. The user has to click on a button to return to your site. So you can&#8217;t rely on the user clicking on that button to record the transaction. Enter IPN. With IPN, PayPal makes an HTTP post to a page of your choosing. On that page, you can receive the HTTP post which has all the variables you&#8217;ll need to store the order in your database, email the customer, and whatever else you want to do. But before, there are some security mechanisms to verify the data. You will need to do an HTTP get request to PayPal&#8217;s server sending it back all the variables you received. You will then receive a status of INVALID or VERIFIED. Once your transaction is verified, there are a few more instructions that I won&#8217;t get into of things you can check before actually processing the order. So by using IPN, you make sure that your system records the transaction, independent of what the user does. If they paid, you&#8217;ll know about it, even if they wander off after they&#8217;re done paying.
</p>
<p>
Finally, it&#8217;s worth mentioning that you&#8217;ll be able to test this entire process on PayPal&#8217;s sandbox server. All you need to do is sign-up for a free account on the developer site. You will then be able to create accounts for testing purposes on the sandbox. The sandbox works exactly like the live PayPal site except financial transactions don&#8217;t actually go through. It even has a built in email reader so you can see the emails that would go out. Nifty.
</p>
<p>
I&#8217;m pretty happy with this system so far. The only disappointing thing is that the customization options for the look of the payment page are very limited. Also, I was disappointed about the auto return not working for non-PayPal account holders. But overall, I&#8217;m satisfied, and I can&#8217;t wait to have this live. Show me the money!
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.epiphantastic.com/?feed=rss2&amp;p=17</wfw:commentRSS>
		</item>
	</channel>
</rss>
