Re: Understanding other people's code

2013-07-16 Thread David M Chess
Literally any idea will help, pen and paper, printing off all the code and doing some sort of highlighting session - anything! I keep reading bits of code and thinking well where the hell has that been defined and what does it mean to find it was inherited from 3 modules up the chain. I

Re: Functional vs. Object oriented API

2013-04-12 Thread David M Chess
Roy Smith r...@panix.com As part of our initial interview screen, we give applicants some small coding problems to do. One of the things we see a lot is what you could call Java code smell. This is our clue that the person is really a Java hacker at heart who just dabbles in Python

Re: Cannot run a single MySQLdb execute....

2013-03-28 Thread David M Chess
Νίκος Γκρ33κ nikos.gr...@gmail.com : What paramstyle are you using? Yes it is Chris, but i'am not sure what exactly are you asking me. Please if you cna pout it even simper for me, thank you. For instance: import MySQLdb MySQLdb.paramstyle 'format' FWIW and HTH, DC --

Re: Getting a TimedRotatingFileHandler not to put two dates in the same file?

2012-10-24 Thread David M Chess
d...@davea.name On 10/23/2012 11:23 AM, David M Chess wrote: We have a TimedRotatingFileHandler with when='midnight' You give us no clue what's in this class, or how it comes up with the filenames used. Sorry if I was unclear. This isn't my own subclass of TimedRotatingFileHandler

Re: Getting a TimedRotatingFileHandler not to put two dates in the same file?

2012-10-24 Thread David M Chess
w...@mac.com Something like: Does a log file exist? - No - First run; create log file continue | Yes | Read backwards looking for date change, copy lines after change to new file, delete from old file. Yep, I'm concluding that also. It just wasn't clear

A lock that prioritizes acquire()s?

2012-10-24 Thread David M Chess
Okay, next silly question. :) We have a very simple multi-threaded system where a request comes in, starts running in a thread, and then (zero, one, or two times per request) gets to a serialization point, where the code does: with lock: do_critical_section_stuff_that_might_take_awhile()

Re: A lock that prioritizes acquire()s?

2012-10-24 Thread David M Chess
Lovely, thanks for the ideas! I remember considering having release() pick the next thread to notify, where all the waiters were sitting on separate Conditions or whatever; not sure why I didn't pursue it to the end. Probably distracted by something shiny; or insufficient brainpower. :)

Getting a TimedRotatingFileHandler not to put two dates in the same file?

2012-10-23 Thread David M Chess
We have a TimedRotatingFileHandler with when='midnight'. This works great, splitting the log information across files by date, as long as the process is actually up at midnight. But now the users have noticed that if the process isn't up at midnight, they can end up with lines from two (or I

Re: problem with ThreadingTCPServer Handler

2012-10-23 Thread David M Chess
jorge jaoro...@estudiantes.uci.cu I'm programming a server that most send a message to each client connected to it and nothing else. this is obviously a base of what i want to do. the thing is, I made a class wich contains the Handler class for the ThreadingTCPServer and starts the

Re: Py3.3 unicode literal and input()

2012-06-18 Thread David M Chess
If you (the programmer) want a function that asks the user to enter a literal at the input prompt, you'll have to write a post-processing for it, which looks for prefixes, for quotes, for backslashes, etc., and encodes the result. There very well may be such a decoder in the Python library,

bus errors when the network interface is reset?

2012-05-01 Thread David M Chess
greatly appreciated. DC David M. Chess IBM Watson Research Center -- http://mail.python.org/mailman/listinfo/python-list