Rashakil Fol 978 Super Senior Demiposter Team Colleague

ps) if someone could figure out why my equations weren't outputting the right stuff, my teacher asked me to tell him what the problem was.

You're talking about the off-by-one errors? You were converting a floating point number to an integer, which is done by truncation. When you try to compute the sine of pi/2 with the inaccurate approximation you had there, you get something like 0.99999394829..., instead of 1. Then, multiplying that by an integer (for example, 5) produces a number slightly less than 5, like 4.99996... Then converting this to an integer truncates, giving 4. If you're going to allow free rotation of points (as you've mentioned the possibility), it doesn't really make sense unless you use doubles to represent the coordinates.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

If you're rotating 270 degrees (or any multiple of 2pi/4 radians), there's no reason to be using trig functions. Just replace (x,y) -> (y,-x). That's what your code simplifies to, once you replace cos(angle) with 0 and sin(angle) with 1. You don't really need to know trig for this, just congruent triangles :-)

Also, make a habit of thinking in radians (which is just a way of describing angles as a fraction of a full circle). It's useful. Always look upon degrees as inferior, except when navigating. It helps if you remember that 2pi is a fundamental constant, while pi is merely 2pi/2, and a quarter circle is 2pi/4, etc. The people who decided that 3.141... was worthy of a name while 6.283... was not were noobs.

Also, in your implementation above, you really shouldn't hard-code the constant 2pi/4. Write it as SOME_NAME_FOR_PI/2. The only reason for this is that your constant doesn't have all the digits you need -- and you don't want to go around copying some random mathematical constants all over the place, to 16 decimal places or whatever is needed to completely fill the floating point mantissa you're using. It's much easier to remember the name. You'll suffer inaccuracy from using a constant that only goes to a paltry 8 decimal places. And you're using floating point numbers which gives you inherent accuracy. For rotating integers 90 degrees, using floating point math is just immoral :-) You're getting errors not from the inaccuracy of …

Duki commented: thanks! good explanation +4
Rashakil Fol 978 Super Senior Demiposter Team Colleague

Nobody's going to edit your code for you; do your own homework.

Rashakil Fol 978 Super Senior Demiposter Team Colleague
Rashakil Fol 978 Super Senior Demiposter Team Colleague

You've given us no clue on how we can help you or on where your problems lie, so I doubt you'll get any more useful help without being more specific. Of course, first, you need to be introspective enough to figure out what problems you have that keep you from programming well, and once you've figured that out, you should be able to fix them.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Dani, your "no complaints" argument is your standard flawed reasoning. The only feedback that matters is the feedback you've been given.

No, you're standing on flawed reasoning. Feedback is not a scientific poll.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

i would donate if i could but i have run out of miney :( lol

Try sending your eeny and meenie instead.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

This is the wrong forum.

If you overwrote some of the information in the original file, that will be gone*, but the other information (past the end of the file as it now stands) might still be on your hard drive.

* Depending on the file system you're using.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

I think religion should be allowed in public schools and that's not just because I'm a Christian. I think that learning about different religions helps everyone to better understand the origins and beliefs of each one.

This is allowed and happens; I had a class like this.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

I disagree. I demand unconditional surrender. There will be no treaty.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Um, it's hard to understand you, so I'm going to guess that the answer depends on the definition of 'driver'.

Edit: but more seriously, I'd say no, based on the way the word 'driver' is used in common usage.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

I think thats going a bit to far. Do you think that supporters or members of PETA are bad people? My friends mom used to be a member of PETA and she doesn't strike as a particularly evil, immoral, and nasty person.

People who want to control what others are allowed to do in order to satisfy their moral prejudices aren't evil, immoral, or nasty?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

^
Is too friendly to criticize Nichito for not using his money for more efficient forms of generosity. :-)

Rashakil Fol 978 Super Senior Demiposter Team Colleague

http://www.petitionspot.com/petitions/animals4

This is a site where you can sign a petition to protect animals against animal cruelty....

Lets all sign it :)

You don't like the principle of religious freedom, do you?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

> Why do they make computers harder to use and program than they need to be? Here are some examples:

Why do you assume that computers are harder to use and program, instead of assuming you were a lot smarter when you were younger?

