All this is OT, and I had decided to reply, waiting for two days, but
now I will reply. Please note that this is NOT to be interpreted as
personally insulting, as I have no wish to insult you.
This is what you wrote, a sarcastic and offensive reply to someone who
I cannot recall ever being sarcastic or offensive himself. You said
'Your Majesty' when you really meant, 'Peon: Who are you to decline to
give Me, My Majesty, exactly what I want.'
In point of fact, Gleixner gave you some very good advice, which is a
lot more useful to you that would have been a line by line exposition
of the algorithm. I, too, had a similar issue with a very neat little
trick called a Schwartzian Transform. I stared at it for (literally)
years trying to understand it before I ran it (with the debugger) and
examined the state of the runtime stack value by value. The BAST way
to understand an algorithm is to step through it, examining the state
of each data item as you go.
If you don't know how to do this, or don't think it's a legitimate
approach to understanding a piece of code, well, you've just
embarrassed yourself a second time in c.l.p.m.
Okay, I was making a literary reference. The book is very well known -
you may have heard of it - it's called the Bible. My reference was to
a conversation one of the major characters, Jesus, had with some
friends. It's actually a two part quote, but I omitted the second part
in order to emphasize it, thinking that you would complete the quote
in your mind. Since you appear not to be familiar with this, or too
dimwitted to recognize it, I'll do this for you.
The second part goes like this: "... lest they trample them underfoot
and then turn and devour you." My point was that G. had attempted to
bestow a precious gift to you which you not only threw back in his
face but added personal insult. Please think about these words before
you reply.
I didn't say that you WERE a swine, simply that your words SEEMED to
make you so. There is a difference. You are not your words, and if by
some chance you use words (out of thoughtlessness or irritation,
maybe) that you don't mean, you can always take them back. I guess
that in this case you meant the remark about 'Your Majesty' so I'll
have nothing further to say on the subject.
CC
I was hoping not to have to do this, but (sigh)..
Last month I happened to see an article asking for help with homework.
"Camel" <
[email protected]> in article
<
[email protected]> asked how to print all the
permutations of a string of digits of arbitrary length. Several
people replied, but seemed more interested in preening themselves in
their superiority to "Camel" than in actually helping him.
Not knowing how to do it myself, I started playing around. It is
relatively easy to write a program to print all the permutations of a
list, or array (yes I know the difference) if you already know the
length of the input list. But to permute a list whose length is not
known in advance is more difficult.
Eventually I came across perlfaq 4.51 (perldoc -q permute), and the
code that I quoted in my original message.
I tried to understand both the algorithm (Fischer-Krause Algorithm)
and most of the perl idiom implementing it. The code worked as
advertized, but how?
My enquiry started by a search of Wikipedia. No luck. Then I tried a
google search. Almost all the documents returned were various
mirrors, throughout the world, of perlfaq4 or perlfaq 4.51. Several
documents were in Japanese, several in German. I read neither. Some
documents mention it in passing. From one of those I learned that the
algorithm dated from 1819! One result,from ACM, wanted me to pay $198
before downloading a PDF document (without being sure of its
relevance).
In the meantime I was playing with the code from faq 4.51, with very
small results.
Then I posted my query. I didn't want to recite the details of my
lengthy investigation, so I simply asked my questions.
The first two responses assumed I had done nothing to help myself. Mr
Gleichner told me about Data:
umper and print, both familiar to me
for a number of years. Then he told me to search the internet.
Mr Greer said:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
It says what it does, so I assume you mean the actual code? If so,
what parts are you not understanding? What parts _do_ you understand?
Knowing this will be helpful to giving you the best answer, without
anyone having to go into great detail or explain every aspect (since
if you didn't know any of it, it probably wouldn't do you any good to
have someone explain it when it comes down to it). That is, you must
have looked for or saw this code somewhere and wanted to use it, so
you must have some idea of what it does?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Did he not see that I had told him the source of the code? And then he
excused himself from helping, since it wouldn't do any good!
So I made a couple of quick remarks to both of those snobs. Am I
depriving myself of their help? What help? I called one "Your
Majesty", the other "Your Holiness". Insulting? Only if you think
comparison to majesty and holiness is insulting.
Now to you: I knew the provenience of 'pearls before swine', and I
probably came into contact with the Bible several decades before you
did. (You don't know how ancient I am.) Perhaps you don't realize that
Jesus was Jewish, and the Jews have a profound revulsion to anything
having to do with swine. To call someone 'swine' was an insult then
and it is an insult now. But I forgive you, for you know not what you
do.
I also came into contact with the "Schwartzian Transform" a number of
years ago, but I didn't need the debugger to understand it.
Incidentally, Wikipedia has an excellent article on it, in which it is
explained that the idea is not original with Randal L. Schwartz, nor
with perl.
Now that I have a better understanding of the Fischer-Krause
Algorithm, thanks largely to xhoster, perhaps I will write an article
about it on Wikipedia, unless, of course, one of you folks, in your
infinite superiority to me, beats me to it. The race is on!
__
Evybuddy needs sumbuddy that they kin look down on.
Eff yo aint got no wun else, why, hep yoseff to me.