Ethan Glasser-Camp | 1 Sep 2006 01:38
Picon
Favicon

< in wiki?

Seems like when I post code in the cookbook with a < (less-than sign),
it gets replaced by &lt;, and then remains &lt; in the entry. Is there
something I can do about this?

Ethan

Chris Ashurst | 1 Sep 2006 15:42

RE: &lt; in wiki?

Sounds like the problem is that the POST action on the initial submit
translates all html special characters to their "safe" equivalents, and then
when the wiki article is called for display it replaces all ampersand
characters with its safe equivalent again, ie: "<" --> "&lt;" --> "&amp;lt;"

Err... Not sure how this information will actually help (or even if it's
correct!), but I've definitely encountered that situation before (even with
my own stuff, as a result of being htmlspecialchar nazi).

~Chris

-----Original Message-----
From: owner-pygame-users@... [mailto:owner-pygame-users@...]On
Behalf Of Ethan Glasser-Camp
Sent: Thursday, August 31, 2006 19:38
To: pygame-users@...
Subject: [pygame] &lt; in wiki?

Seems like when I post code in the cookbook with a < (less-than sign),
it gets replaced by &lt;, and then remains &lt; in the entry. Is there
something I can do about this?

Ethan

CONFIDENTIAL NOTICE: This email including any attachments, contains 
confidential information belonging to the sender. It may also be 
privileged or otherwise protected by work product immunity or other 
legal rules. This information is intended only for the use of the 
individual or entity named above.  If you are not the intended 
recipient, you are hereby notified that any disclosure, copying, 
(Continue reading)

Phil Hassey | 1 Sep 2006 18:04
Picon
Favicon

RE: &lt; in wiki?

Chris,

That's about right.  I run all the data through a html cleaner script...

I'll have to give this one a bit of thought.  Seems like I'll have to take the content of the <code> areas out of the HTML before it is cleaned and then replace it back in or something...

I'll put this on my TODO for my next website update.

Phil

Chris Ashurst <CAshurst-m+RvqUOZKbM@public.gmane.org> wrote:

Sounds like the problem is that the POST action on the initial submit
translates all html special characters to their "safe" equivalents, and then
when the wiki article is called for display it replaces all ampersand
characters with its safe equivalent again, ie: "<" --> "<" --> "&lt;"

Err... Not sure how this information will actually help (or even if it's
correct!), but I've definitely encountered that situation before (even with
my own stuff, as a result of being htmlspecialchar nazi).


~Chris

-----Original Message-----
From: owner-pygame-users-eePT7DaMpNY@public.gmane.org [mailto:owner-pygame-users-eePT7DaMpNY@public.gmane.org]On
Behalf Of Ethan Glasser-Camp
Sent: Thursday, August 31, 2006 19:38
To: pygame-users-eePT7DaMpNY@public.gmane.org
Subject: [pygame] < in wiki?


Seems like when I post code in the cookbook with a < (less-than sign),
it gets replaced by <, and then remains < in the entry. Is there
something I can do about this?

Ethan





CONFIDENTIAL NOTICE: This email including any attachments, contains
confidential information belonging to the sender. It may also be
privileged or otherwise protected by work product immunity or other
legal rules. This information is intended only for the use of the
individual or entity named above. If you are not the intended
recipient, you are hereby notified that any disclosure, copying,
distribution or the taking of any action in reliance on the contents
of this emailed information is strictly prohibited. If you have
received this email in error, please immediately notify us by
reply email of the error and then delete this email immediately.

Stay in the know. Pulse on the new Yahoo.com. Check it out.
Ethan Glasser-Camp | 1 Sep 2006 19:03
Picon
Favicon

Geometry engine

Hey guys,

Last night I posted to the cookbook my geometry engine. It uses
Numeric as suggested a few weeks ago to combine math to whatever
degree possible. It's still not as fast as I would like it, and the
part that checks for collision between round and polygonal objects is
still very ugly. I'd like to hear any advice or criticism you have.

Known defects:

- a function that simply says "yes, these things overlap" would be nice
- missing poly-poly collisions
- Still not fast enough!
- Could be documented better
- littered with commented-out print statements, which are the proof
that I was debugging the crap out of this thing

Thanks,

Ethan

Richard Jones | 2 Sep 2006 01:08
Picon

Re: Geometry engine

