News for hackers. Stuff that matters.
Re:"River" detection in text by oofabz on Saturday February 23, 2013 @05:01AM (#5269187)
It's really impressive how their sophisticated image processing algorithms are only a few lines long. If I wrote an algorithm to detect rivers, it would be hundreds of lines long and less effective. These guys tackle it mathematically and it seems almost magical. I wish I could think that way.
Re:"River" detection in text by Chirono on Saturday February 23, 2013 @05:21AM (#5269232)
I find this comment interesting given the recent (ok, continuous) talk about not using maths puzzles in programmer interviews. This is perhaps an interesting real-world case that demonstrates how a mathematical outlook leads to much cleaner code.

Ok, solving this kind of thing is rare, but still...

Re:"River" detection in text by coliveira on Saturday February 23, 2013 @10:36AM (#5269935)
In some areas, programming is not the most important ability, but instead the understanding of the mathematics behind the phenomenon. This is the case in areas such as operations research, computer vision, and machine learning. You cannot assume that, to be a programmer, a person must know these subjects. On the other hand, creating a good algorithm in these mathematical subjects doesn't imply that you are a good programmer.
Re:"River" detection in text by thomasz on Saturday February 23, 2013 @05:56AM (#5269314)
The secret sauce here is not the ability to solve "maths puzzles", but specialized domain knowledge.
Re:"River" detection in text by ColinWright on Saturday February 23, 2013 @06:59AM (#5269423)
That's exactly the wrong way round. You can acquire domain knowledge, you can have a domain expert assigned to you to work with you. What you can't acquire, on demand, is the ability to think in the ways that mathematics gives you. That requires extensive training and practice, and recognizing when obscure bits of theory are applied is something that doesn't come overnight.
Re:"River" detection in text by kamaal on Saturday February 23, 2013 @09:10AM (#5269668)
Its made up of both actually. Somebody outside devops would consider pervasive use of sed, awk and other unix text processing utilities line noise. Yet such a thing would come naturally to that person working on it daily.

If you can't really get such stuff easily at the very first time does it mean you are a bad programmer?

Not quite.

The way I look at it, I would consider somebody good if he can read the documentation/theory etc and then come up solution to problems(read: can write programs). That way you know the guy can actually get some work done. It requires practice and time to get used to and comfortable to a new domain. That's natural friction you have to wear out. Regardless of whether its math, music, literature of whatever. Paying too much importance to factual stuff isn't of much use. What's more important is, can the person work his way out of the problem.

I checked out your bio, I understand you do math for a living and are obviously a little defensive when some one underplays the importance of your area of expertise. But the fact of the matter is though math is relevant, the areas in which its relevant are largely either rare or are already solved and presented to most programmers as libraries and frameworks. And if its not, simple analysis, a little reading and experimenting is sufficient to solve the problem at hand.

Your problem is not with programmers but with a term called abstraction. And fighting that is futile. The benefits vastly over weight any intellectual argument you can present against it.

EDIT: By the way after reading your bio, I have developed atmost respect for all the work you have done in your life.

Re:"River" detection in text by srean on Saturday February 23, 2013 @03:18PM (#5271283)
Was a fine tangential comment, till you started an unsolicited diagnosis of Colin's hypothetical disease.

Downvoted.

Re:"River" detection in text by kintamanimatt on Saturday February 23, 2013 @03:44PM (#5271407)
Huh? What hypothetical disease?
Re:"River" detection in text by ColinWright on Saturday February 23, 2013 @05:39PM (#5271795)
He said:

    Your problem is not with programmers but with a term
    called abstraction. And fighting that is futile. The
    benefits vastly over weight any intellectual argument
    you can present against it.
Utterly bizarre, to be claiming that a pure mathematician has a problem with abstraction.
Re:"River" detection in text by kintamanimatt on Saturday February 23, 2013 @06:05PM (#5271861)
Why would that be a disease though? I thought he'd maybe edited his reply and said something else. Maybe I'm just tangled up in the misuse of a word though!

Side note, does the theory of juggling have a mathematical underpinning?

Re:"River" detection in text by ColinWright on Saturday February 23, 2013 @06:24PM (#5271927)
I have no idea why it would be a "disease", but he did seem to be diagnosing my attitude or "problem."

Don't care.

And yes, there is a great deal of mathematics underneath the structures of juggling patterns. Using them we predicted the existence of previously unknown juggling patterns, and have now used the math to create a proof that of all the juggling tricks of a certain type, we know them all (for some definition of "to know").

Re:"River" detection in text by srean on Sunday February 24, 2013 @12:03AM (#5272935)
It was supposed to be a metaphor, intended to highlight that no such disease is present and nor was it necessary to go about trying to diagnose what "the problem" with Colin was.

diagnose <-> disease

It clearly did not work as intended.

Re:"River" detection in text by Schwolop on Saturday February 23, 2013 @06:34PM (#5271952)
Yes, juggling patterns can be expressed neatly by the use of fairly simple mathematics. Look up "siteswap" or "siteswap notation". (It's also closely related to the mathematics of bell-ringing or "chiming".)
Re:"River" detection in text by ColinWright on Saturday February 23, 2013 @05:37PM (#5271787)
This is an utterly bizarre comment, and I have absolutely no idea what to make of it. It seems mostly non-sequitur, and then gets things exactly the wrong way round. I really don't know how to respond - it's almost perverse.

However, there appears to be such a depth of misunderstanding, or non-understanding, I feel compelled to try ...

Having read, re-read, and re-re-read your comment, let me say this. You appear to completely misunderstand the point. I'm not talking about mathematical ideas that have been taken, used, programmed, and made available through libraries. I'm talking about recognizing problems and techniques when they turn up unexpectedly, and in disguise.

Many, many times in my 30 years as a working programmer have I found elegant solutions to previously intractable problems, purely because I recognized some sort of weird mathematical structure lurking underneath. It's my specialty to go into a situation where the domain experts have worked to solve a problem, sometimes for years, to have them explain the problem to me, and then to bring different insights and tools to bear on the problem. I'm not necessarily more clever, or more capable, I just have a different toolbox. And when the problem at hand is unusual, my toolbox is particularly powerful.

You said:

    Somebody outside devops would consider pervasive use of sed, awk
    and other unix text processing utilities line noise.  Yet such a
    thing would come naturally to that person working on it daily.
I have no idea what point you're trying to make here.

    If you can't really get such stuff easily at the very first time
    does it mean you are a bad programmer?  Not quite.
Of course it doesn't. Different programmers have different skill sets, and different experience. Someone who doesn't know databases or web programming may be a wonderfully productive programmer in another area of specialization.

I have no idea what relevance this has to my comment.

    The way I look at it, I would consider somebody good if he can read
    the documentation/theory etc and then come up solution to problems
    (read: can write programs). That way you know the guy can actually
    get some work done. It requires practice and time to get used to and
    comfortable to a new domain. That's natural friction you have to wear
    out. Regardless of whether its math, music, literature of whatever.
    Paying too much importance to factual stuff isn't of much use. What's
    more important is, can the person work his way out of the problem.
Perhaps. My point is that people often dismiss mathematics as useless to programmers because they can't see how this lemma or that theorem can ever be relevant. My point is that the methods of thought trained by the study of advanced mathematics has, in my experience and others', regularly led to deep insights in apparently unrelated problem domains. This ability is not something you can "just read up on." This isn't a case of reading documentation and/or existing theory - this is a case of seeing something as being a disguised example of something else. I've lost count of the number of times I've recognized a matching problem, or a topological separation, or an abstract vector space, or a group acting on a metric space, and that recognition has subsequently led to a new solution.

    I checked out your bio, I understand you do math for a living and are
    obviously a little defensive when some one underplays the importance
    of your area of expertise. But the fact of the matter is though math
    is relevant, the areas in which its relevant are largely either rare
    or are already solved and presented to most programmers as libraries
    and frameworks.  And if its not, simple analysis, a little reading and
    experimenting is sufficient to solve the problem at hand.
Then, with respect, your experience appears to be limited, and your opinions parochial.

    Your problem is not with programmers but with a term called abstraction.
    And fighting that is futile. The benefits vastly over weight any
    intellectual argument you can present against it.
This is just bizarre. I'm a pure mathematician - how can you suggest my problem is with abstraction? How can you possibly think I'm offering any argument against abstraction?
Re:"River" detection in text by kamaal on Saturday February 23, 2013 @10:34PM (#5272665)
When I said 'your', I didn't mean 'you'. I mean't the problem with 'your argument'. I apologize if this has hurt you. Its like code review, I was intending to critique your argument, not you.

Yes, I agree my experience is limited. In fact now that you mention you have been a programmer for 30 years. I now realize I have much more to learn and understand, Its possible I have simply don't even know what you know and how deeply you understand things.

What advice would you give to some one like me.

Re:"River" detection in text by ColinWright on Sunday February 24, 2013 @04:36AM (#5273563)

  > I meant the problem with 'your argument'.
To recap the discussion:

==========

Chirono: I find this comment interesting given the recent ... talk about not using maths puzzles in programmer interviews. This is perhaps an interesting real-world case that demonstrates how a mathematical outlook leads to much cleaner code.

thomasz: The secret sauce here is not the ability to solve "maths puzzles", but specialized domain knowledge.

I replied: That's exactly the wrong way round. You can acquire domain knowledge, you can have a domain expert assigned to you to work with you. What you can't acquire, on demand, is the ability to think in the ways that mathematics gives you. That requires extensive training and practice, and recognizing when obscure bits of theory are applied is something that doesn't come overnight.

==========

So my argument is that while domain knowledge is a good thing, and (jacquesm eloquently argued) often necessary to solve a problem, it usually can be acquired as needed through reading, study, and discussion with local experts. The ability to recognize, let alone solve, problems that are actually obscure mathematics in disguise cannot be acquired on as "as needed" basis. This is why knowledge of advanced mathematics needs to be gained early, and if you don't have it by the time you are a practising, working programmer, you are unlikely ever to acquire it.

Not having acquired such skills does not make one a bad programmer. I know very, very few programmers who hold advanced degrees in mathematics, and yet the world is full of programmers who can "get the job done" efficiently and effectively. Equally, having skills in advanced mathematics does not, of itself, make one a better programmer (and certainly not a better person.) I know many PhDs in mathematics who simply cannot program effectively.

But it does make one a programmer with different skills, and those skills can enable one to solve problems others can't, and sometimes to produce solutions that are more elegant. Not always, not every problem requires such skills. But if it does, by the time you find the problem, it's too late to acquire them.

  > What advice would you give to some one like me.
I don't know what you like, what skills you already have, or what you want to end up doing. I studied math because it was fun, exciting, and I was good at it. Computers at the time didn't exist in the form they do now - maybe I would have done computing. Impossible to say.

So I can't give advice - there would be a real danger of simply trying to turn you into a clone of me, and that's a bad idea. I can tell you that understanding algorithms, time-complexity, calculus, vector spaces, and point-set topology have all been of direct and immediate use in my work.

And if you'd like a simple puzzle, here:

    Suppose the demand for a product falls linearly as a function
    of its price.  Show that if you price the product to maximise
    your profit, you will have less than half the possible market.
That turned up a few years ago in a discussion with a customer.
Re:"River" detection in text by ivix on Sunday February 24, 2013 @06:16AM (#5273820)
If you want a mathematician who can also program, that's fine. But you should be aware that that's what you actually want, and make that clear to potential applicants.

The majority of development roles do not need any more mathematical knowledge than any other job.

Re:"River" detection in text by ColinWright on Sunday February 24, 2013 @08:18AM (#5274090)
You don't know that. The point is that mathematical insights turn up and are useful far, far more often than people expect. The problem is that the insights usually go unnoticed because there's no one with the background or skills to recognize them.
Re:"River" detection in text by Bjartr on Saturday February 23, 2013 @09:19AM (#5269690)
For what it's worth (I've only taken one college level course on computer vision, plus some side projects) my experience with matlab is that it's surprisingly easy to put together a short solution once you've figured out what's actually needed. The matlab CV API is very broad and pretty well documented, so it's less about knowing the math and more about reading the manual. In that regard producing a concise solution to a CV problem is very much like producing a concise solution to most other problems in any language.
Re:"River" detection in text by michael_h on Saturday February 23, 2013 @01:48PM (#5270913)
The MATLAB CV library is almost identical to OpenCV if you prefer C or C++.
Re:"River" detection in text by upquark on Saturday February 23, 2013 @12:21PM (#5270429)
Actually math and stats applications are very common, developers could really benefit from knowing more math, recognizing known problems and applying known solutions. People just do things the dumb way more often than not, and then spend months if not years fixing the mess they've created.
Re:"River" detection in text by maurits on Saturday February 23, 2013 @10:11AM (#5269818)
There is no panacea in image processing.

These methods work for this particular image, and give an idea about the possible solution, but the thresholding and morphological operations are not scale invariant, and very sensitive to light changes and noise.

Any algorithm that can detect rivers in text from any image, acquired by some device, such as mobile phone or a scanner, in any light circumstances, will run hundreds of lines long.

Re:"River" detection in text by phil on Saturday February 23, 2013 @02:29PM (#5271092)
Sure, but the problem here is "we'd like to detect rivers in TeX, but it doesn't know about glyph shape which we know is important." They're talking about clean images only.