Python Memory Leak Detector
Announcing Software Tools for Python We are pleased to inform you that we have completed the port and beta test of our Memory Analysis software tool to support Python. The software tools run on the Windows NT/2000/XP (and above) platforms. Python Memory Validator (a memory leak detection tool) http://www.softwareverify.com/python/memory/index.html The website provides 30 day evaluation versions of the software as well as full product versions of the software. The evaluation versions are fully functional with only the 30 day limit on usage. Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk/software.html Computer Consultancy, Software Development Windows C++, Java, Assembler, Performance Analysis, Troubleshooting -- http://mail.python.org/mailman/listinfo/python-list
Re: do people really complain about significant whitespace?
In message [EMAIL PROTECTED], [EMAIL PROTECTED] writes No. In that case Python makes it more readily apparent that your code is too complex. If only life and software engineering was that simple. Not every problem can be reduced to one screenful of code, not in the real world anyway. Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk/software.html Computer Consultancy, Software Development Windows C++, Java, Assembler, Performance Analysis, Troubleshooting -- http://mail.python.org/mailman/listinfo/python-list
Re: do people really complain about significant whitespace?
In message [EMAIL PROTECTED], Gerhard Fiedler [EMAIL PROTECTED] writes I mean the code should be written so that as few as possible comments are necessary to understand it. I don't mean that additional comments are a bad thing. Agreed. Concise code is always good. Just found this on c.l.ruby. Seems kind of relevant. QUOTE My apologies if someone has posted this already -- I just received it: http://www.americanscientist.org/template/AssetDetail/assetid/51982 The Semicolon Wars Every programmer knows there is one true programming language. A new one every week /QUOTE -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk/software.html Computer Consultancy, Software Development Windows C++, Java, Assembler, Performance Analysis, Troubleshooting -- http://mail.python.org/mailman/listinfo/python-list
Re: do people really complain about significant whitespace?
In message [EMAIL PROTECTED], Carl Banks [EMAIL PROTECTED] writes Stephen Kellett wrote: I don't really understand how a closing brace helps here. Care to explain why it helps you? (Deeply nested long functions are evil anyways. If you have such a I didn't write deeply nested. I wrote multiple levels of indentation. They are not the same thing (they can be, but they don't have to be). A lot of code gets to 3 or 4 levels of indentation quite easily. I wouldn't call that deeply nested, not by a long shot. To answer your first question: In C++/Ruby/Pascal you'd have something like this function() { loop1() { blah blah loop2() { blah loop3() { blah } blah } } otherloop() { blah } } and in Python that gets to function() loop1() blah blah loop2() blah loop3() blah blah3 otherloop() blah I really dislike that the end of loop2 is implicit rather than explicit. If its implicit you have to look for it. And if blah3 didn't exist then both loop2 and loop3 would be ending implicitly. This problem gets worse with longer functions and more indentation. I'm sure some people are thinking the above is elegant. To me, its clumsy, and here is why... Now, the above Python version looks nice, I grant you, but that is because it is short. I'm talking about long functions which take up some space. When you come to add loop4, which for arguments sake is after loop2 but before otherloop() and at the same indentation as loop2, thats trivial in C/Ruby/etc but in Python I've got to scroll up the screen find loop2, remembers its indentation go back down and carefully insert it hoping I've got it right. I don't have do that with C/Ruby etc because loop2() ends with a brace/end statement so I know its indentation/end point without having to go and find the start of it (which is off the screen). Yes the above example is contrived - so that I could demonstrate what I wanted to demonstrate. But I've run into these problems with Python code I've written and when reading code written by others. Its a real problem, not just one I've cooked up for an argument. As part of my day job I get to look at a lot of code written by other people, mainly people I've never met and often people I've never even traded email with. Strangely, if people have traded email with me, code that arrives is usually well formatted :-) The amount of code written in horrible styles is amazing, but if you can't spot the start/end of loops/conditionals easily and quickly without having to actually read the code then scanning for the actual code of interest becomes a lot harder. C/C++ have quite a number of horrible styles (K/R being one) which can be fixed with a code formatter, but that implicit loop ending thing with Python I demo above - thats a language feature and nothing I can do will make that go away. I'm always thinking maintenance and readability, some time after the fact. I know that I'll have a reason to come back some time later. Maybe for a bug fix, a feature improvement or just to lift some code. That is why stuff like this is important to me. It needs to be as fast, efficient and error free as possible. And the above doesn't do if for me. Now I'm sure some of you will think I'm mad or whatever, but things like this are important (to me, at least). I don't want to waste my time with issues like the above. If I'm wasting my time on stuff like this it can't be that readable can it? If you think the above isn't an issue we'll just have to agree to disagree. There some are people on the c.l.ruby newsgroup that love Ruby because they don't have to type semicolons anymore. Not that its going to change the world, but its important for them. I think that is one of the least important things you can think of about Ruby, but there you go. Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk/software.html Computer Consultancy, Software Development Windows C++, Java, Assembler, Performance Analysis, Troubleshooting -- http://mail.python.org/mailman/listinfo/python-list
Re: do people really complain about significant whitespace?
In message [EMAIL PROTECTED], Gerhard Fiedler [EMAIL PROTECTED] writes http://www.americanscientist.org/template/AssetDetail/assetid/51982 The Semicolon Wars Good reading :) Thanks. Found something else relevant to this thread. The Pliant language. Appears to use whitespace indentation for grouping. http://fullpliant.org/pliant/language/parser/default_syntax.html Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk/software.html Computer Consultancy, Software Development Windows C++, Java, Assembler, Performance Analysis, Troubleshooting -- http://mail.python.org/mailman/listinfo/python-list
Re: do people really complain about significant whitespace?
In message [EMAIL PROTECTED], [EMAIL PROTECTED] [EMAIL PROTECTED] writes of the driving principles behind Python is that, because code will be read more often than written, readability is more important. In which case, for long functions with multiple levels of indentation Python fails compared to languages that use braces or END or end; etc. Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk/software.html Computer Consultancy, Software Development Windows C++, Java, Assembler, Performance Analysis, Troubleshooting -- http://mail.python.org/mailman/listinfo/python-list
Re: do people really complain about significant whitespace?
In message [EMAIL PROTECTED], Gerhard Fiedler [EMAIL PROTECTED] writes But there is well-written code that is as much as reasonably possible self-documenting, meaning easy to read and understand, with a clear structure, helpful names, appropriate types (where applicable) etc etc. But that code is documenting what is does, not what it should do. That is the fallacy of self-documenting. It is simply a bogus concept. If you have the two together then if they match, most likely the program is written correctly. If you have only the one you can't make the comparison. I don't think you should have a line of comment per line of code. I once worked in a place where they insisted on 1 comment per 5 lines of code. I was the #1 troublemaker there after they created that rule - I hated it. It resulted in a lot of bogus comments that added nothing. Its what you write and where. The problem with the self-documenting crowd is they don't write anything so you can't follow their assumptions in the comments. It should be as sparse as you can get but enough so that each block/chunk of code can be validated by comparing it with the comment that describes what you are doing. My first code was basic on a VIC-20, then assembly on a variety of different 6502/6510 based machines (C64, C16, Atari...). I didn't bother much with comments back then. I was writing games and once they are done you never revisit them so you didn't care too much as long as you got the job done. I thought it was reasonably obvious what each function did etc. Ding! I went back some years later and looked at some of my own code. I had little idea what a lot of it did. I started commenting my code after that. So when it came time to port a game written for the 6510/6516/6502 to the 68000 (Atari ST) and IBM PC-AT (80286) the comments came in handy. Sadly the game never saw the light of day for legal reasons outside of my control. The game was a copy of the wonderful arcade game Dingo written by Ashbury Computers and Graphics (the team that later became Ultimate Play the Game who wrote for the Sinclair ZX Spectrum very successfully in the 1980s). A bit of history for you :-) Since someone mentioned assemblers and significant whitespace and I'm rambling about assembly: I don't every remember whitespace being significant for any of the assemblers I used (650x, 630x, 680x, 8085, 80286, 68000). There was a convention though - you indented to column 8 to write the mnemonics and used the first 6 or 7 chars for labels for branch/jmp instructions. Come on, if you have been in the business for 23 years you know what I mean. If you mean, should code be well written, thought about, well formatted, sensible class/variable names, redesigned if you find a better way, sure no problem with that. Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk/software.html Computer Consultancy, Software Development Windows C++, Java, Assembler, Performance Analysis, Troubleshooting -- http://mail.python.org/mailman/listinfo/python-list
Re: do people really complain about significant whitespace?
In message [EMAIL PROTECTED], Gerhard Fiedler [EMAIL PROTECTED] writes conclusion for me: they must not like self-documenting code... :) Oh dear. So if the code is wrong it is self documenting? Comments document what the code should do. The code shows what the code actually does. Also from a maintenance perspective reading comments is a lot faster than reading the code. For a whitespace significant language this can be very helpful when the formatting gets mangled for some reason. There is no such thing as self-documenting code. People that say they don't need to document their code because its self documenting - no hire. I've been writing and selling software for 23 years now and I still keep hearing this bull about self documenting code. Sigh. Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk/software.html Computer Consultancy, Software Development Windows C++, Java, Assembler, Performance Analysis, Troubleshooting -- http://mail.python.org/mailman/listinfo/python-list
Re: Memory leak in Python
In message [EMAIL PROTECTED], Serge Orlov [EMAIL PROTECTED] writes The next step is to find out what type of objects contributes to the growth most of all, Shame you aren't on Windows, as Python Memory Validator does all of this. after that print several object of that type that didn't exist on iteration N-1 but exist on iteration N And this, but for garbage collection generations. Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk/software.html Computer Consultancy, Software Development Windows C++, Java, Assembler, Performance Analysis, Troubleshooting -- http://mail.python.org/mailman/listinfo/python-list
Re: Memory visualization
In message [EMAIL PROTECTED], Tim Peters [EMAIL PROTECTED] writes [EMAIL PROTECTED] I'd like to know if for Python there is a similar program to dynamically see the memory in a similar way. If such tool doesn't exist yet, I'd like to know if it may be diffifult to create it. One already exists: Python Memory Validator. Software Verification provide software tools for Python on the Windows platform. Software Verification have two commercial products for coverage and performance profiling and three beta products for flow tracing, memory analysis and thread deadlock monitoring. http://www.softwareverify.com Software Verification run with Python 2.2 upwards - no need to modify the python source or binary. Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk/software.html Computer Consultancy, Software Development Windows C++, Java, Assembler, Performance Analysis, Troubleshooting -- http://mail.python.org/mailman/listinfo/python-list
Re: Some thoughts on garbage collection
In message [EMAIL PROTECTED], Frank Millman [EMAIL PROTECTED] writes You could then also categorize this by type, e.g. If you want a nice GUI and no requirement to modify your code Python Memory Validator could be useful. http://www.softwareverify.com Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk/software.html Computer Consultancy, Software Development Windows C++, Java, Assembler, Performance Analysis, Troubleshooting -- http://mail.python.org/mailman/listinfo/python-list
Re: Possible memory leak?
In message [EMAIL PROTECTED], Steven D'Aprano [EMAIL PROTECTED] writes But the real killer is this one line: row=row+chr(num/64) Bad, bad BAD idea. Every time you add two strings together, Python has to copy BOTH strings. As row gets huge, this takes longer and longer to do. A rule of thumb I use is, never add more than two strings together. Maybe three. Certainly not more than four. Or five. But absolutely not millions of strings, which is what you are doing. You would be able to visualize this process very well using Python Memory Validator and Python Performance Validator. http://www.softwareverify.com Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk/software.html Computer Consultancy, Software Development Windows C++, Java, Assembler, Performance Analysis, Troubleshooting -- http://mail.python.org/mailman/listinfo/python-list
Re: Memory Profiler
In message [EMAIL PROTECTED], Dave [EMAIL PROTECTED] writes Is there any memory profiler for Python programs? I Python Memory Validator http://www.softwareverify.com/pythonMemoryValidator/index.html Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk/software.html Computer Consultancy, Software Development Windows C++, Java, Assembler, Performance Analysis, Troubleshooting -- http://mail.python.org/mailman/listinfo/python-list
Re: memory usage of a specific function
In message [EMAIL PROTECTED], Sverker Nilsson [EMAIL PROTECTED] writes Python Memory Validator. Run your program to completion. Switch to the hotspots tab. Search for your function. All memory used in that function will be shown in the tree (with the effective callstack) underneath that function node in the tree. http://www.softwareverify.com I can't try it out easily since it doesn't seem to support Linux. Correct. Windows NT and above only at this time. Also looking at the home page I couldn't find any description of what it was actually doing. The info links didn't work, they showed blank pages with my browser (Netscape 3.01.) IE 6, Opera and Firefox. No idea with NS 3.0 Maybe this more direct link helps. http://www.softwareverify.com/pythonMemoryValidator/index.html So if you would like to explain here, it would be helpful. Especially, it isn't clear to me what this means (requoting): All memory used in that function Exactly that. In a GC language (Python, Ruby, Java, Javascript) each object needs to memory to exist. PMV tracks the creation/destruction of objects (and in the case of Python, the other special non-object datatypes such as integers that have their own pool). Consider the following psuedo code Func 1 allocates A calls Func 2 calls Func 3 calls Func 4 Func 2 allocates B allocates C Func 3 allocates B calls Func 5 allocates C Func 4 allocates D allocates E Func 5 loop 5 times allocates F allocates G This gives you the following tree showing all memory allocations Func1 A Func 2 B C Func 3 B Func 5 5 x F 5 x G C Func 4 D E The tree also includes stats so that you know which node has more (in % terms) data in it (in bytes) that another node. From that tree we can see that the following objects are created. A 1 B 2 C 2 D 1 E 1 F 5 G 5 memory usage could be tested using heapy and the following function. You cannot reliably use native GC language code to monitor the same application's memory usage. You need to do this externally (from C or what takes your fancy - something that won't create/destroy objects on the native language). On the other hand, test for memory usage according to alternative (1) would be harder to add, and it is somewhat undefined what it means. And it is perhaps not so useful as the 2nd alternative? PMV provides both. If you want stats on the number of objects created, no problem. If you want callstacks for all objects created and stats for the memory allocated at these locations, no problem. If you want stats for each generation of objects (a generation being the group allocated between GC invocations), no problem. Plus a whole load of analysis and query functions to allow you to find information on particular object types etc, plus data export functions (HTML and XML). Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk/software.html Computer Consultancy, Software Development Windows C++, Java, Assembler, Performance Analysis, Troubleshooting -- http://mail.python.org/mailman/listinfo/python-list
Re: memory usage of a specific function
In message [EMAIL PROTECTED], Sverker Nilsson [EMAIL PROTECTED] writes i need to find out the memory usage of a specific function that i use in my program. this function does some recursive calculations and i want my program to display the amount of memory the function used to calculate a specific value. Python Memory Validator. Run your program to completion. Switch to the hotspots tab. Search for your function. All memory used in that function will be shown in the tree (with the effective callstack) underneath that function node in the tree. http://www.softwareverify.com Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk/software.html Computer Consultancy, Software Development Windows C++, Java, Assembler, Performance Analysis, Troubleshooting -- http://mail.python.org/mailman/listinfo/python-list
Re: Weird memory consumption problem.
In message [EMAIL PROTECTED], Bo Peng [EMAIL PROTECTED] writes The problem is not that difficult to find, but it was 2am in the morning and I was misled by the different behavior of pyFun1 and pyFun2. Don't know if you were using Windows, but if you were then Python Memory Validator would have helped you identify that bug. Its in beta at the moment if you want to try it. http://www.softwareverify.com Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk/software.html Computer Consultancy, Software Development Windows C++, Java, Assembler, Performance Analysis, Troubleshooting -- http://mail.python.org/mailman/listinfo/python-list
Re: Web-based client code execution
In message [EMAIL PROTECTED], Steve [EMAIL PROTECTED] writes AJAX works because browsers can execute javascript. I don't know of a browser that can execute python. Basically your stuck with java or javascript because everything else really isn't cross platform. ActiveState do a version of Python that can run in a script tag like JavaScript and VBScript. This requires Windows Scripting Host. They also do a similar thing for Perl, not sure about TCL. The syntax is along the lines of SCRIPT language=PythonScript Python goes here /SCRIPT I remember reading this about PerlScript and I'm pretty sure I'm correct in remembering there is a PythonScript. Anyway you are limited to ActiveState and Windows Scripting Host. For pragmatic reasons I think you would be better concentrating on JavaScript for the Client and your language of choice Python/Ruby/Lua/whatever for the server part of AJAX. Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk/software.html Computer Consultancy, Software Development Windows C++, Java, Assembler, Performance Analysis, Troubleshooting -- http://mail.python.org/mailman/listinfo/python-list
Re: python gc performance in large apps
In message [EMAIL PROTECTED], Robby Dermody [EMAIL PROTECTED] writes An update (along with a request for paid help at the end): Over the past week and a half I've improved the memory usage situation by quite a bit. Going to python 2.4, linux kernel 2.6, twisted 2.0 and altering some code I don't know if you have a Windows version of this software but if you do you may find Python Memory Validator useful. http://www.softwareverify.com/pythonMemoryValidator/index.html Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk/software.html Computer Consultancy, Software Development Windows C++, Java, Assembler, Performance Analysis, Troubleshooting -- http://mail.python.org/mailman/listinfo/python-list
Re: Need advice on finding memory leak
In message [EMAIL PROTECTED], [EMAIL PROTECTED] writes I am having trouble identifying the source of a memory leak in a Windows Python program. The basic gist is as follows: Perhaps Python Memory Validator can help you? http://www.softwareverify.com/beta.php Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk/software.html Computer Consultancy, Software Development Windows C++, Java, Assembler, Performance Analysis, Troubleshooting -- http://mail.python.org/mailman/listinfo/python-list
Re: Python profiler
In message [EMAIL PROTECTED], Celine Dave [EMAIL PROTECTED] writes I am trying to find a profiler that can measure the memory usage in a Python program. I would like to gather some statistics about object usages. For Python Memory Validator. Apply for beta here: http://www.softwareverify.com/beta.php?product=PMVB000 example, I would like to be able to see how much time it takes to search for an item in a dict object, That is something for a performance profiler, not a memory profiler. Python Performance Validator will help you there. how many times it has to access the symbol table to retrieve a specific item, and things like that. Python Coverage Validator will help you there. Python Performance Validator will help you there. http://www.softwareverify.com Windows NT/2000/XP/and above(vista, etc) Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk/software.html Computer Consultancy, Software Development Windows C++, Java, Assembler, Performance Analysis, Troubleshooting -- http://mail.python.org/mailman/listinfo/python-list
Re: Memory stats
In message [EMAIL PROTECTED], Tarek Ziadé [EMAIL PROTECTED] writes I am trying to find a general memory profiler that can measure the memory usage in Python program and gather some stats about object usages, and things like that. Not a Python module, but Python Memory Validator may fit the bill. No data on the website, just go straight to the beta page and select the product. Windows NT/W2K/XP/etc.. http://www.softwareverify.com http://www.softwareverify.com/beta.php?product=PMVB000 Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk/software.html Computer Consultancy, Software Development Windows C++, Java, Assembler, Performance Analysis, Troubleshooting -- http://mail.python.org/mailman/listinfo/python-list
Re: Would you pls tell me a tool to step debug python program?
Johnny Lee wrote: Hi, I've met a problem to understand the code at hand. And I wonder whether there is any useful tools to provide me a way of step debug? Just like the F10 in VC... Not single stepping, but flow tracing, complete with variables, parameters and return values. Python Bug Validator. http://www.softwareverify.com Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk/software.html Computer Consultancy, Software Development Windows C++, Java, Assembler, Performance Analysis, Troubleshooting -- http://mail.python.org/mailman/listinfo/python-list
Re: python profiling, hotspot and strange execution time
In message [EMAIL PROTECTED], [EMAIL PROTECTED] writes Hi there, I have some scientific application written in python. There is a good deal of list processing, but also some simple computation such as basic linear algebra involved. I would like to speed things up implementing some of the functions in C. So I need profiling. You haven't said which platform you are on. If you are on Windows you may want to try Python Performance Validator. http://www.softwareverify.com Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk/software.html Computer Consultancy, Software Development Windows C++, Java, Assembler, Performance Analysis, Troubleshooting -- http://mail.python.org/mailman/listinfo/python-list
Re: wanna stop by my homemade glory hole?
wanna stop by my homemade glory hole? I don't think anyone on this group will be interested in trying their Python with that. Take it somewhere else. -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk/software.html Computer Consultancy, Software Development Windows C++, Java, Assembler, Performance Analysis, Troubleshooting -- http://mail.python.org/mailman/listinfo/python-list
Re: When someone from Britain speaks, Americans hear a British accent...
In message [EMAIL PROTECTED], [EMAIL PROTECTED] writes T can be silent in England too .. frui' cricke' Both of those words (fruit and cricket) have the letter T sounded. Stephen (Nationality: English). -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk/software.html Computer Consultancy, Software Development Windows C++, Java, Assembler, Performance Analysis, Troubleshooting -- http://mail.python.org/mailman/listinfo/python-list
Re: Thoughts on Guido's ITC audio interview
In message [EMAIL PROTECTED], Markus Wankus [EMAIL PROTECTED] writes just think it is silly not to benefit from them. In which case you misunderstood me - I never said people should not use them, just that they should not be relied on for productivity improvements. They must factor in at a fraction of 1% of productivity. I don't really class improvements at that level as much to be shouted about :-) Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk/software.html Computer Consultancy, Software Development Windows C++, Java, Assembler, Performance Analysis, Troubleshooting -- http://mail.python.org/mailman/listinfo/python-list
Re: Thoughts on Guido's ITC audio interview
In message [EMAIL PROTECTED], Markus Wankus [EMAIL PROTECTED] writes Have you ever tried anything that provides real, usable refactoring like Eclipse does with Java? I guarantee if you used it more than a few times your view would most likely change. I was forced to use Eclipse recently. Dreadful. I really disliked it. I never got as far as wanting to refactor things. I couldn't wait to stop using it. The fact is, code evolves. You simply cannot write high-quality software in one pass. Total agreement. My point is that productivity gains from refactoring tools are the least of your worries. Hiring good staff that know how to write, test and debug software is very much more important than the amount of time a refactoring tool will save. Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk/software.html Computer Consultancy, Software Development Windows C++, Java, Assembler, Performance Analysis, Troubleshooting -- http://mail.python.org/mailman/listinfo/python-list
Re: Thoughts on Guido's ITC audio interview
In message [EMAIL PROTECTED], Simon Brunning [EMAIL PROTECTED] writes Eclipse's refactorings are a great boon, I find. Refectoring is never *fully* automatic, of course, but the ability to, for example, select a chunk of code and have it extracted into a separate method with all needed arguments and the return value worked out for you is very helpful. All you have to do is give the new method a name. And this sort of thing can certainly improve readability. This is not an attach on you Simon, but if people are relying on that type of thing for increases in software productivity they are hiring the wrong people. Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk/software.html Computer Consultancy, Software Development Windows C++, Java, Assembler, Performance Analysis, Troubleshooting -- http://mail.python.org/mailman/listinfo/python-list
Re: Tracing down segfault
In message [EMAIL PROTECTED], Tony Meyer [EMAIL PROTECTED] writes I have (unfortunately) a Python program that I can consistently (in a reproducible way) segfault. However, I've got somewhat used to Python's very nice habit of protecting me from segfaults and raising exceptions instead, and am having trouble tracking down the problem. Python Bug Validator, a flow tracer, is in beta. Should show you the program execution history, line by line, with variables, params and return codes and exceptions right up until the point the application dies. http://www.softwareverify.com Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk/software.html Computer Consultancy, Software Development Windows C++, Java, Assembler, Performance Analysis, Troubleshooting -- http://mail.python.org/mailman/listinfo/python-list
Re: Dealing with marketing types...
In message [EMAIL PROTECTED], EP [EMAIL PROTECTED] writes that means) and are going crazy throwing around the Java buzzwords (not to mention XML). Sounds like someone has read about AJAX and decided that is what is next. They probably put 2 and 2 together and came up with 5 thinking the J stands for Java rather than Javascript and that your sever end must be Java. Well if they really want performance play the C++ (or assembler!) trump card and watch them squirm :-) I think you best approach is some serious education of upper management on the benefits and pitfalls of each language, and of switching languages. Also point out the huge costs: o Total write-off of all development costs of V1.0. o Total write off of all intellectual property assets of V1.0 (well if you are building V2.0 on something else, you've put V1.0 in the bin with zero re-use) o Total slap in the face and moral-crusher to the development team and support staff for V1.0. You will most likely see an exodus of talented staff after the change, if it happens. o Effectively starting from ground-zero, making the cost for implementing V2.0 the entire development cost, rather than the incremental cost for the jump to V2.0 from V1.0 using the existing language. The costs in human, timescale and financial terms for what these people are proposing are huge. This company may not survive the change. If they change you may want to consider the abandon ship approach and find a more reliable place to devote you skills to. Finally, read The Peter Principle and realise there are people like these with their sights set on getting to the top of the greasy pole without any consideration for the damage they cause to others. You need to identify such people and steer clear of them (they generally do not infect all companies). All the best. Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk/software.html Computer Consultancy, Software Development Windows C++, Java, Assembler, Performance Analysis, Troubleshooting -- http://mail.python.org/mailman/listinfo/python-list
Problem calling Python methods from C
Hello everyone, I'm trying to do something in C calling Python and its failing. I'd be grateful if you could take a look and hopefully you have an answer. What I'm trying to do is determine the address of the collect function in the gc module. I want to do this so that we can determine when a garbage collection happens, regardless of how it is triggered (explicitly by a user call, or implicitly by the behaviour of the program allocating lots of data). As far as I can tell, the gc.collect function is not exposed as a C API, so I cannot hook that to do the monitoring I want. Therefore the only way to get the address to hook is to inspect the Python module function dictionaries, well I think its the only way :-) The approach is to get the module that holds gc. You can do this by calling PyImport_AddModule for an existing module - it will return it. Then you get the dictionary of methods from the module and lookup the method in there. Well, that was my theory after looking at the Python source code. I've shown the source code below. // get collect method from GC module // this module should always be present // as it is a fundamental part of Python PyObject*module; DWORD funcAddress = NULL; module = PyImport_AddModule(gc); if (module != NULL) { // get dictionary of methods for this module PyObject*dict; dict = PyModule_GetDict(module); if (dict != NULL) { // lookup collect in the dictionary PyObject*func; int numItems; // check we have some elements, // strangely there are only 2 numItems = PyDict_Size(dict); // this works, good, that is expected func = PyDict_GetItemString(dict, __name__); // this fails, why? collect is a method in gc // I would expect it to work func = PyDict_GetItemString(dict, collect); } } Hopefully someone can shed some light on why this doesn't work, or explain what the correct method should be if I am doing the wrong thing. Answers as descriptions, Python or C most welcome. Cheers Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk/software.html Computer Consultancy, Software Development Windows C++, Java, Assembler, Performance Analysis, Troubleshooting -- http://mail.python.org/mailman/listinfo/python-list
Re: Problem calling Python methods from C
In message [EMAIL PROTECTED], Stephen Kellett [EMAIL PROTECTED] writes Following my posting with the solution for anyone else that wants to know the answer. The solution appears to be not to use: module = PyImport_AddModule(gc); But to use module = PyImport_ImportModule(gc); Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk/software.html Computer Consultancy, Software Development Windows C++, Java, Assembler, Performance Analysis, Troubleshooting -- http://mail.python.org/mailman/listinfo/python-list
Running PythonNN.DLL as debug or release?
Hi Folks, We've been using Python embedded in an application for a while now, where the Python dll is PythonNN.dll, NN being the version number, such as Python24.dll. Recently it was pointed out to me that Python can run in a debug or release configuration and that you can specify this on the command line using -O and -OO. My question is how do I specify this to the Python DLL I have embedded in my application? Is it as straightforward as: o Use PythonNN.dll for release mode Python o Use PythonNN_d.dll for debug mode Python and if so, how do I specify I want -O or -OO with release mode? I've tried looking at the C API documentation but couldn't find anything useful there. We are using versions of Python from 2.2 upwards. Cheers Stephen -- Stephen Kellett Object Media Limited Computer Consultancy, Software Development Windows C++, Java, Assembler, Performance Analysis, Troubleshooting -- http://mail.python.org/mailman/listinfo/python-list
Re: Supercomputer and encryption and compression @ rate of 96%
In message [EMAIL PROTECTED], Will McGugan [EMAIL PROTECTED] writes Please implement this as a Python module. I would like to compress my mp3 collection to single bits. Just think you could have better than broadband download speeds, on your old 300bps modem! -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk RSI Information:http://www.objmedia.demon.co.uk/rsi.html -- http://mail.python.org/mailman/listinfo/python-list
Re: NSInstaller Vs. Inno Setup
In message [EMAIL PROTECTED], Martin v. Löwis [EMAIL PROTECTED] writes dcrespo wrote: Any comments? MSI. MSI fails on every NT 4 system I've seen. Even with all the patches from Microsoft. Inno Setup wins every time in this situation. Its also a lot less hassle than MSI for what I need. Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk RSI Information:http://www.objmedia.demon.co.uk/rsi.html -- http://mail.python.org/mailman/listinfo/python-list
Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler
In message [EMAIL PROTECTED], George Sakkis [EMAIL PROTECTED] writes Ilias Lazaridis [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Grant Edwards wrote: [...] Um, you realize that nobody in this thread takes you the least bit seriously and people are just poking you with a stick to watch you jump? jump: [EVALUATION] - E02 - Support for MinGW Open Source Compiler Essence: http://groups-beta.google.com/group/comp.lang.python/msg/5ba2a0ba55d4c102 Lol, this guy is hopeless :-) Who's Guido? -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk RSI Information:http://www.objmedia.demon.co.uk/rsi.html -- http://mail.python.org/mailman/listinfo/python-list
Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler
In message [EMAIL PROTECTED], Ilias Lazaridis [EMAIL PROTECTED] writes Stephen Kellett wrote: [...] Who's Guido? Guido is the one, who should care by time about the status of the python-community. Who is care by time? -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk RSI Information:http://www.objmedia.demon.co.uk/rsi.html -- http://mail.python.org/mailman/listinfo/python-list
Re: [EVALUATION] - E02 - ULTIMATE RECIPE TO RESOLVE ALL ISSUES
In message [EMAIL PROTECTED], David Fraser [EMAIL PROTECTED] writes Actually I suspect Ilias is trying to carry out his own sort of 'survey' on how various communities respond to questions asked in the kind of way he asked them ... See his web site. Its as unreadable as his network news postings. One of the first things I did was check out his website. I didn't gain a lot as it is written in his typical automaton style. It actively discourages you from engaging. Thats quite an achievement for a static piece of text. Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk RSI Information:http://www.objmedia.demon.co.uk/rsi.html -- http://mail.python.org/mailman/listinfo/python-list
Re: [EVALUATION] - E02 - ULTIMATE RECIPE TO RESOLVE ALL ISSUES
In message [EMAIL PROTECTED], Peter Maas [EMAIL PROTECTED] writes Perhaps we will soon see a triumphant publication with the title Ilias Lazaridis - the ELIZA of the 21st century. A milestone towards the perfect Turing test ;) I've got to admit that for a large proportion of the time interacting (if that is the word) with him I thought I was the butt of a clever AI joke. I've finally come to the conclusion that there is a real, if seriously dysfunctional, person behind the communications. If I knew more about the AI subject arena AND had more time on my hands I'd try to write an IlliasBot to see how far I got before I was found out. But I'm way too busy, so someone else will have to do it. I just hope they do it in Python or Ruby so that these languages get more publicity. Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk RSI Information:http://www.objmedia.demon.co.uk/rsi.html -- http://mail.python.org/mailman/listinfo/python-list
Re: [EVALUATION] - E02 - ULTIMATE RECIPE TO RESOLVE ALL ISSUES
In message [EMAIL PROTECTED], Ilias Lazaridis [EMAIL PROTECTED] writes This thread proofs simply the inability of this community [1] to focus on a simple essence. Incorrect analysis. This thread proves that you have no concept of how to interact with the community. If you had done what many people asked you to do, which is do some work yourself, then ask questions about the few answers you didn't discover yourself, you would have got lots of helpful answers. You were told this many times by many people. Also on the odd occasion someone did proffer some on-topic advice, sometimes in long articles that must have taken some time to produce you'd dismiss the article with It is not on topic, I have not read it. How could you know if it is not on topic if you don't read it? Apart from the gross rudeness in such an attitude it demonstrates your arrogance, selfishness and utter contempt for those replying to you. And then you have the gall to blame your failure on others... Next you'll be telling me the world is flat and held up by an infinite array of tortoises. -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk RSI Information:http://www.objmedia.demon.co.uk/rsi.html -- http://mail.python.org/mailman/listinfo/python-list
Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler
In message [EMAIL PROTECTED], Ilias Lazaridis [EMAIL PROTECTED] writes The community is everyone around python (including me at this moment). Based on the communities response to you (and the similar response you are getting in c.l.ruby) you are not a member of either community as you continue to deliberately ignore the accepted norms of interaction with the community. I'll list them here for you (again). 1) Do some research yourself (i.e try to answer your own questions) 2) When you have problems tell the group what you did, what the results were and what the problem was. 3) If the community thinks you have done 1 and 2 you will most likely get a helpful response. Some people will be generous and help you anyway. After a while people will realise you have no interest in doing any work yourself and give you a hard time (the c.l.ruby group appear to have hit this threshold today) until you mend your ways. Do 1 and 2 and you'll get your questions answered much faster than your current approach. The most amazing thing is the number of times you've been told this by so many different people and so many different newsgroups and yet you *still don't get it*. Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk RSI Information:http://www.objmedia.demon.co.uk/rsi.html -- http://mail.python.org/mailman/listinfo/python-list
Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler
In message [EMAIL PROTECTED], Ilias Lazaridis [EMAIL PROTECTED] writes MinGW compatibility is not [only] my need. It is an community need [at least partially] Clearly not. If it was, using your logic, it would already exist. -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk RSI Information:http://www.objmedia.demon.co.uk/rsi.html -- http://mail.python.org/mailman/listinfo/python-list
Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler
Hi Robert, Note that this reaction is pretty specific to you and not to other newcomers. I couldn't agree more. This guy is amazing, I think he is an AI or nowhere near as bright as he thinks he is. Seems to get the same reaction regardless of newsgroup or language. His reaction to the Ruby crowd almost seemed incendiary - pretty much accused them of having a lame language. Most newcomers do not carry around a sense of entitlement that could flatten a small village. That has to rate as one of the funniest things I've read on usenet in years. Cheers Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk RSI Information:http://www.objmedia.demon.co.uk/rsi.html -- http://mail.python.org/mailman/listinfo/python-list
Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler
In message [EMAIL PROTECTED], Ilias Lazaridis [EMAIL PROTECTED] writes And yet there is not one company that has someone devoted full-time to developing Python. Not even Guido. Who's Guido? LOL Falling off my chair!! -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk RSI Information:http://www.objmedia.demon.co.uk/rsi.html -- http://mail.python.org/mailman/listinfo/python-list
Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler
In message [EMAIL PROTECTED], Ilias Lazaridis [EMAIL PROTECTED] writes the community do not care about essential needs and requirements. Wrong. They do. They just don't care about *your* essential needs and requirements which *you* want *others* to fulfill at *their* cost. As others have said, do some work yourself. Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk RSI Information:http://www.objmedia.demon.co.uk/rsi.html -- http://mail.python.org/mailman/listinfo/python-list
Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler
In message [EMAIL PROTECTED], Simon Brunning [EMAIL PROTECTED] writes On Mon, 14 Feb 2005 14:12:57 +0100, bruno modulix [EMAIL PROTECTED] wrote: Why do you hate Perl and Ruby community that much ? Oh, I don't. But fair's fair - we've carried our share of the burden, surely? He is already badgering the Ruby guys. Without about as much success as this newsgroup. When he doesn't get what he wants a post along the lines of lang is only suited to small projects and not real world industrial projects or the community doesn't care will appear. Its quite incredible - in the time he has spent complaining he could have done his own research and written some useful tools. I know how long it took me to write my first major C++ app that interfaced with Python and Ruby. It was less time than he has spent complaining - and that included rebuilding Python/Ruby, inspecting the source for what I needed and performing many experiments before I succeeded. Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk RSI Information:http://www.objmedia.demon.co.uk/rsi.html -- http://mail.python.org/mailman/listinfo/python-list
Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler
In message [EMAIL PROTECTED], Stephen Kellett [EMAIL PROTECTED] writes Hi Robert, Weird, you hit reply and the newsreader does a post. C'est la vie. -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk RSI Information:http://www.objmedia.demon.co.uk/rsi.html -- http://mail.python.org/mailman/listinfo/python-list
Re: - E02 - Support for MinGW Open Source Compiler
In message [EMAIL PROTECTED], Pat [EMAIL PROTECTED] writes Wow! I must say, I'm less than impressed with the responses so far. I know Ilias can give the impression that he is just trolling, but I can assure you he is not. At least, not in this case. ;-) He deserves what he gets. He appears to put no effort in, other than to o Write his own document for his own needs that no one else is interested in o Answer people's comments to him in a way that does not demonstrate he has put any effort in. o Based on his answers it seems pretty clear to me (and it seems many others) that he has not put any effort in and has no intention of doing so. In addition, there are some unresolved licensing questions concerning the .NET runtime file for extensions (msvcr71.dll): To quote that URL; QUOTE The 2.4 python.org installer installs msvcr71.dll on the target system. If someone uses py2exe or a similar tool to create a frozen application, is he allowed to redistribute this msvcr71.dll to other users together with his application or not, even if he doesn't own MSVC? /END QUOTE msvcr71.dll is a redistributable for applications written using their compiler. You can redistribute that. If that answer is not good enough for you there is now a free version of Microsofts Visual Studio called Visual Studio Express (downloadable from the Microsoft's website). This DLL is (to my understanding) part of Visual Studio 7.1 and Visual Studio Express. No licensing problem exists. Microsoft will not get upset about msvcr71.dll being distributed. They will if you distribute msvcr71d.dll though - don't do that! I'm not a lawyer, so take this as you would any other free advice and download Visual Studio Express and read the redistribution sections in the license/help file to verify. Alternatively search msdn.microsoft.com for redistributable. Look at this from Microsoft's perspective - Python is a language that can be used on Windows operating systems. msvcr71.dll is required to make some versions of Python work. Microsoft are not stupid - they know that to encourage uptake of their OS they shouldn't put needless restrictions on certain technology - the C runtime being on of those technologies. It is in Microsoft's own best interests to allow msvcr71.dll to be used for Python. users. I can't expect them to purchase a .NET compiler or go through a See above. Regards Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk RSI Information:http://www.objmedia.demon.co.uk/rsi.html -- http://mail.python.org/mailman/listinfo/python-list
Re: - E02 - Support for MinGW Open Source Compiler
In message [EMAIL PROTECTED], Stephen Kellett [EMAIL PROTECTED] writes Studio Express (downloadable from the Microsoft's website). This DLL is (to my understanding) part of Visual Studio 7.1 and Visual Studio Express. My mistake. Visual Studio Express is going to be part of Version 8 (2005) and thus the DLLs there will be msvcr80.dll That said, I still stand by my licensing comments. Distributable files overview. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/h tml/vcconalistofredistributablefiles.asp V7.0/V7.1 specific redistribution instructions. http://support.microsoft.com/default.aspx?scid=kb;en-us;326922 Title: INFO: Redistribution of the Shared C Runtime Component in Visual C++ .NET Article ID : 326922 Last Review : March 25, 2004 Revision: 1.0 Keywords: kbinfo KB326922 Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk RSI Information:http://www.objmedia.demon.co.uk/rsi.html -- http://mail.python.org/mailman/listinfo/python-list
Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler
In message [EMAIL PROTECTED], Pat [EMAIL PROTECTED] writes now it feels like I'm in the company of a bunch of hell-bent school bullies. From my experience of bully behaviour that isn't what is happening here. Bullying usually involves abusive behaviour and language and isn't much to do with the topic as the person. The responses he has got are to do with how he is behaving, not who he is. I haven't seen any abusive language. As for behaviour, people are being as blunt with him as he is with them. Many have also told him what he should do in order to get a better response. He has ignored them. Many societies around the world shun people that won't fit the norm. The norm in the newsgroups he is causing trouble in is that You look for yourself first, do some research, then ask. He isn't even willing to use a search engine, let alone read the documentation or heaven forbid, read the source code himself. Sooner or later he'll give up, or realise that if he does a bit of the work himself he'll get much more back. Its up to him. You'll notice that I've answered your question in another reply as its obvious you have put some effort in before making your comments. In other words I am not behaving in a contradictory way to what I specified above. Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk RSI Information:http://www.objmedia.demon.co.uk/rsi.html -- http://mail.python.org/mailman/listinfo/python-list
Re: - E02 - Support for MinGW Open Source Compiler
In message [EMAIL PROTECTED], Pat [EMAIL PROTECTED] writes Actually, no. We ran into some issues with Python 2.4 that caused us to return to Python 2.3.5. But I would really like to upgrade to Python 2.4. So I started researching the subject before I did anything. Pat, could you include some context in your replies? I have no idea if you are replying to my comments about Visual Studio Express or someone else? The only text I see in your replies is what you write, no text from the posting you are replying to. As it is I've ignored all your replies so far as I'm not sure I'm the person you are addressing (until I saw the above, now I'm confused). Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk RSI Information:http://www.objmedia.demon.co.uk/rsi.html -- http://mail.python.org/mailman/listinfo/python-list
Re: - E02 - Support for MinGW Open Source Compiler
In message [EMAIL PROTECTED], Pat [EMAIL PROTECTED] writes That answers the cost question (assuming that your interpretation of the licensing is correct, since I'm not a lawyer nor qualified to render much of an opinion on that). But there is still the issue of going through a bunch of configuration hassle that scares me away from What configuration hassle? Can't be any harder than specifying a different CRT surely? Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk RSI Information:http://www.objmedia.demon.co.uk/rsi.html -- http://mail.python.org/mailman/listinfo/python-list
Re: - E02 - Support for MinGW Open Source Compiler
In message [EMAIL PROTECTED], Stephen Kellett [EMAIL PROTECTED] writes In message [EMAIL PROTECTED], Pat [EMAIL PROTECTED] writes if I have both versions of Python installed - 2.3.5 and 2.4? Is there an easy way to detect this and switch between the two dlls? Easy? Depends what you call easy. a) You just need to detect if pythonNN.dll is implicitly linked to msvcrt.dll or msvcrXX.dll (where XX indicates a VS studio number, currently XX can only be 71, but if Python is done for Visual Studio 2005 (8.0) then XX may also have a value of 80). I should have also mentioned that if you don't know how to do get the list of imported DLLs you can grab the source code for the PE Explorer DLL from: http://www.objmedia.demon.co.uk/freeSoftware/peFileDLL.html If you want to see how to use this DLL you can also grab: http://www.objmedia.demon.co.uk/freeSoftware/peFileExplorer.html Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk RSI Information:http://www.objmedia.demon.co.uk/rsi.html -- http://mail.python.org/mailman/listinfo/python-list
Re: - E02 - Support for MinGW Open Source Compiler
In message [EMAIL PROTECTED], Pat [EMAIL PROTECTED] writes What configuration hassle? Can't be any harder than specifying a different CRT surely? I don't want to have to ask users of my code to have to go through this: http://www.vrplumber.com/programming/mstoolkit/ OK. I misunderstood your original intent. I thought the original question was can we redistribute this DLL? I answered this bit. I wasn't attempting to answer the larger question about building extensions etc. My development environment has all the things in that article by default - I wouldn't even start work without them, so I had them taken for granted in my thoughts. I can see your problem :-) but I have no easy answer. Sorry. -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk RSI Information:http://www.objmedia.demon.co.uk/rsi.html -- http://mail.python.org/mailman/listinfo/python-list
Re: - E02 - Support for MinGW Open Source Compiler
In message [EMAIL PROTECTED], Tony Meyer [EMAIL PROTECTED] writes There are also other conditions, to do with what you are redistributing it with (it can't be alone), and including a particular type of license with your redistribution. (It appears that Python 2.4 doesn't correctly follow this at the moment, IIRC). Lots of points from Tony stating a different point of view. I'll assume you are correct. However, surely if you Python 2.4 installed they'll have this DLL anyway, so the point is moot, unless of course, Python 2.4 is in breach as well. -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk RSI Information:http://www.objmedia.demon.co.uk/rsi.html -- http://mail.python.org/mailman/listinfo/python-list
Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler
In message [EMAIL PROTECTED], Ilias Lazaridis [EMAIL PROTECTED] writes I like to synchronize any efforts with the existing ones. I assume the reason for doing that would be to avoid duplicating effort? If that is the case why do you want lots of people all to answer your questionnaire. Thats a huge duplication of effort. A much more effective use of effort would be for you to do the research and when you are done to ask people to comment on the *results* of the research, not the questions. This accomplishes several things: o Reduction in duplication of effort. o Demonstrates to everyone else that you are prepared to do some work before asking questions. o When you find that the response is much more welcoming than you have had so far you will have learnt that you need to put some effort in to get some reward out (which is what most of us have been trying to tell you). Of course, based on your behaviour here (and currently in comp.lang.ruby where you are spinning a nice yarn in not bothering to read up on the answers people give you, even when their answers are detailed), I have not much hope of you taking the above approach. Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk RSI Information:http://www.objmedia.demon.co.uk/rsi.html -- http://mail.python.org/mailman/listinfo/python-list
Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler
In message [EMAIL PROTECTED], Steve Horsley [EMAIL PROTECTED] writes Stephen Kellett wrote: Who's Guido? LOL Falling off my chair!! I think the expression you are looking for is ROFL! :-) Yes, but with that I could've been standing up before ending up on the floor. I wrote it as I felt it!. Its a really good demonstration as to the depth of the research performed by Illias. I'm waiting for the Who's Matz? comment in comp.lang.ruby Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk RSI Information:http://www.objmedia.demon.co.uk/rsi.html -- http://mail.python.org/mailman/listinfo/python-list
Re: [EVALUATION] - E01: The Java Failure - May Python Helps?
In message [EMAIL PROTECTED], Ilias Lazaridis [EMAIL PROTECTED] writes Can one please point me to a downloadable version of the 2 reference manuals (did not found them)? Well, there is an obvious website address to visit and you can see the word documentation on that website without scrolling. Use Google or a different search engine to find the obvious website. Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk RSI Information:http://www.objmedia.demon.co.uk/rsi.html -- http://mail.python.org/mailman/listinfo/python-list
Re: [EVALUATION] - E01: The Java Failure - May Python Helps?
In message [EMAIL PROTECTED], Ilias Lazaridis [EMAIL PROTECTED] writes [I like to avoid interaction with google.] Well, use a different search engine. I've not evaluated Java. That is strange - the title of this thread indicates that you have evaluated Java. You have posted similar threads in comp.lang.ruby and comp.lang.java.*. You are a troll. Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk RSI Information:http://www.objmedia.demon.co.uk/rsi.html -- http://mail.python.org/mailman/listinfo/python-list
Re: Profiling python 2.3
In message [EMAIL PROTECTED], Kenneth Johansson [EMAIL PROTECTED] writes I wonder what would be a good way to profile a python program where the main thread starts two worker threads that do all the work. I get no infomation at all from the threads. Python Performance Validator (beta) http://www.softwareverify.com/pythonPerformanceValidator/index.html Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk RSI Information:http://www.objmedia.demon.co.uk/rsi.html -- http://mail.python.org/mailman/listinfo/python-list
Re: Profiling and speed up
In message [EMAIL PROTECTED], Franz Steinhaeusler [EMAIL PROTECTED] writes best if it would be graphical like performance analysis from DevPartner for Visual C++? Python Performance Validator http://www.softwareverify.com/pythonPerformanceValidator/index.html Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk RSI Information:http://www.objmedia.demon.co.uk/rsi.html -- http://mail.python.org/mailman/listinfo/python-list
Re: is there better 32 clock() timing?
In message [EMAIL PROTECTED], Bengt Richter [EMAIL PROTECTED] writes QueryPerformanceCounter is 47 times slower to call than clock() on my 1Ghz Athlon. That really makes me wonder. Perhaps the Athlon handles RDTSC by way of an illegal instruction trap and faking the pentium instruction? No. Athlon implements it correctly- if it didn't you'd end up in the debugger with an illegal instruction trap - you don't. Also my stats below show that Athlon's RDTSC is faster than Pentium's which I doubt you'd get if you were faking things. Taking it further - the test to see if a processor supports RDTSC is to wrap it in an exception handler and execute the instruction - if it doesn't you end up in the __except part of the SEH handler. QueryPerformanceCounter and RDTSC are not the same thing. QueryPerformanceCounter talks to hardware to get its results. I imagine that differences in performance for QueryPerformanceCounter are down to how the HAL talks to the hardware and can't be blamed on the processor or manufacturer. clock() gets its info from the OS at (I imagine) the same granularity as the NT scheduler. Some systems schedule at 10ms/11ms others at about 6ms or 7ms. I think this is to do with single/dual processors - unsure as I don't have a dual processor box. If you call GetThreadTimes() you will find values returned that match the approx clock() values - which is why I think they are related. I've just run some tests using the same old program. QPC is QueryPerformanceCounter. QPF is QueryPerformanceFrequency. I've included the QPC/QPF column to show the timings in seconds. 1Ghz Athlon, Windows XP, SP2 1,000,000 iterations QPC QPC/QPF (seconds) QueryPerformanceCounter 7156984 5.998233 GetThreadTimes5032770.421794 RDTSC 1034300.086684 clock() 1489090.124800 QPC QPC/QPF (seconds) 850Mhz Pentium III, W2K. 1,000,000 iterations QueryPerformanceCounter 5652161 1.579017 GetThreadTimes 3608976 1.008222 RDTSC 8429500.235491 clock() 6998400.195511 The results surprise me - Pentium III clock() takes less time to execute than Pentium III RDTSC! It surprises me that the 850Mhz Pentium III QPC is faster than the 1Ghz Athlon QPC, but whichever way you slice it, QPC is massively slower than RDTSC or clock(). Also surprising is the W2K GetThreadTimes is so slow compared to the Athlon GetThreadTimes(). of the timer chip that drives the old 55ms clock that came from IBM using cheap TV crystal based oscillators instead of defining an OS-implementer-friendly time base, I think. The frequency was nominally 1193182 hz I believe. Obviously the OS didn't get interrupted that often, but if you divide by 2**16, you get the traditional OS tick of ~55ms: I though that was the Windows 9x way of doing things. You get the 49 day wrap around with this one I think. you can't expect to control ignition of a racing engine reliably with an ordinary windows based program ;-) ...and Schumacher is in the lead, oh look! The Ferrari has blue screened. The new regulations to reduce speeds in F1 are working, that has really slowed him down... Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk RSI Information:http://www.objmedia.demon.co.uk/rsi.html -- http://mail.python.org/mailman/listinfo/python-list
Re: is there better 32 clock() timing?
In message [EMAIL PROTECTED], Peter Hansen [EMAIL PROTECTED] writes (I've read the five or so following messages you and Bengt have posted, but not in detail so I'm not sure where you're going with all this, but... ) We've gone off at a tangent about Windows timing etc. Pretty much over now. According to the docs for time.clock(), On Windows, this function returns wall-clock seconds elapsed since the first call to this function, as a floating point number, based on the Win32 function QueryPerformanceCounter(). The resolution is typically better than one microsecond. Depending on whether you really meant accuracy above, and on other things, this is either irrelevant, or contradicts your first statement... No contradiction. Python (from what you write above) implements time.clock() differently from the CRT clock() (which I had assumed Python would call for simplicity). Hence the differing results. Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk RSI Information:http://www.objmedia.demon.co.uk/rsi.html -- http://mail.python.org/mailman/listinfo/python-list
Re: is there better 32 clock() timing?
that time.clock() is inaccurate. The problem is that the time.clock() statement takes several hundred microseconds to execute. The statement is incorrect. clock() itself isn't slow, but it is accessing a resource, the accuracy of which is no better than 1ms. There are various timers available, documented and undocumented, all of which end up at 1ms or 1.1ms, give or take. For anything shorter you need QueryPerformanceCounter() (but that *is* a slow call), or use the RDTSC instruction which is fast but gives a count of instruction cycles executed and is thus not totally accurate (multiple execution pipelines, plus multithreading considerations). You have to choose the system that works best for you. In many cases RDTSC works OK. Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk RSI Information:http://www.objmedia.demon.co.uk/rsi.html -- http://mail.python.org/mailman/listinfo/python-list
Re: is there better 32 clock() timing?
In message [EMAIL PROTECTED], Bengt Richter [EMAIL PROTECTED] writes I believe that is quite wrong as a general statement. Actually my initial statement should have been written accessing a resource, the accuracy of which is no better than 10ms.. I was thinking of the 1ms multimedia timer but wrote about clock() instead. 10ms, coincidentally is the approx minimum scheduling granularity for threads unless you are in a multimedia thread (or real time thread - not sure about real time threads in NT). If the resource only had ~1ms granularity, the minimum would be zero, as it is if you call time.time() in a tight loop, Correct. Write your app in C and call clock(). Thats what you get. You can call clock 2 times and still get a delta of zero. The next delta (on my system) is 10ms at about 22000 calls. There are various timers available, documented and undocumented, all of which end up at 1ms or 1.1ms, give or take. For anything shorter you Whoops here we go, same typo - should have been 10ms or 11ms. There is a 1ms timer in the multimedia timing group. need QueryPerformanceCounter() (but that *is* a slow call), or use the Have you timed it, to make that claim? Yes. What do you mean by slow? Slower than any other Win32, CRT or Undocumented NT function you can use to get timer information. Yes, I have timed them all, a few years ago. QueryPerformanceCounter is 47 times slower to call than clock() on my 1Ghz Athlon. QueryPerformanceCounter may have finer granularity, but called in a tight loop it'll crush your program. RDTSC instruction which is fast but gives a count of instruction cycles executed and is thus not totally accurate (multiple execution pipelines, plus multithreading considerations). Accurate for what. See below - you haven't taken things into account, despite my comment in brackets above which gives a big hint. A single clock AFAIK drives RDTSC Correct. The main problem with a CPU clock based reading is that it's very stable unless there's variable clock rate due to power management. Try running multiple apps at the same time you are doing your measurement, each of which has a variable loading. Each of these apps is contributing to the count returned by RDTSC. That is what I was referring to. Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk RSI Information:http://www.objmedia.demon.co.uk/rsi.html -- http://mail.python.org/mailman/listinfo/python-list
Re: Memory Usage
In message [EMAIL PROTECTED], rbt [EMAIL PROTECTED] writes That's right. I look at that column. Should I measue mem usage in some other way? Try VM Validator, a free memory visualization tool from Software Verification. http://www.softwareverify.com http://www.softwareverify.com/vmValidator/index.html It shows paged memory usage and also Virtual Memory manager usage on separate tabs. Colour coded visual representation of each 4K page of memory. Probably more use on more memory intensive applications than yours, but may still shed some light all the same. Either launch Python from VM Validator, or inject VM Validator into your running Python.exe process. Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk RSI Information:http://www.objmedia.demon.co.uk/rsi.html -- http://mail.python.org/mailman/listinfo/python-list
Re: Python Operating System???
In message [EMAIL PROTECTED], Christopher Koppler [EMAIL PROTECTED] writes Still, Java feels like C++ done right, while being more wrong :-[ Couldn't disagree more. Just about anything you want to do that is low-level, is impossible in Java. Anyway this is off-topic. Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk RSI Information:http://www.objmedia.demon.co.uk/rsi.html -- http://mail.python.org/mailman/listinfo/python-list
Re: Python Operating System???
In message [EMAIL PROTECTED], Arich Chanachai [EMAIL PROTECTED] writes think). Or what about D? Digital Mars have a D compiler. http://www.digitalmars.com Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk RSI Information:http://www.objmedia.demon.co.uk/rsi.html -- http://mail.python.org/mailman/listinfo/python-list
Re: Garbage collector strategy
In message [EMAIL PROTECTED], Martin Drautzburg [EMAIL PROTECTED] writes Just for curiosity: does python use a mark-and-sweep garbage collector or simple reference counting? In the latter case it would not garbage collect circular references, right ? gcmodule.c in the python sources shows the implementation, plus the code for this is well documented. Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk RSI Information:http://www.objmedia.demon.co.uk/rsi.html -- http://mail.python.org/mailman/listinfo/python-list
Re: memory leak
In message [EMAIL PROTECTED], Daniel Wheeler [EMAIL PROTECTED] writes However, I would like to understand first if pure python can leak without the reference count increasing? How are you determining that used memory is increasing? Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk RSI Information:http://www.objmedia.demon.co.uk/rsi.html -- http://mail.python.org/mailman/listinfo/python-list
Re: memory leak
In message [EMAIL PROTECTED], Daniel Wheeler [EMAIL PROTECTED] writes I'm on a linux platform and looking in proc/pid/status. Using top shows the same problem. OK, If you were on Windows I could give you some detailed advice - but for Linux, better that somebody else does it. Linux is not my main thing these days (it was in '94 :-). Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk RSI Information:http://www.objmedia.demon.co.uk/rsi.html -- http://mail.python.org/mailman/listinfo/python-list
[ANNOUNCE] Python Thread Validator software tool
Python Thread Validator. A thread analysis, lock analysis and deadlock detection tool for Python. Tool is now in beta. http://www.softwareverify.com/pythonThreadValidator/index.html Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk RSI Information:http://www.objmedia.demon.co.uk/rsi.html -- http://mail.python.org/mailman/listinfo/python-list
Re: Python mascot proposal
In message [EMAIL PROTECTED], EP [EMAIL PROTECTED] writes Well, the snake mascot as drawn is, of course, very flexible, appears to be friendly, and is, well, just how fast is a big snake, esp. a python? I don't know about Pythons but there is a black snake in Africa (a black mamba?) that when it stands up is taller than a man. This snake can out run a man in straight line or over rough ground. I saw a TV program where they'd attached a camera to its head. Absolutely incredible watching this thing whizzing through the undergrowth in search of a mate. Don't think all snakes are slow - they aren't. BTW. The suggestions - I like them, for what little that is worth. Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk RSI Information:http://www.objmedia.demon.co.uk/rsi.html -- http://mail.python.org/mailman/listinfo/python-list
Re: Deadlock detection
In message [EMAIL PROTECTED], Duncan Grisby [EMAIL PROTECTED] writes understood, and there are plenty of systems that do it. I just haven't been able to find one for Python. There is one at http://www.softwareverify.com as I mentioned in a previous posting. Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk RSI Information:http://www.objmedia.demon.co.uk/rsi.html -- http://mail.python.org/mailman/listinfo/python-list
Re: Deadlock detection
Does anyone know of a deadlock detector for Python? I don't think it would be too hard to hook into the threading module and instrument mutexes so they can be tested for deadlocks. I've googled around but I haven't found anything. Software Verification have Python Thread Validator. Its not publicly advertised on the beta part of the website, but it is available. http://www.softwareverify.com/publicBeta.html Take a look at Thread Validator or Java Thread Validator to see what the tool looks like (the Python tool is similar). If you are interested send an email to support asking about the Python port. Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk RSI Information:http://www.objmedia.demon.co.uk/rsi.html -- http://mail.python.org/mailman/listinfo/python-list