On Saturday 02 September 2006 03:03, Ethan Glasser-Camp wrote:
> Last night I posted to the cookbook my geometry engine. It uses
> Numeric as suggested a few weeks ago to combine math to whatever
> degree possible. It's still not as fast as I would like it, and the
> part that checks for collision between round and polygonal objects is
> still very ugly. I'd like to hear any advice or criticism you have.

Thanks for submitting it. There's probably some overlap with Alex's recent 
euclid module?

http://www.partiallydisassembled.net/euclid.html

> Known defects:
> - littered with commented-out print statements, which are the proof
> that I was debugging the crap out of this thing

I cleaned most (if not all) of those out of the code when I also edited it for 
readability:

- wrapped the code so it was a reasonable width (if the code is wider
  than the textarea box then it'll push out the width of the resultant
  page too much, and will also be harder for casual reading)
- put a space after the comment chars (as per PEP 8)
  http://www.python.org/dev/peps/pep-0008/

(I perform these edits for all submissions to the CookBook that need them)

    Richard

Ethan Glasser-Camp | 2 Sep 2006 01:55
Picon
Favicon

Re: Geometry engine

Richard Jones wrote:
> Thanks for submitting it. There's probably some overlap with Alex's recent 
> euclid module?

To some extent. Euclid supplies more geometric primitives, but what I
posted does more in the way of collision detection. Computing
collision between two polygons by computing distances between line
segments is kind of hacky.

>> Known defects:
>> - littered with commented-out print statements, which are the proof
>> that I was debugging the crap out of this thing
> 
> I cleaned most (if not all) of those out of the code when I also edited it for 
> readability:

I saw, thanks.

Ethan

David | 5 Sep 2006 03:23
Picon

flip() and opengl


What does the flip() function do exactly, in OpenGL mode?

I have been doing some profiling of variations on a simple script, and the time taken by flip can vary from 0 (too small to measure) to 35 ms per call.

flip() must do more than just change a hardware register indicating which buffer to display.  I assume there are finalizing operations to be done before toggling the buffers.  Is there documentation somewhere on what exactly is being done? 

Knowing what is taking the 35 ms would help in optimizing.

Thanks
David




Cameron Blackwood | 5 Sep 2006 03:54

Re: flip() and opengl


David writes:
  |
  | 
  | What does the flip() function do exactly, in OpenGL mode?

flip() toggles the buffer but on _some_ OS's it also _waits_ until the
screen is being displayed.

On windows, the _max_ fps I can get is 75 because thats
what my monitor operates at and opengl's flip() waits until the
monitor is displaying the buffer i just flipped to.

On unix, the same code can get 200+ because it doesnt wait for
the montior to display (but my monitor still works at only 75 fps,
so those extra updates dont get me anything). (Except maybe glitches
if I flip mid frame.)

Check out page 22 of the red book, "The Refresh that Pauses".

  | Thanks
  | David

--
 / `Rev Dr'   cam  at darkqueen.org            Roleplaying, virtual goth \
<   http://darkqueen.org        Poly, *nix, Python, C/C++, genetics, ATM  >
 \  [+61 3] 9809 1523[h]         skeptic, Evil GM(tm). Sysadmin for hire /
                      ---------- Random Quote ----------
I wonder if I should put myself in ESCROW!!

altern | 6 Sep 2006 11:37
Picon

weird refresh error

hi all

I am getting a refresh error on linux (tried couple of machines) and on 
a windows machine with Nvidia card. I run my app and it is ok but if 
another windows overlap the pygame window, after that the area that was 
overlapped does not refresh anymore. Up to tomorrow I thought this was 
something to do with linux as on my windows machines runs fine, but 
yesterday I tested it on a friends laptop and I got the same error.

I am using pygame + pyOpenGL.

sounds familiar to anyone?

thanks!

enrike

Richard Jones | 6 Sep 2006 11:40
Picon

Re: weird refresh error

On Wednesday 06 September 2006 19:37, altern wrote:
> I am getting a refresh error on linux (tried couple of machines) and on
> a windows machine with Nvidia card. I run my app and it is ok but if
> another windows overlap the pygame window, after that the area that was
> overlapped does not refresh anymore. Up to tomorrow I thought this was
> something to do with linux as on my windows machines runs fine, but
> yesterday I tested it on a friends laptop and I got the same error.

It's not an error ;)

You will need to redraw the part of the window that was covered. There is a 
specific event you can receive that tells you when you need to perform this 
action.

     Richard


Gmane