<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Hi guys, I know I am stupid and I can&amp;#39;t figure out is this java code can be translate into Sail Expression?</title><link>https://community.appian.com/discussions/f/general/18729/hi-guys-i-know-i-am-stupid-and-i-can-t-figure-out-is-this-java-code-can-be-translate-into-sail-expression</link><description>int count = 0, i = 0; 
 do { int next = (i + 1) % n; if (doIntersect(polygon[i], polygon[next], p, extreme)) { if (orientation(polygon[i], p, polygon[next]) == 0) return onSegment(polygon[i], p, polygon[next]); count++; } i = next; } while (i != 0); return</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Hi guys, I know I am stupid and I can't figure out is this java code can be translate into Sail Expression?</title><link>https://community.appian.com/thread/73725?ContentTypeID=1</link><pubDate>Thu, 30 Apr 2020 18:23:02 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e49652d9-b8a3-404b-8b31-0c9b4ff1c634</guid><dc:creator>Danny Verb</dc:creator><description>&lt;p&gt;I think it might help to think less about&amp;nbsp;translating Java to SAIL and more about what the core problem is and how to solve it. SAIL is a functional language which is very different than Java. It looks like the problem you are trying to solve is trying to figure out if any lines intersect. There are SAIL functions such as reduce() which you can utilize but you can also use a forLoop as before to go through each item in the list and compare items to those before and after. Looking at the docs&amp;nbsp;&lt;a href="https://docs.appian.com/suite/help/18.4/fnc_looping_a_foreach.html"&gt;https://docs.appian.com/suite/help/18.4/fnc_looping_a_foreach.html&lt;/a&gt;&amp;nbsp;a!forEach() has values such as fv!index to know the index of the list as well as fv!isLast to know when you&amp;#39;re comparing something with the last item in the list. For loops can definitely be a performance issue, but depending on the problem there may be ways to solve it without using a loop such as using set functions like wherecontains(). The more you think of the problem in Java, the harder it will be to solve in SAIL.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hi guys, I know I am stupid and I can't figure out is this java code can be translate into Sail Expression?</title><link>https://community.appian.com/thread/73724?ContentTypeID=1</link><pubDate>Thu, 30 Apr 2020 18:13:06 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4bea5897-cb3f-43b4-a81a-54cb2747e238</guid><dc:creator>peiranl0001</dc:creator><description>&lt;p&gt;The issues is I have no idear how many times this loop runs...Then I do not know how to use foreach loop...Also the issue with do while loop&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>