ation with the callback function, which
would be called when a request to the server completed. A global
variable wouldn't have worked, because multiple instances of the object
making the callback are possible.
It's a useful tool, but not one you need frequently. Don't get
car
John Nagle wrote:
> Michael Ströder wrote:
>
>> John Nagle wrote:
>>
>>>The Python SSL object offers two methods from obtaining
>>> the info from an SSL certificate, "server()" and "issuer()".
>>> The actual values in the certif
ctual video passes through Python at any point.
Transcoding in Python would take forever.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
thon community. Perl and PHP come
with MySQL support built in. Python is out to lunch on this.
John Nagle
Animats
--
http://mail.python.org/mailman/listinfo/python-list
Fuzzyman wrote:
> johnf wrote:
>
>>John Nagle wrote:
>>
>>
>>>Jan Dries wrote:
>>>
>>>>[EMAIL PROTECTED] wrote:
>>>>
>>>>
>>>>>I'm also looking for a MySQLdb binary for windows. This is holding me
John Nagle wrote:
>What's happened is that Python fell through the cracks here. MySQL
> themselves support Java, Microsoft ".NET", PHP, and a C interface.
> The Perl interface to MySQL is part of the supported Perl distribution.
> But for for Python, everybody is ru
e MySQL objects have a
year range from 1000 to , while Python only has the UNIX range
of 1970 to 2038. Remember, a database may have DATETIME dates which
reflect events in the distant past or future.
None of this will help performance; dates and times are sent over the
connection to a MySQL database as strings.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
John Machin wrote:
> John Nagle wrote:
>
>>dyork wrote:
>>
>>>"John Machin" <[EMAIL PROTECTED]> wrote in message
>>>news:[EMAIL PROTECTED]
>>>
>>>
>>>>If you have, as you should, Python 2.5, you can use this:
>
Marc 'BlackJack' Rintsch wrote:
> In <[EMAIL PROTECTED]>, John Nagle wrote:
>
>>John Machin wrote:
>>
>>>John Nagle wrote:
>>>
>>>>dyork wrote:
>>>>
>>>>>"John Machin" <[EMAIL PROTECTED]>
no
system-independent way. It's often not possible for files accessed
across a network; the information just isn't being sent.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
Delaney, Timothy (Tim) wrote:
> vertigo wrote:
>
>
>>Hello
>>
>>What library/functions/classes could i use to create trees ?
SpeedTree, of course.
http://www.speedtree.com
They have great downloadable demos.
index.php?func=detail&aid=1559350&group_id=22307&atid=374932
and look at other charset related bugs at
http://sourceforge.net/tracker/?atid=374932&group_id=22307&func=browse
Also note that MySQLdb didn't support this until recently, so check
you
side needs code from
the other. The protocol is published. So there's no license issue.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
scaped form that will work for all URLs.
There's "htmldecode" at "http://zesty.ca/python/scrape.py";, which works,
but this should be a standard library function.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
Lawrence D'Oliveiro wrote:
> In message <[EMAIL PROTECTED]>, John Nagle
> wrote:
>
>
>>Here's a URL from a link on the home page of a major company.
>>
>>About Us
>>
>>What's the appropriate Python function to call to unescape a U
why this is a problem.
I need valid XML out, even if what went in wasn't quite valid.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
ers, numbers,
and '#' ending with a ';' Admittedly this would let something
like '&xx#2;', which isn't a legal entity, through unmodified.
There's still a potential problem with unknown entities in the output XML, but
at least they're recognized as entities.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
. It first parsed it right, but then stuck
in an extra, totally bogus line. Note the entity "&linkurl;", which
appears nowhere in the original. It looks like code to handle a missing
quote mark did the wrong thing.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
Duncan Booth wrote:
> John Nagle <[EMAIL PROTECTED]> wrote:
>
>
>>And this came out, via prettify:
>>
>>>url="http%3A//www.apartmentsapart.com/Europe/Spain/Madrid/FAQ">
>> > value="/images/offersBanners/sw04.swf?binfot=We off
m you have encountered is with a project web
site hosted by SourceForge.net. This issue should be reported to the
SourceForge.net-hosted project (not to SourceForge.net).
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
ged from doing so.
The code was forked by Zope as a workaround in 2003:
http://pywebsvcs.sourceforge.net/apidocs/wstools/Utility.html
but that's not in the mainstream Python tree.
The correct fix would probably be to add methods to class
URLopener to control this; that's the usual way of handling
finishing
the Python SSL library, which doesn't even check certificates, let alone
revocation lists. It's a pure interface problem. OpenSSL does all the
hard parts, but the Python glue code is crude and incomplete.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
d by a grammar-level parser.
Any compiler book will cover this.
Using regular expressions for LALR(0) parsing is a vice inherited
from Perl, in which regular expressions are easy and "get next
character from string" is unreasonably expensive. In Python, at least
you can inde
t be worth doing. The
languages have quite different syntax, but roughly the same
functionality. You'd probably have to write a set of libraries
in Python with the equivalent definitions to their Perl
counterparts, but that's just time-consuming, not difficult.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
oblems.
There hasn't been a new release of MySQLdb since April 2006, and
there's no official support for either Python 2.5 or Windows.
Realistically, you have to run Python 2.4 or earlier if you
need database access. We dropped back to Python 2.4,
with good results.
n via "self._x"
forms, so they'd be inaccessable outside the object. It's undesirable
from a maintenance standpoint to have an unenforced convention like
a lead underscore. The maintenance programmer can't trust its meaning.
As Python grows up, and larger systems are written in it, these
issues become more important.
John Nagle
Animats
--
http://mail.python.org/mailman/listinfo/python-list
undation.org/show_bug.cgi?id=9401
>
> Thanks for the report!
That helps. I've been getting occasional stalls and timeouts in
a multithreaded program that can have several M2Crypto operations
going, and this is probably the explaination.
John Nagle
In any case, SOAP servers should have a separate object for
each connection, or the thing will mess up if two requests
are made at the same time.
See
http://www.ibm.com/developerworks/library/ws-pyth5/
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
right now.
John Nagle
Hamish Moffatt wrote:
> Hi,
> I'm fetching some files over HTTPS from Python and I want to verify the
> server certificate. (Not just the name etc provided in certificate.)
>
> How can I get access to this information?
>
> urllib2 do
p. Then the simple
Physics 101 approach isn't so simple any more.
John Nagle
Animats
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> On Jun 9, 12:16 pm, James Stroud <[EMAIL PROTECTED]> wrote:
>
>>Terry Reedy wrote:
>>
>>>In Python, you have a choice of recursion (normal or tail)
>>
>>Please explain this. I remember reading on this newsgroup that an
>>advantage of ruby (wrt python) is that ruby has ta
f loops. Hoisting reference count updates out of
loops. Keeping frequently used variables in registers. And elimination of
many unnecessary dictionary lookups.
Python could get much, much faster. Right now CPython is said to be 60X slower
than C. It should be possible to get at least an order of magnitude over
CPython.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
Steve Howell wrote:
> --- John Nagle <[EMAIL PROTECTED]> wrote:
>
>>With this, the heavy optimizations are possible.
>>Strength reduction. Hoisting
>>common subexpressious out of loops. Hoisting
>>reference count updates out of
>>loops. Keeping freq
ctually facing that because Python's HTML
parsing is so slow.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
In LISP, one might iterate over
a list using tail recursion, but in Python, that would be
both silly and inefficient.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
ly
replaceable. The compiler would have to detect that the function
doesn't modify or replace itself while recursing for this optimization
to be valid. Worst case, another thread could replace the function
while it was recursing, invalidating the tail recursion optimization.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
startup JavaScript, then lets you examine the DOM. There
are too many pages now that just come through as blank if you don't
run the OnLoad JavaScript.)
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
The "I'm so l33t" thing.
I used EMACS back in the LISP era, but really, that approach
is mostly of historical interest at this late date.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
comments. The
default action is to suck up the rest of the entire document into
the comment, which is usually not what you want. I have a fix for that
at
http://mail.python.org/pipermail/python-list/2007-May/440370.html
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
on libraries
which I import. (I've reported all of them in the tracker as bugs, and some
later version of Python will contain the fixes. But that can take years.)
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
ot here yet.
Modula 3 was getting close, but it was being developed
at DEC, which had no software business outside of selling for DEC systems.
Then Compaq bought DEC and HP bought Compaq and all the research units
disappeared.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
ot really essential to Python.
(PEAK, the main effort in that direction, seems to be defunct.)
What we need are better implementations than CPython, not
hokey attribute schemes bolted onto the language. We're seeing
stuff go in that's easy to add to CPython, but not necessarily
good f
l language
baggage. PEP 3107 adds the excess baggage without providing the benefit
of compile time checks.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
which
results in an HTTP error 400.
Is "urllib" wrong?
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
Martin v. Löwis wrote:
> John Nagle schrieb:
>
>>Here's a URL, found in a link, which gives us trouble
>>when we try to follow the link:
>>
>>http://sportsbra.co.uk/../acatalog/shop.html
>>
>>Browsers immediately turn this into
>>
>&g
> Thanks
>
> Jackie
>
Generate HTML for such pages, open them with OpenOffice, and
have OpenOffice generate the PDF file.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
dea whether it's being
used by a client or a server, so it, reasonably enough, takes option 1.
(Yet another hassle in processing real-world HTML.)
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
Bruno Desthuilliers wrote:
> harri a écrit :
> Indeed - static typing is for compilers, not for programmers.
Actually, static typing is for detecting errors before the
program is run.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
sort of thing.
Remember "Hungarian notation"? "LPSTR"? Yes, that stuff.
Moving to C++ and strong typing was generally considered a major
improvement in the Windows world.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
Bruno Desthuilliers wrote:
> Jorgen Bodde a écrit :
>
>> But, what about something in between like only
>> using the dot (.) for a shorter notation?
How about "Mavis Beacon Teaches Typing"?
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
re.)
With those approaches, destructors
would be sound, order of destruction would be well defined, and
the "here be dragons" notes about destructors could come out of
the documentation.
With that, we wouldn't need "with". Or a garbage collector.
If you like minimalism, this is the way to go.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
Andy Freeman wrote:
> On Jun 27, 11:41 pm, John Nagle <[EMAIL PROTECTED]> wrote:
> While I agree that weak pointers are good and can not be an
> afterthought, I've written code where "back" changed dynamically, and
> I'm pretty sure that Nagle has as well.
will refuse that,
> and force you to use this->a instead;-).
Yes, as Strostrup admits, "this" should have been a reference.
Early versions of C++ didn't have references.
One side effect of that mistake was the "delete(this)" idiom,
which does not play well with i
Okay, I thought you meant that there was an actual symbol 'inf' in the
> builtins
> or in a module somewhere.
>
>
>>>No. You can make one that fits your requirements, though.
That sounds like a bug. If Python numerics don't define
+INF, -INF, and NaN, along with the tests for them, that's a
flaw in the language. We can assume IEEE floating point at this
late date; it's been standard for twenty years and Java assumes it.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
to Microsoft's byte code as used by their
".NET" common language runtime. This is then compiled to machine
code by a just-in-time compiler.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
his differs across platforms. Your code won't work on
> Windows,
> for example.
Yes. This is CPython bug #1255395, status "open".
Also CPython bug #44585 (Pickle fails on "inf" values)
PEP 42 contains excuses for not calling it a bug.
member function
in the whole program. (And, in fact, in Python you pay exactly the
dispatch cost that would take.)
The problem is that in both C++ and Java, the first round
of the type system was botched. C++ originally had neither
generics nor checked downcasting (a la "dynamic_cast").
Java originally lacked generics. Both languages added those
as bolt-ons, and it shows.
But, again, this really isn't a Python issue.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
(Coyote Point uses regular expressions to parse HTTP headers, and
I think somebody wrote "\m" where they meant "\n".)
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
cost. "repr/eval" is not
an efficient way to marshall. Try using "pack" and "unpack", if
you control both ends of the connection.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
a killer if there's another compute
bound process running; on each message pass you lose your turn for
the CPU.
(There have been worse operating systems. The classic MacOS allows
you one (1) message pass per clock tick, or 60 messages per second.)
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
ot filled up.
>>...
> If the problem does not require two way communication, which is
> typical of a producer-consumer, it is a lot faster to allow P to fully
> run before C is started.
>
> If P and C are tied using a pipe, in most linux like OS (QNX may be
> doing somethi
forced static typing requires a quality assurance group that
reads code and checks coding standards.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
ction. Relying on the specific semantics of refcounting to give
>>certain lifetimes is a logic error.
We may need a guarantee that if you create a local object and
don't copy a strong reference to it to an outer scope, upon exit from
the scope, the object will be destroyed.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
ve been reduced.
See:
http://labs.google.com/papers/mapreduce.html
Contrast this with Python's "reduce", which is inherently sequential.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
\
>
> ex: what if i want the motor to turn for 10 seconds. stop for 5. then
> turn the other direction.
>
> would you program it the same way you would on a personal computer
> (via c, python, etc)?
Try "comp.robotics.misc" for the basics of robot motor control.
h time you go through the
loop, but never goes negative.
Most type issues can be resolved at compile time if you can
see the whole program.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
ode, as the
DEC effort.
Back when I was working on this, we only had a 1 MIPS VAX, and theorem
proving was slow. That's much less of a problem now.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
The value of this field specifies a partial URL that is not to
be visited. This can be a full path, or a partial path; any URL that starts with
this value will not be retrieved." That suggests that "//" should only disallow
paths beginning with "//".
re denied:
> User-agent: *
> Disallow: /
>
Ah, that's it. The problem is that "ibm.com" redirects to
"http://www.ibm.com";, but but "ibm.com/robots.txt" does not
redirect. For comparison, try "microsoft.com/robots.txt",
which does redirect.
ng in high performance
aircraft and flying with the software written there. I've worked
with car-sized robot vehicles, ones big enough to injure people.
This gives one a stronger feeling about wanting to eliminate
software defects early.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
w. The basic problem is that
C and C++ aren't well suited to proof of correctness, yet none of the
other hard-compiled languages have any significant market share left.
This is irrelevant to Python issues, though.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
hat took a while to overcome. Much of that was from trying
to cram interactive systems into computers with very modest
capacity per user.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
Nikita the Spider wrote:
> In article <[EMAIL PROTECTED]>,
> John Nagle <[EMAIL PROTECTED]> wrote:
>
>
>>Nikita the Spider wrote:
>>
>>
>>>Hi John,
>>>Are you sure you're not confusing your sites? The robots.txt file at
>&g
everything is a dictionary. Don't get carried away.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
g. The main implementation,
CPython, is about 60x slower than C, though, so if you're trying
to implement, say, a rapidly changing digital oscilloscope display,
the result may be sluggish.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
ten while being sent by the server.
Any good way to deal with this, short of reading it twice
and comparing?
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
Miles wrote:
> On Jul 16, 1:00 am, John Nagle <[EMAIL PROTECTED]> wrote:
>
>>I'm reading the PhishTank XML file of active phishing sites,
>>at "http://data.phishtank.com/data/online-valid/"; This changes
>>frequently, and it's big (about 10
orry about the socket
overhead.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
code in real scenario yet with a 301 redirect.
> If its okay, I shall test it and submit a patch for the tracker item.
That assumes you're reusing the same object to reopen another URL.
Is this thread-safe?
That's also an inefficient way to test for an empty dictionary.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
Miles wrote:
> On Jul 16, 1:00 am, John Nagle <[EMAIL PROTECTED]> wrote:
>
>>I'm reading the PhishTank XML file of active phishing sites,
>>at "http://data.phishtank.com/data/online-valid/"; This changes
>>frequently, and it's big (about 10
heck out the "Spec#" effort at Microsoft for current work.
Work continues in Europe on Extended Static Checking for Java,
which was developed at DEC before DEC disappeared.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
herently wrong. It was a good idea in the 1970s
when it was developed, but we know better now.
If you were doing proofs of correctness for Python, the biggest headache
would be checking for all the places where some object like a module or function
might be dynamically modified and making sure nobody was patching the code.
Enough on this issue, though.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
paper:
http://www.computationallogic.com/news/amd.html
This stuff is hard to do, but notice that AMD hasn't had any recalls
for floating point problems.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
'm parsing URLs used by hostile sites, and the wierd cases come up
all too frequently.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
d none of which really became finished
products.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
se with the hash mechanism for attribute lookup.
The generality should be there if it's needed, but when
it's not, the excess baggage should be removed. That's how
you get the performance of the language up.
This doesn't require type declarations. There are arguments
Steve Holden wrote:
> Marc 'BlackJack' Rintsch wrote:
>
>> In <[EMAIL PROTECTED]>, John Nagle wrote:
>>
>>> Many cases are easy. If a smart compiler sees
>>>
>>> for i in range(n) :
>>>... # something
>>
or" exceptions.
It's worth a mention in the documentation for "socket".
John Nagle
D:\>/python25/python.exe
Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on win
32
Type "help", "copyright",
ubclass. That function will be called when a password is needed,
and you return (username, password) as a tuple, which gets sent
to the web server.
Python, instead of having one library for reading URLs that works,
has at least three, all with different problems.
J
Steve Holden wrote:
> John Nagle wrote:
>
>> Here's a strange little bug. "socket.getaddrinfo" blows up
>> if given a bad domain name containing ".." in Unicode. The
>> same string in ASCII produces the correct "gaierror" ex
def prompt_user_passwd(self, host, realm):
return None, None
robotparser.URLopener.prompt_user_passwd = prompt_user_passwd # temp patch
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
abase.
No address found on site.
No usable SSL certificate.
Rating: "Site ownership unknown or questionable."
Any questions?
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
ed more CPUs. There's a numerics library
for Python called NumPy, but it doesn't have a convolution function,
although it has an FFT, which may be useful.
But this is just homework. Do something reasonable and turn it
in. A high performance solution to this problem is probably more
Terry Reedy wrote:
> "John Nagle" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> | This was reported in 2003, and a patch was uploaded in 2005, but the
> patch
> | never made it into Python 2.4 or 2.5.
>
> If the patch is still open, perhaps
Steven Bethard wrote:
> John Nagle wrote:
>
>> Terry Reedy wrote:
>>
>>> "John Nagle" <[EMAIL PROTECTED]> wrote in message
>>> news:[EMAIL PROTECTED]
>>> | This was reported in 2003, and a patch was uploaded in 2005, but
>>>
except IOError, message:# I/O error
But it wasn't. The "IOError" fell through, was caught by the
next outer exception block, and was logged as a generic
error.
I can't find where in the Python socket module an "IOError"
could be raised. I would have expec
Dennis Lee Bieber wrote:
> On Sun, 22 Apr 2007 23:20:25 -0700, John Nagle <[EMAIL PROTECTED]>
> declaimed the following in comp.lang.python:
>
>
>>2. File "D:\Python24\lib\socket.py", line 295, in read
>>data = self._sock.recv(recv_size)
&g
Steve Holden wrote:
> John Nagle wrote:
>
>> Dennis Lee Bieber wrote:
>>
>>> On Sun, 22 Apr 2007 23:20:25 -0700, John Nagle <[EMAIL PROTECTED]>
>>> declaimed the following in comp.lang.python:
>>>
>>>
>>>> 2. File &q
s don't hang.
But MySQLdb uses the MySQL C library, which doesn't use Python opens.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
Steve Holden wrote:
> John Nagle wrote:
> [socket.error bug report]
>
>>>
>>> Where did you get this information? If true it would certainly need
>>> to be logged as a bug, but under Windows on 2,4 I see
>>>
>>> >>> issubclass(soc
201 - 300 of 1270 matches
Mail list logo