ignorance and intolerance in computing communties

X

Xah Lee

Today, a motherfucker Christophe Rhodes (aka Xof in irc://chat.freenode.net/lisp
) kicked banned me.
Here's the few relevant excerpt. (full, unedited excerpt will be
published if there is a public interest)

Begin excerpt:

[5:31am] <xahlee> k, here is a simple problem but rather tedious to do
it correctly.
....
[5:32am] <xahlee> given a unit vector A={a1,a2}, write a function
AngleA, such that it returns the positive angle from {1,0} to A.
[5:33am] <xahlee> mathematically this is simple, but to implement it
is rather cumbersome, with many if statements.
[5:34am] <xahlee> also, anyone who has implemented this will know trig
well.
[5:34am] <xahlee> i wonder if there's already in some library in lisp.
(i doubt it)
[5:36am] <pjb> xahlee: (acos (scalar-product A #(1 0)))

....

[6:34am] <xahlee> can anyone show me the source code of a function
that convert a complex number (a1 b2) to it's polar representation?
[6:35am] <Xof> (defun polarize (complex) (values (abs complex) (phase
complex)))
[6:35am] <Xof> wait, why am I replying to the troll?
[6:36am] <fax> :/
[6:36am] <Jasko> even the mighty Xof is not immune!
[6:36am] <tritchey> Xach: you were right, he HAS turned into mary
poppins.
[6:36am] <xahlee> well... what is the source code for your “phase�
[6:36am] <Xach> xahlee: it is, as kmp once said, given from god
[6:36am] <Xof> clhs phase
[6:36am] <specbot> http://www.lispworks.com/reference/HyperSpec/Body/f_phase.htm
[6:36am] LiamH joined the chat room.
[6:36am] <fax> xahlee: you know enough maths to write an
impllementation
[6:36am] <froydnj> piso: ah...hmmm
[6:37am] <fax> xahlee: if its a CLHS function, then how its actually
written will be implementation specific
[6:37am] <fax> er CL not CLHS
[6:37am] <xahlee> as i described, i'm interested in the algorithm of
the implementation, not what it means.
[6:37am] <xahlee> «can anyone show me the source code of a function
that convert a complex number (a1 b2) to it's polar representation?»
[6:37am] <Xof> all of that is true, but there's quite a good
suggestion for how to implement it on the page I got from specbot
[6:37am] <fax> xahlee: afaik there is no way to calculate it without
conditionals
[6:38am] <Xof> xahlee: and that's what you got
[6:38am] <fax> you can do 4 dot products, or atan.. however you do it
you have to handle cases
[6:38am] <xahlee> fax: thanks fax! only you come thru understand the
question and not being a troll.
[6:38am] <Xof> (atan y x)
[6:38am] <xahlee> the others so far, e.g. xof and pjb in particular,
just wanted to troll.
[6:38am] <Xof> look, ma, no conditionals
[6:38am] <fax> xahlee: more than just me gave you some info..
[6:39am] Xof was promoted to operator by ChanServ.
[6:39am] Xof set a ban on *!
*[email protected].
[6:39am] You were kicked from the chat room by Xof. (now go away,
please)


------------------

Christophe Rhodes has unjustly kicked banned me about 3 times in the
past year in #lisp. Basically, making it impossible for me to use the
service provided by freenode.net in way. Today's incident, is actually
the most lenient. In the past ~3 times, he simply kick banned me
within few minutes i joined the #lisp channel.

Christophe Rhodes is one example of a power-struggling tech geeker in
the computing industry. Incidents like this, happens frequently in
just about all computer forums where almost all members are
exclusively male.

I want to bring this to the public attention (in this case, in the
lisp community). Because, it is motherfuckers like these, that does
society harm, and they all pretent to be saints and justice holders.

-------------------

Some notes about the math problem discussed in the topic:

As i have indicated in my post, it is non-trivial to implement a
function that returns the positive angle of a vector. For example, it
can be done with sign checking of the coordinate components (in total
4 cases, which can be done as 2 levels of nesting if, or simply 4
if.), and or the evaluation of Min[Abs[ArcCos[x],Abs[ArcSin[x]]], or
use clever ways with dot product, or ArcTan. It is not a trivial to
know which algorithm is in general more efficient. (this is important,
since finding the angle of a vector is a basic function, that may
needs to be called millions times directly or indirectly) Further,
consider the inverse trig function, it is likely 99.99% of people with
a PH D in math wouldn't know how these are actually implemented. So,
the question of whether calling one of the inverse trig function is
more robust or efficient than another is a open question. And, besides
the algorithmic level, the question also entails how the language
actually implement the inverse trig functions.

Besides efficiency concerns, there's also robustness concerns. For
example, if the 2 vectors are {1,0} and {0,1}, a simplistic
implementation will result in division by 0 or similar errors.
Checking whether one of them lies on the x or y axis means more if
statements, as well the non-trivial problem of determining if two
numbers are equal. (e.g. is 0.000001 considered equal to 0.0001 )

My interest in bringing this up for discussion, is because i'm writing
a program in Linden Scripting Language to generate a architecture of a
given polyhedral symmetry in Second Life (see http://xahlee.org/sl/index.html
), and i need to write a function that returns the positive angle of 2
given vectors from A to B. I have implemented solution to this
problem a few times in Mathematica since about 1993. Being a
efficiency and perfection nerd with some leisure at the moment, i
thought i'd like to know more details about his problem. A optimal
implementation with respect to the algorithm level, or see how
languages implement the function that convert complex numbers to polar
form, or some general understanding and learning with regards to this
problem.

In a person's computing career, concrete and specialized questions
like these abound, and the answers or knowledge about them are scarce.
Due to the general ignorance of technical knowledge, and the power-
struggling nature of males, and the habit of intolerance and “troll-
crying†in computing communities, made it difficult to have any
sensible discussion of original questions that doesn't fit into some
elementary level of FAQs and concepts.

Asides from complainting about the person who unjustly kicked banned
me many times in the past year (which has happened to me in other irc
channels (in particular, #perl, #python, #emacs,...), mailing lists,
forums, as well happens all the time to many many others (every day in
just about every irc channel).), i hope that in general, tech geekers
be more tolerant and knoweledgable. In particular, aquire
understanding and communication from persons in society who are not in
the computing community.

For example, in newsgroups everyone is all concerned and involved
about the phenomenon of troll all day. To understand this more
seriously, study psychology, sociology, anhtropology, ethnology,
history. I do not mean getting interested and excited with a slashdot
news article then start to discuss it in your forum. But do, take a
class in community colleges, or if suitable, spare a reading of your
favorite science fiction for a text book on the these subjects. The so-
called “troll†(whatever it means), is a social, behavior phenomenon.
So, understanding social sciences is the proper way to understand it,
if necessary, learn how to remedy the situation. Not, for example, by
tech geeking with other tech geekers.

If you are, for example, interested in the comparative superiority of
computer languages that almost every tech geekers seem to know so much
about, then, try to take a course on the great many specific branches
of philosophy, the great branches and depths of (non-computer-
language) lingusitics, or the great depth and branches and specialties
and even philosophies of mathematical logic, or its history. Various
branches or trainings in philosophy will help you in critical
thinking, as well as aid you in seeing perspectives, philosophies, or
how to approach a problem with a good definition. Similarly,
linguistics will help you, in general, understand the concept or
theories of semantics or meaning and syntax and grammar, in a way that
can give you a independent and original thinking on the questions of
judging computing languages. Similarly, mathematical logic gives you a
extremely modern technical tool in evaluating or accessing the
problem. Spare a tech-geeking on a techincal book on your favorite
languages or computer language design book or latest computer
engineering practice guide or forum argumentation or wiki or Open
Sourcing zeitgeist ****, to read a text book or learn on the above
topics.

Xah
(e-mail address removed)
∑ http://xahlee.org/
 
E

Edward

As i have indicated in my post, it is non-trivial to implement a
function that returns the positive angle of a vector. For example, it
can be done with sign checking of the coordinate components (in total
4 cases, which can be done as 2 levels of nesting if, or simply 4
if.), and or the evaluation of Min[Abs[ArcCos[x],Abs[ArcSin[x]]], or
use clever ways with dot product, or ArcTan. It is not a trivial to
know which algorithm is in general more efficient. (this is important,
since finding the angle of a vector is a basic function, that may
needs to be called millions times directly or indirectly) Further,
consider the inverse trig function, it is likely 99.99% of people with
a PH D in math wouldn't know how these are actually implemented. So,
the question of whether calling one of the inverse trig function is
more robust or efficient than another is a open question. And, besides
the algorithmic level, the question also entails how the language
actually implement the inverse trig functions.

<snip>

"We should forget about small efficiencies, say about 97% of the time:
premature optimization is the root of all evil."

The question you are asking depends a great deal on other factors
outside of the coding environment such as the compiler and the
hardware. If you are coding for a specific language/compiler/hardware
combination, all you need do is profile different versions of your
code until you're happy with the results.
 
P

Pillsy

In a person's computing career, concrete and specialized questions
like these abound, and the answers or knowledge about them are scarce.
Due to the general ignorance of technical knowledge, and the power-
struggling nature of males, and the habit of intolerance and "troll-
crying" in computing communities, made it difficult to have any
sensible discussion of original questions that doesn't fit into some
elementary level of FAQs and concepts.

I'm sort of wondering why you'd expect to have a conversation about
one concrete and specialized topic in a venue devoted to an entirely
different concrete and specialized topic.

Cheers,
Pillsy
 
J

James Stroud

Xah said:
Today, a motherfucker Christophe Rhodes (aka Xof in irc://chat.freenode.net/lisp
) kicked banned me.

Are you aware that you are a troll? Have you considered that this has
anything to do with your being kick-banned? Why do 99.999999 % of the
people on the web not get treated like you? Answer: you are a troll and
they are not.

James
 
S

Steven D'Aprano

Are you aware that you are a troll? Have you considered that this has
anything to do with your being kick-banned? Why do 99.999999 % of the
people on the web not get treated like you? Answer: you are a troll and
they are not.

Sometimes I dream of a world, a wonderful, far away world, where nobody
was allowed to post to Usenet until they can correctly answer the
following multiple-choice question:

Q Verbally abusing trolls ...
1. gives them the attention they crave
2. fails to discourage their trollish behaviour
3. annoys the people who otherwise wouldn't have seen the troll's post
4. all of the above
 
F

fireblade

As i have indicated in my post, it is non-trivial to implement a
function that returns the positive angle of a vector. For example, it
can be done with sign checking of the coordinate components (in total
4 cases, which can be done as 2 levels of nesting if, or simply 4
if.), and or the evaluation of Min[Abs[ArcCos[x],Abs[ArcSin[x]]], or
use clever ways with dot product, or ArcTan. It is not a trivial to
know which algorithm is in general more efficient. (this is important,
since finding the angle of a vector is a basic function, that may
needs to be called millions times directly or indirectly) Further,
consider the inverse trig function, it is likely 99.99% of people with
a PH D in math wouldn't know how these are actually implemented. So,
the question of whether calling one of the inverse trig function is
more robust or efficient than another is a open question. And, besides
the algorithmic level, the question also entails how the language
actually implement the inverse trig functions.

Besides efficiency concerns, there's also robustness concerns. For
example, if the 2 vectors are {1,0} and {0,1}, a simplistic
implementation will result in division by 0 or similar errors.
Checking whether one of them lies on the x or y axis means more if
statements, as well the non-trivial problem of determining if two
numbers are equal. (e.g. is 0.000001 considered equal to 0.0001 )


  Xah
  (e-mail address removed)
∑http://xahlee.org/

Xah could you please post staff related to lisp programming like above
in separate thread from your personal things like someone banning you
from the IRC.

thanks
bobi
 
X

Xah Lee

Xah Lee wrote:
«
....
“Ignorance And Intolerance In Online Computing Communitiesâ€
http://xahlee.org/Netiquette_dir/ignorance_intolerance.html

.... As i have indicated in my post, it is non-trivial to implement a
function that returns the positive angle of a vector....
»

I have now coded this. I think it is probably the most algorithmically
optimal, and rather much simpler than i originally thought. Here's the
Mathematica code:

vectorAngle[{a1_, a2_}] := Module[{x, y},
{x, y} = {a1, a2}/Sqrt[a1^2 + a2^2] // N;
If[x == 0 && y == 0, "fucked",
If[x == 0, If[Sign@y === 1, π/2, -π/2],
If[y == 0, If[Sign@x === 1, 0, π],
If[Sign@y === 1, ArcCos@x, 2 π - ArcCos@x]
]
]
]
]

Btw, if we can use any Mathematica's buildin function, this is
actually just
vectorAngle2[{a1_, a2_}] := Arg@(Complex @@ {a1, a2})

I'm still interested, if someone would show the source code, of how
Perl, Python, or Lisp or Java, implement the function that finds the
angle of a complex number.

Originally, i was also hoping perhaps there's some math trick by dot
product or combination of trig functions, that obviates the need to
check which quadrant the vector is in ...

Xah
(e-mail address removed)
∑ http://xahlee.org/
 
I

Ignoramus12143

It is not that difficult to those of us who know math. Obvious analogy
to the function below exists in 'perl'.

double vectorAngle( double x, double y )
{
double r2 = x*x+y*y;
if( r2 == 0 ) return -10; // error case

int quadrant = x > 0 ? (y >= 0 : 0 : 3) : (y > 0 ? 1 : 2);

return pi/2 * quadrant + asin( abs(y)/sqrt( r2 ) );
}
 
F

Frank Buss

Xah said:
I'm still interested, if someone would show the source code, of how
Perl, Python, or Lisp or Java, implement the function that finds the
angle of a complex number.

So you have forgotten to cross-post to comp.lang.java :)

I think at least for strict floating-point Java uses the netlib:

http://www.netlib.org/fdlibm/e_atan2.c

For normal floating-point calculations I assume Java uses something like
FPATAN on x86'er computers:

http://www.ews.uiuc.edu/~cjiang/reference/vc107.htm

But you can download the source code of the JVM to verify it yourself:

https://openjdk.dev.java.net/
 
R

Roel Schroeven

Xah Lee schreef:
Xah Lee wrote:
«
...
“Ignorance And Intolerance In Online Computing Communitiesâ€
http://xahlee.org/Netiquette_dir/ignorance_intolerance.html

... As i have indicated in my post, it is non-trivial to implement a
function that returns the positive angle of a vector....
»

I have now coded this. I think it is probably the most algorithmically
optimal, and rather much simpler than i originally thought. Here's the
Mathematica code:

vectorAngle[{a1_, a2_}] := Module[{x, y},
{x, y} = {a1, a2}/Sqrt[a1^2 + a2^2] // N;
If[x == 0 && y == 0, "fucked",
If[x == 0, If[Sign@y === 1, π/2, -π/2],
If[y == 0, If[Sign@x === 1, 0, π],
If[Sign@y === 1, ArcCos@x, 2 π - ArcCos@x]
]
]
]
]

I might be wrong of course, but can't you just use atan2? Only problem
is that it returns negative angles for quadrants 3 and 4, but that is
easily solved. In Python:

from math import atan2, pi, fmod
def vectorAngle(x, y):
return fmod(atan2(y, x) + 2*pi, 2*pi)

No conditionals in sight.
 
J

James Stroud

Steven said:
Sometimes I dream of a world, a wonderful, far away world, where nobody
was allowed to post to Usenet until they can correctly answer the
following multiple-choice question:

Q Verbally abusing trolls ...
1. gives them the attention they crave
2. fails to discourage their trollish behaviour
3. annoys the people who otherwise wouldn't have seen the troll's post
4. all of the above

If you say so, but I honestly can not fathom such twisted psychology.

James
 
C

Charles Sanders

Roel said:
I might be wrong of course, but can't you just use atan2? Only problem
is that it returns negative angles for quadrants 3 and 4, but that is
easily solved. In Python:

from math import atan2, pi, fmod
def vectorAngle(x, y):
return fmod(atan2(y, x) + 2*pi, 2*pi)

No conditionals in sight.

Yes, but there will be some conditionals for special
cases in the implementation of atan2().

I am pretty sure that in Python (and Perl) atan2() is
the C atan2() from the C math library, also often used by
Fortran.

This is normally written in assembler for the individual
architecture by the hardware vendor or compiler writer, is usually
heavily optimized, carefully handles all the corner cases, and
often carries extra precision to ensure accuracy.

If I recall correctly P. J. Plauger's book on the C
standard library ("The Standard C Library") includes a C version
of atan2(), which is probably pretty typical of the algorithms
used when there is no hardware support for trigonometric functions.

As I remember it, atan2 (and atan) in Plauger's book
use a ratio of polynomials to approximate atan(x) over a
limited range, (such as -1.0 ... +1.0 or 0.0 ... sqrt(2)-1)
and formulae (assuming I have remembered high school
trigonometry correctly) such as atan(x) = pi/2 - atan(1/x)
and atan(x) = pi/4 - atan((1-x)/(1+x)) [derived from tan(pi/4-x)
= (1-x)/(1+x)] to extend the range.

There is an obvious trade off between the complexity
of the approximating polynomials (and the range they cover
with acceptable accuracy), and the number of cases needed to
extend the range to all valid inputs. For example, if the
polynomials cover -1.0 ... +1.0 (atan() values of -pi/4
to +pi/4) then there are at least 5 cases to consider
(atan() ranges -pi ... -3pi/4, -3pi/4 ... -pi/4, -pi/4
.... +pi4, +pi/4 ... +3pi/4, +3pi/4 ... +pi), while if the
approximations only cover 0.0 ... sqrt(2)-1 (atan() values
from 0.0 to pi/8) then there are at least 16 cases. NaNs
and infinities would add additional cases, as may the need
to preserve accuracy near zero.


Charles
 
R

Roel Schroeven

Charles Sanders schreef:
Yes, but there will be some conditionals for special
cases in the implementation of atan2().

That's true, but the user of the atan2() doesn't need to concern himself
with it; that's what I meant with 'in sight'.
I am pretty sure that in Python (and Perl) atan2() is
the C atan2() from the C math library, also often used by
Fortran.

I'm pretty sure too: the Python 2.4 documentation says "The math module
consists mostly of thin wrappers around the platform C math library
functions."
This is normally written in assembler for the individual
architecture by the hardware vendor or compiler writer, is usually
heavily optimized, carefully handles all the corner cases, and
often carries extra precision to ensure accuracy.

Yep, and that's why I prefer using that instead of trying to roll my
own. And because it leverages the speed of the FPU on platforms where it
is implemented in hardware.

I believe the FPU's of the i386 family have it in their instruction set.
I even believe there are no instructions for asin, atan and acos; they
are all calculated using FPATAN which calculates atan2.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,954
Messages
2,570,116
Members
46,704
Latest member
BernadineF

Latest Threads

Top