Re: Processing large CSV files - how to maximise throughput?
On Fri, Oct 25, 2013 at 2:57 PM, Dave Angel da...@davea.name wrote: But I would concur -- probably they'll both give about the same speedup. I just detest the pain that multithreading can bring, and tend to avoid it if at all possible. I don't have a history of major pain from threading. Is this a Python thing, or have I just been really really fortunate (growing up on OS/2 rather than Windows has definitely been, for me, a major boon)? Generally, I find threads to be convenient, though of course not always useful (especially in serialized languages). ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Python was designed (was Re: Multi-threading in Python vs Java)
Le mardi 15 octobre 2013 23:00:29 UTC+2, Mark Lawrence a écrit : On 15/10/2013 21:11, wxjmfa...@gmail.com wrote: Le lundi 14 octobre 2013 21:18:59 UTC+2, John Nagle a écrit : [...] No, Python went through the usual design screwups. Look at how painful the slow transition to Unicode was, from just str to Unicode strings, ASCII strings, byte strings, byte arrays, 16 and 31 bit character builds, and finally automatic switching between rune widths. [...] Yes, a real disaster. This poor Python is spending its time in reencoding when necessary, without counting the fact it's necessary to check if reencoding is needed. Where is Unicode? Away. Use one of the coding schemes endorsed by Unicode. If a dev is not able to see a non ascii char may use 10 bytes more than an ascii char or a dev is not able to see there may be a regression of a factor 1, 2, 3, 5 or more simply by using non ascii char, I really do not see now I can help. Neither I can force people to understand unicode. I recieved a ton a private emails, even from core devs, and as one wrote, this has not been seriously tested. Even today on the misc. lists some people are suggesting to write to add more tests. All the tools I'm aware of, are using unicode very smoothly (even utf-8 tools), Python not. That's the status. This FSR fails. Period. jmf -- https://mail.python.org/mailman/listinfo/python-list
Re: Processing large CSV files - how to maximise throughput?
Chris Angelico, 25.10.2013 08:13: On Fri, Oct 25, 2013 at 2:57 PM, Dave Angel wrote: But I would concur -- probably they'll both give about the same speedup. I just detest the pain that multithreading can bring, and tend to avoid it if at all possible. I don't have a history of major pain from threading. Is this a Python thing, or have I just been really really fortunate Likely the latter. Threads are ok if what they do is essentially what you could easily use multiple processes for as well, i.e. process independent data, maybe from/to independent files etc., using dedicated channels for communication. As soon as you need them to share any state, however, it's really easy to get it wrong and to run into concurrency issues that are difficult to reproduce and debug. Basically, with multiple processes, you start with independent systems and add connections specifically where needed, whereas with threads, you start with completely shared state and then prune away interdependencies and concurrency until it seems to work safely. That approach makes it essentially impossible to prove that threading is safe in a given setup, except for the really trivial cases. Stefan -- https://mail.python.org/mailman/listinfo/python-list
Cookie aint retrieving when visiting happens from a backlink.
Hello i having the following code to try and retrieve the visitor's saved cookie form the browser. [CODE] # initialize cookie and retrieve cookie from clients browser try: cookie = cookies.SimpleCookie( os.environ['HTTP_COOKIE'] ) cookieID = cookie['name'].value except: cookieID = 'visitor' [/CODE] It works as expected except form the fact from when the visitor enters my webpage(superhost.gr) by clicking a backlink of another webpage. Then even if the cookie exists in his browser for some reason the try fails and except take actions. Can somebody explain why this is happening? You can see this action yourself by hitting: 1. superhost.gr as a direct hit 2. by clicking superhost.gr's backlink from ypsilandio.gr/mythosweb.gr You will see than in 2nd occasion another ebtry will appear in the database here: http://superhost.gr/?show=logpage=index.html -- https://mail.python.org/mailman/listinfo/python-list
Re: Processing large CSV files - how to maximise throughput?
On Fri, Oct 25, 2013 at 5:39 PM, Stefan Behnel stefan...@behnel.de wrote: Basically, with multiple processes, you start with independent systems and add connections specifically where needed, whereas with threads, you start with completely shared state and then prune away interdependencies and concurrency until it seems to work safely. That approach makes it essentially impossible to prove that threading is safe in a given setup, except for the really trivial cases. Not strictly true. With multiple threads, you start with completely shared global state and completely independent local state (in assembly language, shared data segment and separate stack). If you treat your globals as either read-only or carefully controlled, then it makes little difference whether you're forking processes or spinning off threads, except that with threads you don't need special data structures (IPC-based ones) for the global state. For me, threading largely grew out of the same sorts of concerns as recursion - as long as all your internal state is in locals, nothing can hurt you. Of course, it's still far easier to shoot yourself in the foot with threads than with processes, but for the tasks I've used them for, I've never found footholes; that may, however, be inherent to the simplicity of the two main jobs I used threads for: socket handling (where nearly everything's I/O bound) and worker threads spun off to let the GUI remain responsive (posting a message back to the main thread when there's a result). ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Cookie aint retrieving when visiting happens from a backlink.
On Fri, Oct 25, 2013 at 6:22 PM, Νίκος Αλεξόπουλος nikos.gr...@gmail.com wrote: Can somebody explain why this is happening? You can see this action yourself by hitting: 1. superhost.gr as a direct hit 2. by clicking superhost.gr's backlink from ypsilandio.gr/mythosweb.gr You will see than in 2nd occasion another ebtry will appear in the database here: http://superhost.gr/?show=logpage=index.html Issue closed, unable to replicate. Either something you're doing is different from what you're describing, or your browser is behaving differently. Look at the Set-Cookie headers coming back, and the subsequent Cookie headers in requests, and see what you can learn. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Re-raising a RuntimeError - good practice?
I'm surprised no-one is mentioning what seems the obvious pattern here - exception wrapping. So you define your exception class as containing the root exception. Then your specific job routines wrap the exceptions they encounter in your personal exception class. This is where you go add in specific information re: the circumstances under which the exception occurred. Then you throw your exception, which is captured at the appropriate level, and logged appropriately. The nice thing here is that you to tend to write all the exception logging in one place, instead of scattered all around. Your code looks very close to this pattern. Just raise an exception that can wrap the low level exception. -- https://mail.python.org/mailman/listinfo/python-list
Re: Maintaining a backported module
On Oct 24, 2013 9:38 PM, Terry Reedy tjre...@udel.edu wrote: On 10/24/2013 1:46 PM, Ned Batchelder wrote: On Thu, 24 Oct 2013 06:36:04 -0400, Ned Batchelder wrote: coverage.py currently runs on 2.3 through 3.4 I want to thank you for this package. I have used it when writing test modules for idlelib modules and aiming for 100% coverage forces me to really understand the code tested to hit all the conditional lines. It's been fun dropping the contortions for coverage.py 4.x, though! One request: ignore if __name__ == '__main__': clauses at the end of files, which cannot be run under coverage.py, so 100% coverage is reported as 100% instead of 9x%. Coverage already does this. You have to put it in your coveragerc. Personally I arrange to ensure that I am testing that part though. You can enable coverage for these with the pth file and the environment variable whose name temporarily escapes me. Or you can just invoke coverage directly on the script. Oscar -- https://mail.python.org/mailman/listinfo/python-list
Re: Python was designed (was Re: Multi-threading in Python vs Java)
On Monday, October 21, 2013 9:29:34 PM UTC-5, Steven D'Aprano wrote: On Mon, 21 Oct 2013 01:43:52 -0700, Peter Cacioppi wrote: Challenge: give some examples of things which you can do in Python, but cannot do *at all* in C, C++, C#, Java? Please. No exceptions is huge. No garbage collection is huge. But you can do anything with a Turing machine. You can do anything in assembly. The point is to pick the appropriate tool for the job. I can build a house without a nail gun. I can probably even build a house without a hammer. But it's a waste of time to build things with the wrong tools. -- https://mail.python.org/mailman/listinfo/python-list
Re: Cookie aint retrieving when visiting happens from a backlink.
Στις 25/10/2013 10:32 πμ, ο/η Chris Angelico έγραψε: On Fri, Oct 25, 2013 at 6:22 PM, Νίκος Αλεξόπουλος nikos.gr...@gmail.com wrote: Can somebody explain why this is happening? You can see this action yourself by hitting: 1. superhost.gr as a direct hit 2. by clicking superhost.gr's backlink from ypsilandio.gr/mythosweb.gr You will see than in 2nd occasion another ebtry will appear in the database here: http://superhost.gr/?show=logpage=index.html Issue closed, unable to replicate. Either something you're doing is different from what you're describing, or your browser is behaving differently. Look at the Set-Cookie headers coming back, and the subsequent Cookie headers in requests, and see what you can learn. There is no set of cookie returned back when visitor comes from a referer. Isn't this strange? No matter if you visit a webpage as a direct hit or via a referer the cookie on the visitor's browser should have been present. But it can only can be found and retrieved as a direct hit and _not_ from a referrer backlink. But thw browser is the same... -- What is now proved was at first only imagined! WebHost http://superhost.gr -- https://mail.python.org/mailman/listinfo/python-list
Re: Cookie aint retrieving when visiting happens from a backlink.
Στις 25/10/2013 10:32 πμ, ο/η Chris Angelico έγραψε: On Fri, Oct 25, 2013 at 6:22 PM, Νίκος Αλεξόπουλος nikos.gr...@gmail.com wrote: Can somebody explain why this is happening? You can see this action yourself by hitting: 1. superhost.gr as a direct hit 2. by clicking superhost.gr's backlink from ypsilandio.gr/mythosweb.gr You will see than in 2nd occasion another ebtry will appear in the database here: http://superhost.gr/?show=logpage=index.html Issue closed, unable to replicate. Either something you're doing is different from what you're describing, or your browser is behaving differently. Look at the Set-Cookie headers coming back, and the subsequent Cookie headers in requests, and see what you can learn. There is no set of cookie returned back when visitor comes from a referer. Isn't this strange? No matter if you visit a webpage as a direct hit or via a referer the cookie on the visitor's browser should have been present. But it can only can be found and retrieved as a direct hit and _not_ from a referrer backlink. But thw browser is the same... Why would it matter how superhost.gr is called? -- What is now proved was at first only imagined! WebHost http://superhost.gr -- https://mail.python.org/mailman/listinfo/python-list
Re: Cookie aint retrieving when visiting happens from a backlink.
On Fri, Oct 25, 2013 at 7:25 PM, Νίκος Αλεξόπουλος nikos.gr...@gmail.com wrote: Isn't this strange? No matter if you visit a webpage as a direct hit or via a referer the cookie on the visitor's browser should have been present. But it can only can be found and retrieved as a direct hit and _not_ from a referrer backlink. Trace your logs. You've been told this before; are you sure the request is even getting to your server? Fundamentally, you're caring about things that it's a LOT easier to not care about. Just let things happen, and don't try to track people so much. Not only will some people object to it (are you, for instance, complying with EU regulations about cookies?), but you're going to keep running into situations where you just *can't* track people, no matter how hard you try. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Cookie aint retrieving when visiting happens from a backlink.
Στις 25/10/2013 11:33 πμ, ο/η Chris Angelico έγραψε: On Fri, Oct 25, 2013 at 7:25 PM, Νίκος Αλεξόπουλος nikos.gr...@gmail.com wrote: Isn't this strange? No matter if you visit a webpage as a direct hit or via a referer the cookie on the visitor's browser should have been present. But it can only can be found and retrieved as a direct hit and _not_ from a referrer backlink. Trace your logs. You've been told this before; are you sure the request is even getting to your server? Please be more detailed to what you want me to check. Fundamentally, you're caring about things that it's a LOT easier to not care about. Just let things happen, and don't try to track people so much. Not only will some people object to it (are you, for instance, complying with EU regulations about cookies?), but you're going to keep running into situations where you just *can't* track people, no matter how hard you try. If an expert want to hide from my tracking of course he can use a proxy, or a TOR service, or incognito Chrome mode or whatever to bypass cookie tracking. But the usual visitors wont even know these things and their browser will accept cookies. I do this not as a way to track everybody, but to learn handling cookies, database storing of cookies ans stuff like that. But i cannot overcome this weird baclink referring visits that tend to ignore cookies stored in the browser. I need an explanation for that because it screwns my visitors databases. -- https://mail.python.org/mailman/listinfo/python-list
Re: Cookie aint retrieving when visiting happens from a backlink.
On 25/10/2013 09:46, Νίκος Αλεξόπουλος wrote: Στις 25/10/2013 11:33 πμ, ο/η Chris Angelico έγραψε: Trace your logs. You've been told this before; are you sure the request is even getting to your server? Please be more detailed to what you want me to check. Please send Chris a suitable cheque, or you could even design, build and test a site like paypal and use that to pay him, and I'm sure that he'll be happy to oblige. -- Python is the second best programming language in the world. But the best has yet to be invented. Christian Tismer Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list
Cookie aint retrieving when visiting happens from a backlink.
[code] Hello, i was happy to see that a python module for geoip2 came out. But unfortunately when i tried to install it: root@secure [~]# pip install geoip2[DB] Downloading/unpacking geoip2[db] Running setup.py egg_info for package geoip2 Traceback (most recent call last): File string, line 16, in module File /tmp/pip-build/geoip2/setup.py, line 29, in module long_description=open('README.rst').read(), File /usr/local/bin/python/lib/python3.3/encodings/ascii.py, line 26, in decode return codecs.ascii_decode(input, self.errors)[0] UnicodeDecodeError: 'ascii' codec can't decode byte 0xe7 in position 2255: ordinal not in range(128) Complete output from command python setup.py egg_info: Traceback (most recent call last): File string, line 16, in module File /tmp/pip-build/geoip2/setup.py, line 29, in module long_description=open('README.rst').read(), File /usr/local/bin/python/lib/python3.3/encodings/ascii.py, line 26, in decode return codecs.ascii_decode(input, self.errors)[0] UnicodeDecodeError: 'ascii' codec can't decode byte 0xe7 in position 2255: ordinal not in range(128) Command python setup.py egg_info failed with error code 1 in /tmp/pip-build/geoip2 Storing complete log in /root/.pip/pip.log root@secure [~]# [/code] What is wrong and the module cannot be installed? -- https://mail.python.org/mailman/listinfo/python-list
How to design:Use One TCPIP Client connection to Server and work concurrently
Hi all, The system use ONE tcpip client and connection to server. A large batch transactions send to server.I want to send to server concurrently. any idea ? In my thinking, A.Devide large batch transactions to small batch transactions. B.Create multi-thread or multiprocessing to process small transactions. C.No idea at how to control multithread using ONE client concurrently? Each small transactions do not need to wait others Thank for your suggestions. -- https://mail.python.org/mailman/listinfo/python-list
Re: How to design:Use One TCPIP Client connection to Server and work concurrently
On Fri, Oct 25, 2013 at 9:06 PM, ray yehray...@gmail.com wrote: Hi all, The system use ONE tcpip client and connection to server. A large batch transactions send to server.I want to send to server concurrently. any idea ? In my thinking, A.Devide large batch transactions to small batch transactions. B.Create multi-thread or multiprocessing to process small transactions. C.No idea at how to control multithread using ONE client concurrently? Each small transactions do not need to wait others Thank for your suggestions. Are you able to open multiple TCP/IP connections to the server and run them in parallel? If not, you're going to be limited to what the server can do for you. Otherwise, though, it's just a matter of working out how best to manage multiple connections. * You can manage everything with a single thread and asynchronous I/O. This would probably be easier if you're on Python 3.4, but it's possible with any version. * Or you can spin off threads, one for each connection. This can work nicely, but if you don't know how to get your head around threads, you may confuse yourself, as has been recently discussed in other threads (discussion threads, that is, not threads of execution - what a crackjaw language this English is!). * Or you can use the multiprocessing module and divide the work into several processes. Again, you have to figure out what you're doing where, but this can in some ways be a lot easier than threading because each process, once started, is completely separate from the others. * Or, rather than manage it within Python, you could simply start multiple independent processes. Somehow you need to figure out how to divide the transactions between them. Could be really easy, but could be quite tricky. I suspect the latter, in this case. There are many ways to do things; figuring out which is the One Obvious Way demands knowledge of what you're trying to achieve. Do any of the above options sound good to you? ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Cookie aint retrieving when visiting happens from a backlink.
Στις 25/10/2013 11:46 πμ, ο/η Νίκος Αλεξόπουλος έγραψε: Trace your logs. You've been told this before; are you sure the request is even getting to your server? what do you mean by that Chris? please be more specific. -- What is now proved was at first only imagined! WebHost http://superhost.gr -- https://mail.python.org/mailman/listinfo/python-list
Re: Cookie aint retrieving when visiting happens from a backlink.
On Fri, Oct 25, 2013 at 9:30 PM, Nick the Gr33k nikos.gr...@gmail.com wrote: Στις 25/10/2013 11:46 πμ, ο/η Νίκος Αλεξόπουλος έγραψε: Trace your logs. You've been told this before; are you sure the request is even getting to your server? what do you mean by that Chris? please be more specific. These are not Python questions. Google is your friend. Look at the web development/debugging tools you have available, look into TCP tracing (tcpdump, etc), look at your web server's logs, look at physics, look at all you can think of. [1] That is as specific as I am going to be on this list. ChrisA [1] Don't cry, or you won't be good for anything when the feast comes! -- https://mail.python.org/mailman/listinfo/python-list
Re: Processing large CSV files - how to maximise throughput?
On 25/10/2013 02:13, Chris Angelico wrote: On Fri, Oct 25, 2013 at 2:57 PM, Dave Angel da...@davea.name wrote: But I would concur -- probably they'll both give about the same speedup. I just detest the pain that multithreading can bring, and tend to avoid it if at all possible. I don't have a history of major pain from threading. Is this a Python thing, No, all my pain has been in C++. But nearly all my Python code has been written solo, so I can adopt strict rules. The problem comes that with many people's sticky fingers in the code pie, things that seem innocuous are broken once they can happen from multiple threads. And C++ does not give you any way to tell at a glance where you're asking for trouble. I've also been involved in projects that existed and were broken long before I came on the scene. Finding that something is broken when it wasn't caused by any recent change is painful. And in large, old C++ projects, memory management is convoluted. Even when not broken, sometimes performance takes big hits because multiple threads are banging at the same cache line. (using thread affinity to make sure each thread uses a consistent core) So you have a dozen memory allocation strategies, each with different rules and restrictions. or have I just been really really fortunate (growing up on OS/2 rather than Windows has definitely been, for me, a major boon)? Generally, I find threads to be convenient, though of course not always useful (especially in serialized languages). All my heavy duty multi-task/multi-thread stuff has been on Linux. And Python floats above most of the issues I'm trying to describe. E.g. you don't have to tune the memory management because it's out of your control. Still my bias persists. -- DaveA -- https://mail.python.org/mailman/listinfo/python-list
Re: Possibly better loop construct, also labels+goto important and on the fly compiler idea.
Because it's logical. If the exit condition was placed on the top, the loop would exit immediatly. Instead the desired behaviour might be to execute the code inside the loop first and then exit. Thus seperating logic into enter and exit conditions makes sense. Bye, Skybuck. -- https://mail.python.org/mailman/listinfo/python-list
Re: Processing large CSV files - how to maximise throughput?
On Fri, Oct 25, 2013 at 10:24 PM, Dave Angel da...@davea.name wrote: On 25/10/2013 02:13, Chris Angelico wrote: On Fri, Oct 25, 2013 at 2:57 PM, Dave Angel da...@davea.name wrote: But I would concur -- probably they'll both give about the same speedup. I just detest the pain that multithreading can bring, and tend to avoid it if at all possible. I don't have a history of major pain from threading. Is this a Python thing, No, all my pain has been in C++. But nearly all my Python code has been written solo, so I can adopt strict rules. The problem comes that with many people's sticky fingers in the code pie, things that seem innocuous are broken once they can happen from multiple threads. And C++ does not give you any way to tell at a glance where you're asking for trouble. Yeah, that is a big issue. And even the simple rule I mentioned earlier (keep everything on the stack) isn't sufficient when you use library functions that aren't thread-safe... even slabs of the standard library aren't, and I'm not just talking about obvious ones like strtok(). I've also been involved in projects that existed and were broken long before I came on the scene. Finding that something is broken when it wasn't caused by any recent change is painful. And in large, old C++ projects, memory management is convoluted. Even when not broken, sometimes performance takes big hits because multiple threads are banging at the same cache line. (using thread affinity to make sure each thread uses a consistent core) So you have a dozen memory allocation strategies, each with different rules and restrictions. Absolutely. Something might have just-happened to work, even for years. I came across something that would almost be brown-paper-bag quality, in my own production code at work, today; the TCP socket protocol between two processes wasn't properly looking for the newline that marks the end of the message, and would have bugged out badly if ever two messages had been combined into one socket-read call. With everything working perfectly, like on a low-latency LAN where all our testing happens, it was all safe, but if anything lagged out, it would have meant messages got lost. Yet it's been working for years without a noticed glitch. or have I just been really really fortunate (growing up on OS/2 rather than Windows has definitely been, for me, a major boon)? Generally, I find threads to be convenient, though of course not always useful (especially in serialized languages). All my heavy duty multi-task/multi-thread stuff has been on Linux. OS/2 is very Unix-like in many areas, but it doesn't have a convenient fork(), so processes are rather more fiddly to spawn than threads are. Actually, sliding from OS/2 to Linux has largely led to me sliding from threads to processes - forking a process under Linux is as easy as spinning off a thread under OS/2, and as easy to pass state to (though (obviously) harder to pass state back from). And Python floats above most of the issues I'm trying to describe. E.g. you don't have to tune the memory management because it's out of your control. Still my bias persists. Hrm yes, I can imagine running into difficulties with a non-thread-safe malloc/free implementation... I think that would rate about a 4 on the XKCD 883 scale. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Cookie aint retrieving when visiting happens from a backlink.
Στις 25/10/2013 1:51 μμ, ο/η Chris Angelico έγραψε: On Fri, Oct 25, 2013 at 9:30 PM, Nick the Gr33k nikos.gr...@gmail.com wrote: Στις 25/10/2013 11:46 πμ, ο/η Νίκος Αλεξόπουλος έγραψε: Trace your logs. You've been told this before; are you sure the request is even getting to your server? what do you mean by that Chris? please be more specific. These are not Python questions. Google is your friend. Look at the web development/debugging tools you have available, look into TCP tracing (tcpdump, etc), look at your web server's logs, look at physics, look at all you can think of. [1] That is as specific as I am going to be on this list. ChrisA [1] Don't cry, or you won't be good for anything when the feast comes! Can you reproduce this simple problem on your side to see if it behaves the same way as in me? -- What is now proved was at first only imagined! WebHost http://superhost.gr -- https://mail.python.org/mailman/listinfo/python-list
Re: Python Front-end to GCC
On Thu, Oct 24, 2013 at 8:40 PM, Mark Lawrence breamore...@yahoo.co.uk wrote: On 22/10/2013 18:37, Oscar Benjamin wrote: OTOH why in particular would you want to initialise them with zeros? I often initialise arrays to nan which is useful for debugging. Is this some kind of joke? What has this list become? -- MarkJ Tacoma, Washington -- https://mail.python.org/mailman/listinfo/python-list
Re: Cookie aint retrieving when visiting happens from a backlink.
On Fri, Oct 25, 2013 at 10:46 PM, Nick the Gr33k nikos.gr...@gmail.com wrote: Can you reproduce this simple problem on your side to see if it behaves the same way as in me? Like I said at the beginning, no it doesn't. Go forth and wield the Google. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Cookie aint retrieving when visiting happens from a backlink.
Στις 25/10/2013 3:11 μμ, ο/η Chris Angelico έγραψε: On Fri, Oct 25, 2013 at 10:46 PM, Nick the Gr33k nikos.gr...@gmail.com wrote: Can you reproduce this simple problem on your side to see if it behaves the same way as in me? Like I said at the beginning, no it doesn't. Go forth and wield the Google. ChrisA Answer me in detail an stop pointing me at vague google searchs. -- What is now proved was at first only imagined! WebHost http://superhost.gr -- https://mail.python.org/mailman/listinfo/python-list
Re: Cookie aint retrieving when visiting happens from a backlink.
On Fri, Oct 25, 2013 at 11:20 PM, Nick the Gr33k nikos.gr...@gmail.com wrote: Στις 25/10/2013 3:11 μμ, ο/η Chris Angelico έγραψε: On Fri, Oct 25, 2013 at 10:46 PM, Nick the Gr33k nikos.gr...@gmail.com wrote: Can you reproduce this simple problem on your side to see if it behaves the same way as in me? Like I said at the beginning, no it doesn't. Go forth and wield the Google. ChrisA Answer me in detail an stop pointing me at vague google searchs. No. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Cookie aint retrieving when visiting happens from a backlink.
Στις 25/10/2013 3:35 μμ, ο/η Chris Angelico έγραψε: On Fri, Oct 25, 2013 at 11:20 PM, Nick the Gr33k nikos.gr...@gmail.com wrote: Στις 25/10/2013 3:11 μμ, ο/η Chris Angelico έγραψε: On Fri, Oct 25, 2013 at 10:46 PM, Nick the Gr33k nikos.gr...@gmail.com wrote: Can you reproduce this simple problem on your side to see if it behaves the same way as in me? Like I said at the beginning, no it doesn't. Go forth and wield the Google. ChrisA Answer me in detail an stop pointing me at vague google searchs. No. ChrisA Yes, don't be lazy. -- What is now proved was at first only imagined! WebHost http://superhost.gr -- https://mail.python.org/mailman/listinfo/python-list
Re: Python Front-end to GCC
On Fri, 25 Oct 2013 04:55:43 -0700, Mark Janssen wrote: On Thu, Oct 24, 2013 at 8:40 PM, Mark Lawrence breamore...@yahoo.co.uk wrote: On 22/10/2013 18:37, Oscar Benjamin wrote: OTOH why in particular would you want to initialise them with zeros? I often initialise arrays to nan which is useful for debugging. Is this some kind of joke? What has this list become? We used to initialize RAM to 0xdeadbeef on CPU reset (and sometimes calls to free in a debugging environment) for the same reason: if a program crashesd, and I saw that value in one of the CPU registers, then I knew that some part of the program accessed uninitialized (or freed) memory. That pattern also sticks out like a sore thumb (insert your own C++/hammer joke here) in a core dump. That said, I seem to recall that somewhere along the way, ANSI C began to guarantee that certain static (in the technical sense) values were initialized to 0, or NULL, or something like that, on program startup, before any user-level code executed. Dan -- https://mail.python.org/mailman/listinfo/python-list
Re: Possibly better loop construct, also labels+goto important and on the fly compiler idea.
On 24/10/2013 21:02, Skybuck Flying wrote: Because it's logical. If the exit condition was placed on the top, the loop would exit immediatly. Instead the desired behaviour might be to execute the code inside the loop first and then exit. Thus seperating logic into enter and exit conditions makes sense. Bye, Skybuck. Are you replying to Her Majesty the Queen, President Obama or whom? What context is this in? -- Python is the second best programming language in the world. But the best has yet to be invented. Christian Tismer Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list
Re: Python Front-end to GCC
On 25/10/2013 12:55, Mark Janssen wrote: On Thu, Oct 24, 2013 at 8:40 PM, Mark Lawrence breamore...@yahoo.co.uk wrote: On 22/10/2013 18:37, Oscar Benjamin wrote: OTOH why in particular would you want to initialise them with zeros? I often initialise arrays to nan which is useful for debugging. Is this some kind of joke? What has this list become? What did *I* write? Something about real world practical programming that a text book theorist such as yourself wouldn't understand. The only snag is you haven't quoted anything that I've written. -- Python is the second best programming language in the world. But the best has yet to be invented. Christian Tismer Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list
Re: Cookie aint retrieving when visiting happens from a backlink.
On 25/10/2013 13:54, Nick the Gr33k wrote: Στις 25/10/2013 3:35 μμ, ο/η Chris Angelico έγραψε: On Fri, Oct 25, 2013 at 11:20 PM, Nick the Gr33k nikos.gr...@gmail.com wrote: Στις 25/10/2013 3:11 μμ, ο/η Chris Angelico έγραψε: On Fri, Oct 25, 2013 at 10:46 PM, Nick the Gr33k nikos.gr...@gmail.com wrote: Can you reproduce this simple problem on your side to see if it behaves the same way as in me? Like I said at the beginning, no it doesn't. Go forth and wield the Google. ChrisA Answer me in detail an stop pointing me at vague google searchs. No. ChrisA Yes, don't be lazy. I'll be blunt and to the point. Fuck off. Oh, sorry for my lack of manners, fuck off please. Now have you finally got the message? -- Python is the second best programming language in the world. But the best has yet to be invented. Christian Tismer Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list
Re: Python Front-end to GCC
On 10/25/13 7:55 AM, Mark Janssen wrote: On Thu, Oct 24, 2013 at 8:40 PM, Mark Lawrence breamore...@yahoo.co.uk wrote: On 22/10/2013 18:37, Oscar Benjamin wrote: OTOH why in particular would you want to initialise them with zeros? I often initialise arrays to nan which is useful for debugging. Is this some kind of joke? What has this list become? It's a useful debugging technique to initialize memory to distinctive values that should never occur in real data. Perhaps it better to say, pre-initialize. If the program is working correctly, then that data will be written over with actual initial values, and you'll never see the distinctive values. But if your program does encounter one of those values, it's clear that there's a bug that needs to be fixed. Additionally, if you have a number of different distinctive values, then the actual value encountered provides a clue as to what might have gone wrong. In an array of floats, initializing to NaN would be very useful, since NaNs propagate through calculations, or raise exceptions. --Ned. -- https://mail.python.org/mailman/listinfo/python-list
Re: Cookie aint retrieving when visiting happens from a backlink.
Στις 25/10/2013 5:21 μμ, ο/η Mark Lawrence έγραψε: On 25/10/2013 13:54, Nick the Gr33k wrote: Στις 25/10/2013 3:35 μμ, ο/η Chris Angelico έγραψε: On Fri, Oct 25, 2013 at 11:20 PM, Nick the Gr33k nikos.gr...@gmail.com wrote: Στις 25/10/2013 3:11 μμ, ο/η Chris Angelico έγραψε: On Fri, Oct 25, 2013 at 10:46 PM, Nick the Gr33k nikos.gr...@gmail.com wrote: Can you reproduce this simple problem on your side to see if it behaves the same way as in me? Like I said at the beginning, no it doesn't. Go forth and wield the Google. ChrisA Answer me in detail an stop pointing me at vague google searchs. No. ChrisA Yes, don't be lazy. I'll be blunt and to the point. Fuck off. Oh, sorry for my lack of manners, fuck off please. Now have you finally got the message? After you please, i insist! -- What is now proved was at first only imagined! WebHost http://superhost.gr -- https://mail.python.org/mailman/listinfo/python-list
Re: Cookie aint retrieving when visiting happens from a backlink.
On 25/10/2013 16:04, Nick the Gr33k wrote: Στις 25/10/2013 5:21 μμ, ο/η Mark Lawrence έγραψε: On 25/10/2013 13:54, Nick the Gr33k wrote: Στις 25/10/2013 3:35 μμ, ο/η Chris Angelico έγραψε: On Fri, Oct 25, 2013 at 11:20 PM, Nick the Gr33k nikos.gr...@gmail.com wrote: Στις 25/10/2013 3:11 μμ, ο/η Chris Angelico έγραψε: On Fri, Oct 25, 2013 at 10:46 PM, Nick the Gr33k nikos.gr...@gmail.com wrote: Can you reproduce this simple problem on your side to see if it behaves the same way as in me? Like I said at the beginning, no it doesn't. Go forth and wield the Google. ChrisA Answer me in detail an stop pointing me at vague google searchs. No. ChrisA Yes, don't be lazy. I'll be blunt and to the point. Fuck off. Oh, sorry for my lack of manners, fuck off please. Now have you finally got the message? After you please, i insist! Please send your CV to the Greek government, I'm sure they could be with a new chief economist, a position that is obviously far better suited to you than your current position. -- Python is the second best programming language in the world. But the best has yet to be invented. Christian Tismer Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list
Re: Cookie aint retrieving when visiting happens from a backlink.
On Fri, 25 Oct 2013 10:22:00 +0300, Νίκος Αλεξόπουλος wrote: Can somebody explain why this is happening? Yes -- it's the same answer that was given the previous time you asked this same question, 2-3 weeks ago, and it will be the same answer next time you ask too. Look back at the thread called Cookie gets changed when hit comes from a referrer. This is the same problem, and the answer remains the same. -- Steven -- https://mail.python.org/mailman/listinfo/python-list
Re: Cookie aint retrieving when visiting happens from a backlink.
On Fri, 25 Oct 2013 15:54:05 +0300, Nick the Gr33k wrote: Can you reproduce this simple problem on your side to see if it behaves the same way as in me? Like I said at the beginning, no it doesn't. Go forth and wield the Google. Answer me in detail an stop pointing me at vague google searchs. No. Yes, don't be lazy. You're the one who is too lazy to learn enough about tcp / ip and http to understand what is happening with your cookie problem, and you are calling other people lazy for not solving it. I confirmed in an earlier thread that the problem you describe does not happen on my system with my python cookie handling. Chris has confirmed that it does not happen on his system, so it must be something specific to what you are doing. The obvious step is to use a tool like wireshark to capture the tcp/ip exchanges between the server and the client, to analyse those exchanges, and to see exactly what is being sent in each direction. This is how you debug such problems. When you know what data is actually being transferred, then you can go back to software and work out why the data that you expect to be transferred isn't being transferred. Using wireshark is beyond the scope of this newsgroup, as is analysing the contents of tcp/ip packets and http requests and responses. If the client is not sending the expected cookie to the server, then the most likely problem is that the client does not associate that particular cookie with the server url. If this is the case, then the problem is that when you initially sent the cookie to the client, you did not define the server url in the cookie in a manner that would cause the client to associate the cookie with the url in the subsequent request. This is not a python problem, it's an http cookies problem, and the answer lies in the cookie you are creating. Or you can extract the cookie from the cookie jar in the client (again not a python issue, so don't ask how to do it here) and look for an http forum where you can ask why cookie x isn't applied to server y. This is not that forum. Oh look, that's almost the same advice I gave you about 10 days ago! So you've spent 10 days ignoring my advice, and then you call Chris lazy. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list
Re: Cookie aint retrieving when visiting happens from a backlink.
On Fri, 25 Oct 2013 12:50:47 +0300, Νίκος Αλεξόπουλος wrote: Hello, i was happy to see that a python module for geoip2 came out. What has this got to do with your cookies problem? UnicodeDecodeError: 'ascii' codec can't decode byte 0xe7 in position 2255: ordinal not in range(128) What is wrong and the module cannot be installed? 'ascii' codec can't decode byte 0xe7 in position 2255: ordinal not in range(128) Hmm, let me try and phrase this in a way you might understand: You fed poison to baby. Baby got sick and died. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list
Re: Cookie aint retrieving when visiting happens from a backlink.
On Sat, Oct 26, 2013 at 2:13 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Fri, 25 Oct 2013 10:22:00 +0300, Νίκος Αλεξόπουλος wrote: Can somebody explain why this is happening? Yes -- it's the same answer that was given the previous time you asked this same question, 2-3 weeks ago, and it will be the same answer next time you ask too. It's like an Augury or Divination. http://www.dandwiki.com/wiki/SRD:Divination As with augury, multiple divinations about the same topic by the same caster use the same dice result as the first divination spell and yield the same answer each time. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Cookie aint retrieving when visiting happens from a backlink.
Στις 25/10/2013 6:17 μμ, ο/η Denis McMahon έγραψε: If the client is not sending the expected cookie to the server, then the most likely problem is that the client does not associate that particular cookie with the server url. If this is the case, then the problem is that when you initially sent the cookie to the client, you did not define the server url in the cookie in a manner that would cause the client to associate the cookie with the url in the subsequent request. This is not a python problem, it's an http cookies problem, and the answer lies in the cookie you are creating. Assiciate the cookie with the url? You mean add a domain directive to the cookie like: # initialize cookie and retrieve cookie from clients browser try: cookie = cookies.SimpleCookie( os.environ['HTTP_COOKIE'] ) cookieID = cookie['name'].value except: cookieID = random.randrange(0, ) cookie['ID'] = cookieID cookie['ID']['domain'] = superhost.gr cookie['ID']['path'] = '/' print( cookie ) If this is how you mean it does not solve anything, problem persits. I googled lots of hours and days about this but this is not mentioned in any thread and i', stuck. -- https://mail.python.org/mailman/listinfo/python-list
Re: Cookie aint retrieving when visiting happens from a backlink.
On Sat, Oct 26, 2013 at 2:29 AM, Nick the Gr33k nikos.gr...@gmail.com wrote: Assiciate the cookie with the url? You mean add a domain directive to the cookie like: Do you understand: 1) what cookies are? 2) how the browser receives them? 3) how the server gets them back? 4) when #3 happens and when it does not? If not, go to Wikipedia and start reading. If you get to the end of Wikipedia without comprehending this, go back to the beginning and start over. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Cookie aint retrieving when visiting happens from a backlink.
On Fri, Oct 25, 2013 at 11:34 AM, Chris Angelico ros...@gmail.com wrote: On Sat, Oct 26, 2013 at 2:29 AM, Nick the Gr33k nikos.gr...@gmail.com wrote: Assiciate the cookie with the url? You mean add a domain directive to the cookie like: Do you understand: 1) what cookies are? 2) how the browser receives them? 3) how the server gets them back? 4) when #3 happens and when it does not? If not, go to Wikipedia and start reading. If you get to the end of Wikipedia without comprehending this, go back to the beginning and start over. ChrisA -- https://mail.python.org/mailman/listinfo/python-list Chris is too kind. Go to wikipedia. and then go for a walk.. don't come back here -- Joel Goldstick http://joelgoldstick.com -- https://mail.python.org/mailman/listinfo/python-list
Re: Cookie aint retrieving when visiting happens from a backlink.
Στις 25/10/2013 6:36 μμ, ο/η Joel Goldstick έγραψε: On Fri, Oct 25, 2013 at 11:34 AM, Chris Angelico ros...@gmail.com wrote: On Sat, Oct 26, 2013 at 2:29 AM, Nick the Gr33k nikos.gr...@gmail.com wrote: Assiciate the cookie with the url? You mean add a domain directive to the cookie like: Do you understand: 1) what cookies are? 2) how the browser receives them? 3) how the server gets them back? 4) when #3 happens and when it does not? If not, go to Wikipedia and start reading. If you get to the end of Wikipedia without comprehending this, go back to the beginning and start over. ChrisA -- https://mail.python.org/mailman/listinfo/python-list Chris is too kind. Go to wikipedia. and then go for a walk.. don't come back here if he was too kind liek you say,he wouldn't give vague ideas of help like google , or wiki it. he would provide actual testing code so to know what the fuck is goidn wrong with it. -- What is now proved was at first only imagined! WebHost http://superhost.gr -- https://mail.python.org/mailman/listinfo/python-list
Why does lzma hangs for a very long time when run in parallel using python's muptiprocessing module?
When trying to run lzma in parallel (see the code below) it hangs for a very long time. The non-parallel version of the code using map() works fine as shown in the code below. Python 3.3.2 [GCC 4.6.3] on linux import lzmafrom functools import partialimport multiprocessing def run_lzma(data,c): return c.compress(data) def split_len(seq, length): return [str.encode(seq[i:i+length]) for i in range(0, len(seq), length)] def lzma_mp(sequence,threads=3): lzc = lzma.LZMACompressor() blocksize = int(round(len(sequence)/threads)) strings = split_len(sequence, blocksize) lzc_partial = partial(run_lzma,c=lzc) pool=multiprocessing.Pool() lzc_pool = list(pool.map(lzc_partial,strings)) pool.close() pool.join() out_flush = lzc.flush() return b.join(lzc_pool + [out_flush]) sequence = 'AJKGJFKSHFKLHALWEHAIHWEOIAH IOAHIOWEHIOHEIOFEAFEASFEAFWEWEWFQWEWQWQGEWQFEWFDWEWEGEFGWEG' lzma_mp(sequence,threads=3) When using lzma and the map function it works fine. threads=3 blocksize = int(round(len(sequence)/threads)) strings = split_len(sequence, blocksize) lzc = lzma.LZMACompressor() out = list(map(lzc.compress,strings)) out_flush = lzc.flush() result = b.join(out + [out_flush]) lzma.compress(str.encode(sequence)) lzma.compress(str.encode(sequence)) == result Map using partial function works fine as well. lzc = lzma.LZMACompressor() lzc_partial = partial(run_lzma,c=lzc) out = list(map(lzc_partial,strings)) out_flush = lzc.flush() result = b.join(out + [out_flush]) -- https://mail.python.org/mailman/listinfo/python-list
Re: Cookie aint retrieving when visiting happens from a backlink.
On 25/10/2013 16:34, Chris Angelico wrote: Do you understand: 1) what cookies are? 2) how the browser receives them? 3) how the server gets them back? 4) when #3 happens and when it does not? If not, go to Wikipedia and start reading. If you get to the end of Wikipedia without comprehending this, go back to the beginning and start over. ChrisA Chris, You truly are a saint! I simply cannot believe the level of restraint you have shown during this exchange (unless of course you have bought tickets to Greece in order to deal with this issue in person and 'with extreme prejudice'). As for the OP - Nick, I think your utterly ignorant rudeness to Chris will have alienated the entire membership of this list and you should seriously consider a carefully worded apology. This list does not exist to teach you how to run a website or to write software for it. This list does not exist to explain every single aspect of network and web technology to someone who openly admits that they prefer to get answers from list members without doing any personal research. This list exists to provide mutual to support members in their personal usage of and research into Python. Most importantly, any contribution comes free of charge and you should recognise this gift and remember to use 'please and thank you' instead of 'don't be lazy'. If you want to be respected by this group, you need to substantially change your attitude and start to do some research of your own before posting questions on this or any other list. Steve -- https://mail.python.org/mailman/listinfo/python-list
Re: Python was designed (was Re: Multi-threading in Python vs Java)
On 25/10/2013 07:14, wxjmfa...@gmail.com wrote: [snip all the double spaced crap - please read, digest and action this https://wiki.python.org/moin/GoogleGroupsPython] Use one of the coding schemes endorsed by Unicode. As I personally know nothing about unicode for the unenlightened such as myself please explain this statement with respect to the fsr. If a dev is not able to see a non ascii char may use 10 bytes more than an ascii char Are you saying that an ascii char takes a byte but a non ascii char takes up to 11? If yes please state where the evidence of this is. If no please state what you are saying. or a dev is not able to see there may be a regression of a factor 1, 2, 3, 5 or more simply by using non ascii char, I really do not see now I can help. Are you saying that the fsr causes a speed regression of this order? If yes please state where the evidence of this is. If no please state what you are saying. Neither I can force people to understand unicode. Very true, I certainly don't. I recieved a ton a private emails, even from core devs Please provide examples of these. If you have to name names, out of courtesy all you neeed do is ensure that they're given copies of anything that you say. and as one wrote, this has not been seriously tested. Surely any core dev would simply have raised an issue on the bug tracker? Why are they sending you private emails on this subject? Even today on the misc. lists some people are suggesting to write to add more tests. What are these misc. lists? Why suggest, why not write? All the tools I'm aware of, are using unicode very smoothly (even utf-8 tools), Python not. Please provide evidence to support this statement. That's the status. This FSR fails. Period. Please provide evidence to support this statement. jmf -- Python is the second best programming language in the world. But the best has yet to be invented. Christian Tismer Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list
Re: Cookie aint retrieving when visiting happens from a backlink.
On 25/10/2013 17:28, Steve Simmons wrote: On 25/10/2013 16:34, Chris Angelico wrote: Do you understand: 1) what cookies are? 2) how the browser receives them? 3) how the server gets them back? 4) when #3 happens and when it does not? If not, go to Wikipedia and start reading. If you get to the end of Wikipedia without comprehending this, go back to the beginning and start over. ChrisA Chris, You truly are a saint! I simply cannot believe the level of restraint you have shown during this exchange (unless of course you have bought tickets to Greece in order to deal with this issue in person and 'with extreme prejudice'). Hear hear. Sadly I cannot say the same for myself. Sorry folks :( As for the OP - Nick, I think your utterly ignorant rudeness to Chris will have alienated the entire membership of this list and you should seriously consider a carefully worded apology. This list does not exist to teach you how to run a website or to write software for it. This list does not exist to explain every single aspect of network and web technology to someone who openly admits that they prefer to get answers from list members without doing any personal research. This list exists to provide mutual to support members in their personal usage of and research into Python. Most importantly, any contribution comes free of charge and you should recognise this gift and remember to use 'please and thank you' instead of 'don't be lazy'. If you want to be respected by this group, you need to substantially change your attitude and start to do some research of your own before posting questions on this or any other list. Steve Thanks for this, it's helped bring me back to the world of reality. -- Python is the second best programming language in the world. But the best has yet to be invented. Christian Tismer Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list
Re: Python Front-end to GCC
OTOH why in particular would you want to initialise them with zeros? I often initialise arrays to nan which is useful for debugging. Is this some kind of joke? What has this list become? It's a useful debugging technique to initialize memory to distinctive values that should never occur in real data. If you're doing this, you're doing something wrong. Please give me the hex value for NaN so I can initialize with my array. -- MarkJ Tacoma, Washington -- https://mail.python.org/mailman/listinfo/python-list
Re: Python Front-end to GCC
On 25/10/2013 19:26, Mark Janssen wrote: OTOH why in particular would you want to initialise them with zeros? I often initialise arrays to nan which is useful for debugging. Is this some kind of joke? What has this list become? It's a useful debugging technique to initialize memory to distinctive values that should never occur in real data. If you're doing this, you're doing something wrong. Please give me the hex value for NaN so I can initialize with my array. It is clear that you know as much about debugging as you do about objects and message passing, a summary here for the uninitiated http://code.activestate.com/lists/python-ideas/19908/. I can see why the BDFL described you as an embarrassment, and if he didn't, he certainly should have done. -- Python is the second best programming language in the world. But the best has yet to be invented. Christian Tismer Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list
Re: Python Front-end to GCC
OTOH why in particular would you want to initialise them with zeros? I often initialise arrays to nan which is useful for debugging. Is this some kind of joke? What has this list become? It's a useful debugging technique to initialize memory to distinctive values that should never occur in real data. If you're doing this, you're doing something wrong. Please give me the hex value for NaN so I can initialize with my array. It is clear that you know as much about debugging as you do about objects and message passing [...] can see why the BDFL described you as an embarrassment, and if he didn't, he certainly should have done. Clearly the python list has been taken over by TheKooks. Notice he did not respond to the request. Since we are talking about digital computers (with digital memory), I'm really curious what the hex value for NaN is to initialize my arrays All hail chairman Meow. Dismissed. -- MarkJ Tacoma, Washington -- https://mail.python.org/mailman/listinfo/python-list
Re: Possibly better loop construct, also labels+goto important and on the fly compiler idea.
Dave said : Include a quote from whomever you're responding to, and we might actually take you seriously. And of course, make sure you don't delete the attribution. This forum is working for me. One of the more frequent and sophisticated posters emailed me saying he appreciates my contributions. I'm sorry I'm putting in a bustle in your hedgerow (just a little bit sorry) but I've got 20 balls in the air right now and I haven't got around to configuring a proper client for this feed. The default Google Group client is notoriously cruddy with quotes attribution. Some readers can discern context from the previous posts. That's sort of what the word context means. But I understand this skill isn't universal. If it makes you feel better, I'm mostly lurking/learning and just posting on areas where I have expertise. Thanks for letting me off with a warning officer, I'll do better next time. -- https://mail.python.org/mailman/listinfo/python-list
Re: Python Front-end to GCC
On Saturday, October 26, 2013 12:15:43 AM UTC+5:30, zipher wrote: Clearly the python list has been taken over by TheKooks. Notice he did not respond to the request. Since we are talking about digital computers (with digital memory), I'm really curious what the hex value for NaN is to initialize my arrays I dont see how thats any more relevant than: Whats the hex value of the add instruction? Presumably floating point numbers are used for FP operations FP operations barf on nans So a mis-initialized array in which a nan shows up can be easily caught Yes nans are not one value but a class http://docs.oracle.com/cd/E19957-01/806-3568/ncg_math.html but so what? -- https://mail.python.org/mailman/listinfo/python-list
Re: Python Front-end to GCC
On 25/10/2013 19:45, Mark Janssen wrote: OTOH why in particular would you want to initialise them with zeros? I often initialise arrays to nan which is useful for debugging. Is this some kind of joke? What has this list become? It's a useful debugging technique to initialize memory to distinctive values that should never occur in real data. If you're doing this, you're doing something wrong. Please give me the hex value for NaN so I can initialize with my array. It is clear that you know as much about debugging as you do about objects and message passing [...] can see why the BDFL described you as an embarrassment, and if he didn't, he certainly should have done. Clearly the python list has been taken over by TheKooks. Notice he did not respond to the request. Since we are talking about digital computers (with digital memory), I'm really curious what the hex value for NaN is to initialize my arrays All hail chairman Meow. Dismissed. Reinstating http://code.activestate.com/lists/python-ideas/19908/ where you're described as a quack, which I assume in this context makes you an expert on duck typing, which should obviously be abbreviated to ducking. As for the hex value for Nan who really gives a toss? The whole point is that you initialise to something that you do not expect to see. Do you not have a text book that explains this concept? -- Python is the second best programming language in the world. But the best has yet to be invented. Christian Tismer Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list
Re: Python Front-end to GCC
On Fri, Oct 25, 2013 at 11:59 AM, rusi rustompm...@gmail.com wrote: On Saturday, October 26, 2013 12:15:43 AM UTC+5:30, zipher wrote: Clearly the python list has been taken over by TheKooks. Notice he did not respond to the request. Since we are talking about digital computers (with digital memory), I'm really curious what the hex value for NaN is to initialize my arrays I dont see how thats any more relevant than: Whats the hex value of the add instruction? You don't see. That is correct. Btw, I believe the hex value for the add instruction on the (8-bit) Intel 8088 is x0. Now what were you saying? -- MarkJ Tacoma, Washington -- https://mail.python.org/mailman/listinfo/python-list
Re: Python Front-end to GCC
On 2013-10-25, Mark Janssen dreamingforw...@gmail.com wrote: OTOH why in particular would you want to initialise them with zeros? I often initialise arrays to nan which is useful for debugging. Is this some kind of joke? What has this list become? It's a useful debugging technique to initialize memory to distinctive values that should never occur in real data. If you're doing this, you're doing something wrong. Pardon me if I don't take your word for it. Please give me the hex value for NaN so I can initialize with my array. Seriously? You haven't discovered google and wikepedia yet? http://www.google.com/ http://en.wikipedia.org/ Assuming you're using IEEE-754, all 1's is a quiet NaN: http://en.wikipedia.org/wiki/IEEE_floating_point http://en.wikipedia.org/wiki/NaN If you want a signaling NaN you've got to change one of the bits (see the above links). IIRC, the Pascal language required that using unintialized variables caused an error. intializing FP values to a signalling NaN is a very convenient way to do that. -- Grant Edwards grant.b.edwardsYow! I'm also against at BODY-SURFING!! gmail.com -- https://mail.python.org/mailman/listinfo/python-list
Re: Python Front-end to GCC
As for the hex value for Nan who really gives a toss? The whole point is that you initialise to something that you do not expect to see. Do you not have a text book that explains this concept? No, I don't think there is a textbook that explains such a concept of initializing memory to anything but 0 -- UNLESS you're from Stupid University. Thanks for providing fodder... Mark Janssen, Ph.D. Tacoma, WA -- https://mail.python.org/mailman/listinfo/python-list
Re: Python Front-end to GCC
On Saturday, October 26, 2013 12:39:09 AM UTC+5:30, zipher wrote: On Fri, Oct 25, 2013 at 11:59 AM, rusi wrote: I dont see how thats any more relevant than: Whats the hex value of the add instruction? You don't see. That is correct. Btw, I believe the hex value for the add instruction on the (8-bit) Intel 8088 is x0. Now what were you saying? There are a dozen different (hex values) for the add instruction -- depending on operand sizes/directions/immediate-operand/special-registers etc. So just as there is one add instruction with many hex values there is one nan as a concept with many different hex values. Are you arguing for the sake of arguing? If so lets at least agree on what you are arguing about!! -- https://mail.python.org/mailman/listinfo/python-list
Re: Python Front-end to GCC
On 25/10/2013 20:18, Mark Janssen wrote: As for the hex value for Nan who really gives a toss? The whole point is that you initialise to something that you do not expect to see. Do you not have a text book that explains this concept? No, I don't think there is a textbook that explains such a concept of initializing memory to anything but 0 -- UNLESS you're from Stupid University. Thanks for providing fodder... Mark Janssen, Ph.D. Tacoma, WA We've been discussing *DEBUGGING*. If you can't be bothered to read what's written please do not respond. -- Python is the second best programming language in the world. But the best has yet to be invented. Christian Tismer Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list
decorators and mangled names for private methods
Given the following example 2.7 code: from functools import wraps class require_keys: def __init__(self, *keys): self.keys = keys def __call__(decorator_self, fn): @wraps(fn) def result_fn(method_self, *args, **kwargs): # import pdb; pdb.set_trace() req = method_self.__private() for key in decorator_self.keys: if key not in req: raise ValueError(Missing [%s] parameter % key) return fn(method_self, *args, **kwargs) return result_fn class Foo(object): def __init__(self, *params): self.params = params self.__private = params * 2 def __private(self, *args, **kwargs): return self.__private @require_keys(hello, world) def action(self): print self.params f1 = Foo(hello, world) f1.action() f2 = Foo(world) f2.action() I'm surprised to get the exception: Traceback (most recent call last): File dec_examp.py, line 28, in module f1.action() File dec_examp.py, line 10, in result_fn req = method_self.__private() AttributeError: 'Foo' object has no attribute '_require_keys__private' For some reason, it's looking for _require_keys__private (which obviously doesn't exist) instead of _Foo__private which exists and would be what I expect. What am I missing here? Why is the decorator class finding the wrong private-scope? Thanks, -tkc -- https://mail.python.org/mailman/listinfo/python-list
Re: Python Front-end to GCC
As for the hex value for Nan who really gives a toss? The whole point is that you initialise to something that you do not expect to see. Do you not have a text book that explains this concept? No, I don't think there is a textbook that explains such a concept of initializing memory to anything but 0 -- UNLESS you're from Stupid University. Thanks for providing fodder... We've been discussing *DEBUGGING*. Are you making it LOUD and *clear* that you don't know what you're talking about? Input: Yes/no MarkJanssen -- https://mail.python.org/mailman/listinfo/python-list
Re: decorators and mangled names for private methods
Tim Chase wrote: Given the following example 2.7 code: from functools import wraps class require_keys: def __init__(self, *keys): self.keys = keys def __call__(decorator_self, fn): @wraps(fn) def result_fn(method_self, *args, **kwargs): # import pdb; pdb.set_trace() req = method_self.__private() The above __private literal is in the (statically determined) scope of the require_keys class and therefore magically mangled to _require_keys__private. Unfortunately I can't think of an elegant way to work around that... for key in decorator_self.keys: if key not in req: raise ValueError(Missing [%s] parameter % key) return fn(method_self, *args, **kwargs) return result_fn class Foo(object): def __init__(self, *params): self.params = params self.__private = params * 2 def __private(self, *args, **kwargs): return self.__private @require_keys(hello, world) def action(self): print self.params f1 = Foo(hello, world) f1.action() f2 = Foo(world) f2.action() I'm surprised to get the exception: Traceback (most recent call last): File dec_examp.py, line 28, in module f1.action() File dec_examp.py, line 10, in result_fn req = method_self.__private() AttributeError: 'Foo' object has no attribute '_require_keys__private' For some reason, it's looking for _require_keys__private (which obviously doesn't exist) instead of _Foo__private which exists and would be what I expect. What am I missing here? Why is the decorator class finding the wrong private-scope? Thanks, -tkc -- https://mail.python.org/mailman/listinfo/python-list
Don't use default Google Group client (was re:....)
On 10/25/2013 2:57 PM, Peter Cacioppi wrote: The default Google Group client is notoriously cruddy with quotes attribution. So don't use it. Get any decent newsreader, such as Thunderbird, and access the list at news.gmane.org as gmane.comp.python.general. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list
Re: Python Front-end to GCC
We've been discussing *DEBUGGING*. Are you making it LOUD and *clear* that you don't know what you're talking about? Input: Yes/no no Now please explain what you do not understand about the data below that's been written by Oscar Benjamin, myself and Ned Batchelder, specifically the use of the word *DEBUGGING*. Is this a word that does not appear in your text books? Yes. And how do I explain what I do NOT understand? If that is in fact the case would you like one of the experienced practical programmers on this list to explain it to you? N/A Have you ever bothered to read The Zen of Python, specifically the bit about Practicality beats purity? Yes, I have. And if you have read that, you know that preceding that is the rule Special cases aren't enough to break the rules. You sir, have broken the rules, you should not be preaching practicality if you don't know the rules. Now take your choir boys there and sit down. Mark P.S. In his book Writing Solid Code Steve Maguire states that he initialises with 0xA3 for Macintosh programs, and that Microsoft uses 0xCC, for exactly the reasons that you describe above. I will be glad to discuss all these arcane measures, when you aren't all being asswipes. It's a useful debugging technique to initialize memory to distinctive values that should never occur in real data. As I said, you're going something wrong. Python is the second best programming language in the world. But the best has yet to be invented. Christian Tismer When you're ready to make Python the best programming language in the world, re-engage. -- MarkJ Tacoma, Washington -- https://mail.python.org/mailman/listinfo/python-list
Re: Python Front-end to GCC
On 26 October 2013 06:18, Mark Janssen dreamingforw...@gmail.com wrote: As for the hex value for Nan who really gives a toss? The whole point is that you initialise to something that you do not expect to see. Do you not have a text book that explains this concept? No, I don't think there is a textbook that explains such a concept of initializing memory to anything but 0 -- UNLESS you're from Stupid University. Thanks for providing fodder... I know I'm replying to a someone who has trolled many threads over multiple years ... or as I'm now starting to suspect, possibly a bot, but I'll give him (it?) this one chance to show the capability to read and learn. http://en.wikipedia.org/wiki/Hexspeak Search for 0xBAADF00D; 0xBADDCAFE; and (in particular) OxDEADBEEF. These are historical examples of this technique used by major companies. Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list
Re: Python Front-end to GCC
On 25/10/2013 21:11, Tim Delaney wrote: On 26 October 2013 06:18, Mark Janssen dreamingforw...@gmail.com mailto:dreamingforw...@gmail.com wrote: As for the hex value for Nan who really gives a toss? The whole point is that you initialise to something that you do not expect to see. Do you not have a text book that explains this concept? No, I don't think there is a textbook that explains such a concept of initializing memory to anything but 0 -- UNLESS you're from Stupid University. Thanks for providing fodder... I know I'm replying to a someone who has trolled many threads over multiple years ... or as I'm now starting to suspect, possibly a bot, but I'll give him (it?) this one chance to show the capability to read and learn. http://en.wikipedia.org/wiki/Hexspeak Search for 0xBAADF00D; 0xBADDCAFE; and (in particular) OxDEADBEEF. These are historical examples of this technique used by major companies. Tim Delaney I can't see it being a bot on the grounds that a bot wouldn't be smart enough to snip a URL that referred to itself as a quack. Mind you, the thought of a bot with a Ph.D. is mind boggling. Must have been an absolutely amazing sheep dip to have graduated from, but the Bruces were incredible professors :) Thanks for the link by the way. -- Python is the second best programming language in the world. But the best has yet to be invented. Christian Tismer Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list
Re: Python Front-end to GCC
On 25/10/2013 21:29, Mark Janssen wrote: We've been discussing *DEBUGGING*. Are you making it LOUD and *clear* that you don't know what you're talking about? Input: Yes/no no Now please explain what you do not understand about the data below that's been written by Oscar Benjamin, myself and Ned Batchelder, specifically the use of the word *DEBUGGING*. Is this a word that does not appear in your text books? Yes. And how do I explain what I do NOT understand? If that is in fact the case would you like one of the experienced practical programmers on this list to explain it to you? N/A Have you ever bothered to read The Zen of Python, specifically the bit about Practicality beats purity? Yes, I have. And if you have read that, you know that preceding that is the rule Special cases aren't enough to break the rules. You sir, have broken the rules, you should not be preaching practicality if you don't know the rules. Now take your choir boys there and sit down. Mark P.S. In his book Writing Solid Code Steve Maguire states that he initialises with 0xA3 for Macintosh programs, and that Microsoft uses 0xCC, for exactly the reasons that you describe above. I will be glad to discuss all these arcane measures, when you aren't all being asswipes. It's a useful debugging technique to initialize memory to distinctive values that should never occur in real data. As I said, you're going something wrong. Python is the second best programming language in the world. But the best has yet to be invented. Christian Tismer When you're ready to make Python the best programming language in the world, re-engage. Please show rather less arrogance. Or are you upset at me as I've reminded you and told everybody else that you've been referred to on a Python list as a quack? I do admit that in your case I find quack very suitable, it has a ring to it that far outweighs troll, which Tim Delany has used fairly recently. -- Python is the second best programming language in the world. But the best has yet to be invented. Christian Tismer Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list
Re: Python Front-end to GCC
On 26 October 2013 07:36, Mark Lawrence breamore...@yahoo.co.uk wrote: I can't see it being a bot on the grounds that a bot wouldn't be smart enough to snip a URL that referred to itself as a quack. My thought based on some of the responses is that they seem auto-generated, then tweaked - so not a bot per-se, but verging on it. But OTOH, it can also be explained away entirely by (as you previously noted) the Dunning-Kruger effect, with the same uninformed responses trotted out to everything. Not necessarily a troll as I injudiciously claimed in my previous post (I'd just woken up after 4 hours sleep - my apologies to the list). Anyway, not going to get sucked into this bottomless hole. Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list
Re: Python Front-end to GCC
On 25/10/2013 21:48, Tim Delaney wrote: But OTOH, it can also be explained away entirely by (as you previously noted) the Dunning-Kruger effect, with the same uninformed responses trotted out to everything. It was rusi who first mentioned this, I merely replied in my normal dead pan way. Slight aside, I spelt your surname incorrectly a few minutes ago whilst replying elsewhere, I do apologise. -- Python is the second best programming language in the world. But the best has yet to be invented. Christian Tismer Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list
Re: Python Front-end to GCC
But OTOH, it can also be explained away entirely by (as you previously noted) the Dunning-Kruger effect, with the same uninformed responses trotted out to everything. It was rusi who first mentioned this, I merely replied in my normal dead pan way. Slight aside, I spelt your surname incorrectly a few minutes ago whilst replying elsewhere, I do apologise. What is this? The circle-jerk list? I make some points on the last couple of threads and you all get bent-out of shape, then gather around each other as if you're all in a cancer ward -- MarkJ Tacoma, Washington -- https://mail.python.org/mailman/listinfo/python-list
Re: Possibly better loop construct, also labels+goto important and on the fly compiler idea.
On Fri, 25 Oct 2013 19:57:37 +0100, Peter Cacioppi peter.cacio...@gmail.com wrote: Some readers can discern context from the previous posts. That's sort of what the word context means. But I understand this skill isn't universal. Some readers are reading this forum as a mailing list or Usenet newsgroup. Google groups seems to delight in making the previous post a poorly defined concept (by gratuitously breaking reference chains and the like). It's not that the skill isn't universal, it's that the opportunity isn't. -- Rhodri James *-* Wildebeest Herder to the Masses -- https://mail.python.org/mailman/listinfo/python-list
Re: Python Front-end to GCC
On 25/10/2013 22:02, Mark Janssen wrote: But OTOH, it can also be explained away entirely by (as you previously noted) the Dunning-Kruger effect, with the same uninformed responses trotted out to everything. It was rusi who first mentioned this, I merely replied in my normal dead pan way. Slight aside, I spelt your surname incorrectly a few minutes ago whilst replying elsewhere, I do apologise. What is this? The circle-jerk list? I make some points on the last couple of threads and you all get bent-out of shape, then gather around each other as if you're all in a cancer ward Will you please do yourself a favour and get a new dealer before you do some real damage, the batch you're currently on is definitely contaminated. -- Python is the second best programming language in the world. But the best has yet to be invented. Christian Tismer Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list
Add committers according to codeaccess.txt
You want to merge codeaccess.txt to the Misc/ACKS file. Here's a list (just look at the sixth line for the names of committers). https://wesnoth-contribcommunity.googlecode.com/svn/codeaccess.txt The mailing list (python-list) has been spammed for many years. Here's some spam posts. https://mail.python.org/pipermail/python-list/2002-May/144625.html https://mail.python.org/pipermail/python-list/2002-June/127033.html https://mail.python.org/pipermail/python-list/2002-June/136070.html You also want to grant permission to login to your Python Issue Tracker account (taewong.seo). -- https://mail.python.org/mailman/listinfo/python-list
Re: Add committers according to codeaccess.txt
On 25/10/2013 22:24, Tae Wong wrote: You want to merge codeaccess.txt to the Misc/ACKS file. Here's a list (just look at the sixth line for the names of committers). https://wesnoth-contribcommunity.googlecode.com/svn/codeaccess.txt The mailing list (python-list) has been spammed for many years. Here's some spam posts. https://mail.python.org/pipermail/python-list/2002-May/144625.html https://mail.python.org/pipermail/python-list/2002-June/127033.html https://mail.python.org/pipermail/python-list/2002-June/136070.html You also want to grant permission to login to your Python Issue Tracker account (taewong.seo). Was this meant for the bug tracker? -- Python is the second best programming language in the world. But the best has yet to be invented. Christian Tismer Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list
Re: Python Front-end to GCC
On Fri, Oct 25, 2013 at 2:07 PM, Ned Batchelder n...@nedbatchelder.com wrote: (Offlist) Mark, these conversations would go much more smoothly if you would make direct statements about technical points. Your messages are usually insinuating questions, or personal insults. Yes, thank you. That is correct. For example, you said: Please give me the hex value for NaN so I can initialize with my array. I think what you meant by this was: I don't think there is a hex value that represents NaN. Why not say that? Why? Because I know there's not a hex value for NaN, otherwise it would confuse the abstraction of what a computer is. Any hex digit you could attempt to obscure would be translatable as a number, and therefore a contradiction. Is that a good enough reason for ya? Then we could talk about your claim. How about we talk about my claim with facts instead of attempts at creating reality a la NovusOrdoSeclorum? You could even go so far as to admit that others might know things you don't, and ask, is there a hex value that represents NaN, I didn't realize there was? How sweet. Do you like makeup? We could have a discussion about the concepts involved. As it is, the threads devolve into name calling, topic-changing non-sequiturs, and silly sound effects. You seem to start with the assumption that you are right and everyone else is wrong, and begin with snark. I'm still waiting on the binary-digit lexer, Ned. There really are people on the list who know a lot about software and computer science, including the people you are currently calling known-nothings. I don't know if you are personally qualified for the latter, but agree somewhat on the part of software. These things are true: There are hex values that represent NaNs. Why don't you follow your own advice? Instead of These things are true: Why don't you say These things could be true OR *I* believe that hex values could be used to represent NaN? Tell us, which hex value is used to represent NaN? (thoughts to self: all-ones wouldn't make a very good magic number for finding errors, so I wonder what Ned will dream up (btw: I'm not gay)). Note that, just for the record, I was talking strictly about memory (RAM), not variable assignments. Non-Turing-complete languages can be compiled to C. ASTs don't have enough information to compile to machine code. Please tell us then, what IS enough information to compile to machine code? ...rather than just saying that AST's don't have enough information to compile to machine code Data on punched cards can be tokenized. All of these things are true. *rolls eyes* You seem to be a seeker of truth. Why not listen to others? Yes, now listening -- MarkJ Tacoma, Washington -- https://mail.python.org/mailman/listinfo/python-list
Re: Add committers according to codeaccess.txt
Here is the bug tracker's main page. http://bugs.python.org/ You are not subscribed to this mailing list. -- Tae Wong -- https://mail.python.org/mailman/listinfo/python-list
Re: Python Front-end to GCC
On 25/10/2013 22:37, Mark Janssen wrote: I'm still waiting on the binary-digit lexer, Ned. The whole Python world is still waiting on your response to this http://code.activestate.com/lists/python-ideas/19908/. You were asked three times originally to respond. I've referenced this twice yet you have conveniently ignored all five requests and will presumably ignore this. What's the problem, cat got your typing fingers? Or don't you have the guts to admit that you were talking bollocks? -- Python is the second best programming language in the world. But the best has yet to be invented. Christian Tismer Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list
Re: Python Front-end to GCC
On Friday 2013 October 25 14:11, Mark Lawrence wrote: Will you please do yourself a favour and get a new dealer before you do some real damage, the batch you're currently on is definitely contaminated. Meet Mark Janssen: http://sourceforge.net/apps/mediawiki/pangaia/index.php?title=User:Average -- Yonder nor sorghum stenches shut ladle gulls stopper torque wet strainers. -- https://mail.python.org/mailman/listinfo/python-list
Re: Add committers according to codeaccess.txt
On 25/10/2013 22:46, Tae Wong wrote: Here is the bug tracker's main page. http://bugs.python.org/ You are not subscribed to this mailing list. Oh dear how sad. But who are you talking to and what about? -- Python is the second best programming language in the world. But the best has yet to be invented. Christian Tismer Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list
Re: Add committers according to codeaccess.txt
The Python issue tracker administrators needs to be contacted to grant permission to login to your Python issue tracker account (taewong.seo). The sixth line is the start of the list. Add all names of committers according to codeaccess.txt of the wesnoth-contribcommunity project. -- Tae Wong -- https://mail.python.org/mailman/listinfo/python-list
Approach to creating a Boolean expression parser in Python?
Hi list, I'm working on an app in which longish text chunks (could be up to a few MB in size, and stored either in flat text files or in fields of database records - TBD) need to be searched for the presence of a combination of string constants, where the string constants can be combined with boolean operators (in the user input given in a web form, for the search). The DB is MongoDB, accessed from Python using the PyMongo driver / client. The text chunks are associated with structured fields of database records, of users (say, suppliers), so the end result wanted is that the app user should be able to specify a search using boolean operators and the app should search across all the text chunks belonging to all users (users to text chunks is a one-to-many relationship, whether the chunks are stored as long varchar in the DB or as flat files, with a field of a database record containing the filename of the text file containing the chunk). Then the app should return both the user names and the corresponding text chunks, for chunks that matched the boolean expression. Example return value: user2 filename1.txt filename4.txt user5 filename3.txt user7 filename6.txt (where the filenames.txt could instead be the chunks of text, if the chunks are stored in the DB instead of the file system). The boolean expressions can be like these: apple and orange apple or pear apple and (pear or mango) (apple and pear) or mango not orange apple or not (pear and orange) etc. What are some good approaches to doing this using Python? I'm first looking at pure Python code approaches, though have considered using search tools like Solr (via PySolr), ElasticSearch, etc. Right now the app is in the prototype stage so I first want to establish the feasibility and a simple approach to doing the search, though later, if the app needs to scale, may investigate the tools like PySolr or ES. I think I may need to use one of the parsing libraries for Python such as PLY and others mentioned here: https://wiki.python.org/moin/LanguageParsing Let's say a parse tree is built up by whichever approach is used. A related question would be how to use this parse tree to search in the text chunks. I realize that it is a somewhat complex questiom, so am not looking for complete solutions, but for suggestions on how to go about it. Thanks for any suggestions. -- Vasudev Ram www.dancingbison.com jugad2.blogspot.com -- https://mail.python.org/mailman/listinfo/python-list
Re: Don't use default Google Group client (was re:....)
On 10/25/2013 02:05 PM, Terry Reedy wrote: On 10/25/2013 2:57 PM, Peter Cacioppi wrote: The default Google Group client is notoriously cruddy with quotes attribution. So don't use it. Get any decent newsreader, such as Thunderbird, and access the list at news.gmane.org as gmane.comp.python.general. Peter, you can ignore Terry's advice if Google Groups works for you. There are a small number of Google haters here who seem larger due to their obnoxious noisiness. I've been using Google Groups to post here for many years and with a little care it is usable without annoying anyone except a few drooling fanatics. All access methods have pros and cons (and I've posted here about many of TB numerous cons) so if the usability tradeoff favors GG for you (or anyone else) I recommend you not be intimidated by the anti-GG goon squad. -- https://mail.python.org/mailman/listinfo/python-list
Debugging decorator
Hi people, I wrote this decorator: https://gist.github.com/yasar11732/7163528 When this code executes: @debugging def myfunc(a, b, c, d = 48): a = 129 return a + b print myfunc(12,15,17) This is printed: function myfunc called a 12 c 17 b 15 d 48 assigned new value to a: 129 returning 144 144 I think I can be used instead of inserting and deleting print statements when trying to see what is passed to a function and what is assingned to what etc. I think it can be helpful during debugging. It works by rewriting ast of the function and inserting print nodes in it. What do you think? -- http://ysar.net/ -- https://mail.python.org/mailman/listinfo/python-list
Re: Don't use default Google Group client (was re:....)
On 26/10/2013 00:44, ru...@yahoo.com wrote: On 10/25/2013 02:05 PM, Terry Reedy wrote: On 10/25/2013 2:57 PM, Peter Cacioppi wrote: The default Google Group client is notoriously cruddy with quotes attribution. So don't use it. Get any decent newsreader, such as Thunderbird, and access the list at news.gmane.org as gmane.comp.python.general. Peter, you can ignore Terry's advice if Google Groups works for you. There are a small number of Google haters here who seem larger due to their obnoxious noisiness. I've been using Google Groups to post here for many years and with a little care it is usable without annoying anyone except a few drooling fanatics. All access methods have pros and cons (and I've posted here about many of TB numerous cons) so if the usability tradeoff favors GG for you (or anyone else) I recommend you not be intimidated by the anti-GG goon squad. Thunderbird cons - I've never known any. Google groups cons - continual streams of messages on a daily basis that are double spaced despite umpteen requests to follow instructions so the crap doesn't get repeated. Just how difficult is it? Are you prepared to pay for my new glasses, as the eye strain caused by google crap really does get to me. Goon squad indeed!!! -- Python is the second best programming language in the world. But the best has yet to be invented. Christian Tismer Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list
Re: Cookie aint retrieving when visiting happens from a backlink.
On Sat, Oct 26, 2013 at 3:28 AM, Steve Simmons square.st...@gmail.com wrote: Chris, You truly are a saint! I simply cannot believe the level of restraint you have shown during this exchange (unless of course you have bought tickets to Greece in order to deal with this issue in person and 'with extreme prejudice'). I have no such tickets. If I were to go to Greece, there are many things much more worthy of my time than juvenile retaliation. :) The main reason I'm patient with him is for the benefit of those coming afterwards - maybe years afterwards - and reading the thread. I want every thread to be either useful/informative or funny - preferably both. :) Flaming Nikos isn't particularly helpful, though sometimes it has been done very wittily. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Processing large CSV files - how to maximise throughput?
In article mailman.1560.1382744694.18130.python-l...@python.org, Dennis Lee Bieber wlfr...@ix.netcom.com wrote: Memory is cheap -- I/O is slow. G Just how massive are these CSV files? Actually, these days, the economics of hardware are more like, CPU is cheap, memory is expensive. I suppose it all depends on what kinds of problems you're solving, but my experience is I'm much more likely to run out of memory on big problems than I am to peg the CPU. Also, pegging the CPU leads to well-behaved performance degradation. Running out of memory leads to falling off a performance cliff as you start to page. And, with the advent of large-scale SSD (you can get 1.6 TB SSD in 2.5 inch form-factor!), I/O is as fast as you're willing to pay for :-) -- https://mail.python.org/mailman/listinfo/python-list
Re: Don't use default Google Group client (was re:....)
On Sat, Oct 26, 2013 at 10:44 AM, ru...@yahoo.com wrote: Peter, you can ignore Terry's advice if Google Groups works for you. There are a small number of Google haters here who seem larger due to their obnoxious noisiness. I've been using Google Groups to post here for many years and with a little care it is usable without annoying anyone except a few drooling fanatics. All access methods have pros and cons (and I've posted here about many of TB numerous cons) so if the usability tradeoff favors GG for you (or anyone else) I recommend you not be intimidated by the anti-GG goon squad. As soon as we hear of people automatically blacklisting any posts that come from Thunderbird, I'll believe you that they're on par. Until then, no matter how courteous you might be in your use of GG (which still makes you part of an extremely small minority), you still have a fundamental downside in that your message simply won't get to everyone. As to without annoying anyone except a few drooling fanatics - I wouldn't count myself among those fanatics (do you count me there?), but the GG issus (mainly with regard to quoted text) DO annoy me, and very much. Just because I don't flame people or throw tantrums doesn't mean I don't mind. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Python interactive segfaults on OS X 10.9 Mavericks
Since OS X 10.9 Mavericks is now out, people are running into a severe problem when using some Python interpreters interactively. The symptom is that the interpreter in interactive mode crashes after typing two lines: $ python3.3 Python 3.3.2 (v3.3.2:d047928ae3f6, May 13 2013, 13:52:24) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type help, copyright, credits or license for more information. Hello # first line OK 'Hello' World # second line causes crash Segmentation fault: 11 It does not matter what is entered on the two lines; the interpreter crashes after the second line. The problem is caused by an upstream change in the OS X 10.9 editline library, libedit. Most recent versions of the python.org installers dynamically link to the system-provided libedit and are susceptible to the problem. These include Pythons from the following current installers: 3.3.2 64-bit/32-bit 10.6+ 3.3.2 32-bit-only 10.5+ 2.7.5 64-bit/32-bit 10.6+ Older releases of similar installers are also susceptible. 2.7.x Pythons from the 32-bit-only installers are not susceptible because they do not use libedit. Pythons using GNU readline, including those with the PyPI readline distribution installed should not have problems. Also, the Apple-supplied system Pythons (2.7.x, 2.6,x, and 2.5.x) shipped with OS X 10.9 do not exhibit the crash. The problem is described in Issue18458. It describes a workaround: disabling the readline extension by renaming or deleting it. It also provides a script that can be downloaded to automate this patching. The fix for the problem has been released in the current 3.4.0a4 installers. It will be available in the installers for Python 3.3.3 and 2.7.6, which are expected to be released in the near future. Release candidate installers for both should be available by Monday. http://bugs.python.org/issue18458 Otherwise, for the most part, the transition to OS X 10.9 appears to be relatively problem-free so far. Please open issues on the Python bug tracker for any new problems you encounter (after doing a quick search to see if it has already been reported!). -- Ned Deily, n...@acm.org -- https://mail.python.org/mailman/listinfo/python-list
Re: Don't use default Google Group client (was re:....)
On 10/25/2013 7:44 PM, ru...@yahoo.com wrote: On 10/25/2013 02:05 PM, Terry Reedy wrote: On 10/25/2013 2:57 PM, Peter Cacioppi wrote: The default Google Group client is notoriously cruddy with quotes attribution. So don't use it. Get any decent newsreader, such as Thunderbird, and access the list at news.gmane.org as gmane.comp.python.general. Peter, you can ignore Terry's advice if Google Groups works for you. Rurpy: My advice was real advice (what I do) given in response to Cacioppi's complaint 'notoriously cruddy'. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list
Re: Why does lzma hangs for a very long time when run in parallel using python's muptiprocessing module?
On Sat, Oct 26, 2013 at 3:21 AM, cantor cantor cantorma...@gmail.com wrote: When trying to run lzma in parallel (see the code below) it hangs for a very long time. The non-parallel version of the code using map() works fine as shown in the code below. Confirmed that your code does indeed hang as you describe, but I can't help much with the details. I poked around with it a bit but without finding much of use. Sorry. :( ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: How to design:Use One TCPIP Client connection to Server and work concurrently
Hi all, Because the server only can accept ONE connect from client. If the client establish connection with the server,the server can not accept other client. One large batch transaction file come from user. client divide the large file to several smaller files. In my thinking: client have many seats.Each smaller files is thread. client manage which seat was avaiable,handle send to/recv from server. Any idea or suggestion? -- https://mail.python.org/mailman/listinfo/python-list
Re: How to design:Use One TCPIP Client connection to Server and work concurrently
On Sat, Oct 26, 2013 at 11:48 AM, ray yehray...@gmail.com wrote: Hi all, Because the server only can accept ONE connect from client. If the client establish connection with the server,the server can not accept other client. Are you sure? If that's the case, you're stuck - you can't parallelize at all. One large batch transaction file come from user. client divide the large file to several smaller files. In my thinking: client have many seats.Each smaller files is thread. client manage which seat was avaiable,handle send to/recv from server. Any idea or suggestion? A normal server setup would accept multiple connections at once. But you'll need to look into what the server can actually do. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Python Front-end to GCC
On Sat, Oct 26, 2013 at 8:37 AM, Mark Janssen dreamingforw...@gmail.com wrote: On Fri, Oct 25, 2013 at 2:07 PM, Ned Batchelder n...@nedbatchelder.com wrote: (Offlist) You responded on-list to a private email that was even tagged as off-list. Please be more careful and courteous. Anyway, IEEE floating-point makes it pretty clear that any value that sets the exponent to all-ones and the mantissa to anything other than all-zeros is a NaN. So an all-ones hex pattern (0x) will flood the area with NaNs. You really don't understand IEEE 754 here. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Python Front-end to GCC
On Fri, 25 Oct 2013 21:36:42 +0100, Mark Lawrence wrote: Mind you, the thought of a bot with a Ph.D. is mind boggling. You can buy degrees on the Internet quite cheaply: http://en.wikipedia.org/wiki/List_of_animals_with_fraudulent_diplomas PhD's are more expensive, which leads me to think that Mark Jenssen is being a tad flexible with the truth when he claims to have one. He certainly hasn't *earned* a PhD in computer science, that is obvious from his posts. -- Steven -- https://mail.python.org/mailman/listinfo/python-list
Re: Don't use default Google Group client (was re:....)
On Fri, 25 Oct 2013 16:44:45 -0700, rurpy wrote: On 10/25/2013 02:05 PM, Terry Reedy wrote: On 10/25/2013 2:57 PM, Peter Cacioppi wrote: The default Google Group client is notoriously cruddy with quotes attribution. So don't use it. Get any decent newsreader, such as Thunderbird, and access the list at news.gmane.org as gmane.comp.python.general. Peter, you can ignore Terry's advice if Google Groups works for you. There are a small number of Google haters here who seem larger due to their obnoxious noisiness. There are people here who hate Google Groups but simply don't chime in. I'm one of them. Perhaps I should. There are also many people who have a blanket ignore switch on anything coming from GG, not out of any personal vendetta against you, but simply out of self-defence. They don't say anything simply because they don't see the posts. I've been using Google Groups to post here for many years and with a little care it is usable without annoying anyone This is true, and thank you for taking that care, that is really appreciated. But perhaps you should consider that although GG works for you, it doesn't work for many people who don't take that care. So far Peter Cacioppi is one of those people. He has shown no inclination that he is willing to take the care to communicate well according to the community standards here, and he has shown a distressing tendency towards snarky, arrogant responses to polite requests to fix his posts. except a few drooling fanatics. All access methods have pros and cons (and I've posted here about many of TB numerous cons) so if the usability tradeoff favors GG for you (or anyone else) I recommend you not be intimidated by the anti-GG goon squad. Your personal attacks are not appreciated. Why can you not accept that people who post using GG's defaults cause pain and difficulty to many -- probably the great majority -- of readers who use either the mailing list or the news group to read this list? Don't you think that they are entitled to complain when people repeatedly post double-spaced, hard to read messages, or set the reply address wrongly, or include no context or attributes, or all of the above at once? Do you really intend to say that we have no right to complain about how difficult Google Groups makes it for us? -- Steven -- https://mail.python.org/mailman/listinfo/python-list
Re: Debugging decorator
On Sat, Oct 26, 2013 at 10:55 AM, Yaşar Arabacı yasar11...@gmail.com wrote: I think I can be used instead of inserting and deleting print statements when trying to see what is passed to a function and what is assingned to what etc. I think it can be helpful during debugging. It works by rewriting ast of the function and inserting print nodes in it. What do you think? Technologically very cool! I don't know that I'd ever use it for actual debugging, especially as it'll get VERY spammy as soon as you start working with complex objects, but it looks like a fun thing to play with. I see it as a parallel to dis.dis() - one looks at the disassembly and the other at the resulting actions, and between them you can get a fairly good idea of what's happening. Still don't know of any places I'd actually use it productively, but hey, nothing wrong with cool toys :) ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: How to design:Use One TCPIP Client connection to Server and work concurrently
In some enviroment,Client connect with Server(Always connect). It is a little like pipe.Many requester use the pipe send request and receive reponse.In client side,it dispatch requests and handle/match response. -- https://mail.python.org/mailman/listinfo/python-list
Re: Python was designed (was Re: Multi-threading in Python vs Java)
On Fri, 25 Oct 2013 19:05:09 +0100, Mark Lawrence wrote: On 25/10/2013 07:14, wxjmfa...@gmail.com wrote: Use one of the coding schemes endorsed by Unicode. As I personally know nothing about unicode for the unenlightened such as myself please explain this statement with respect to the fsr. Please don't encourage JMF. You know he'll just continue with his ridiculous vendetta against Python 3.3's Unicode handling. If a dev is not able to see a non ascii char may use 10 bytes more than an ascii char Are you saying that an ascii char takes a byte but a non ascii char takes up to 11? He's talking about the fact that strings in Python are objects, and hence carry a certain amount of overhead. Just to prove it's not specific to Python 3.3, or Unicode, here's an empty byte-string in 2.6: py sys.getsizeof('') 24 On the other hand, this overhead becomes trivial as the string gets bigger: py sys.getsizeof('x'*10**6) 124 Unicode is no different. Here is the hated 3.3 again: py sys.getsizeof('') # Unicode, not byte-string 25 py sys.getsizeof('ó'*10**6) 137 Again, a totally trivial amount of overhead. If you aren't willing to pay that overhead for the convenience of an OOP language like Python, you shouldn't be using an OOP language like Python. -- Steven -- https://mail.python.org/mailman/listinfo/python-list
[issue16595] Add resource.prlimit
Roundup Robot added the comment: New changeset 87d41a5a9077 by Christian Heimes in branch 'default': Issue #16595: prlimit() needs Linux kernel 2.6.36+ http://hg.python.org/cpython/rev/87d41a5a9077 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16595 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16595] Add resource.prlimit
Christian Heimes added the comment: The buildbot is Linux-2.6.35-vs2.3.0.36.32-gentoo-i686-Intel-R-_Core-TM-2_CPU_6600_@_2.40GHz-with-gentoo-2.1 but prlimit() requires 2.6.36+. I didn't expect to see a combination of glibc with prlimit() and Kernel without prlimit(). According to man prlimit it's not suppose to fail with ENOSYS, too. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16595 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16595] Add resource.prlimit
STINNER Victor added the comment: Or we should extend with supress(OSerror, errno=errno.ENOSYS): ... :-) (Just kidding, ignored tests must be marked as skipped.) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16595 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com