> Why do most spreadsheets and programming languages do trigonometric functions in radians, when most people use degrees?

Why do you expect them to behave differently than the behavior they have had in all the history of mathematics? Why do you expect it to default to a version of the function that's usually slower to implement?

> Why do most of the C-based languages (including Java, JavaScript, and Perl) have two different syntax forms to call functions with, depending on which function you want?

What makes you think that having braces anywhere in its syntax makes a language "C-based"?

> In the 1980s, kids all over were programming computers. With the change to Windows, this suddenly stopped, as Microsoft made programming a lot harder to do. Why?

What makes you think programming was any harder to do?

> Why have all of the easy-to-use programming languages been replaced with the hard-to-use C derivatives?

Why do you act as if the invention of new programming languages means that older ones are replaced?

> Why are they making HTML harder to use by taking away features and not replacing them?

They haven't removed any features.

> …

joshSCH commented: Well, shit ya.. and so do you obviously.. -2
Rashakil Fol 978 Super Senior Demiposter Team Colleague

So being gay is like being as stupid as a chicken? So gay people are like people with attention-mongering personalities? So you just happen to declare human beings to be disgusting based on some trait they have no control over?

And you act nicely to people you find morally revolting just for personal gain? Ooh, how principled of you.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

We Americans are completely ignorant of the event you've described. It doesn't register on anyone's radar at all.

Edit: The word 'anyone' could be replaced by 'my' to achieve a more factual interpretation of things.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

All common human behavior has evolutionary causes. Societies that carried 'gay genes' apparently held some advantage over those that didn't. To treat evolution as a contest between individuals is to be mistaken. Also, not all human attributes are genetic, though -- some congenital attributes have to do with conditions in the womb, and occasionally are a result of the parent's or the grandparent's health and nutrition.

The fact that homosexuality is a physiological attribute, and not a mental choice, is obvious. Gay people react differently when exposed to certain armpit smells. The fact that you (assuming you're straight) are attracted to people of the opposite sex is not a choice you made. I know I never decided that I'd be attracted to women.

If you think that sexuality is a choice, that people decide to go one way or the other, that means that you're probably homosexual or bisexual.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Maybe true in some countries, but not here in usa. The jobs the government creates when it spends money gives people an income who in turn pay taxes which gives the government more money so that it can create more jobs.

That's nonsensical reasoning. If they weren't hired by the government, they'd be hired by a privately operated employer and paying the same amount in taxes.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

..obviously there is some controversy as to whether homosexuality is a choice or 'genetic'.

That's not true. That is, there is not a dichotomy between it being a 'choice' and being 'genetic'. A condition can be congenital but not genetic, and it can be a result of environmental (chemical) stimuli.

So the controversy would be whether it's a mental choice or if it's physiological. But that's only a controversy in Texas. It's known to be physiological.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Do you know what big O notation means?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Generally speaking, algorithms which cut the input size in half on each constant time iteration.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Do you understand big O notation?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Rashakil accomplished more in a couple hours of festive hackery than in years of diplomacy.

What are you talking about? You should report bugs by reporting them, not by exploiting them.

The reason I didn't report the possibility of rep spam was because I was purely a malicious user, nothing else.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Wait, it's a bug that people can logon as others on IRC? I thought that was a feature.

What do you think NickServ is for?

Rashakil Fol 978 Super Senior Demiposter Team Colleague
Rashakil Fol 978 Super Senior Demiposter Team Colleague

I don't see what the problem is. Why can't you write these programs? There must be some specific information you're lacking. What do you need to figure out how to do in order to make progress towards a solution?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

I know! Make a dynamically meta-orthogonal optimistically hyper-hybrid interpreter-optimizer.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

But why is your logarithm in the base [tex]\sqrt{2}[/tex]?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

You're right. I should have said [TEX]2\log(n+1)[/TEX].

What? How can the height of a tree be a non-integral value?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Dear All,
Since understading of Induction Is very Important in the Analysis of Algorithm .I have studied it ,but have never practically put them in use ,while desigining my programs. can you kindly explain to me how one should exploit this conceps while desiging an algorithm using loops and recursions. Simple Example will help me to uderstand the concept little clearly.

Algorithm design is an exercise in procrastination. Ask yourself, "what's the least I can do that will make this problem easier?" And then do that. For example, take the algorithm that finds the sum of an array of length N.

First, you might think, "okay, to find the sum, well, all we have to do is find the value at index 0, and then add to it the sum of the values from indices 1 to N-1."

So now you're interested in finding the sum from 1 to N-1. And to do that, you just take ray[1] (let's assume that 'ray' is the name of our array) and add it to the sum of the array elements from 2 to N-1. And in general, it looks like we'll want an algorithm that takes the sum of an array from indices i to j, for arbitrary values of i and j, where i <= j. And if i = j, we have a simple problem: finding the sum of an empty slice of array (and that sum is zero).

