Forum: Python Jan 6th, 2009 |
| Replies: 11 Views: 796 x = initial_value
x_last = x
threshold = minimum_change
MAXITER = maximum_iterations_desired
iterations = 0
while iterations < MAXITER and x - x_last > threshold:
x_last = x
x =... |
Forum: Python Jan 5th, 2009 |
| Replies: 13 Views: 4,287 Try this from the interpreter (after creating a window)
while True:
print pygame.event.wait()
to see all the events a window typically recieves. |
Forum: Python Jan 5th, 2009 |
| Replies: 13 Views: 4,287 For a program run from a file, even if it doesn't do any event processing, the window's lifetime will be so short that it probably won't have a chance for any unprocessed events to pile up. So that... |
Forum: Python Jan 5th, 2009 |
| Replies: 13 Views: 4,287 If I've understood correctly, flip() is specifically for double-buffered surfaces ... or more specifically, for changing buffers on surfaces for which you're taking advantage of SDL double buffering... |
Forum: Python Jan 4th, 2009 |
| Replies: 13 Views: 4,287 Just typing at the interpreter so far, but I'll try loading a file. BRB.
[Edit]
Okay, it works. This seems a bit off to me; if I call the update() function it ought to do what it's supposed to,... |
Forum: Python Jan 3rd, 2009 |
| Replies: 13 Views: 4,287 (Google turned up this thread for me...)
Same problem. I've tried it by typing right into Python, from the Windows shell (cmd.exe) and from a Cygwin bash shell, and got slightly different behavior... |
Forum: Posting Games Jan 22nd, 2007 |
| Replies: 3,185 Views: 249,572 |
Forum: Computer Science Oct 30th, 2004 |
| Replies: 2 Views: 27,977 Code Style
---------------
Comments are useful for telling people WTF this code is supposed to do, but there's another aspect to readability - formatting!
Most languages allow a programmer to... |
Forum: C++ Oct 20th, 2004 |
| Replies: 2 Views: 6,058 Consider the definition of a stack - last-in, first-out. If you load a bunch of stuff into a stack, and then take it all out again, you now have your original items *in reverse order*. |
Forum: C++ Oct 6th, 2004 |
| Replies: 3 Views: 2,698 Take the points (1,1), (1,-1), (-1,1) and (-1,-1). Stretch the set to however wide/tall you need, then run all four through
x *= cos(a);
y *= sin(a);
It's the same principle as in the... |
Forum: C Oct 6th, 2004 |
| Replies: 2 Views: 2,557 Construct the formula for the ellipse in standard position, and then use an affine transformation to rotate it. Better yet, if you need to draw it to screen, construct the parametric formula for the... |
Forum: Computer Science Oct 6th, 2004 |
| Replies: 2 Views: 11,469 The Maintenance-Time Error
The original author didn't comment, used crappy and inconsistent code style, and obfuscated because it made him/her feel clever. So now when the system needs updating, the... |
Forum: Computer Science Oct 6th, 2004 |
| Replies: 6 Views: 3,975 Haskell is a functional programming language. Similar in that respect to LISP or Scheme, but it is a lot more rigorous about types and formal math. I had the great luck to be in the 'guinea-pig'... |
Forum: Computer Science Oct 6th, 2004 |
| Replies: 9 Views: 5,033 lmao.
Might I just bring this down to earth a bit and ask if you don't think that many bafrickingzillion possible distinct hashes will be ENOUGH?? |
Forum: Computer Science Oct 6th, 2004 |
| Replies: 2 Views: 3,765 That's exactly the question that logarithms will answer. Were invented to answer.
Going back to the definition: a^x=b --> log_a(b)=x, we have 36 as the base, and we know the result of the... |
Forum: Computer Science Oct 6th, 2004 |
| Replies: 9 Views: 5,149 lol.
Winzip doing a pretty good job, huh? |
Forum: Computer Science Oct 6th, 2004 |
| Replies: 4 Views: 6,414 Does Windows filter the input so much that typing ALT+(ASCII) codes won't produce the right results?
*Nuez goes to check.
Yeah, guess it does. :rolleyes: |
Forum: Computer Science Oct 6th, 2004 |
| Replies: 3 Views: 5,533 For obvious reasons I can't recite code from memory that'll do what you're asking for, but there does exist a regexp-->DFA algorithm...on paper. You're probably already familiar with it, it's the one... |