<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Extend CF native Objects &#8211; Harnessing Java</title>
	<atom:link href="http://www.rupeshk.org/blog/index.php/2007/01/extend-cf-native-objects-harnessing-java/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rupeshk.org/blog/index.php/2007/01/extend-cf-native-objects-harnessing-java/</link>
	<description>My Views on ColdFusion, Java and related technologies</description>
	<lastBuildDate>Mon, 06 Feb 2012 13:41:45 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: HellP</title>
		<link>http://www.rupeshk.org/blog/index.php/2007/01/extend-cf-native-objects-harnessing-java/comment-page-1/#comment-129</link>
		<dc:creator>HellP</dc:creator>
		<pubDate>Tue, 12 May 2009 20:25:00 +0000</pubDate>
		<guid isPermaLink="false">http://rupesh106.wordpress.com/2007/01/12/extend-cf-native-objects-harnessing-java/#comment-129</guid>
		<description>Note that if you create your array using the toArray() java function, you cannot use indexOf() java function anymore. &lt;br /&gt;&lt;br /&gt;Ex.:&lt;br /&gt;&lt;br /&gt;myArray = aQuery.aColumn.toArray(); // return you all rows corresponding to that column in an array.&lt;br /&gt;findIt = myArray.indexOf(&#039;foo&#039;); // Results in a crash -&gt; method indexOf() not found.</description>
		<content:encoded><![CDATA[<p>Note that if you create your array using the toArray() java function, you cannot use indexOf() java function anymore. </p>
<p>Ex.:</p>
<p>myArray = aQuery.aColumn.toArray(); // return you all rows corresponding to that column in an array.<br />findIt = myArray.indexOf(&#39;foo&#39;); // Results in a crash -&gt; method indexOf() not found.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: CV</title>
		<link>http://www.rupeshk.org/blog/index.php/2007/01/extend-cf-native-objects-harnessing-java/comment-page-1/#comment-123</link>
		<dc:creator>CV</dc:creator>
		<pubDate>Wed, 09 Jan 2008 16:48:00 +0000</pubDate>
		<guid isPermaLink="false">http://rupesh106.wordpress.com/2007/01/12/extend-cf-native-objects-harnessing-java/#comment-123</guid>
		<description>Thanks Rupesh, I found that out yesterday. Using the code I originally posted, is there anyway to find the *first* index of a substring of an array using a &quot;partial match&quot; with these java utils?&lt;br/&gt;&lt;br/&gt;That is what I am trying to accomplish. Using listtoarray() and listcontains() would be much slower.&lt;br/&gt;&lt;br/&gt;Thanks again!</description>
		<content:encoded><![CDATA[<p>Thanks Rupesh, I found that out yesterday. Using the code I originally posted, is there anyway to find the *first* index of a substring of an array using a &#8220;partial match&#8221; with these java utils?</p>
<p>That is what I am trying to accomplish. Using listtoarray() and listcontains() would be much slower.</p>
<p>Thanks again!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rupesh Kumar</title>
		<link>http://www.rupeshk.org/blog/index.php/2007/01/extend-cf-native-objects-harnessing-java/comment-page-1/#comment-122</link>
		<dc:creator>Rupesh Kumar</dc:creator>
		<pubDate>Wed, 09 Jan 2008 11:01:00 +0000</pubDate>
		<guid isPermaLink="false">http://rupesh106.wordpress.com/2007/01/12/extend-cf-native-objects-harnessing-java/#comment-122</guid>
		<description>CV,&lt;br/&gt;thats because &quot;images&quot; that you get from reMatchNoCase is an Array and it does not contain any element whose value is &quot;_1thumb.jpg&quot;. Sure enough, there are elements in this array which contain this string, but indexof looks for the exact object.&lt;br/&gt;&lt;br/&gt;If you need to get the count of elements that contain this string then, here is how you can modify the code&lt;br/&gt;&lt;br/&gt;&lt;cfhttp url=&quot;http://ww2.collectorcartrader.com/details.php?adId=90177579&quot;&lt;br/&gt;method=&quot;get&quot;&gt;&lt;br/&gt;&lt;br/&gt;&lt;cfset images = reMatchNoCase(&quot;&lt;img([^&gt;]*[^/]?)&gt;&quot;,cfhttp.FileContent)&gt;&lt;br/&gt;&lt;br/&gt;&lt;cfset count = 0&gt;&lt;br/&gt;&lt;cfloop from=&quot;1&quot; to=&quot;#ArrayLen(images)#&quot; index=&quot;i&quot;&gt;&lt;br/&gt; &lt;cfset image = images[i]&gt;&lt;br/&gt; &lt;cfif Find(&quot;_1thumb.jpg&quot;, image) gt 0&gt;&lt;br/&gt;  &lt;cfset count=count + 1&gt;&lt;br/&gt; &lt;/cfif&gt;&lt;br/&gt;&lt;/cfloop&gt;&lt;br/&gt;&lt;br/&gt;&lt;cfoutput&gt;#count#&lt;/cfoutput&gt;</description>
		<content:encoded><![CDATA[<p>CV,<br />thats because &#8220;images&#8221; that you get from reMatchNoCase is an Array and it does not contain any element whose value is &#8220;_1thumb.jpg&#8221;. Sure enough, there are elements in this array which contain this string, but indexof looks for the exact object.</p>
<p>If you need to get the count of elements that contain this string then, here is how you can modify the code</p>
<p>&lt;cfhttp url=&#8221;http://ww2.collectorcartrader.com/details.php?adId=90177579&#8243;<br />method=&#8221;get&#8221;&gt;</p>
<p>&lt;cfset images = reMatchNoCase(&#8221;&lt;img([^&gt;]*[^/]?)&gt;&#8221;,cfhttp.FileContent)&gt;</p>
<p>&lt;cfset count = 0&gt;<br />&lt;cfloop from=&#8221;1&#8243; to=&#8221;#ArrayLen(images)#&#8221; index=&#8221;i&#8221;&gt;<br /> &lt;cfset image = images[i]&gt;<br /> &lt;cfif Find(&#8221;_1thumb.jpg&#8221;, image) gt 0&gt;<br />  &lt;cfset count=count + 1&gt;<br /> &lt;/cfif&gt;<br />&lt;/cfloop&gt;</p>
<p>&lt;cfoutput&gt;#count#&lt;/cfoutput&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: CV</title>
		<link>http://www.rupeshk.org/blog/index.php/2007/01/extend-cf-native-objects-harnessing-java/comment-page-1/#comment-121</link>
		<dc:creator>CV</dc:creator>
		<pubDate>Tue, 08 Jan 2008 18:52:00 +0000</pubDate>
		<guid isPermaLink="false">http://rupesh106.wordpress.com/2007/01/12/extend-cf-native-objects-harnessing-java/#comment-121</guid>
		<description>Rupesh, please look at the simple code below. (Change &lt; and &gt; to get code to work.) I can never get a value greater than zero even though I should. Any ideas what I can do?&lt;br/&gt;&lt;br/&gt;&lt;cfhttp url=&quot;http://ww2.collectorcartrader.com/details.php?adId=90177579&quot;&lt;br/&gt;method=&quot;get&quot;&gt;&lt;br/&gt;&lt;br/&gt;&lt;cfset images = reMatchNoCase(&quot;&lt;img([^&gt;]*[^/]?)&gt;&quot;,cfhttp.FileContent)&gt;&lt;br/&gt;&lt;cfset temp = images.indexof(&quot;_1thumb.jpg&quot;) + 1&gt;&lt;br/&gt;&lt;br/&gt;&lt;cfoutput&gt;#temp#&lt;/cfoutput&gt;</description>
		<content:encoded><![CDATA[<p>Rupesh, please look at the simple code below. (Change &lt; and &gt; to get code to work.) I can never get a value greater than zero even though I should. Any ideas what I can do?</p>
<p>&lt;cfhttp url=&#8221;http://ww2.collectorcartrader.com/details.php?adId=90177579&#8243;<br />method=&#8221;get&#8221;&gt;</p>
<p>&lt;cfset images = reMatchNoCase(&#8221;&lt;img([^&gt;]*[^/]?)&gt;&#8221;,cfhttp.FileContent)&gt;<br />&lt;cfset temp = images.indexof(&#8221;_1thumb.jpg&#8221;) + 1&gt;</p>
<p>&lt;cfoutput&gt;#temp#&lt;/cfoutput&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://www.rupeshk.org/blog/index.php/2007/01/extend-cf-native-objects-harnessing-java/comment-page-1/#comment-120</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Thu, 03 Jan 2008 00:59:00 +0000</pubDate>
		<guid isPermaLink="false">http://rupesh106.wordpress.com/2007/01/12/extend-cf-native-objects-harnessing-java/#comment-120</guid>
		<description>Here&#039;s an alternate, fairly speedy one liner that returns true if two shorter lists have anything in common (case sensitive listreplacenocase is an alternative too):&lt;br/&gt; {cfif listreplace(myfirst_list,mysecond_list,&quot;*,*,...&quot;) contains &quot;*&quot;}&lt;br/&gt;&lt;br/&gt;One asterisk must exist in &quot;*,*,...&quot; for each mysecond_list element to be searched for.</description>
		<content:encoded><![CDATA[<p>Here&#8217;s an alternate, fairly speedy one liner that returns true if two shorter lists have anything in common (case sensitive listreplacenocase is an alternative too):<br /> {cfif listreplace(myfirst_list,mysecond_list,&#8221;*,*,&#8230;&#8221;) contains &#8220;*&#8221;}</p>
<p>One asterisk must exist in &#8220;*,*,&#8230;&#8221; for each mysecond_list element to be searched for.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dom</title>
		<link>http://www.rupeshk.org/blog/index.php/2007/01/extend-cf-native-objects-harnessing-java/comment-page-1/#comment-119</link>
		<dc:creator>Dom</dc:creator>
		<pubDate>Tue, 25 Sep 2007 23:15:00 +0000</pubDate>
		<guid isPermaLink="false">http://rupesh106.wordpress.com/2007/01/12/extend-cf-native-objects-harnessing-java/#comment-119</guid>
		<description>Hey Rupesh, in late response to your response to my response (the util function to get object heirarchy) - I have modified the function and posted some results of it on my blog (has a link to this post):&lt;br/&gt;&lt;br/&gt;http://fusion.dominicwatson.co.uk&lt;br/&gt;(first ever post on it)&lt;br/&gt;&lt;br/&gt;There is a little correction which I assume was a slip, it loops until the class is &#039;java.lang.object&#039; and not &#039;System.lang.Object&#039;.&lt;br/&gt;&lt;br/&gt;Definately prettier anyway, thanks!</description>
		<content:encoded><![CDATA[<p>Hey Rupesh, in late response to your response to my response (the util function to get object heirarchy) &#8211; I have modified the function and posted some results of it on my blog (has a link to this post):</p>
<p><a href="http://fusion.dominicwatson.co.uk" rel="nofollow">http://fusion.dominicwatson.co.uk</a><br />(first ever post on it)</p>
<p>There is a little correction which I assume was a slip, it loops until the class is &#8216;java.lang.object&#8217; and not &#8216;System.lang.Object&#8217;.</p>
<p>Definately prettier anyway, thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rupesh Kumar</title>
		<link>http://www.rupeshk.org/blog/index.php/2007/01/extend-cf-native-objects-harnessing-java/comment-page-1/#comment-118</link>
		<dc:creator>Rupesh Kumar</dc:creator>
		<pubDate>Mon, 06 Aug 2007 11:26:00 +0000</pubDate>
		<guid isPermaLink="false">http://rupesh106.wordpress.com/2007/01/12/extend-cf-native-objects-harnessing-java/#comment-118</guid>
		<description>Marco,&lt;br/&gt;You figured out right that you have to use removeAll() to do this. Just wanted to make sure that this is how you are doing.&lt;br/&gt;&lt;br/&gt;&lt;cfset arr1 = ListToArray(&quot;1,2,3,4,5,7&quot;)&gt;&lt;br/&gt;&lt;cfset arr2 = ListToArray(&quot;2,3,4,5,6&quot;)&gt;&lt;br/&gt;&lt;br/&gt;&lt;cfset dupArr1 = Duplicate(arr1)&gt;&lt;br/&gt;&lt;cfset dupArr1.removeAll(arr2)&gt;&lt;br/&gt;&lt;br/&gt;&lt;cfdump var=&quot;#dupArr1#&quot;&gt;&lt;br/&gt;&lt;br/&gt;Some how I am not convinced that java gives a inconsistent result. Can you send me your sample code which can show inconsistent result? If it is a big file, you can mail it to me at rukumar at adobe.com</description>
		<content:encoded><![CDATA[<p>Marco,<br />You figured out right that you have to use removeAll() to do this. Just wanted to make sure that this is how you are doing.</p>
<p>&lt;cfset arr1 = ListToArray(&#8221;1,2,3,4,5,7&#8243;)&gt;<br />&lt;cfset arr2 = ListToArray(&#8221;2,3,4,5,6&#8243;)&gt;</p>
<p>&lt;cfset dupArr1 = Duplicate(arr1)&gt;<br />&lt;cfset dupArr1.removeAll(arr2)&gt;</p>
<p>&lt;cfdump var=&#8221;#dupArr1#&#8221;&gt;</p>
<p>Some how I am not convinced that java gives a inconsistent result. Can you send me your sample code which can show inconsistent result? If it is a big file, you can mail it to me at rukumar at adobe.com</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marco Antonio</title>
		<link>http://www.rupeshk.org/blog/index.php/2007/01/extend-cf-native-objects-harnessing-java/comment-page-1/#comment-117</link>
		<dc:creator>Marco Antonio</dc:creator>
		<pubDate>Fri, 03 Aug 2007 14:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://rupesh106.wordpress.com/2007/01/12/extend-cf-native-objects-harnessing-java/#comment-117</guid>
		<description>Rupesh, I&#039;m using removeAll in arrays with more than 10 thousand elements. Java with big arrays works very unstable. For this example array1 haves 15000 elements and array2 15001 elements. Only 1 record in array2 doesn&#039;t match with array1. Please looks this simple code:&lt;br/&gt;get Array size before removeAll&lt;br/&gt;cfset arGetArquivosDir_Size = arGetArquivosDir.size()&lt;br/&gt;cfset arArquivoIndice_Size = arArquivoIndice.size()&lt;br/&gt;duplicate the final array - I&#039;m using for the final removeAll&lt;br/&gt;cfset arGetArquivosDir_Copia = Duplicate(arGetArquivosDir)&lt;br/&gt;&lt;br/&gt;arGetArquivosDir_Copia: #arGetArquivosDir_Copia.size()# elements&lt;br/&gt;&lt;br/&gt;remove elements in array1 matched with array2&lt;br/&gt;cfset arGetArquivosDir.removeAll(arArquivoIndice)&lt;br/&gt;vice versa&lt;br/&gt;cfset arArquivoIndice.removeAll(arGetArquivosDir_Copia)&lt;br/&gt;&lt;br/&gt;Using cfdump var=&quot;#arArquivoIndice#&quot; should display only one record but after 2 tests look this dump:&lt;br/&gt;&lt;br/&gt;TEST 1&lt;br/&gt;arArquivoIndice - array  &lt;br/&gt;1 arArquivoIndice - struct &lt;br/&gt;NAME 00000000000000122006070604.SGD  &lt;br/&gt; &lt;br/&gt;2 arArquivoIndice - struct &lt;br/&gt;NAME 04025367000000162006070704.SGD  &lt;br/&gt; &lt;br/&gt;3 arArquivoIndice - struct &lt;br/&gt;NAME 04025566000001132006070704.SGD  &lt;br/&gt; &lt;br/&gt;4 arArquivoIndice - struct &lt;br/&gt;NAME 04026829000000742006071104.SGD  &lt;br/&gt; &lt;br/&gt;5 arArquivoIndice - struct &lt;br/&gt;NAME 04027182000000112006071104.SGD  &lt;br/&gt;&lt;br/&gt;TEST 2&lt;br/&gt;arArquivoIndice - array  &lt;br/&gt;1 arArquivoIndice - struct &lt;br/&gt;NAME 00000000000000122006070604.SGD  &lt;br/&gt; &lt;br/&gt;2 arArquivoIndice - struct &lt;br/&gt;NAME 04026827000000722006071104.SGD  &lt;br/&gt; &lt;br/&gt;3 arArquivoIndice - struct &lt;br/&gt;NAME 04027172000000862006071104.SGD  &lt;br/&gt; &lt;br/&gt;4 arArquivoIndice - struct &lt;br/&gt;NAME 04027180000000592006071104.SGD  &lt;br/&gt; &lt;br/&gt;5 arArquivoIndice - struct &lt;br/&gt;NAME 04027415000000172006071204.SGD  &lt;br/&gt; &lt;br/&gt;Please look that 2 different results.</description>
		<content:encoded><![CDATA[<p>Rupesh, I&#8217;m using removeAll in arrays with more than 10 thousand elements. Java with big arrays works very unstable. For this example array1 haves 15000 elements and array2 15001 elements. Only 1 record in array2 doesn&#8217;t match with array1. Please looks this simple code:<br />get Array size before removeAll<br />cfset arGetArquivosDir_Size = arGetArquivosDir.size()<br />cfset arArquivoIndice_Size = arArquivoIndice.size()<br />duplicate the final array &#8211; I&#8217;m using for the final removeAll<br />cfset arGetArquivosDir_Copia = Duplicate(arGetArquivosDir)</p>
<p>arGetArquivosDir_Copia: #arGetArquivosDir_Copia.size()# elements</p>
<p>remove elements in array1 matched with array2<br />cfset arGetArquivosDir.removeAll(arArquivoIndice)<br />vice versa<br />cfset arArquivoIndice.removeAll(arGetArquivosDir_Copia)</p>
<p>Using cfdump var=&#8221;#arArquivoIndice#&#8221; should display only one record but after 2 tests look this dump:</p>
<p>TEST 1<br />arArquivoIndice &#8211; array  <br />1 arArquivoIndice &#8211; struct <br />NAME 00000000000000122006070604.SGD  </p>
<p>2 arArquivoIndice &#8211; struct <br />NAME 04025367000000162006070704.SGD  </p>
<p>3 arArquivoIndice &#8211; struct <br />NAME 04025566000001132006070704.SGD  </p>
<p>4 arArquivoIndice &#8211; struct <br />NAME 04026829000000742006071104.SGD  </p>
<p>5 arArquivoIndice &#8211; struct <br />NAME 04027182000000112006071104.SGD  </p>
<p>TEST 2<br />arArquivoIndice &#8211; array  <br />1 arArquivoIndice &#8211; struct <br />NAME 00000000000000122006070604.SGD  </p>
<p>2 arArquivoIndice &#8211; struct <br />NAME 04026827000000722006071104.SGD  </p>
<p>3 arArquivoIndice &#8211; struct <br />NAME 04027172000000862006071104.SGD  </p>
<p>4 arArquivoIndice &#8211; struct <br />NAME 04027180000000592006071104.SGD  </p>
<p>5 arArquivoIndice &#8211; struct <br />NAME 04027415000000172006071204.SGD  </p>
<p>Please look that 2 different results.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marco Antonio</title>
		<link>http://www.rupeshk.org/blog/index.php/2007/01/extend-cf-native-objects-harnessing-java/comment-page-1/#comment-116</link>
		<dc:creator>Marco Antonio</dc:creator>
		<pubDate>Fri, 03 Aug 2007 12:37:00 +0000</pubDate>
		<guid isPermaLink="false">http://rupesh106.wordpress.com/2007/01/12/extend-cf-native-objects-harnessing-java/#comment-116</guid>
		<description>Rupesh, thank you. Great! Only one challenge to you: how to compare 2 arrays and display the differences between? Looks like this:&lt;br/&gt;arrayTest1  &lt;br/&gt;1 struct &lt;br/&gt;NAME 01076354000000012006071101.BAA  &lt;br/&gt;&lt;br/&gt;arrayTest2 &lt;br/&gt;1 struct &lt;br/&gt;NAME 0107635400000002200607110A.BAA  &lt;br/&gt;&lt;br/&gt;arrayTest1 haves 100 elements and arrayTest2 103 elements. I&#039;ll want to display all elements that exist in arrayTest1 and not exist in ArrayTest2 and vice versa. Impossible?</description>
		<content:encoded><![CDATA[<p>Rupesh, thank you. Great! Only one challenge to you: how to compare 2 arrays and display the differences between? Looks like this:<br />arrayTest1  <br />1 struct <br />NAME 01076354000000012006071101.BAA  </p>
<p>arrayTest2 <br />1 struct <br />NAME 0107635400000002200607110A.BAA  </p>
<p>arrayTest1 haves 100 elements and arrayTest2 103 elements. I&#8217;ll want to display all elements that exist in arrayTest1 and not exist in ArrayTest2 and vice versa. Impossible?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rupesh Kumar</title>
		<link>http://www.rupeshk.org/blog/index.php/2007/01/extend-cf-native-objects-harnessing-java/comment-page-1/#comment-115</link>
		<dc:creator>Rupesh Kumar</dc:creator>
		<pubDate>Fri, 06 Jul 2007 08:25:00 +0000</pubDate>
		<guid isPermaLink="false">http://rupesh106.wordpress.com/2007/01/12/extend-cf-native-objects-harnessing-java/#comment-115</guid>
		<description>Thanks Dominic. Nice util function to get object hierarchy. I would suggest a small enhancement in it. Instead of depending on exception for breaking out of the while loop, you can loop until your super class name is &quot;System.lang.Object&quot;. Thats because all the java objects extend from java.lang.Object.&lt;br/&gt;&lt;br/&gt;Cheers,&lt;br/&gt;Rupesh</description>
		<content:encoded><![CDATA[<p>Thanks Dominic. Nice util function to get object hierarchy. I would suggest a small enhancement in it. Instead of depending on exception for breaking out of the while loop, you can loop until your super class name is &#8220;System.lang.Object&#8221;. Thats because all the java objects extend from java.lang.Object.</p>
<p>Cheers,<br />Rupesh</p>
]]></content:encoded>
	</item>
</channel>
</rss>

