<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-12983281.post114122284237070350..comments</id><updated>2008-12-09T19:14:51.370-08:00</updated><title type='text'>Comments on I Need Closure(s): Let's scream</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://i-need-closures.blogspot.com/feeds/114122284237070350/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12983281/114122284237070350/comments/default'/><link rel='alternate' type='text/html' href='http://i-need-closures.blogspot.com/2006/03/lets-scream.html'/><author><name>Richard Cook</name><uri>http://www.blogger.com/profile/11838741004941594394</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>8</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-12983281.post-114135430672237722</id><published>2006-03-02T18:51:00.000-08:00</published><updated>2006-03-02T18:51:00.000-08:00</updated><title type='text'>Richard,   Thanks for catching the off-by-one bug....</title><content type='html'>Richard,&lt;BR/&gt;&lt;BR/&gt;   Thanks for catching the off-by-one bug.   The line above the arraycopy() needs a "+1" also.&lt;BR/&gt;&lt;BR/&gt;   I didn't read the original problem carefully so I figured that if all of the numbers were negative then the largest largest sum would be zero and it would belong to any zero-length sequence.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12983281/114122284237070350/comments/default/114135430672237722'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12983281/114122284237070350/comments/default/114135430672237722'/><link rel='alternate' type='text/html' href='http://i-need-closures.blogspot.com/2006/03/lets-scream.html?showComment=1141354260000#c114135430672237722' title=''/><author><name>Kevin Greer</name><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://i-need-closures.blogspot.com/2006/03/lets-scream.html' ref='tag:blogger.com,1999:blog-12983281.post-114122284237070350' source='http://www.blogger.com/feeds/12983281/posts/default/114122284237070350' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-12983281.post-114133248766438599</id><published>2006-03-02T12:48:00.000-08:00</published><updated>2006-03-02T12:48:00.000-08:00</updated><title type='text'>Kevin,The last parameter to System.arraycopy is le...</title><content type='html'>Kevin,&lt;BR/&gt;&lt;BR/&gt;The last parameter to System.arraycopy is length, which needs to be 'maxhigh - maxlow + 1'. Also, your app doesn't work for all negative numbers; from Brian's comments in his solution,&lt;BR/&gt;{-5, -12, -3, -7}            =&gt;  {-3}</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12983281/114122284237070350/comments/default/114133248766438599'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12983281/114122284237070350/comments/default/114133248766438599'/><link rel='alternate' type='text/html' href='http://i-need-closures.blogspot.com/2006/03/lets-scream.html?showComment=1141332480000#c114133248766438599' title=''/><author><name>Richard Cook</name><uri>http://www.blogger.com/profile/11838741004941594394</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='14118512511685171087'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://i-need-closures.blogspot.com/2006/03/lets-scream.html' ref='tag:blogger.com,1999:blog-12983281.post-114122284237070350' source='http://www.blogger.com/feeds/12983281/posts/default/114122284237070350' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-12983281.post-114132044056833188</id><published>2006-03-02T09:27:00.000-08:00</published><updated>2006-03-02T09:27:00.000-08:00</updated><title type='text'>I'd be interested to hear more about your Screamer...</title><content type='html'>I'd be interested to hear more about your Screamer experiences in future blog posts.  I have tried to use it on a few occasions, and I've found it was difficult to debug the nondeterministic search, and that harvesting information out of a nondeterministic part of one of my programs and into a "normal" part was difficult.  I've always ended up giving up and using a more conventional search approach, or using CLP in Prolog, where nondeterminism is basic to the language and hence better integrated.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12983281/114122284237070350/comments/default/114132044056833188'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12983281/114122284237070350/comments/default/114132044056833188'/><link rel='alternate' type='text/html' href='http://i-need-closures.blogspot.com/2006/03/lets-scream.html?showComment=1141320420000#c114132044056833188' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://i-need-closures.blogspot.com/2006/03/lets-scream.html' ref='tag:blogger.com,1999:blog-12983281.post-114122284237070350' source='http://www.blogger.com/feeds/12983281/posts/default/114122284237070350' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-12983281.post-114130897563291550</id><published>2006-03-02T06:16:00.000-08:00</published><updated>2006-03-02T06:16:00.000-08:00</updated><title type='text'>Here's a solution in Java which is much less than ...</title><content type='html'>Here's a solution in Java which is much less than 100 lines of code and runs in O(n) as apposed to your solution which is O(n^2).&lt;BR/&gt;&lt;BR/&gt;int[] maxSeq(int[] a) {&lt;BR/&gt;  int max = 0, sum = 0,low = 0, high = 0, maxlow = 0, maxhigh = 0;&lt;BR/&gt;&lt;BR/&gt;  for ( int i = 0 ; i &lt; a.length ; i++, high++ ) {&lt;BR/&gt;     sum += a[i];&lt;BR/&gt;     if ( sum &lt; 0 ) {&lt;BR/&gt;        sum = 0;&lt;BR/&gt;        low = i+1;&lt;BR/&gt;     } else if ( sum &gt; max ) {&lt;BR/&gt;        max     = sum;&lt;BR/&gt;        maxlow  = low;&lt;BR/&gt;        maxhigh = high;&lt;BR/&gt;     }&lt;BR/&gt;  }&lt;BR/&gt;&lt;BR/&gt;  int[] seq = new int[maxhigh-maxlow];&lt;BR/&gt;  System.arraycopy(a, maxlow, seq, 0, maxhigh-maxlow);&lt;BR/&gt;  return seq; &lt;BR/&gt;}</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12983281/114122284237070350/comments/default/114130897563291550'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12983281/114122284237070350/comments/default/114130897563291550'/><link rel='alternate' type='text/html' href='http://i-need-closures.blogspot.com/2006/03/lets-scream.html?showComment=1141308960000#c114130897563291550' title=''/><author><name>Kevin Greer</name><uri>http://www.peerbox.com:8668/space/start</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://i-need-closures.blogspot.com/2006/03/lets-scream.html' ref='tag:blogger.com,1999:blog-12983281.post-114122284237070350' source='http://www.blogger.com/feeds/12983281/posts/default/114122284237070350' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-12983281.post-114127409058001542</id><published>2006-03-01T20:34:00.000-08:00</published><updated>2006-03-01T20:34:00.000-08:00</updated><title type='text'>I tried Screamer+, but the arefv they had implemen...</title><content type='html'>I tried Screamer+, but the arefv they had implemented mainly varied the indices of the array access, not the data in the arrays.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12983281/114122284237070350/comments/default/114127409058001542'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12983281/114122284237070350/comments/default/114127409058001542'/><link rel='alternate' type='text/html' href='http://i-need-closures.blogspot.com/2006/03/lets-scream.html?showComment=1141274040000#c114127409058001542' title=''/><author><name>Richard Cook</name><uri>http://www.blogger.com/profile/11838741004941594394</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='14118512511685171087'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://i-need-closures.blogspot.com/2006/03/lets-scream.html' ref='tag:blogger.com,1999:blog-12983281.post-114122284237070350' source='http://www.blogger.com/feeds/12983281/posts/default/114122284237070350' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-12983281.post-114126061819029608</id><published>2006-03-01T16:50:00.000-08:00</published><updated>2006-03-01T16:50:00.000-08:00</updated><title type='text'>screamer+ is an extension to screamer that attemps...</title><content type='html'>screamer+ is an extension to screamer that attemps to make it work better with aggregates. You might want to use it. I have a mostly CL-clean version somewhere, although I think the quasi totality of the work was in fixing EVAL-WHENs and dependencies.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12983281/114122284237070350/comments/default/114126061819029608'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12983281/114122284237070350/comments/default/114126061819029608'/><link rel='alternate' type='text/html' href='http://i-need-closures.blogspot.com/2006/03/lets-scream.html?showComment=1141260600000#c114126061819029608' title=''/><author><name>pkhuong</name><uri>http://www.pvk.ca</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://i-need-closures.blogspot.com/2006/03/lets-scream.html' ref='tag:blogger.com,1999:blog-12983281.post-114122284237070350' source='http://www.blogger.com/feeds/12983281/posts/default/114122284237070350' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-12983281.post-114123946980031665</id><published>2006-03-01T10:57:00.000-08:00</published><updated>2006-03-01T10:57:00.000-08:00</updated><title type='text'>Not great. On my 1 Ghz iBook it takes about .7 sec...</title><content type='html'>Not great. On my 1 Ghz iBook it takes about .7 seconds to do one puzzle, much slower than Jalat's &lt;A HREF="http://www.jalat.com/blogs/lisp?id=4" REL="nofollow"&gt;Let's Dance&lt;/A&gt;. This was mainly an exercise in learning Screamer and LTK, and the only contest mine will win would be "ease of understanding". Someone could probably look at the Screamer version and understand the rules of Sudoku without knowing Sudoku beforehand.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12983281/114122284237070350/comments/default/114123946980031665'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12983281/114122284237070350/comments/default/114123946980031665'/><link rel='alternate' type='text/html' href='http://i-need-closures.blogspot.com/2006/03/lets-scream.html?showComment=1141239420000#c114123946980031665' title=''/><author><name>Richard Cook</name><uri>http://www.blogger.com/profile/11838741004941594394</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='14118512511685171087'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://i-need-closures.blogspot.com/2006/03/lets-scream.html' ref='tag:blogger.com,1999:blog-12983281.post-114122284237070350' source='http://www.blogger.com/feeds/12983281/posts/default/114122284237070350' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-12983281.post-114123489522556039</id><published>2006-03-01T09:41:00.000-08:00</published><updated>2006-03-01T09:41:00.000-08:00</updated><title type='text'>So, how did it perform?</title><content type='html'>So, how did it perform?</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12983281/114122284237070350/comments/default/114123489522556039'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12983281/114122284237070350/comments/default/114123489522556039'/><link rel='alternate' type='text/html' href='http://i-need-closures.blogspot.com/2006/03/lets-scream.html?showComment=1141234860000#c114123489522556039' title=''/><author><name>jrm</name><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://i-need-closures.blogspot.com/2006/03/lets-scream.html' ref='tag:blogger.com,1999:blog-12983281.post-114122284237070350' source='http://www.blogger.com/feeds/12983281/posts/default/114122284237070350' type='text/html'/></entry></feed>