« first day (929 days earlier)      last day (3499 days later) » 

2:07 PM
Have a look at this question
Currently, it has an "EDIT" tag, followed by an explanation by the OP how the accepted answer is working for him
In general, such information can be very useful for someone doing the same thing later
But where should this information belong exactly? IMO, the best place is as a comment to the accepted answer
 
@Juho Agreed. No way to mod this, afaik.
Ah, I was meaning to tell D.W. about chat.
 
But a regular user can't edit such things
Right
 
@d.w. Regarding login to chat: it's a somewhat arcane process. I noticed that you have to allow some Javascript from a domain that does not show up anywhere on SE, and only shortly during the login. So in case you use a blocker, try whitelisting everything for the login. Session timeout is quite long so you won't have to do that very often. Would be nice having you here!
@Juho Even mods can't impersonate users, and that's probably a good thing. :) Well, we can transform answers into comments, but not the other way round let alone create arbitrary post for any user.
 
Well that makes sense :-)
But yeah, it's a bit annoying if the OP doesn't make it himself/herself
I guess another (not as good IMO) approach is just to post it as a community wiki answer, but I don't like that too much
 
@Juho You can comment on the question to nudge the OP into posting a comment, or post a comment on the answer notifying D.W. of the edit. Or both.
Everybody, D.W.'s clarifying edit on his testing question made everything that does not propose deterministic algorithms a non-answer. Should we delete those, too?
One might argue that the restriction of determinism arrived late, and that they answer the (original) question insofar as algorithmic issues prevent effective testing.
 
2:17 PM
I think we should; question & answers should stay relevant through time
 
@Gilles Did you deal with the flags on that question?
I'm confused that the Python question is still there.
@Juho On the other hand, we generally discourage edits that make lots of valid answers (valid in the sense that they fit a reasonable interpretation of the question) obsolete.
 
That's true, and my opinion is not really strong on this one
 
Well, since the question only says, "preferably, a deterministic algorithm", we might as well keep the answers.
Not sure about your answer, @Juho, by the way. It's a rather obvious bug looking at the code. My feeling is that it's an implementation bug. There is no reasonable idea behind the algorithm as is ("check if the words are equally long, and if they are if the last symbols match"). The reasonable idea refers to one that has another implementation.
It's definitely a cute bug, one that is horrible to find if you've written the code yourself, and as you explain passes many test cases. A bug, though.
What do you think?
 
2:39 PM
It's feel like it's hard to say what's actually an implementation bug, and what's a bug in the algorithm itself
and somewhat depends on the reader
 
True.
Hence my "reasonable idea" explanation.
 
in this sense, the question is not really that good maybe
it is somewhat subjective
 
It's improved, but yet. It has some "I know it when I see it" flair.
 
I get that yes, but I think that was an actual example indeed from Backhouse's book
and the person doing it was a new student
 
What I'm thinking is probably, "every correct implementation of the idea in any Turing-complete model should exhibit the same flaw"
 
2:42 PM
the accepted answer is a good one; greedy algorithms are typically like this
they might seem correct at first sight, but rarely are :-)
 
@Juho It's definitely a good example for "why some tests are not enough" (motivating either more serious testing strategies, or proofs, or both).
@Juho Yea, I like that one best, too.
 
Of course, even with greedy algorithms, with some experience you realize this too...
 
Coin exchanges skrews our students every time. They even gave Greedy as an answer in the exam after they had explicitly shown that it was faulty in the exercises.
 
yeah, those tend to be typical exam questions
 
@Juho But you'll agree that the actual (pseudo)code is not important for neither the flaw nor finding it.
 
2:45 PM
My answer only tries to be simple motivation for why testing is not enough
But yeah, my answer has way too many upvotes :p
 
:D
 
Questions of this sort tend to attract a lot attention
 
Jup. The hot question thingy is...troublesome at times. It brings attention to small sites, but it rarely seems to be the good kind. The entry metrics are probably broken ("many views and answers in a short time" does not happen on interesting questions, but on clickbait).
 
vzn
3:05 PM
WL this sounds interesting. intel CILK parallel optimizer. heard of it? Intel Cilk Plus for Complex Parallel Algorithms: "Enormous Fast Fourier Transform" (EFFT) Library
 
@Raphael I dealt with some of the flags. You can check the flag history on a post to know what flags were previously handled. What do you mean by “the python question”?
 
3:44 PM
@Gilles *answer, sorry.
 
@Raphael cs.stackexchange.com/questions/29475/… you mean? Nothing wrong with it
it isn't about python, that's just an example of how to implement the algorithm badly
 
@Gilles And as such, not an answer to the question. (Wasn't it flagged?)
 
@Raphael how is it not an answer to the question?
Q: examples of algorithms that work with casual tests yet are not correct
A: numerically unstable algorithm, that works with some value ranges but loses precision in others
 
4:01 PM
@Gilles Read the updated question, specifically item 1 in the "Specifically..." list. Implementation errors/bugs are not what he's after.
If the algorithm itself is the issue it might qualify, but the answer is not very clear on that.
Obviously, numerical algorithms should offer a rich class of examples. I'd guess D.W. is not interested in such (since they are rarely topic of basic algorithms classes, afaik) but he did not exclude them either.
Note also D.W.'s comment on the answer (which says "not a good example for my needs" but certainly doesn't "not an answer").
 
@Raphael If @D.W. is still having trouble logging in to chat, you might ask him to try a different browser. Chat login just completely stopped working from Chrome browser for me about two weeks ago. So I started logging in to chat using Firefox. Chat and Chrome combo may just be broken at the moment.
 
@WanderingLogic Good call, thanks. (I remember now you told me that some days ago.)
 
@Raphael It's an algorithm issue. The mathematical formula is correct, but not the floating-point algorithm. It isn't related to the choice of programming language. I wouldn't call this an implementation bug as opposed to an algorithm flaw.
 
@d.w. As @WanderingLogic just reminds me, Chrome and SE chat may be broken at this time. If that's the browser you are using, maybe try Firefox?
 
You could say it's the implementation of real arithmetic using floating-point arithmetic, but I'd call this an approximation rather than an implementation
@Raphael works for me this very minute
 
4:09 PM
@Gilles Okay then. I'd have written the answer differently -- the Python thing seems tangential and an explanation of what the issue is is missing. But agreed, it can stay.
 
but I don't do anything silly like blocking js
 
@Gilles Silly? O.o You work in security, right?
@Gilles Your edit helps, thanks.
 
@Gilles I don't block js. And I've been using Chrome as my primary browser for several years. This is the second time in about a year that SE chat just started refusing to let me login using Chrome. The last time (about 6 or 9 months ago maybe?) the problem cleared itself after a few days. This time it hasn't.
It probably has to do with some cookies that Chrome stores in my Google account, because login stopped working on my machine at work, my machine at home, and my phone simultaneously.
But I can't figure out which cache to clear.
So I gave up and switched to Firefox.
(Which also seems to be handling my music streaming service far more robustly at the moment too.)
 

« first day (929 days earlier)      last day (3499 days later) »