So we could have

int sum(int* …
Rashakil Fol 978 Super Senior Demiposter Team Colleague

Of course, y = x + 1.

I'd like to nitpick the statement that the height is [TEX]\log n[/TEX]. On a balanced tree, it's correct to say that the height is [TEX]O(\log n)[/TEX], but not exactly (or even remotely close to, in any base) [TEX]\log n[/TEX]

Rashakil Fol 978 Super Senior Demiposter Team Colleague

One example of this might be quickcheck.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

And its semantics are?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Just use a std::map. You hear me? A std::map. Do you have any good reason to do otherwise? You're probably overestimating the importance of the log n time factor (which hash tables usually still have, albeit in a hidden manner). Of course, maybe you really can't use a std::map for some reason. But I don't see why.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

What in the fµck are you talking about?

christina>you commented: lmao +21
jbennet commented: i agree but dont use the f word -4
Rashakil Fol 978 Super Senior Demiposter Team Colleague

You're being inconsiderate when you deliberately write in a way that is difficult to read. Also, words typed in ALL CAPS will be perceived as shouting.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Yes.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

why dont they rewrite the java VM in assembley it would be faster. maybe its too big.

Correctness is more important than speed.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

More specifically, one way is binary search. Given a range [low, high] in which your square root lies, you can test if the square of (low + high) / 2 is greater than the value you're square rooting or not. If it's greater, then your new range is [low, (low + high)/2], if less, then your new range is [(low + high)/2, high]. Keep narrowing this range in half until the value (low + high)/2 is either <= low or >= high (which it will be, eventually, because you're using doubles.)

You need to pick appropriate starting values of low and high, of course -- one choice is 1 and the number you're taking the square root of.

This algorithm is rather slow, requiring about 52 or 64 iterations for reasonable numbers (if you're using the double datatype), but if if the number you're square-rooting is very, very close to zero, it will have to run thousands of iterations before it terminates (because instead of running into the limits of a double's precision, you'll be descending down to lower and lower exponents). Maybe you'd then want to make 0 a special case, tested for at the beginning.

A faster algorithm to find the square root of x is to compute f(f(...(f(f(f(f(1))))...)), where f(y) = (x/y + y)*0.5, and where f is iterated sufficiently many times.

Killer_Typo commented: great explination +6
Rashakil Fol 978 Super Senior Demiposter Team Colleague

No room; our game is 'paused' right now.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Is this tournament still being played?

Would you get done with comparing peni^H^H^H^H^H monitor sizes and get on with the games?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

You can find out what it supports by reading 7zip's website.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Don't enter the room. Look from the hallway.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

My first program was a spreadsheet, but after that it was exclusively calculators for a while. There was TI-83 basic and TI-89 basic, both of which were sucky languages, but eventually I escaped to the HP side, where they truly have a good programming environment. I'd say I learned much of how to 'think' programming on an HP-49G.

Rashakil Fol 978 Super Senior Demiposter Team Colleague
The Dude commented: Â -1
John A commented: Hey! You managed to annoy The Dude. I honestly didn't think that was possible. +14
Rashakil Fol 978 Super Senior Demiposter Team Colleague
Rashakil Fol 978 Super Senior Demiposter Team Colleague
Aia commented: You can be a man of little words when you choose so. +6
Rashakil Fol 978 Super Senior Demiposter Team Colleague

Write us a poem.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

People who even think there's a clear line between 'scripting languages' and other languages are the true fools.

Are we allowed to call people fools on this forum?

Killer_Typo commented: sorry you dont like my comments, it's okay though some day you will understand ;) -1
Aia commented: No, I don't think he will ever care to understand. +6