Should Equality be commutative within a Class Hierachy?
It is easy to define the Equals
operation in ways that are not commutative. When providing equality against other types, there are obviously situations (in most languages) were equality not being commutative is unavoidable. However, within one’s own inheritance hierarchy where the root base class defines an equality member, a programmer has more control.
Why use other number bases when programming
My coworkers and I have been bending our minds to figuring out why anyone would go out of their way to program numbers in a base other than base 10.
Can you use Pi as a crude random number generator?
I recently saw this question over at math.SE. It got me thinking. Could Pi be used as a crude random number generator? I mean the results are well known(how long has pi been computed to now?) but, Pi does seem to be quite random when taken 1 digit at a time.
how to programtically build a grid of interlocking but random sized squares
I want to create a two dimensional layout of rectangular shapes, a grid made up of random sized cubes. The cubed should fit together and have equal padding or margin (space between). Kind of like a comic book layout, or more like the image attached.
How to check if 4 points form a square?
Assume I have 4 points (they are 2-dimension), which are different from each other, and I want to know whether they form a square. How to do it? (let the process be as simple as possible.)
Calculating 3d rotation around random axis
This is actually a solved problem, but I want to understand why my original method didn’t work (hoping someone with more knowledge can explain).
Separating merged array of arithmetic and geometric series [closed]
Closed 11 years ago.
Date calculation algorithm
I’m working on a project to schedule a machine shop, basically I’ve got everything covered BUT date calculations, I’ve got a method called schedule (working on PHP here):
How to get audio spectrum analysis? [closed]
Closed 11 years ago.
Randomly Generate Points in a Spiral Motion using Javascript
So I have a javascript program that currently gets random points, it generates a random x,y,z value around the center point, within the radius r