<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>You Give Love a Bad (Dot) Name</title>
	<atom:link href="http://yougiveloveabad.name/feed/" rel="self" type="application/rss+xml" />
	<link>http://yougiveloveabad.name</link>
	<description>Not quite shot through the heart</description>
	<lastBuildDate>Mon, 06 Jun 2011 17:57:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Stuck with CFMX? XML trouble? Try this.</title>
		<link>http://yougiveloveabad.name/archives/2011/06/06/stuck-with-cfmx-xml-trouble-try-this/</link>
		<comments>http://yougiveloveabad.name/archives/2011/06/06/stuck-with-cfmx-xml-trouble-try-this/#comments</comments>
		<pubDate>Mon, 06 Jun 2011 17:57:32 +0000</pubDate>
		<dc:creator>JC</dc:creator>
				<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://yougiveloveabad.name/?p=119</guid>
		<description><![CDATA[Crimson, the XML engine used by CFMX/CF6/CF6.1/whatever was old when CFMX came out. It was last updated in 2000 and abandoned with multiple bugs acknowledged and unfixed. We were running into issues with it in my current contract in mid-may (couple of boxes using CFMX because someone thinks they might have something customized that will [...]]]></description>
			<content:encoded><![CDATA[<p>Crimson, the XML engine used by CFMX/CF6/CF6.1/whatever was old when CFMX came out. It was last updated in 2000 and abandoned with multiple bugs acknowledged and unfixed. We were running into issues with it in my current contract in mid-may (couple of boxes using CFMX because someone thinks they might have something customized that will break in 8 or 9) and I was asked to find a solution. A few false starts because the problem was unpredictable and simply stripping out extra whitespace seemed at first to fix the problem. Basically, the old XML parser reads your XML in chunks of, IIRC, 8000 characters. if the chunk ends inside a CDATA tag, it breaks. So by stripping whitespace we might have been moving the position of the cdata and making it not fail.</p>
<p>But to actually fix the problem, once it was finally diagnosed&#8230; difficult search, but happily, it turns out Brandon Purcell had the answer &#8212; <a href="http://www.bpurcell.org/blog/index.cfm?mode=entry&amp;entry=942">you can change Coldfusion MX's XML parser to use Xerces</a>.</p>
<p>One minor update to his post:</p>
<ul>
<li>The link for the version of Xerxes is bad &#8212; it's here now: <a href="http://archive.apache.org/dist/xml/xerces-j/Xerces-J-bin.1.4.4.zip">http://archive.apache.org/dist/xml/xerces-j/Xerces-J-bin.1.4.4.zip</a> . I'm not sure if  a newer version would work or not and I didn't want to risk it breaking if not. MX is using a very old version of java, too.</li>
</ul>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://yougiveloveabad.name/archives/2011/06/06/stuck-with-cfmx-xml-trouble-try-this/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL Coalesce</title>
		<link>http://yougiveloveabad.name/archives/2010/11/04/sql-coalesce/</link>
		<comments>http://yougiveloveabad.name/archives/2010/11/04/sql-coalesce/#comments</comments>
		<pubDate>Thu, 04 Nov 2010 18:07:56 +0000</pubDate>
		<dc:creator>JC</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://yougiveloveabad.name/?p=111</guid>
		<description><![CDATA[Have you guys ever seen the Coalesce command in SQL? I'd never heard of it til today, and it looks really useful. Say you have a table of business contact information and you want to contact a user from it; but some of the businesses don't have specific contacts, just a position; and some don't [...]]]></description>
			<content:encoded><![CDATA[<p>Have you guys ever seen the Coalesce command in SQL? I'd never heard of it til today, and it looks really useful.</p>
<p>Say you have a table of business contact information and you want to contact a user from it; but some of the businesses don't have specific contacts, just a position; and some don't have either&#8230;</p>
<p>SELECT COALESCE(ContactName,ContactPosition,BusinessName) as theContact FROM foo</p>
<p>If ContactName is null, theContact will be the value of ContactPosition. If that's also null, it will be the value of BusinessName. Simple. handy. wish I'd known it 5 years ago.</p>
]]></content:encoded>
			<wfw:commentRss>http://yougiveloveabad.name/archives/2010/11/04/sql-coalesce/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Data truncated at ~32k&#8230; how to get CLOBbered</title>
		<link>http://yougiveloveabad.name/archives/2010/09/16/data-truncated-at-32k-how-to-get-clobbered/</link>
		<comments>http://yougiveloveabad.name/archives/2010/09/16/data-truncated-at-32k-how-to-get-clobbered/#comments</comments>
		<pubDate>Thu, 16 Sep 2010 14:13:58 +0000</pubDate>
		<dc:creator>JC</dc:creator>
				<category><![CDATA[ColdFusion]]></category>

		<guid isPermaLink="false">http://yougiveloveabad.name/?p=108</guid>
		<description><![CDATA[It was the strangest thing. A query using Coldfusion to a SQL 2005 server, extracting among other things, a large chunk of XML which needed to be parsed and transformed with XSL. It worked fine most of the time&#8230; but occasionally there would be very large XML strings, and they would get cut off at [...]]]></description>
			<content:encoded><![CDATA[<p>It was the strangest thing. A query using Coldfusion to a SQL 2005 server, extracting among other things, a large chunk of XML which needed to be parsed and transformed with XSL.</p>
<p>It worked fine most of the time&#8230; but occasionally there would be very large XML strings, and they would get cut off at 32k in length.</p>
<p>So, of course, I assume the database column is only that large and the data is being truncated on entry to it.</p>
<p>The DBA mentions that it's an n-something data type and I immediately assume that's the problem&#8230; darn 16 byte alphabets&#8230;</p>
<p>I ask him to convert it to VarChar(MAX).</p>
<p>The problem? Goes away. No more truncation.</p>
<p>I think nothing more of it&#8230; including not noticing that even the fields that were previously truncated now work. (probably because I was only parsing one day's worth of data at a time)</p>
<p>Flash forward a few months&#8230; we bring it into production. Bam. Same problem, only much worse because there's more data.</p>
<p>And now, because it's in production and the database is from a vendor product, changing the db field is a huge deal.</p>
<p>A week or so goes by with it truncating as we talk to the vendor.</p>
<p>And then I think to myself&#8230; what the hell column type has a 32k limit? it's 8k or frigging huge, with nothing in between. This is what I get for starting my database experience with MySQL&#8230; TEXT data type there is 65,535 characters; halve that for it being in unicode, and it's about 32k. But we're not working with MySQL here&#8230;.</p>
<p>So I go hunting. Is it a limit in a stored procedure on insert? I can't tell.. no acces to the procedures. Or even the database, really.</p>
<p>I finally whip out my <a href="/archives/2008/06/27/cfdbinfo-what-can-you-see/">CF_DBINFO</a> tag and take a look at the table structure. It's NText and lists the size as some huge number, way more than 32k. Weird.</p>
<p>I run a query to get the max length of the field and discover that len() is invalid for text fields. I research more and discover that you use datalength() for those. Again&#8230; way more than 32k. So where's the problem???</p>
<p>It's not my code&#8230; that's a straightforward select. And why did it start working when we changed data types?</p>
<p>I started wondering if maybe our driver didn't fully support SQL 2005. We had to switch from the default SQL driver that coldfusion uses because the default one doesn't support SSL and we require encrypted connections. Would that bite us in the arse?</p>
<p>Yes and no. By default, the driver handles data over a given amount as a LOB&#8230; it sends it in chunks. But we didn't have the DSN set to look for LOBs, so it would get the first 32k chunk and assume that was all.</p>
<p>One checkbox (CLOB &#8211; Enable Long Text Retrieval) in CF Administrator later&#8230; and everything's magically working.</p>
<p>Oh, and to some extent, I was right&#8230; it appears the driver doesn't fully understand SQL 2005. It only uses CLOBs on TEXT and NTEXT fields&#8230; VarChar(MAX) is exempted, despite being the same thing effectively. That's why the dev system started working when we switched the data type.</p>
<p>So&#8230; lesson of the day&#8230; Don't get CLOBbered. Check the box.</p>
]]></content:encoded>
			<wfw:commentRss>http://yougiveloveabad.name/archives/2010/09/16/data-truncated-at-32k-how-to-get-clobbered/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A moment of photoshoppery</title>
		<link>http://yougiveloveabad.name/archives/2010/05/19/a-moment-of-photoshoppery/</link>
		<comments>http://yougiveloveabad.name/archives/2010/05/19/a-moment-of-photoshoppery/#comments</comments>
		<pubDate>Wed, 19 May 2010 18:08:32 +0000</pubDate>
		<dc:creator>JC</dc:creator>
				<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://yougiveloveabad.name/?p=105</guid>
		<description><![CDATA[Adieu, Representative Souder. I'm sure someone, somewhere is thanking you for your bold service in&#8230; uh&#8230; ensuring that college kids who get caught trying marijuana lose all their financial aid]]></description>
			<content:encoded><![CDATA[<p>Adieu, Representative Souder. I'm sure someone, somewhere is thanking you for your bold service in&#8230; uh&#8230; ensuring that college kids who get caught trying marijuana lose all their financial aid</p>
<p><a href="http://souder.house.gov/"><img class="alignnone size-full wp-image-106" title="souder_hill" src="http://yougiveloveabad.name/wp-content/uploads/2010/05/souder_hill.jpg" alt="" width="247" height="292" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://yougiveloveabad.name/archives/2010/05/19/a-moment-of-photoshoppery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Night Sounds in Puerto Rico</title>
		<link>http://yougiveloveabad.name/archives/2010/02/25/night-sounds-in-puerto-rico/</link>
		<comments>http://yougiveloveabad.name/archives/2010/02/25/night-sounds-in-puerto-rico/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 01:59:22 +0000</pubDate>
		<dc:creator>JC</dc:creator>
				<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://yougiveloveabad.name/?p=101</guid>
		<description><![CDATA[Found this sitting in the sound recorder app on my phone. It's a 16 second clip of what it sounds like at night in Puerto Rico, up in the jungly mountains. Specifically, it was recorded at the Casa Grande Mountain Retreat.]]></description>
			<content:encoded><![CDATA[<p>Found this sitting in the sound recorder app on my phone. It's a 16 second clip of what it sounds like at night in Puerto Rico, up in the jungly mountains. Specifically, it was recorded at the <a href="http://hotelcasagrande.com" target="_blank">Casa Grande Mountain Retreat</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://yougiveloveabad.name/archives/2010/02/25/night-sounds-in-puerto-rico/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Tricks</title>
		<link>http://yougiveloveabad.name/archives/2009/12/17/new-tricks/</link>
		<comments>http://yougiveloveabad.name/archives/2009/12/17/new-tricks/#comments</comments>
		<pubDate>Thu, 17 Dec 2009 21:16:51 +0000</pubDate>
		<dc:creator>JC</dc:creator>
				<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://yougiveloveabad.name/?p=94</guid>
		<description><![CDATA[I've been a coldfusion developer for over 9 years now, and tinkered with web design for at least 12. It's pretty rare for me to find something I've never used before and didn't know existed in HTML&#8230; but today, I did. The OPTGROUP tag is how you make non-selectable headings in select lists. I guess [...]]]></description>
			<content:encoded><![CDATA[<p>I've been a coldfusion developer for over 9 years now, and tinkered with web design for at least 12. It's pretty rare for me to find something I've never used before and didn't know existed in HTML&#8230; but today, I did.</p>
<p>The OPTGROUP tag is how you make non-selectable headings in select lists. I guess for some reason I always assumed that was done with javascript or CSS, but no, it's a simple tag.</p>
]]></content:encoded>
			<wfw:commentRss>http://yougiveloveabad.name/archives/2009/12/17/new-tricks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Proper Ordered List Hierarchy</title>
		<link>http://yougiveloveabad.name/archives/2009/12/17/proper-ordered-list-hierarchy/</link>
		<comments>http://yougiveloveabad.name/archives/2009/12/17/proper-ordered-list-hierarchy/#comments</comments>
		<pubDate>Thu, 17 Dec 2009 21:06:44 +0000</pubDate>
		<dc:creator>JC</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://yougiveloveabad.name/archives/2009/12/17/proper-ordered-list-hierarchy/</guid>
		<description><![CDATA[In case I ever need it again, this is the CSS to force a "proper" ordered list hierarchy all the way to 6 layers deep. (pro tip &#8211; if it's 6 layers deep, you're doing something wrong) &#60;style type="text/css"&#62;   OL { list-style-type:upper-roman }   OL OL { list-style-type:upper-alpha }   OL OL OL { [...]]]></description>
			<content:encoded><![CDATA[<p>In case I ever need it again, this is the CSS to force a "proper" ordered list hierarchy all the way to 6 layers deep. (pro tip &#8211; if it's 6 layers deep, you're doing something wrong)</p>
<p>&lt;style type="text/css"&gt;<br />
  OL { list-style-type:upper-roman }<br />
  OL OL { list-style-type:upper-alpha }<br />
  OL OL OL { list-style-type:decimal }<br />
  OL OL OL OL { list-style-type:lower-roman }<br />
  OL OL OL OL OL { list-style-type:lower-alpha }<br />
  OL OL OL OL OL OL { list-style-type:lower-greek }<br />
&lt;/style&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://yougiveloveabad.name/archives/2009/12/17/proper-ordered-list-hierarchy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>long time no post &#8212; excuse = homeownership</title>
		<link>http://yougiveloveabad.name/archives/2009/08/28/long-time-no-post-excuse-homeownership/</link>
		<comments>http://yougiveloveabad.name/archives/2009/08/28/long-time-no-post-excuse-homeownership/#comments</comments>
		<pubDate>Sat, 29 Aug 2009 03:34:02 +0000</pubDate>
		<dc:creator>JC</dc:creator>
				<category><![CDATA[Michiana]]></category>
		<category><![CDATA[Random]]></category>
		<category><![CDATA[Thoughts]]></category>

		<guid isPermaLink="false">http://yougiveloveabad.name/?p=76</guid>
		<description><![CDATA[Oddly, hunting for a house and buying one is a bit time consuming. All in all, I looked at about a dozen homes before deciding on one. It's a 105 year old Queen Anne, a couple blocks from the river. I moved in a month or so ago and I'm still not completely settled in. [...]]]></description>
			<content:encoded><![CDATA[<p>Oddly, hunting for a house and buying one is a bit time consuming.</p>
<p>All in all, I looked at <a href="http://yougiveloveabad.name/gallery/v/house_hunting/">about a dozen homes</a> before deciding on <a href="http://yougiveloveabad.name/gallery/v/house_hunting/1021_portage/">one</a>. It's a 105 year old Queen Anne, a couple blocks from the river. I moved in a month or so ago and I'm still not completely settled in. It's about 2200 finished square feet, technically 4 bedrooms 1.75 baths (but one bedroom is set up as a laundry room and I'm using another as an office). There's also a great third floor/attic that's finishable (and big enough that I could probably add a loft to it), and a 450 square foot 1 bedroom/1 bathroom "mother-in-law suite" over the "carriage house", which I'm renting to a ND divinity student. On one side of the house is the neighborhood association building. On the other side &#8212; a pair of nuns. Across&#8230;  a street that leads straight down to the river.  Behind, the 2 car "carriage house", and an alley, and a couple of houses that are currently being restored by the neighborhood association. So overall a pretty quiet location, if you ignore that the street is a fairly busy one and the hospital's less than a mile away. Big yard for being in such an old section of town. I've been here almost a month now. Enjoying it thus far. We'll see how it goes <img src='http://yougiveloveabad.name/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>And now, back to the regularly scheduled neglect of blog.</p>
]]></content:encoded>
			<wfw:commentRss>http://yougiveloveabad.name/archives/2009/08/28/long-time-no-post-excuse-homeownership/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Coldfusion: DNS Reverse Lookup</title>
		<link>http://yougiveloveabad.name/archives/2009/02/19/coldfusion-dns-reverse-lookup/</link>
		<comments>http://yougiveloveabad.name/archives/2009/02/19/coldfusion-dns-reverse-lookup/#comments</comments>
		<pubDate>Thu, 19 Feb 2009 17:31:55 +0000</pubDate>
		<dc:creator>JC</dc:creator>
				<category><![CDATA[ColdFusion]]></category>

		<guid isPermaLink="false">http://yougiveloveabad.name/?p=61</guid>
		<description><![CDATA[I have no idea why this information was so difficult to find, but I'm posting it here in case I ever need it again. To do a reverse lookup in coldfusion: &#60;cfscript&#62; rawIP = createObject("java", "java.net.InetAddress").getByName('#ipaddress#').getAddress(); hostname = createObject("java", "java.net.InetAddress").getByAddress('#rawIP#').getHostName(); chostname = createObject("java", "java.net.InetAddress").getByAddress('#rawIP#').getCanonicalHostName(); &#60;/cfscript&#62; Note &#8212; this is slow. If you're doing them in [...]]]></description>
			<content:encoded><![CDATA[<p>I have no idea why this information was so difficult to find, but I'm posting it here in case I ever need it again.</p>
<p>To do a reverse lookup in coldfusion:</p>
<p>&lt;cfscript&gt;<br />
rawIP = createObject("java", "java.net.InetAddress").getByName('#ipaddress#').getAddress();<br />
hostname = createObject("java", "java.net.InetAddress").getByAddress('#rawIP#').getHostName();<br />
chostname = createObject("java", "java.net.InetAddress").getByAddress('#rawIP#').getCanonicalHostName();<br />
&lt;/cfscript&gt;</p>
<p>Note &#8212; this is <strong>slow</strong>. If you're doing them in bulk, you may need to go in small batches or set a higher timeout.</p>
<p>Also, this was perhaps useful: http://api.hostip.info/get_html.php?ip=#ipaddress#&amp;position=true &#8212; returns the country, city, state, and geotag info for an IP address, where available.</p>
]]></content:encoded>
			<wfw:commentRss>http://yougiveloveabad.name/archives/2009/02/19/coldfusion-dns-reverse-lookup/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Distance in CF &#8212; Mostly useless, but fun</title>
		<link>http://yougiveloveabad.name/archives/2009/02/19/distance-in-cf-mostly-useless-but-fun/</link>
		<comments>http://yougiveloveabad.name/archives/2009/02/19/distance-in-cf-mostly-useless-but-fun/#comments</comments>
		<pubDate>Thu, 19 Feb 2009 17:31:30 +0000</pubDate>
		<dc:creator>JC</dc:creator>
				<category><![CDATA[ColdFusion]]></category>

		<guid isPermaLink="false">http://yougiveloveabad.name/?p=64</guid>
		<description><![CDATA[Assumption: table named locations that has a location name and the location's latitude &#38; longitude as a single field, with lat and lon comma separated, both in signed degrees format. This is an intentional cartesian join&#8230; so if you have a lot of locations, use with care. &#60;cfquery datasource="MyDSN" name="getDist"&#62; SELECT DISTINCT        a.latlon AS [...]]]></description>
			<content:encoded><![CDATA[<p>Assumption: table named locations that has a location name and the location's latitude &amp; longitude as a single field, with lat and lon comma separated, both in signed degrees format.</p>
<p>This is an intentional cartesian join&#8230; so if you have a lot of locations, use with care.</p>
<p>&lt;cfquery datasource="MyDSN" name="getDist"&gt;<br />
SELECT DISTINCT   <br />
    a.latlon AS thestart,<br />
    a.locName AS startname,<br />
    b.latlon AS theend,<br />
    b.locName AS endname<br />
FROM     locations a<br />
CROSS JOIN    locations b<br />
WHERE     a.locName&lt;&gt; b.locName<br />
ORDER BY     a.locName, b.locName<br />
&lt;/cfquery&gt;</p>
<p>&lt;cfoutput query="getDist" group="startname"&gt;<br />
&lt;h4&gt;#getDist.startname# to&#8230;&lt;/h4&gt;<br />
&lt;ul&gt;&lt;cfoutput&gt;<br />
&lt;li&gt;#getDist.endname# &#8212; #3963.0*acos(sin(listfirst(thestart)/57.295779513082323)*sin(listfirst(theend) / 57.295779513082323)+ cos(listfirst(thestart) / 57.295779513082323)*cos(listfirst(theend) / 57.295779513082323)*cos((listlast(theend) &#8211; listlast(thestart)) / 57.295779513082323))# Miles<br />
&lt;/li&gt;<br />
&lt;/cfoutput&gt;<br />
&lt;/ul&gt;<br />
&lt;/cfoutput&gt;</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>This is based on a snippet of SQL code someone forwarded to me which was signed "RBarryYoung, 31-Jan-2009" &#8212; so credit to RBarryYoung for it. <img src='http://yougiveloveabad.name/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://yougiveloveabad.name/archives/2009/02/19/distance-in-cf-mostly-useless-but-fun/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

