3 ms·
No need to be angry. None of this is going to remove food from your table or affect your life in any way whatsoever. Take it easy. I am just opening the topic
by robomartin 14y ago
No need to be angry. None of this is going to remove food from your table or affect your life in any way whatsoever. Take it easy. I am just opening the topic for conversation. We can discuss things without pulling out semi-automatic weapons, right?
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/ 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 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.
- stch 14y agoActually, that's not entirely reflective of reality. You would have to access www.python.org in order to download python, so you'd have to write some sort of TCP/IP handler to connect to that interface...actually let me back up, you first would have to solder together a few million transistors to create a CPU before you could do that. You're making it seem way easier than it actually is, please don't go exaggerating the truth so blatantly.
- readme 14y agoSomeone has disagreed with you -- which you anticipated would happen. Therefore he must be angry? 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.
- robomartin 14y agoRead the last line of his post please. He said he was angry, no me. >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.
- cidquick 14y agohttp://www.jwandrews.co.uk/2013/01/breaking-the-minteye-image-captcha-in-34-lines-of-python/ http://www.jwandrews.co.uk/2013/01/breaking-the-minteye-imag... OK, I didn't write the JPEG decoder, but how far do you want me to go?!
- robomartin 14y agoThat's great. 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.