Your results:
You are Iron Man
| Inventor. Businessman. Genius. |
Click here to take the "Which Superhero am I?" quiz...
| Inventor. Businessman. Genius. |
Microsoft Visual C++ Runtime Library error R6034: An application has made an attempt to load the C rutime library incorrectly. Please contact the application's support teamfor more information.Lucky me: I thought I had one problem, but now I have two. I feel duty bound to report this new error under the "Installer" category. Fortunately the installer completes, and I can run the new Thunderbird to confirm the same error occurs (though I stupidlu omit to bring my RSS feeds forward into my new version). So now I can go ahead and add to the bug report for the original problem, since unfortunately it hasn't gone away. My motivation is severely diminished, however, so this may not actually happen. At least I reported the installer problem.
I must apologize, it turns out my problem was due to the fact that I was using a different version of stackless on the intel machine. In case anyone is curious, resuming pickled tasklets across architectures is easy. Thank you for your replies!Let me repeat that, just in case you missed it: resuming pickled tasklets across architectures is easy. As far as I can see this gives Python an amazing capability to produce applications with highly-distributed architectures. It's going to be interesting to see where Stackless goes with this, but it should be shouted from the rooftops. This is an advanced feature that represents a real advantage for (Stackless) Python in a world where everyone is wondering how they can accommodate the new multicore processors.
HowManyOfMe.com | ||
|
When I finally made time to visit comp.lang.python for the first time in two or three weeks I found a post that said
So of course I had to make sure that the material was available on the web. As a result you con now download my tutorials in either PDF or Open Office Impress format (yes, for once I eschewed using the obvious Microsoft products, and found that the Open Office component was a more-than-acceptable clone).I would like to know if anybody can point me to the site, where it is possible to find the tutorial "Using Databases in Python" which is mentioned by Steve Holden here: http://tinyurl.com/ectj8
Using Databases in Python: Impress PDF
An Introduction to wxPython: Impress PDF
An Amazon review of Python Web Pogramming reminds me that the book wasn't written just to explain Python ... thanks, Sheila!
20 of 21 people found the following review helpful:
Excellent example snippets; Clear explanations, February 24, 2002Reviewer: | Sheila King "desk-worker mom who needs to exercise" (L.A. County, California) - See all my reviews |
The book starts with a brief overview of the Python language. The author's intention is that someone with a fairly extensive programming background in other languages would be able to pick up enough Python from this overview to be able to do the rest of the programming in the book. Perhaps so. I already know Python, but did find the summary in the front informative.
I really like the fact that nearly every page has a code snippet on it. Examples are brief and to the point. The author explains each line of code and has a very direct and clear way of explaining things. I found the explanations easy to read and understand.
After the brief Python Language overview, comes an overview of sockets and socket programming. I've been trying to learn a bit about the whole topic of sockets by searching the web and nothing I found on the web explained it as clearly as this book. I now appreciate the difference between TCP and UDP protocols and have an idea of the situations in which I would want to use each. If you want to learn low-level sockets, or how to write your own socket protocols, this is not the book you are looking for. This book basically assumes you will go with either TCP or UDP (and ignores the other types of sockets available in the Python socket library). However, these will probably suit most people's needs.
The author then walks you through each of the Internet data-handling libraries in Python, such as the telnetlib, ftplib, poplib, smtplib and so on. He gives examples of working code for each library, showing first how to implement clients, and later on how to implement servers. If you want to work with these libraries, these explanations should be very helpful.
Later in the book, Holden addresses using databases in Internet programming, using XML and writing your own web-application framework. I haven't yet had a chance to go through these chapters in detail (I've skimmed them only). But there is a LOT of stuff there. One thing the author does at the beginning of each new section, is give an overview of the topic (such as an overview of why you might want to use a database, how databases work, or why you might want to work with a web framework). For me, I really appreciate this type of overview. It helps give me a context for the new information, and helps me to make better sense of it. I read through some of the database chapters where he explains how the SQL query language works, and again, I have to say it is one of the best explanations I've read. (Most explanations I've read about SQL have just convinced me I wanted to steer clear of it.)
Another nice thing, is how he sort of "works you up to" SQL. He starts out with regular Python code, and shows how parts of it are similar to working with an SQL database, and then eventually transitions into the full SQL language. He also addresses database design and efficiency.
Overall, I'd say if you want a good overview of the topics mentioned here, want to understand the reasoning behind their use, and want to be able to understand good design and efficiency, then this book should really help you out."anybody who's going to have a blog has one by now, after two years as a journalist you get stale, lots of bloggers are going back to real life"and graphs the "daily reach" of memeorandum.com, thereby confirming that for him it's all about the eyeballs. When I look back at my own blogging history I see that there are frequently months when I have written nothing at all in my blog, and hey, here I am still blogging.
Given a directory structure of arbitrary shape, locate all JPEG images and copy them into a named destination directory. [Not specified but implied: the files should continue to exist in their original positions]It turned out that the level was fairly well chosen. None of the students managed to complete the task, but they all had a fairly clear sense of where they were going by the end of the exercise, giving them something to work on independently after I'd gone. Of course I had to provide them with a "model solution", which I'm happy to say I just managed to create in the time allotted.
import jpegcopy
import unittest
import os
BASEDIR = '/c/Steve/Projects/BrightonHove'
BASEDIR = 'c:/Steve/Projects/BrightonHove'
INDIR = os.path.join(BASEDIR, "input")
OUTDIR1 = os.path.join(BASEDIR, "output1")
OUTDIR2 = os.path.join(BASEDIR, "output2")
EXPECTED = ['%s.jpg' % s for s in "f1 f2 f3 f4 f5 f6".split()]
class TestJpegCopy(unittest.TestCase):
def setUp(self):
"""Ensure both output directories are empty."""
for d in OUTDIR1, OUTDIR2:
fl = os.listdir(d)
if fl:
try:
for f in fl:
os.unlink(os.path.join(d, f))
except:
raise ValueError, "Cannot empty directory %s" % d
def testEmpty(self):
n0 = jpegcopy.main(OUTDIR1, OUTDIR1)
self.assertEquals(n0, 0)
def testDir1(self):
n1 = jpegcopy.main(INDIR, OUTDIR1)
self.assertEquals(n1, 6)
self.assertEquals(os.listdir(OUTDIR1), EXPECTED)
def testDir2(self):
n2 = jpegcopy.main(INDIR, OUTDIR2)
self.assertEquals(n2, 6)
self.assertEquals(os.listdir(OUTDIR2), EXPECTED)
def tearDown(self):
for d in OUTDIR1, OUTDIR2:
for f in os.listdir(d):
os.unlink(os.path.join(d, f))
if __name__ == "__main__":
unittest.main()
Nothing too fancy here. The tests are parameterised. We set them up by clearing both the output directories. Then we test that they are indeed empty. Then we test to make sure that we can put the JPEGs into two different directories and verifying that each time we see six files copied. Finally we check that both output directories contain the same thing. We tear down the test by deleting the contents of both directories."""Copy jpegs from a recursive to a flat directory structure."""
import os
import shutil
def main(indir, outdir, debug=0):
count = 0
for f in os.listdir(indir):
if os.path.isdir(os.path.join(indir, f)):
count += main(os.path.join(indir, f), outdir, debug=debug)
else:
if f.endswith(".jpg"):
count += 1
shutil.copyfile(os.path.join(indir, f),
os.path.join(outdir, f))
if debug:
print "Returning %d for %s" % (count, indir)
return count
if __name__ == "__main__":
main("input", "output1", debug=1)
As you can see I have put a simple test inline; this script is not intended to be run as a main program, but the debug output was useful sometimes when tests failed for obscure reasons.Update: Meerkat was shut down March 2, 2006No reasons, just that bald statement. Since meerkat was an early exemplar in the web services field I thought it would be appropriate to mark its passing.