<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.wordaligned.org/~d/styles/itemcontent.css"?><rss version="2.0"><channel><title>Word Aligned - Latest Comments</title><link xmlns="http://www.w3.org/2005/Atom" rel="http://api.friendfeed.com/2008/03#sup" href="http://disqus.com/sup/all.sup#forumcomments-4e0fcddc" type="application/json" /><link>http://wordaligned.disqus.com/</link><description>Tales from the code face</description><language>en</language><lastBuildDate>Sun, 14 Mar 2010 04:05:17 -0000</lastBuildDate><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.wordaligned.org/wordaligned/comments" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="wordaligned/comments" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item><title>Re: The Maximum Sum contiguous subsequence problem</title><link>http://wordaligned.org/articles/the-maximum-subsequence-problem#comment-39605998</link><description>Warning: it's a tough problem! In the second edition of Programming Pearls, Jon Bentley writes: "the two-dimensional problem remains open ... Readers who feel that the linear-time algorithm for the one-dimensional problem is 'obvious' are therefore urged to find an 'obvious' algorithm for problem 13!" (Problem 13 is a statement of the 2D problem). &lt;br&gt;I do not know if any efficient algorithm for the 2D problem has been discovered since. To answer your question: I haven't found one.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">tag</dc:creator><pubDate>Sun, 14 Mar 2010 04:05:17 -0000</pubDate></item><item><title>Re: The Maximum Sum contiguous subsequence problem</title><link>http://wordaligned.org/articles/the-maximum-subsequence-problem#comment-39564277</link><description>If/when I get some time, I'll have to do that. Have you done it yourself?</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">RyanBalfanz</dc:creator><pubDate>Sat, 13 Mar 2010 20:51:18 -0000</pubDate></item><item><title>Re: The Maximum Sum contiguous subsequence problem</title><link>http://wordaligned.org/articles/the-maximum-subsequence-problem#comment-39491807</link><description>Thanks, Ryan. If you're feeling inspired, why not try the 2 dimensional version? Find the maximum sum of a rectangular subarray of a 2D array of numbers.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">tag</dc:creator><pubDate>Sat, 13 Mar 2010 04:07:04 -0000</pubDate></item><item><title>Re: The Maximum Sum contiguous subsequence problem</title><link>http://wordaligned.org/articles/the-maximum-subsequence-problem#comment-39470009</link><description>I recently was asked to solve this problem, which oddly I'd never encountered before (or forgotten). Thanks for such a great description of the problem and explanation of how to solve it. The programmatic solutions are great, but the visual representation really take the explanation to the next level!</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">RyanBalfanz</dc:creator><pubDate>Fri, 12 Mar 2010 22:07:17 -0000</pubDate></item><item><title>Re: One svnserve, multiple repositories</title><link>http://wordaligned.org/articles/one-svnserve-multiple-repositories#comment-35652358</link><description>For those running under xinetd, remember to remove the "-d" and add the "-i" flag (one stands for "daemon mode" and the other for "inetd mode"). This seems to be obvious, but for those that don't really know what's going on (my case), it will save much time.&lt;br&gt;&lt;br&gt;I also wanted to password protect my repository. For that I had to change passwd and svnserve.conf under the repository's "conf" directory (you must change the settings for each repository you'll create).&lt;br&gt;&lt;br&gt;Thanks a lot for this post!</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Rafael Cotta</dc:creator><pubDate>Sat, 20 Feb 2010 15:41:13 -0000</pubDate></item><item><title>Re: Joined Output and the Fencepost Problem</title><link>http://wordaligned.org/articles/joined-output-and-the-fencepost-problem#comment-35060311</link><description>Thanks for the bug-fix mmocny.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">tag</dc:creator><pubDate>Thu, 18 Feb 2010 16:09:35 -0000</pubDate></item><item><title>Re: Joined Output and the Fencepost Problem</title><link>http://wordaligned.org/articles/joined-output-and-the-fencepost-problem#comment-35030927</link><description>There is a bug in your first example using a BidirectionalIterator, when you do --last a second time.  This bug does not exist in the final version of your code.&lt;br&gt;Also, I would have replaced the assert( first != last ); with if (first == last) return;&lt;br&gt;&lt;br&gt;Thanks for the article, I have certainly run into this problem before.  Most often it is with text output, like here, but it can crop up in any loop where the last iteration produces *less* side effects than the other iterations.  Most often the last iteration produces *more* side effects and that code just follows after the loop ends.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">mmocny</dc:creator><pubDate>Thu, 18 Feb 2010 11:32:45 -0000</pubDate></item><item><title>Re: When you comment on a comment</title><link>http://wordaligned.org/articles/comments-on-comments#comment-34998712</link><description>Thanks for your comment lorg.&lt;br&gt;&lt;br&gt;&amp;gt; Well, I don't use disqus, so currently I don't have anything much to say about them one way or the other. Yet the "commenter's rights" quote reads a lot like a feature list. Why *should* commenters have these rights?&lt;br&gt;&lt;br&gt;Usually they don't! But Disqus are trying to change that. "Commenter's rights" is putting it strongly, but I guess it all comes down to opinion.&lt;br&gt;&lt;br&gt;&amp;gt; Personally, as a blog owner, I think that having comments on the actual article as opposed to comments on reddit/other social websites has great value. These comments *keep*. They are also visible to anyone reading the article, regardless of where he came from. &lt;br&gt;&lt;br&gt;Yes, an important comment should be easy to find from the original. Often, though, it seems that people read the comments first. Disqus *does* let you include reactions from reddit etc to on your blog. I've got it turned off at the moment. Bloggers can also link back to reddit if they think the discussion there is interesting.&lt;br&gt;&lt;br&gt;&amp;gt; I think that most important right a commenter should have is that the comment will not be edited without his permission (barring special circumstances such as ungarbling code, closing tags, etc...). However, this is a case of blogging ethics, and not a technological issue.&lt;br&gt;&lt;br&gt;Yes, I agree.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">tag</dc:creator><pubDate>Thu, 18 Feb 2010 03:59:02 -0000</pubDate></item><item><title>Re: When you comment on a comment</title><link>http://wordaligned.org/articles/comments-on-comments#comment-34248999</link><description>Heya&lt;br&gt;Well, I don't use disqus, so currently I don't have anything much to say about them one way or the other. Yet the "commenter's rights" quote reads a lot like a feature list. Why *should* commenters have these rights?&lt;br&gt;&lt;br&gt;When thinking about it. I think it's a lot like a power-play. Who wants the comment more, the website, or the commenter? If the website wants it more, and they think having these features will help get it, they'll implement it. If the commenter wants it more, he will comment even in a website that doesn't give that right.&lt;br&gt;&lt;br&gt;Personally, as a blog owner, I think that having comments on the actual article as opposed to comments on reddit/other social websites has great value. These comments *keep*. They are also visible to anyone reading the article, regardless of where he came from. &lt;br&gt;&lt;br&gt;Furthermore, I'm not sure I agree with these rights in principle. I don't think that I'm obliged to keep a copy of the comments in case I shut down my blog. I also don't give any guarantee that the comments there will be kept.&lt;br&gt;&lt;br&gt;I think that most important right a commenter should have is that the comment will not be edited without his permission (barring special circumstances such as ungarbling code, closing tags, etc...). However, this is a case of blogging ethics, and not a technological issue.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">lorg</dc:creator><pubDate>Mon, 15 Feb 2010 04:44:37 -0000</pubDate></item><item><title>Re: When you comment on a comment</title><link>http://wordaligned.org/articles/comments-on-comments#comment-33987067</link><description>Hi Paul. Yes, I had noticed a few evals creeping in recently: I don't think you've messed up, I think they're a good example of when they're useful.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">tag</dc:creator><pubDate>Fri, 12 Feb 2010 04:26:08 -0000</pubDate></item><item><title>Re: When you comment on a comment</title><link>http://wordaligned.org/articles/comments-on-comments#comment-33982754</link><description>I do read all comments on this site (even have a separate RSS feed for them). Kudos to you for the fitting description "trolling teenager" :D.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Stephan202</dc:creator><pubDate>Fri, 12 Feb 2010 02:49:11 -0000</pubDate></item><item><title>Re: When you comment on a comment</title><link>http://wordaligned.org/articles/comments-on-comments#comment-33948719</link><description>It's not that I particularly like comments but if you hadn't mentioned the recent comment activity on your site, I wouldn't have gone looking, found the trolling teenager, then read the article with the eval etc. (It looked like a lisp thing at first glance - I tend to ignore them). So I wouldn't have thought to warn you that there are a couple of cheeky evals in a certain code base you and I are hoping to put into production soon. Maybe you should review them some time, make sure I haven't messed up!&lt;br&gt;&lt;br&gt;Yay for comments.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Paul Thomas</dc:creator><pubDate>Thu, 11 Feb 2010 17:49:48 -0000</pubDate></item><item><title>Re: When you comment on a comment</title><link>http://wordaligned.org/articles/comments-on-comments#comment-33487846</link><description>I know of at least a couple DISQUS developers that follow your blog, so the feeling is mutual.  :)</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">bretthoerner</dc:creator><pubDate>Wed, 10 Feb 2010 17:48:21 -0000</pubDate></item><item><title>Re: Longest common subsequence</title><link>http://wordaligned.org/articles/longest-common-subsequence#comment-33449204</link><description>Ravi, thanks for your kind words. No, I'm not aware if your "hierarchical search algorithms" idea is used anywhere: this article includes most of what I know about this particular problem. Of course, the algorithm doesn't need to be used on characters - it works equally well finding longest common word subsequences.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">tag</dc:creator><pubDate>Wed, 10 Feb 2010 13:53:28 -0000</pubDate></item><item><title>Re: Longest common subsequence</title><link>http://wordaligned.org/articles/longest-common-subsequence#comment-33375920</link><description>Excellent document and teaches on a variety of levels and topics so nicely introducing so many things so well and aptly. I am now a fan of your writing.&lt;br&gt;Many many many thanks for taking the time and willingness to write out such&lt;br&gt;great material that would benefit next generations, introducing them to the best&lt;br&gt;thoughts and practices.&lt;br&gt;&lt;br&gt;Question on the lcs: one would think that before character-by-character match on a long string, one would try to split it up into 'words' and tokenize them and then match the tokens. In other words, from the alphabet soup of dna string one could create ngrams and shorten the strings.&lt;br&gt;&lt;br&gt;Or if the texts to be matched are english, one would tokenize, replacing each word with a hash key and so on. The idea is that 'chunks are matched against chunks, instead of always a character by character match'.&lt;br&gt;&lt;br&gt;Are you aware of such 'hierarchical search algorithms'?</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ravi Annaswamy</dc:creator><pubDate>Wed, 10 Feb 2010 06:03:55 -0000</pubDate></item><item><title>Re: String literals and regular expressions</title><link>http://wordaligned.org/articles/string-literals-and-regular-expressions#comment-32828945</link><description>"A complete C++ string literal matcher"&lt;br&gt;    --------&lt;br&gt;&lt;br&gt;You seem to forgot string declarations like :&lt;br&gt;&lt;br&gt;const char* test =  "this is a multiline"&lt;br&gt;                           "test, it compiles, but your regexp doesn't seem"&lt;br&gt;                           "to work with this kind of example :) ";&lt;br&gt;&lt;br&gt;In there "regex_replace" example boost uses this example to match literals strings :&lt;br&gt;&lt;br&gt;"\"(?:[^\\\\\"]|\\\\.)*\""&lt;br&gt;source : &lt;a href="http://www.boost.org/doc/libs/1_42_0/libs/regex/doc/html/boost_regex/ref/regex_replace.html" rel="nofollow"&gt;http://www.boost.org/doc/libs/1_42_0/libs/regex...&lt;/a&gt;&lt;br&gt;&lt;br&gt;It's realy close of your example, but this one doesn't work for the case above.&lt;br&gt;&lt;br&gt;I don't know how to complete your regexp to match my example..&lt;br&gt;Do you have an idea?&lt;br&gt;&lt;br&gt;Nice work, usefull article, thanks. :)</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">John</dc:creator><pubDate>Sat, 06 Feb 2010 06:59:52 -0000</pubDate></item><item><title>Re: Ignoring .svn directories</title><link>http://wordaligned.org/articles/ignoring-svn-directories#comment-32505859</link><description>very cool find command and emacs integration! ty for you help and useful descriptions!</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">aaron</dc:creator><pubDate>Wed, 03 Feb 2010 12:35:40 -0000</pubDate></item><item><title>Re: Power programming</title><link>http://wordaligned.org/articles/power-programming#comment-32327327</link><description>I don't see, where he didn't solve the problem - and I am not talking about the elegance of his solution. This is - as we all might have recognized by now - a little bit subjective. The description of the problem doesn't mention anywhere, that you should write a recursive parser. Of course, that's what you obviously might expect as a solution, but it's not what's being asked for explicitly.&lt;br&gt;And even IF the challenge did mention something about the way it is expected to be solved, he still could use this very example to show, that there exists a way of solving it without writing a parser. This doesn't mean, that it's a good idea. And it certainly doesn't mean, that you should like it. But it's perfectly legit to prove a point. Which it did.&lt;br&gt;And by the way. You know, that Guido van Rossum works at google and might have had some influence in this challenges? The way the input is formated might not accidentally be like it is. I think it's possible, that they thought, there might be someone out there who solves the parsing with a simple eval, just for fun. Who knows. &lt;br&gt;&lt;br&gt;@emphasis: he marked "can't" in bold while you marked "c++". I don't blame you for "reading it wrong", you just put the emphasis on a different word by marking a different word. If you want to blame someone for being picky the wrong way when blaming someone for being picky the wrong way, do it right. (yeah, I know that it's getting pretty silly at this point but ICNR)&lt;br&gt;&lt;br&gt;And one last thing: we indeed agree, that we've equally valid opinions, and we merely disagree. Let's keep it on this level.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">bestform</dc:creator><pubDate>Mon, 01 Feb 2010 17:34:20 -0000</pubDate></item><item><title>Re: Power programming</title><link>http://wordaligned.org/articles/power-programming#comment-32233445</link><description>Funny, when the man himself replied, he didn't raise that point.  I suppose that, yes, C++ cannot embed an entire programming language for the purpose of parsing one string that resembles but is not the problem description.&lt;br&gt;&lt;br&gt;That does not, however, affect any of the things I said to the man, which were about that he failed to understand the purpose of the challenge in the first place, which was to write the recursive descent parser, and instead did something that whereas might be seen as a convenient hack nonetheless didn't even solve the problem in the first place.&lt;br&gt;&lt;br&gt;Horseshoes and hand-grenades, and all that jazz.  It'd be a more compelling hack if it actually solved the problem.  If you really want a compelling hack, write the one-liner regexp that makes this actually work.  It will still get a resounding yawn, because it's neither difficult nor anything short of tremendously obvious.&lt;br&gt;&lt;br&gt;My criticism stands: this has nothing to do with elegance.  This is the exact opposite of elegance.  This is a ridiculous approach, and it isn't even finished, because it's one line of code short of solving the actual problem.&lt;br&gt;&lt;br&gt;And by the way: we disagree on his emphasis, and you aren't the original speaker, so don't presume to comment on that I'm wrong in my reading of his words.  We've equally valid opinions, and we merely disagree.  If you want to pick on someone for being picky, do it right.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">John Haugeland</dc:creator><pubDate>Sun, 31 Jan 2010 17:04:20 -0000</pubDate></item><item><title>Re: Removing duplicates using itertools.groupby</title><link>http://wordaligned.org/articles/removing-duplicates-using-itertoolsgroupby#comment-32191755</link><description>Really good stuff.&lt;br&gt;&lt;br&gt;I would like to post here how do I do the "sort | uniq" and "sort | uniq -c | sort -n" kind of things:&lt;br&gt;&lt;br&gt;def sortuniq(lista):&lt;br&gt;    return sorted([a for a,b in itertools.groupby(sorted(lista))])&lt;br&gt;&lt;br&gt;def sortuniqc(lista):&lt;br&gt;    return sorted([(len(list(b)), a) for a, b in itertools.groupby(sorted(lista))])&lt;br&gt;&lt;br&gt;Examples:&lt;br&gt;    muscle = ['charger', 'charger', 'dart', 'fury', 'mustang', 'camaro', 'mustang']&lt;br&gt;&lt;br&gt;    utils.sortuniq(muscle)&lt;br&gt;    ['camaro', 'charger', 'dart', 'fury', 'mustang']&lt;br&gt;&lt;br&gt;    utils.sortuniqc(muscle)&lt;br&gt;    [(1, 'camaro'), (1, 'dart'), (1, 'fury'), (2, 'charger'), (2, 'mustang')]&lt;br&gt;&lt;br&gt;Best regards!&lt;br&gt;Rogério Schneider (&lt;a href="http://stockrt.github.com" rel="nofollow"&gt;http://stockrt.github.com&lt;/a&gt;)</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">stockrt</dc:creator><pubDate>Sun, 31 Jan 2010 00:31:04 -0000</pubDate></item><item><title>Re: Power programming</title><link>http://wordaligned.org/articles/power-programming#comment-32167952</link><description>@commas: sorry for not being a native speaker. I hope you can forgive me.&lt;br&gt;&lt;br&gt;@"something c++ can't do": he didn't say, that c++ couldn't solve the problem. He just showed, that it can't do it in a certain way. You don't have to like that way (using something like eval), but it is something c++ can't do. Live with it. I know you can.&lt;br&gt;&lt;br&gt;And by the way: his emphasis in the original text was on "can't", not "C++". If you want to be picky, do it right.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">bestform</dc:creator><pubDate>Sat, 30 Jan 2010 16:16:49 -0000</pubDate></item><item><title>Re: Power programming</title><link>http://wordaligned.org/articles/power-programming#comment-32094864</link><description>"I think a linked list is an elegant data structure."&lt;br&gt;&lt;br&gt;... really?&lt;br&gt;&lt;br&gt;I think you use that word much, much too easily.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">John Haugeland</dc:creator><pubDate>Fri, 29 Jan 2010 17:56:41 -0000</pubDate></item><item><title>Re: Power programming</title><link>http://wordaligned.org/articles/power-programming#comment-32094801</link><description>"But in this article I wanted to discuss something &lt;b&gt;C++&lt;/b&gt; can’t do."&lt;br&gt;&lt;br&gt;Emphasis his.  Way to miss my point.&lt;br&gt;&lt;br&gt;"Try to calm down and realize, that it's not about string parsing or use of libraries."&lt;br&gt;&lt;br&gt;We don't agree.  Commas are difficult, aren't they?</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">John Haugeland</dc:creator><pubDate>Fri, 29 Jan 2010 17:55:36 -0000</pubDate></item><item><title>Re: Power programming</title><link>http://wordaligned.org/articles/power-programming#comment-32092202</link><description>Dude, seriously. Calm down.&lt;br&gt;&lt;br&gt;You seem to be someone, who wrote two or three lines of code in his life for sure. You know your job. But what you write is just bitter. Tag shows us his excitement for different approaches to solving a simple problem. It's fun to explore different possibilities and languages, just for the sake of it.&lt;br&gt;&lt;br&gt;That doesn't mean that you would ever solve such a problem in this way in production code. But that wasn't the motivation at all.&lt;br&gt;&lt;br&gt;To say, he didn't solve the problem in python is not the way I'd put it. It was a code challenge. There is an input and there is an expected output. To "solve" the challenge you have to present a solution which takes a clearly specified input and gives you an expected answer. His solution does exactly that. That you in particular don't like his approach and feel, that it's cheating, is kind of sad and tells a lot about your lost fascination for unusual problem solving, which any coder should try to preserve.&lt;br&gt;Remember: this is a code challenge and it's meant to be fun and a possibility to explore techniques you probably wouldn't use in your everyday production code.&lt;br&gt;&lt;br&gt;Try to calm down and realize, that it's not about string parsing or use of libraries. Tag represents a spirit, that is honorable and that should be in all of us coders. Instead of calling him a beginner with no sense for elegance, you could just have presented your sense of elegance and your way of solving the problem.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">bestform</dc:creator><pubDate>Fri, 29 Jan 2010 17:19:58 -0000</pubDate></item><item><title>Re: Power programming</title><link>http://wordaligned.org/articles/power-programming#comment-31597408</link><description>I think a linked list is an elegant data structure. I think a heapq is an elegant data structure.   I don't think this is a difficult problem at all: I was just using it to talk about some things which interest me.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">tag</dc:creator><pubDate>Wed, 27 Jan 2010 19:41:04 -0000</pubDate></item></channel></rss>
