I agree with him. If it's wrapped up in a library and it's distributed by a package manager then it doesn't count towards the total SLOC of your project.
>If it's wrapped up in a library and it's distributed by a package manager then it doesn't count towards the total SLOC of your project.
Think about what you are saying. With that logic I can write a library in C++ that evaluates all images in the current working directory for least edge length and returns the name or index of the winning file. My Python program, then, might look something like this:
import magic
print magic.evaluate()
And then I claim that I have written a program that solves a swirly CAPCHA in two lines of Python.C'mon.
I you want to count true Python lines, download the language from python.org and write a solver without the use of any add-on libraries. Then we can talk about Python lines.
OK, I didn't write the JPEG decoder, but how far do you want me to go?!
Please note that I did not have any issues with the method you used. My issue was only with the title of your post not being accurate. You used Python + OpenCV in addition to pre-un-swirled images.
To me at least, solving the problem with n lines of Python means that I email you a single swirled image and you, using Python as downloaded from python.org and nothing more, write a solver. The image doesn't even have to be JPG. It can be an easy to read non-compressed format. That'd be fine. But you'd have to un-swirl and do everything else, which is a lot more code.
Don't loose any sleep over this. It isn't important. Your original post was fantastic and very informative. My comments were only about the title and how, in every language camp, there's sometimes a tendency to look down upon other languages by quoting such nonsense as line counts.
When someone publishes code and says something like "solved <problem> in <n lines> of <pick your language>" there generally is an implied "my language is better than yours" subliminal message that, for some strange reason, is based on line count.
Let's not debate the merit of line count as a measure of how good a language may or may not be. If we are going to go there I'll write the same solution in APL and we'll start counting characters instead. Again, line or character count, in my opinion, is not a measure of the "superiority" of a language.
The 28 line solution is not pure Python. How do we define pure Python. Let's just say that "solved <problem> in <n lines> of Python" to me means that you download and install Python:
http://www.python.org/download/releases/2.7.3/
Install nothing else whatsoever and write code that solves <problem>.
OpenCV, which is what the author used for a couple of aspects of this code, is an extensive (and really cool) C++ library that is being accessed from Python. Here's the source:
https://github.com/Itseez/opencv
I'll leave it up to the reader to find the source for the Sobel method.
A much more honest title could have included something like "solving <problem> with <n> lines of Python using OpenCV".
As I said before, the intent of the article and what is being demonstrated are good, no, great. I just wish the title was a little more reflective of reality. That's all. No need to get worked-up. This is not that serious of an issue. Just a comment.