Announce: WHIFF 1.1 Release

2011-03-17 Thread Aaron Watters
WHIFF 1.1 RELEASED

WHIFF [WSGI HTTP Integrated Filesystem Frames]
is a collection of support services
for Python/WSGI Web applications which
allows applications to be composed by
dropping dynamic pages into container
directories.

This mode of development will be familiar
to developers who have created PHP
applications, vanilla CGI scripts,
Apache/modpy Publisher applications,
JSP pages, or static web content.

WHIFF 1.1 improves support for Google App
Engine applications and fixes a number of
bugs/misfeatures regarding string quoting
and encoding.

PROJECT PAGE: http://whiff.sourceforge.net/
DOCUMENTATION: http://whiffdoc.appspot.com
DOWNLOAD: https://sourceforge.net/projects/whiff/
REPOSITORY: http://code.google.com/p/whiff/source/checkout

Please read about the features, tutorials, and demos:

Test drive
  http://whiffdoc.appspot.com/docs/W1100_0500.TestDrive
Mako template support
  http://whiffdoc.appspot.com/docs/W1100_1075.MakoGrading
Drop down menus middlewares
  http://whiffdoc.appspot.com/docs/W1100_1300.menus
AJAX callback support
  http://whiffdoc.appspot.com/docs/W1100_1400.calc
Jquery helpers
  http://whiffdoc.appspot.com/docs/W1100_1450.jQueryUI
Integration support for repoze.who authentication
  http://whiffdoc.appspot.com/docs/W1100_1500.who
Open Flash Charts
  http://whiffdoc.appspot.com/docs/W1100_1600.openFlashCharts
Internationalization support
  http://whiffdoc.appspot.com/docs/W1100_1700.international
Tree views with AJAX callbacks
  http://whiffdoc.appspot.com/docs/W1100_2200.TreeView
Google App Engine compatibility
  http://whiffdoc.appspot.com/docs/W1100_2300.GAEDeploy

And much more.

Please try it out and let me know what you
think.  Also, thanks to all for suggestions and other
feedback.

-- Aaron Watters

===
This one goes to eleven.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Pdf download using mechanize

2010-07-06 Thread Aaron Watters
On Jul 6, 10:00 am, srinivasan srinivas sri_anna...@yahoo.co.in
wrote:
 HI,
 I am using mechanize module for web scraping projects. One of y tasks is to 
 download pdf file from a page and store it.
 Is there a way to download pdf file using mechanize how we do it in Perl's 
 WWW::Mechanize?

 Thanks,
 Srini

Mechanize seems to have a mailing list ;c)

   https://lists.sourceforge.net/lists/listinfo/wwwsearch-general

Also, it would be helpful to know what specific problems you are
having.
Have you tried following the excellent documentation?

   http://wwwsearch.sourceforge.net/mechanize/doc.html

It looks like downloading any sort of file and saving it should be
straightforward to me, but I haven't tried it.

   Aaron Watters
   http://whiffdoc.appspot.com

===
% man less
less is more.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: I wander which is better? JSP or Python? And is there a place for JSP?

2010-06-28 Thread Aaron Watters
On Jun 28, 12:49 am, Roger rogerda...@gmail.com wrote:
 As I plan to study JSP, I find it extremly complicated and a part of
 J2EE.
 I did not attend to get the whole of J2EE.
 I hope anybody can describe the future of JSP.
 Is there a place for JSP?

I work on a big java project to make money and I
like JSP's -- in fact I prefer working with JSPs over
working with complicated web infrastructures such
as java based RSF/Spring or
Python based Zope and Django.  You drop a file into
a JSP directory and a page that looks similar appears
on your web server -- no messing with config files
and regular expressions and such.  It's very easy
to understand, develop, debug.  This is why I wrote
WHIFF to use a similar but generalized drop
in paradigm.

http://whiffdoc.appspot.com

   -- Aaron Watters

===
% man less
less is more.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: I strongly dislike Python 3

2010-06-28 Thread Aaron Watters
On Jun 26, 9:06 pm, Steven D'Aprano st...@remove-this-
cybersource.com.au wrote:
 
 I didn't notice this level of angst when Python made equally significant
 changes going from 1.5 to 2.0... admittedly Python 1.5 code would work
 unchanged in 2.0, but the 2.x series introduced MUCH bigger additions to
 Python than anything 3.0 and 3.1 have added, and anyone taking advantage
 of those changes is implicitly writing code which is not backwards

As a historical note, Python was a lot less pervasive then.
Nevertheless there were some subtle but significant
breakages in 1--2 which caused a lot of people to throw up their
hands
and give up.  The abandonment of regex comes to mind, and there
were others.

I personally earned income a couple years ago
as a contractor supporting Python 1.x
applications which were put into cryogenic preservation when
the developers decided to abandon Python in favor of a less
chaotic platform, like Java or C# or even (got help us) Perl.

I apologize if I pontificate.
 -- Aaron Watters
-- 
http://mail.python.org/mailman/listinfo/python-list


conceptual model diagram builder

2010-06-22 Thread Aaron Watters
Hi folks.

I design a lot of conceptual models and I usually do it on
paper or on a white board.  I sometimes need to send an
image of a conceptual model (not a photo) and I really
don't know of a good tool which works the way I'd like
to make images of conceptual models.
Particularly I'd like the layout to be automatic.

So I built a conceptual diagram model builder
in Python using WHIFF and released it as a WHIFF demo.

It does auto-layout and also allows you to snapshot
the model as a JSON structure.  Here it is:

http://whiffdoc.appspot.com/tests/schema/diagram#

I will certainly continue to fiddle with it but I'm pretty
pleased with how it works now, so I wanted to share it.

More info:
* Implemented in WHIFF: whiff.sourceforge.net.
* Drawn using HTML 5 2D canvas feature http://dev.w3.org/html5/2dcontext/.
* Interactive elements courtesy of jQueryUI http://jqueryui.com/.
* Dynamic server/page interactions use AJAX technology.
* Data encoding uses JSON http://www.json.org/.
* Data modeling conventions adapted from Analysis Patterns:
Reusable Object Models by Martin Fowler.
* Distributed in the whiff test directory. Browse the source at
this link.
   http://code.google.com/p/whiff/source/browse/#hg/trunk/test/root/schema

Let me know what you think.  If you want to get the source you will
have to
clone the google code mercurial archive (it isn't part of the whiff
release yet).
   -- Aaron Watters

===
This one goes to 11.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: mysql query results to web page

2010-06-22 Thread Aaron Watters
On Jun 22, 4:50 pm, Greg gfi...@gmail.com wrote:
 I'd like to query my local MySQL db and send the results to a locally
 served web page.  I've poked around and found complex examples using
 web2py and pylons What's best for beginners?  Can somebody lay out
 the basic steps for me?

 thanks,

 Greg

You need to use some sort of web server and some sort
of interface to a web server.  Most web servers support
the CGI interface.  Here is an example query using a
web server CGI interface and the WSGI/CGI translator.
This is one of many options, but it has the advantage
that you can move to a higher performance approach
later if you need to without changing code.

=== cut, beginning of file
#!/Library/Frameworks/Python.framework/Versions/Current/bin/python

import sys
import wsgiref.handlers
import MySQLdb

def application(env, start_response):
connection = MySQLdb.connect(host=localhost, user=me,
passwd=xyz, db=mydatabase)
cursor = connection.cursor()
cursor.execute(select * from MY_TABLE)
start_response(200 OK, [('Content-Type', 'text/html')])
for x in cursor.fetchall():
yield str(x)
yield br\n

# serve a CGI request using the application
wsgiref.handlers.CGIHandler().run(application)

=== end of file

Here is a link to the running example I just tested:

   http://aaron.oirt.rutgers.edu/cgi-bin/mysql.cgi

The first thing you should try is getting the hello world
CGI script running before adding the MySQL query.

I had to make the CGI script executable and have it point
to my Python installation in the first line.  Please see

http://docs.python.org/library/cgi.html

for a discussion of CGI scripting.  I also had to mess
with some directory permissions because my MySQLdb on my
Mac in inside a Python Egg... to get around these sorts
of problems you may have to look at your server error log.

Also please see the WHIFF quickstart for a discussion
of setting up a WSGI/WHIFF based CGI script.

Good luck!

   -- Aaron Watters

===
% man less
less is more.

-- 
http://mail.python.org/mailman/listinfo/python-list


Announcing: WHIFF 1.0

2010-06-05 Thread Aaron Watters
WHIFF 1.0 RELEASED

WHIFF 1.0 is the first stable release
of WHIFF intended to be production ready.

PROJECT PAGE: http://whiff.sourceforge.net/
DOCUMENTATION: http://whiffdoc.appspot.com
DOWNLOAD: https://sourceforge.net/projects/whiff/
REPOSITORY: http://code.google.com/p/whiff/source/checkout

WHIFF [WSGI HTTP Integrated Filesystem Frames]
is a collection of support services
for Python/WSGI Web applications which
allows applications to be composed by
dropping dynamic pages into container
directories.

This mode of development will be familiar
to developers who have created PHP
applications, vanilla CGI scripts,
Apache/modpy Publisher applications,
JSP pages, or static web content.

WHIFF 1.0 adds support for Guarded Resources
to implement information access control
in web applications.

http://whiffdoc.appspot.com/docs/W1100_2400.AuthorizedResources

In addition to a number of bugfixes and
minor enhancements the release also includes
from previous releases:

Test drive
  http://whiffdoc.appspot.com/docs/W1100_0500.TestDrive
Mako template support
  http://whiffdoc.appspot.com/docs/W1100_1075.MakoGrading
Drop down menus middlewares
  http://whiffdoc.appspot.com/docs/W1100_1300.menus
AJAX callback support
  http://whiffdoc.appspot.com/docs/W1100_1400.calc
Jquery helpers
  http://whiffdoc.appspot.com/docs/W1100_1450.jQueryUI
Integration support for repoze.who authentication
  http://whiffdoc.appspot.com/docs/W1100_1500.who
Open Flash Charts
  http://whiffdoc.appspot.com/docs/W1100_1600.openFlashCharts
Internationalization support
  http://whiffdoc.appspot.com/docs/W1100_1700.international
Tree views with AJAX callbacks
  http://whiffdoc.appspot.com/docs/W1100_2200.TreeView
Google App Engine compatibility
  http://whiffdoc.appspot.com/docs/W1100_2300.GAEDeploy

And much more.

Please try it out and let me know what you
think

   -- Aaron Watters

===
This one goes to eleven.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: CGI templating with python

2010-04-02 Thread Aaron Watters
On Apr 1, 11:19 am, KB ke...@nekotaku.com wrote:
  Django will probably get you where you want to go the fastest:

     http://www.djangoproject.com/

  In particular, its admin interface will probably automatically generate a 
  usable
  UI for you without your having to write many templates at all.

 Robert,

 Thank you very very much. I had a brief peruse of django last night
 and it does indeed look like what I am after! Will take me some
 time :) to delve into it deeper but I wanted to thank you!

You could also look at WHIFF and try out the test drive.

http://whiffdoc.appspot.com/docs/W.intro

  -- Aaron Watters

===
This one goes to 11.
-- 
http://mail.python.org/mailman/listinfo/python-list


regex object limitations/behavior for large regexes?

2009-12-30 Thread Aaron Watters
I'm thinking of a design which automatically generates
regex objects which are essentially disjunctions of simple
pattern alternatives.  The number of alternatives might
conceivably run into the thousands or more.

This raises the question: do regex objects behave nicely
when the regex gets very large?  Do they remain as fast?
Do they display reasonable (linear or n log n) memory
growth?  Do they just stop working at some point?

Please reply if you have any experience with very
large regexes or other insights.

Thanks in advance.  -- Aaron Watters

===
less is more
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: regex object limitations/behavior for large regexes?

2009-12-30 Thread Aaron Watters
Sorry, I should have looked harder.

I found this:
   http://bugs.python.org/issue1160

It looks exactly like my use case.  drat.

   -- Aaron Watters http://whiffdoc.appspot.com

===
less is more.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Moving from PHP to Python. Is it Possible

2009-12-29 Thread Aaron Watters
Sancar wants to move from PHP to Python.

The following a shameless plug for WHIFF: http://whiff.sourceforge.net
-- I wrote it partially because I wanted PHP-like features using
Python, but better ;).

On Dec 11, 5:26 am, Sancar Saran sancar.sa...@evodot.com wrote:
 Greetings.

 After 3 days of crawling google, diving in python and cursing, now  I can 
 show
 something on my linux/apache/mod_wsgi setup.

It's too bad you didn't find the WHIFF quickstart first :).
   http://whiffdoc.appspot.com/docs/W0500.quickstart

 And i'm struck on something

 My design depends on a Global Array. A huge array which store everything about
 requested Web page for a final rendering.
 In PHP accessing globals is easy. You may do direct access or use class
 something like ZEND Registry
 1-) Can I create Global (read/write access anywhere from my code) Multi
 dimensional, associative array (or hash) and store any kind of variable type.

There are a number of ways to do things like this in WHIFF
-- one way is to use the WSGI environment to store your
globals as illustrated in the Mako tutorial:
http://whiffdoc.appspot.com/docs/W1100_1075.MakoGrading

 2-) Is there any error trigger for mod_wsgi. When something go bad I god
 Internal Server error. Looking for error log was't nice. Is there any way to
 shows errors in the web page ?

Configure your application to display tracebacks on errors.
I need to explicitly add this to the documentation, but here
is an example used by the WHIFF documentation app config:

59 whiffDocumentation = resolver.moduleRootApplication(/, docroot,
60   #exception_middleware=None,
61   environment=environment,
62   exception_middleware=displayTraceback.__middleware__,
63   on_not_found=None, # show traceback (could comment)
64   auto_reload=False,
65 )

lines 62 and 63 from
  
http://aaron.oirt.rutgers.edu/cgi-bin/whiffRepo.cgi/file/4b2cea3d92fc/doc/servedocs.py

 3-) Any documents books sites about helping moving from php to python

  http://whiffdoc.appspot.com/ (doesn't explicitly mention PHP).

 4-) In php we had something like
 ob_start(); // start Output buffering
 require('hede.php'); // include phtml similar to psp. mixed language and html
 (to avoiding string replacement (or marker based) html templates)
 $var = ob_get_clean(); // get rendered output and use anywhere
 can find a similar abilities in Python ?

Of course:

See the quoteHtml implementation, for example
http://aaron.oirt.rutgers.edu/cgi-bin/whiffRepo.cgi/file/4b2cea3d92fc/whiff/middleware/quoteHtml.py

 5-) is there any Python documentation based on examples. When I give up about
 to finding  php's $_REQUEST or $_SERVER equivalents in python some demo code 
 in
 Twisted docs are much helpful than any other words. Me and my kind already
 have  problem with English language. Example code much more helpful than full
 academic description.

  http://whiffdoc.appspot.com (again) there are lots and lots of
examples.

I hope you like it and have a happy new year!  -- Aaron Watters

===
my resolution last year
was not to make any resolutions this year.
-- 
http://mail.python.org/mailman/listinfo/python-list


wave robot notes

2009-12-23 Thread Aaron Watters
I implemented a Google Wave Robot which annotates
BNF syntax rules using railroad diagram images.
I put notes about the implementation process
here for the benefit of posterity.

http://listtree.appspot.com/firstWaveRobot

The robot Id is

whiff-gae-tutor...@appspot.com

-- if you are using wave, please add it to a wave and try it out.
It should respond to a BNF rule you type in like this one:

program ::= begin (statement ;)+ end $$

Happy Holidays everyone... I'm off to the slopes :).
   -- Aaron Watters

===
an apple every 8 hours
will keep 3 doctors away --kliban
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ANN: WHIFF.0.7 += GAE + jQueryUI + internationalization + testdrive = (last beta?)

2009-12-10 Thread Aaron Watters

 That was a joke in the tree view.  You clicked on the science link
 in the tree hierarchy.  I will fix it due to your complaint.

Fixed.  Now clicking on the same link goes to Scientific American.

   http://whiffdoc.appspot.com/

Is that humourless enough for you? :)
You are now immortalized in the WHIFF repository

   http://aaron.oirt.rutgers.edu/cgi-bin/whiffRepo.cgi/rev/6d8c650102dd

Please let me know if anything else offends your
sensibilities.

Thanks again,  -- Aaron Watters

===
an apple every 8 hours
will keep 3 doctors away.  -- kliban
-- 
http://mail.python.org/mailman/listinfo/python-list


ANN: WHIFF.0.7 += GAE + jQueryUI + internationalization + testdrive = (last beta?)

2009-12-09 Thread Aaron Watters
ANNOUNCING WHIFF [WSGI HTTP Integrated Filesystem Frames] release 0.7

   WHIFF INDEX PAGE: http://whiff.sourceforge.net

The new release adds many new features, including

- Google app engine support with tutorial:
 http://whiffdoc.appspot.com/docs/W1100_2300.GAEDeploy
- jQueryUI interactive widget support with tutorial:
 http://whiffdoc.appspot.com/docs/W1100_1450.jQueryUI
- Internationalization tutorial:
 http://whiffdoc.appspot.com/docs/W1100_1700.international
- no install test drive:
 http://whiffdoc.appspot.com/docs/W1100_0500.TestDrive

Also the WHIFF documentation is now hosted on Google App
Engine at the http://whiffdoc.appspot.com/ domain.

What is WHIFF?

WHIFF is a collection of support services for
WSGI/Python web applications which allows applications
to be composed by dropping dynamic pages into
container directories. This mode of development will
be familiar to developers who have created PHP applications,
vanilla CGI scripts, Apache/modpy Publisher applications,
JSP pages, or static web content.

The WHIFF implementation significantly generalizes
the drop in paradigm to support WSGI middleware
components and application fragments as well as
stand-alone pages.

WHIFF provides other services in addition to
supporting drop in components, such as managed
application resources.

WHIFF requires Python 2.5 or better to run out-of-the-box.

Unless significant problems appear in the next
month or so I think this release will be the last beta
release and the next release will add a couple
more features to become WHIFF 1.0.

For more fun please have a look at my community
list/tree maker at http://listtree.appspot.com
which is inspired by Guido van Rossum's excellent
faqwiz.  ListTree is implemented on Google App
Engine using WHIFF.

I hope you like.
-- Aaron Watters

===
Talk low.
Talk slow.
And don't say a lot.
  -- John Wayne's advice to Clint Eastwood
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ANN: WHIFF.0.7 += GAE + jQueryUI + internationalization + testdrive = (last beta?)

2009-12-09 Thread Aaron Watters
On Dec 9, 1:48 pm, Terry Reedy tjre...@udel.edu wrote:
 Aaron Watters wrote:
  Also the WHIFF documentation is now hosted on Google App
  Engine at thehttp://whiffdoc.appspot.com/domain.

 When I went there and clicked on the scatter chart is generated by a
 straightforward invocation of the standard WHIFF OpenFlashChart
 middleware: , Firefox *immediately* opened the 'Official' page of a
 well-known ugly cultwww.sci-logy.orgin a new tab. Something is
 very, very wrong. I really hope this was not intentional on your part.

 When I load the doc page again and click the chart box again, the chart
 is reloaded from the local cache instead of your site and no tab is opened.

 tjr

That was a joke in the tree view.  You clicked on the science link
in the tree hierarchy.  I will fix it due to your complaint.

Nothing is very very wrong :), it was just a misguided joke
(the bio link also goes off to someone fisherman's biography...)

Sorry about that.  Thanks for the feedback.
   -- Aaron Watters

===
want a friend?
get a dog.  -- Truman
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: a huge shared read-only data in parallel accesses -- How? multithreading? multiprocessing?

2009-12-09 Thread Aaron Watters
On Dec 9, 9:58 am, Valery khame...@gmail.com wrote:
 Hi all,

 Q: how to organize parallel accesses to a huge common read-only Python
 data structure?

Use a BTree on disk in a file.  A good file system will keep most of
the
pages you need in RAM whenever the data is warm.  This works
for Python or any other programming language.  Generally you can
always get to any piece of data in about 4 seeks at most anyway,
so if your disk is fast your app will be fast too.  The file can
be accessed concurrently without problems by any number of processes
or threads.

   -- Aaron Watters
  http://listtree.appspot.com
  http://whiffdoc.appspot.com
===
less is more
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: High-performance Python websites

2009-12-06 Thread Aaron Watters
The key to scaling a web site is to make
sure you can load-balance to as many front
ends as needed and then use a common database
backend that is fast enough or possibly a
common file system that is fast enough.

I can't speak to Django specifically but
you can certainly get essentially unlimited
scalability on the front-end side of the
equation using a Python based web app.

The google app engine will set such a
configuration up for you automatically, but
they are still working some bugs out
with regard to performance, I think,
based on my experience here
   http://whiffdoc.appspot.com/
and here
   http://listtree.appspot.com/

I hope that helps.
   -- Aaron Watters

===
an apple every 8 hours
will keep 3 doctors away. -kliban
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python simply not scaleable enough for google?

2009-11-20 Thread Aaron Watters

 Because `language is slow' is meaningless.

Yes.  Everyone knows java is faster than Python right?
But look here:

http://gaejava.appspot.com/

(you might want to run it a couple times to see what
it does when it is 'warm').  I don't think this is
a biased test -- I think the author expected to see
Java faster.

In my runs Python is usually a bit faster on a majority
of these metrics consistently.  Why?  My guess is the
reason is that Python is less bloated than Java so
more of it can stay resident on a shared machine
whereas big hunks of Java have to be swapped in for
every access -- but it's just a guess.

By the way: I see this all the time -- for web use
Python always seems to be faster than Java in my
experience.  (With programs that I write: I tend
to avoid some of the larger Python web tools available
out there and code close to the protocol.)

Comparing language platforms using small
numeric benchmarks often completely misses the
point.

   -- Aaron Watters
  http://whiffdoc.appspot.com
  http://listtree.appspot.com

===
an apple every 8 hours will keep 3 doctors
away.  - kliban
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python simply not scaleable enough for google?

2009-11-17 Thread Aaron Watters

 I don't think Python and Go address the same set of programmer
 desires.  For example, Go has a static type system.  Some programmers
 find static type systems to be useless or undesirable.  Others find
 them extremely helpful and want to use them them.  If you're a
 programmer who wants a static type system, you'll probably prefer Go
 to Python, and vice versa.  That has nothing to do with implementation
 speed or development expenditures.  If Google spent a million dollars
 adding static types to Python, it wouldn't be Python any more.

... and I still have an issue with the whole Python is slow
meme.  The reason NASA doesn't build a faster Python is because
Python *when augmented with FORTRAN libraries that have been
tested and optimized for decades and are worth billions of dollars
and don't need to be rewritten* is very fast.

The reason they don't replace the Python drivers with Java is
because that would be very difficult and just stupid and I'd be
willing to bet that when they were done the result would actually
be *slower* especially when you consider things like process
start-up time.

And when someone implements a Mercurial replacement in GO (or C#
or Java) which is faster and more useful than Mercurial, I'll
be very impressed.  Let me know when it happens (but I'm not
holding my breath).

By the way if it hasn't happened and if he isn't afraid
of public speaking someone should invite Matt Mackall
to give a Python conference keynote.  Or how about
Bram Cohen for that matter...

   -- Aaron Watters http://listtree.appspot.com/

===
if you want a friend, get a dog.  -Truman




-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python simply not scaleable enough for google?

2009-11-13 Thread Aaron Watters
On Nov 11, 3:15 pm, Terry Reedy tjre...@udel.edu wrote:
 Robert P. J. Day wrote:
 I can imagine a day when code compiled from Python is routinely
 time-competitive with hand-written C.

That time is now, in many cases.

I still stand by my strategy published in Unix World
ages ago: get it working in Python, profile it, optimize
it, if you need to do it faster code the inner loops in
C.

Of course on google app engine, the last step is not possible,
but I don't think it is needed for 90% of applications
or more.

My own favorite app on google app engine/appspot is

http://listtree.appspot.com/

implemented using whiff
   http://whiff.sourceforge.net
as described in this tutorial
   http://aaron.oirt.rutgers.edu/myapp/docs/W1100_2300.GAEDeploy

not as fast as I would like sporadically.  But that's
certainly not Python's problem because the same application
running on my laptop is *much* faster.

By the way: the GO language smells like Rob Pike,
and I certainly hope it is more successful than
Limbo was.  Of course, if Google decides to really
push it then it's gonna be successful regardless
of all other considerations, just like Sun
did to Java...

   -- Aaron Watters

===
Limbo: how low can you go?


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: wsgi with separate css file

2009-11-13 Thread Aaron Watters

RE: serving static CSS files using WSGI

 ...However, this method is fragile and very inefficient. If you want to  
 eventually deploy this application somewhere, I would suggest starting  
 with a different method.

The WHIFF WSGI tools are meant to make this kind of thing easy.
In fact the quick start tells you how to do this

http://aaron.oirt.rutgers.edu/myapp/docs/W0500.quickstart

And if you want to deploy to the Google App Engine there's a
tutorial for that too:

http://aaron.oirt.rutgers.edu/myapp/docs/W1100_2300.GAEDeploy

For example the http://listtree.appspot.com/ service is implemented
using WHIFF under the Google App Engine environment.

   -- Aaron Watters

===
TO INFINITY... AND BEYOND!

-- 
http://mail.python.org/mailman/listinfo/python-list


Python library support propaganda lists?

2009-10-30 Thread Aaron Watters
Let me vent my annoyance.

In the last couple months on a few occasions
I've tried various Python libraries (and I'm not going to
name names) and run into some problem.

Following the documented procedure I eventually
post the problem to the support list trying to politely
explain everything, including the admission that
it may all be my stupidity causing the problem.

Then I'm told automatically that my post will
be moderated.

Then nothing happens.  The post just disappears.
No offline reply.  Nothing.

I don't know why this happens, but if people
are using their support forums as propaganda
lists for only happy news I consider this a serious
violation of the spirit of open source.  There
is nothing wrong with filtering spam, of course,
but silently filtering non-spam, even inane non-spam,
is not acceptable.  At least there should be an
offline RTFM reply to the poster.

There, I feel better now.
-- Aaron Watters
   http://aaron.oirt.rutgers.edu/myapp/docs/W1100_1600.openFlashCharts

===
If you think you are smart enough
to write multi-threaded programs,
then you're not.-- Jim Ahlstrom
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python library support propaganda lists?

2009-10-30 Thread Aaron Watters
[note: if this shows up twice, it's because my internet connection
flaked out]

On Oct 30, 12:23 pm, Robert Kern robert.k...@gmail.com wrote:
 You almost certainly ran into technical misconfiguration or lazy moderators.

It's suspicious, however, when other posts
which seem to be from new posters get through
in a timely fashion.

On Oct 30, 8:53 am, Frank Millman fr...@chagford.com wrote:
 Question - do you 'subscribe' to the lists first?

Yes I do, or at least I try.  Sometimes the request to
join gets silently moderated into the bit bucket also.

Ulrich: I'm not talking about the python.org lists
where I've *never* had problems.  I'm talking about
other lists.

I know this may be due to simple laziness and negligence,
but in that case they should turn moderation off.

I don't want to say where I've had this problem,
because I don't want to offend anyone in particular
-- I'm just making a general observation.  Maybe
as Robert suggests I will try comp.lang.python as
a fall back after a few days of nonresponsiveness
in the future...

   -- Aaron Watters
  http://aaron.oirt.rutgers.edu/myapp/docs/W1100_2200.TreeView

===
I'm practicing monogamy
(but I'm not very good at it yet).  -- Steven Tyler
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python library support propaganda lists?

2009-10-30 Thread Aaron Watters
On Oct 30, 12:51 pm, Robert Kern robert.k...@gmail.com wrote:
 On 2009-10-30 11:31 AM, Aaron Watters wrote:

  I know this may be due to simple laziness and negligence,
  but in that case they should turn moderation off.

 That's the funny thing about mailing list problems. If a misconfiguration 
 means
 people can't post to your, you don't hear from the people having problems. Try
 emailing one of the project leaders directly (and politely!) to ask them to
 check their moderation queue for your post. And check Spamhaus to see if your
 mail host is on their list!

  I don't want to say where I've had this problem,
  because I don't want to offend anyone in particular
  -- I'm just making a general observation.

 No, you're not. You're making unsupported accusations of malfeasance.

I don't mean to accuse anyone of anything.
I just want to note that any manipulation of
list content, *if* it ever occurs, is not
acceptable (aside from spam filtering).
Of course I can never prove anything along
these lines and any naming will only result
in creating life long enemies, and no benefit
to me of any kind.

You are right that misconfigurations and incompetence
could be confused with mailing list content
manipulation.  I have tried directly contact the owner too in
at least one case that I can think of and received no
response -- maybe the fellow was too busy, or sick
or dead or something (but still active on the same
mailing list, somehow).
   -- Aaron Watters

===
He's a humble man, with good reason.
   - Churchill, on a colleague
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ANN: WHIFF += Mako treeview url rewrites

2009-10-27 Thread Aaron Watters
On Oct 27, 7:04 am, Paul Boddie p...@boddie.org.uk wrote:
 On 27 Okt, 03:49, Aaron Watters aaron.watt...@gmail.com wrote:



  WHIFF now includes components for
  implementing tree views for web navigation panes
  or other purposes, either using AJAX or frame
  reloads.  Try the GenBank demo at

 http://aaron.oirt.rutgers.edu/myapp/GenBankTree/index

 This looks interesting, but when I have JavaScript switched off, I get
 a big traceback page which indicates that the application doesn't
 understand the normal link on each of the nodes of the tree. I imagine
 that the ideas is to have the application functional with and without
 JavaScript, which is a worthy objective forgotten by many Web
 developers these days.

 Paul

That exact application

http://aaron.oirt.rutgers.edu/myapp/GenBankTree/index

cannot be implemented with javascript
turned off.  You can implement something
kinda similar... h

These days I would guess you are pretty
limited without javascript, no?  For example
I don't think the instructional support web
sites at Rutgers will work properly without
js.

By the way tracebacks are on for debugging
purposes, they can be turned off, of course.

  -- Aaron Watters
===
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ANN: WHIFF += Mako treeview url rewrites

2009-10-27 Thread Aaron Watters
Paul Boddie wrote:
 On 27 Okt, 03:49, Aaron Watters aaron.watt...@gmail.com wrote:
...
  http://aaron.oirt.rutgers.edu/myapp/GenBankTree/index

 This looks interesting, but when I have JavaScript switched off, I get
 a big traceback ...

I just tried it.  How do you get a traceback?  For me none of the
javascript links work: they just do nothing.
-- Aaron Watters

===
if you want a friend, get a dog.  --Truman
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ANN: WHIFF += Mako treeview url rewrites

2009-10-27 Thread Aaron Watters
On Oct 27, 8:02 am, alex23 wuwe...@gmail.com wrote:

 If you need a full traceback, let me know.

Well, yes, the bottom of the traceback would be more useful :).

   -- Aaron Watters
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ANN: WHIFF += Mako treeview url rewrites

2009-10-27 Thread Aaron Watters
On Oct 27, 8:16 am, Aaron Watters aaron.watt...@gmail.com wrote:
 On Oct 27, 8:02 am, alex23 wuwe...@gmail.com wrote:

  If you need a full traceback, let me know.

 Well, yes, the bottom of the traceback would be more useful :).

    -- Aaron Watters

Alex sent me the traceback (thanks!) and after consulting
the logs and the pages I figured out that the version of
Firefox in question was not ignoring my javascript links like
it should.  Instead FF was interpreting them as HTTP links to
pages that didn't exist -- which is perfectly idiotic -- so
WHIFF was complaining that it couldn't find the page (which
is correct).

Anyway, you shouldn't see this buglet any more -- if you
don't have javascript you will get a nice polite message
saying that the page doesn't work unless javascript is
enabled.

http://aaron.oirt.rutgers.edu/myapp/GenBankTree/index

I hope you like it again.  Thanks for the help!
   -- Aaron Watters

===

nobody ever got fired for buying IBM^H^H^HMicrosoft.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Web development with Python 3.1

2009-10-27 Thread Aaron Watters
On Oct 27, 10:26 am, Diez B. Roggisch de...@nospam.web.de wrote:
...
 Yes, in the end of the day, it's all python.

For me, in the end of the day, it's all java or PHP.
But I'm working on that.  For my purposes the frameworks
don't really help much.  That's why I built WHIFF :).

http://aaron.oirt.rutgers.edu/myapp/docs/W1100_2200.TreeView

  -- Aaron Watters

===
If all you got is lemons, make lemonade.
  -- anon.
-- 
http://mail.python.org/mailman/listinfo/python-list


ANN: WHIFF += Mako treeview url rewrites

2009-10-26 Thread Aaron Watters
WHIFF 0.6 RELEASED

WHIFF += Mako  treeview  url rewrites

WHIFF is a collection of support services
for Python/WSGI Web applications which
allows applications to be composed by
dropping dynamic pages into container
directories.

This mode of development will be familiar
to developers who have created PHP
applications, vanilla CGI scripts,
Apache/modpy Publisher applications,
JSP pages, or static web content.

The new WHIFF 0.6 release now includes

** Treeview widgets

WHIFF now includes components for
implementing tree views for web navigation panes
or other purposes, either using AJAX or frame
reloads.  Try the GenBank demo at

http://aaron.oirt.rutgers.edu/myapp/GenBankTree/index

Read more in the tree view tutorial:

http://aaron.oirt.rutgers.edu/myapp/docs/W1100_2200.TreeView

** Mako template support

New standard middleware provides built in support
for using the fast, powerful, elegant, and popular
Mako template engine in WHIFF applications. Read
more in the Mako tutorial:

http://aaron.oirt.rutgers.edu/myapp/docs/W1100_1075.MakoGrading

** Url rewrites

The URL rewrite tutorial explains how to
implement WHIFF applications using URLs that
are shorter and easier to understand.  Read
it here:

http://aaron.oirt.rutgers.edu/myapp/docs/W1100_2050.UrlMapping

WHIFF HOME PAGE: http://whiff.sourceforge.net

I hope you like it!  -- Aaron Watters

===
less is more.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Web development with Python 3.1

2009-10-26 Thread Aaron Watters
On Oct 25, 7:52 pm, Alan Harris-Reid a...@baselinedata.co.uk wrote:
 I am very much new to Python, and one of my first projects is a simple
 data-based website. I am starting with Python 3.1 (I can hear many of
 you shouting don't - start with 2.6), but as far as I can see, none of
 the popular python-to-web frameworks (Django, CherryPy, web.py, etc.)
 are Python3 compatible yet.

 So, what can I use to start my web programming experience using 3.1?

 Any help would be appreciated.

 Alan

Don't. use python 2.6 with WHIFF :)
  http://aaron.oirt.rutgers.edu/myapp/GenBankTree/index
  http://whiff.sourceforge.net

-- Aaron Watters

===
It gotta be rock-roll music
if you wanna dance with me
if you wanna dance with me
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Object Relational Mappers are evil (a meditation)

2009-10-21 Thread Aaron Watters
On Oct 16, 10:35 am, mario ruggier mario.rugg...@gmail.com wrote:
 On Oct 5, 4:25 pm, Aaron Watters aaron.watt...@gmail.com wrote:

  Occasionally I fantasize about making a non-trivial change
  to one of these programs, but I strongly resist going further
  than that because the ORM meatgrinder makes it somewhere
  between extremely unpleasant and impossible to make any
  non-trivial changes to a non-trivial program, especially after
  it has been populated with data.

 Object-relational mappers are like putting lipstick on a 
 pig:http://gizmoweblog.blogspot.com/2006/10/putting-lipstick-on-pig.html

 m ;-)

Cute, but wrong.  Using ORMs is better than using Object databases.

In my case I use Python to un data created by java/hibernate.
If I was using a java based object database I would be simply stuck.
At least if you use an ORM you have a way to access the information
without writing a program in the programming language that the
ORM was defined in.  Anyway, thanks for all the great comments on
this thread from all you Sarcopterygii and Haplorrhini out there.

  -- Aaron Watters
 http://aaron.oirt.rutgers.edu/myapp/GenBankTree/index

===

SQL is the worst possible data interface language
except for all the others.  -- Churchill (paraphrased)
-- 
http://mail.python.org/mailman/listinfo/python-list


Object Relational Mappers are evil (a meditation)

2009-10-05 Thread Aaron Watters
This is a bit off topic except that many Python
programmers seem to be allergic to typing SQL.

RESOLVED:  Using ORMs leads lazy programmers
to make bad database designs.  It's better to
carefully design your database with no invisible
means of support and there is no reason to not
use SQL directly for this purpose.

FOR EXAMPLE:  Consider blogging.  The most
successful blog software is WORDPRESS.  Here
is the WordPress data model:

http://blog.kapish.co.in/wp-content/uploads/2009/03/wp_2.7.png

Beautiful, isn't it?  It was designed by people who
thought about what they were doing and did it carefully.

Now let's look at the Sakai Blogger tool data model
(as reverse engineered by someone who had to
fix a bug -- there actually was no data design created
by the implementers):

confluence.sakaiproject.org/download/attachments/17072138/
entitymodel.pdf

How did the above happen?  I suspect someone opened
up Eclipse and started typing, relying on the Hibernate
ORM to handle all the database stuff automagically.  The
result is a massive headache for people like me.  Another
one.  I routinely open up the mysql prompt and start typing
show tables, describe table blah, select * from blah limit 10...
trying to figure out WTF Hibernate did with my data.

Occasionally I fantasize about making a non-trivial change
to one of these programs, but I strongly resist going further
than that because the ORM meatgrinder makes it somewhere
between extremely unpleasant and impossible to make any
non-trivial changes to a non-trivial program, especially after
it has been populated with data.

Ok I feel a little better now.  Maybe I should get back
to work...

   -- Aaron Watters
  http://aaron.oirt.rutgers.edu/myapp/docs/W1100_1200.wwiki

===

It has been said that democracy is the worst form of government except
all the others that have been tried.
Sir Winston Churchill
http://www.quotationspage.com/quote/364.html
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: is this whiff/wsgi claim true?

2009-09-30 Thread Aaron Watters
regarding
  http://aaron.oirt.rutgers.edu/myapp/docs/W1000.concepts

On Sep 27, 11:12 pm, Дамјан Георгиевски gdam...@gmail.com wrote:
 mod_wsgi (the apache module) can be configured to automatically run any
 .wsgi file dropped in a folder just like CGI ... see here
 http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIScr...

Thanks.  I think this observation makes a liar of me :(.
I'll have to reword the claim.  I could split hairs to
assert that this is not the same thing, but it's close
enough

   -- Aaron Watters

===
Speak roughly to your little boy
  and beat him when he sneezes.
He only does it to annoy
  because he knows it teases.
I speak severely to my boy
  and beat him when he sneezes
For he can thoroughly enjoy
  the pepper when he pleases!
 -- Lewis Carroll
-- 
http://mail.python.org/mailman/listinfo/python-list


is this whiff/wsgi claim true?

2009-09-25 Thread Aaron Watters
Hi folks.  I just modified the WHIFF concepts index page

http://aaron.oirt.rutgers.edu/myapp/docs/W1000.concepts

To include the following paragraph with a startling and arrogant
claim in the final sentence :)


Developers build WHIFF applications much like they build
static web content, PHP applications, JSP pages, or ASP
pages among others -- the developer drops files into a
directory, and the files are automatically used to respond
to URLs related to the filename.
**This intuitive and ubiquitous approach to organizing
web components is not automatically supported by other
WSGI infrastructures.**


[I go on to illustrate the concept with examples...]

Is the final sentence true?  Are there other WSGI approach
which make deploying a dynamic page as easy as putting
an HTML file in a static directory?  If I'm lying I'd like to
correct the statement and my knowledge of what else is out
there is faulty and incomplete, so please correct me.

Thanks,  -- Aaron Watters

===

less is more
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: is this whiff/wsgi claim true?

2009-09-25 Thread Aaron Watters
regarding http://aaron.oirt.rutgers.edu/myapp/docs/W1000.concepts

Michele Simionato writes:
 To me, it looks like the approach Quixote used long before the coming
 of WSGI
 (see http://www.quixote.ca/learn/1 How Quixote Works).

This a fair comparison and you could
also note similarities with
to modpy/publisher and even CGI but
none of these are WSGI components
or infrastructures whereas WHIFF is both a WSGI
component and an infrastructure.  So this is
not the counterexample I was looking for.
  -- Aaron Watters

===
- She turned me into a newt!
- A newt?
- ...I got better.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Looking for a pure Python chart drawing module

2009-09-18 Thread Aaron Watters
On Sep 15, 1:25 pm, John Nagle na...@animats.com wrote:
 I'm looking for something that can draw simple bar and pie charts
 in Python.  I'm trying to find a Python package, not a wrapper for
 some C library, as this has to run on both Windows and Linux
 and version clashes are a problem.

http://skimpygimpy.sourceforge.net includes charts and canvases
that generate PNG using pure Python.  Honestly, they aren't
very pretty though :(.

Also, if you are looking for web display also take a look
at WHIFF Flash charts (using either open flash charts or amcharts)
-- these are very pretty.

  http://aaron.oirt.rutgers.edu/myapp/docs/W1100_1600.openFlashCharts

  -- Aaron Watters

===
Tee front:
  80 minutes / 16 positions / no protection
back:
  Rutgers Rugby

-- 
http://mail.python.org/mailman/listinfo/python-list


WHIFF += Open Flash Charts

2009-09-17 Thread Aaron Watters
WHIFF (WSGI HTTP Integrated Filesystem Frames) 0.5 released.
 [ WHIFF += Open Flash Charts ]

The new WHIFF 0.5 release linked from

http://whiff.sourceforge.net

includes built in support for Open Flash Charts --
see documentation at

http://aaron.oirt.rutgers.edu/myapp/docs/W1100_1600.openFlashCharts

Its pretty cool, if I do say so myself :).

It also includes number of enhancements and bugfixes including
a fairly important performance bugfix.

What is Open Flash Charts?

Open Flash Charts (http://teethgrinder.co.uk/open-flash-chart-2/ )
is an LPGL Flash implementation for a large number of
attractive and dynamic graphical charts.  These charts
may be used to present numeric data on web pages
in an attractive, accessible and forceful manner.
Available chart types include line, bar, scatter, candle stick,
and radar charts.

What is WHIFF?

WHIFF is a collection of support services for Python WSGI
applications which allows applications to be composed
by dropping dynamic pages into container directories.
This mode of development will be familiar to developers
who have created PHP applications, vanilla CGI scripts,
Apache/modpy Publisher applications, JSP pages, or
static web content.  It is distributed under a BSD
style open source license.

The WHIFF implementation significantly generalizes the
drop in paradigm to support WSGI middleware components
and application fragments as well as stand-alone pages.

WHIFF provides other services in addition to supporting
drop in components, such as managed application
resources.

I created WHIFF to address complexity issues I
encounter when creating and fixing sophisticated
Web applications which include complex database
interactions and dynamic features such as AJAX
(Asynchronous Javascript And XML).

Project home page:
   http://whiff.sourceforge.net .
Documentation index:
   http://aaron.oirt.rutgers.edu/myapp/docs/W.intro .

I hope you like it!

   -- Aaron Watters

===
an apple every 8 hours will keep 3 doctors away
  -- kliban
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Data visualization in Python

2009-08-20 Thread Aaron Watters
On Aug 17, 3:10 pm, kj no.em...@please.post wrote:
 I'm looking for a good Python package for visualizing
 scientific/statistical data.  (FWIW, the OS I'm interested in is
 Mac OS X).

Please take a look at the amcharts embedding in WHIFF

http://aaron.oirt.rutgers.edu/myapp/amcharts/doc

WHIFF is a collection of support services for WSGI
applications which allows applications to be composed
by dropping dynamic pages into container directories.

http://aaron.oirt.rutgers.edu/myapp/docs/W.intro

thanks, -- Aaron Watters

===
Sisyphus got ripped.
-- 
http://mail.python.org/mailman/listinfo/python-list


off topic: google groups sucks?

2009-08-17 Thread Aaron Watters
Just a note.  It seems that google groups is increasing the
sucks coefficient.

I search for things using group search for comp.lang.python
and I get no results even though I know there are results from
a few months or weeks ago.

What is the best alternative for this kind of trawling?  gmane?

With all the smart people working at google how can they
 up like this?

Inquiring minds want to know.

   -- Aaron Watters

===
Sisyphus got ripped.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: off topic: google groups sucks?

2009-08-17 Thread Aaron Watters
On Aug 17, 10:05 am, Aaron Watters aaron.watt...@gmail.com wrote:
 Just a note.  It seems that google groups is increasing the
 sucks coefficient.

I'm having better luck now using the advanced search option
with queries like

   gadfly group:comp.lang.python

which become

   http://groups.google.com/groups/search?q=gadfly+group:comp.lang.python

The search this group feature still needs fixing, however.

  -- Aaron Watters

===
if you lined up all economists end to end
they'd still point in different directions.
   -- stolen from somewhere
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: off topic: google groups sucks?

2009-08-17 Thread Aaron Watters
On Aug 17, 1:44 pm, John Yeung gallium.arsen...@gmail.com wrote:
 Thanks, Aaron, for confirming that it's not just me!

yea, unfortunately this kind of thing happens in monopolies
that have no viable competition anymore... Sometimes I begin
to suspect that I'm seeing the results that I should want
rather than the results I want.

(Lucene has this property
too -- you get the results bthe algorithm/b wants you to get,
rather than the results you want to get.)

-- Aaron Watters

===
In communism the future is certain,
but the past is ever changing.
-- 
http://mail.python.org/mailman/listinfo/python-list


WHIFF 0.4 += repoze.who authentication + menus + calculator + docs.

2009-07-14 Thread Aaron Watters
WHIFF (WSGI HTTP Integrated Filesystem Frames) 0.4 released.

The new WHIFF 0.4 release linked from

http://whiff.sourceforge.net

includes the following enhancements:

Built in support for repoze.who based authentication
(from http://static.repoze.org/whodocs/ ) + tutorial
   see: http://aaron.oirt.rutgers.edu/myapp/docs/W1100_1500.who .

AJAX calculator demo and tutorial:
   see: http://aaron.oirt.rutgers.edu/myapp/docs/W1100_1400.calc .

Built in drop-down menu support and tutorial:
   see: http://aaron.oirt.rutgers.edu/myapp/docs/W1100_1300.menus .

Some subtle but important bug fixes, including a thread
race condition bug fix.  Auto-reload support.

Also documentation improvements: particularly
for standard middleware
   see: http://aaron.oirt.rutgers.edu/myapp/docs/W1200_1400.stdMiddleware

What is WHIFF?

WHIFF is a collection of support services for Python WSGI
applications which allows applications to be composed
by dropping dynamic pages into container directories.
This mode of development will be familiar to developers
who have created PHP applications, vanilla CGI scripts,
Apache/modpy Publisher applications, JSP pages, or
static web content.

The WHIFF implementation significantly generalizes the
drop in paradigm to support WSGI middleware components
and application fragments as well as stand-alone pages.

WHIFF provides other services in addition to supporting
drop in components, such as managed application
resources.

I created WHIFF to address complexity issues I
encounter when creating and fixing sophisticated
Web applications which include complex database
interactions and dynamic features such as AJAX
(Asynchronous Javascript And XML).

Project home page:
   http://whiff.sourceforge.net .
Documentation index:
   http://aaron.oirt.rutgers.edu/myapp/docs/W.intro .

I hope you like it!

   -- Aaron Watters

===
% ping elvis
elvis is alive
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Good books in computer science?

2009-06-16 Thread Aaron Watters
On Jun 14, 4:47 pm, dads wayne.dads.b...@gmail.com wrote:
 I'm wanting to purchase some of the titles that have been raised in
 this thread. When I look they are very expensive books which is
 understandable. Do you think getting earlier editions that are cheaper
 is a daft thing or should I fork out the extra £10-£30 to get the
 latest edition?

This is the best book ever written on computer science
and the first edition is free.

http://www.math.upenn.edu/~wilf/AlgComp3.html

  -- Aaron Watters
 http://aaron.oirt.rutgers.edu/myapp/amcharts/doc

===
less is more.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ANN: WHIFF += Flash chart widget support (Aaron Watters)

2009-06-12 Thread Aaron Watters
Regarding:
 http://aaron.oirt.rutgers.edu/myapp/amcharts/doc

On Jun 12, 3:07 am, oyster lepto.pyt...@gmail.com wrote:
 nice
 the only pity is that amcharts is not a money-free product

It is if you don't mind the little link in the corner.
(which I think is only fair).

I found a totally free one that looked pretty good
too, which I may add sometime.

http://teethgrinder.co.uk/open-flash-chart/

  -- Aaron Watters

===
an apple every 8 hours
will keep 3 doctors away.  -- kliban
-- 
http://mail.python.org/mailman/listinfo/python-list


ANN: WHIFF += Flash chart widget support

2009-06-11 Thread Aaron Watters
WHIFF.0.3 adds amChart Flash based Charts.

The amChart chart widgets
  [ http://www.amcharts.com ]
provide a sophisticated methodology
for creating beautiful and interactive
statistical charts using Adobe Flash
plug-in technology.

The WHIFF.0.3 release adds extensive
support for embedding amCharts charts
in web pages under the ./demo/amcharts
demo directory area.

Please look at chart examples
explained in the documentation at

http://aaron.oirt.rutgers.edu/myapp/amcharts/doc

Also please try out the
disk usage analysis pie chart drill
down demo at

http://aaron.oirt.rutgers.edu/myapp/amcharts/diskUsage

Below is more information about WHIFF:
===

WHIFF -- WSGI/HTTP INTEGRATED FILESYSTEM FRAMES

WHIFF is an infrastructure for easily building
complex Python/WSGI Web applications by combining
smaller and simpler WSGI components organized
within file system trees.

To DOWNLOAD WHIFF go to the WHIFF project
information page at

http://sourceforge.net/projects/whiff

and follow the download instructions.

To GET THE LATEST WHIFF clone the
WHIFF Mercurial repository located at

http://aaron.oirt.rutgers.edu/cgi-bin/whiffRepo.cgi.

To READ ABOUT WHIFF view the WHIFF documentation at

http://aaron.oirt.rutgers.edu/myapp/docs/W.intro.

To PLAY WITH WHIFF try the demos listed in the demos page at

http://aaron.oirt.rutgers.edu/myapp/docs/W1300.testAndDemo.

Why WHIFF?
==
WHIFF (WSGI HTTP Integrated Filesystem Frames)
is intended to make it easier to create, deploy,
and maintain large and complex Python based WSGI
Web applications. I created WHIFF to address
complexity issues I encounter when creating and
fixing sophisticated Web applications which
include complex database interactions
and dynamic features such as AJAX
(Asynchronous JavaScript and XML).

The primary tools which reduce complexity are
an infrastructure for managing web application
name spaces, a configuration template language
for wiring named components into an application,
and an applications programmer interface for
accessing named components from Python and
javascript modules.

All supporting conventions and tools offered by
WHIFF are optional. WHIFF is designed to work well
with other modules conformant to the
WSGI (Web Service Gateway Interface) standard.
Developers and designers are free to use those
WHIFF tools that work for them and ignore or
replace the others.

WHIFF does not provide a packaged cake mix
for baking a web application.
Instead WHIFF is designed to provide a set of
ingredients which can be easily combined to make
web applications (with no need to refine your own
sugar or mill your own wheat).

I hope you like it.  -- Aaron Watters

===
less is more
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: free chart lib for Python?

2009-06-10 Thread Aaron Watters
On May 7, 10:27 pm, oyster lepto.pyt...@gmail.com wrote:
 I mean chart, not plot. If you don't know the difference, you can
 checkwww.advsofteng.com, which is a commercial program

 is there such a thing with many kinds ofchart, i.e. pie-chart,
 line-chart, ..?

 A long time ago, I programmed a rmchart interface, however rmchart is
 windows only, andwww.rmchart.comdisappeared now

 See you

I'm about to announce WHIFF/amChart after some more testing.

WHIFF/amCharts generates highly sophisticated interactive
charts using Adobe/Flash plug-in applets.

Documentation here:

  http://aaron.oirt.rutgers.edu/myapp/amcharts/doc

You can get it from the WHIFF mercurial repository for now.

  http://aaron.oirt.rutgers.edu/cgi-bin/whiffRepo.cgi

I will upload a tarball to http://whiff.sourceforge.net soonish.

Thanks in advance for any comments.

   -- Aaron Watters

===
I want to achieve immortality by not dieing.
  -- Woody Allen
-- 
http://mail.python.org/mailman/listinfo/python-list


Ann: Nucular full text search 0.5 +boolean queries +unicode fixes

2009-05-20 Thread Aaron Watters
Announcing Nucular 0.5

This release adds streamlined interfaces for
boolean queries.  Search for dogs or cats
but not smelly like this:

  dicts = session.dictionaries((dogs|cats) ~smelly)

Also included are some other features and bug
fixes, including some unicode handling bugfixes.

   HOME: http://nucular.sourceforge.net/
   BOOLEAN QUERIES: http://nucular.sourceforge.net/Boolean.html

About Nucular:

Nucular is a system for creating full text indices
for fielded data.  It can be accessed via a Python API
or via a suite of command line interfaces.

Nucular archives fielded documents and retrieves them
based on field value, field prefix, field word prefix,
or full text word prefix, word proximity or combinations of
these. Nucular also includes features for determining values
related to a query often called query facets.

Features

Nucular is very light weight. Updates and accesses
do not require any server process or other system
support such as shared memory locking.

Nucular supports concurrency. Arbitrary concurrent
updates and accesses by multiple processes or threads
are supported, with no possible locking issues.

Nucular is pure Python.
Nucular indexes and retrieves data quickly.
Nucular has a funny name.

More information about Nucular including links
to documentation, and releases is available at
http://nucular.sourceforge.net

Thanks: Rene Maurer and Matt Chaput and others
for comments, suggestions, patches.

   -- Aaron Watters

===
an apple every 8 hours
will keep 3 doctors away.  -- kliban
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: OT: a metacomment on feedback comments

2009-04-27 Thread Aaron Watters
Regarding feedback about
WHIFF -- WSGI/HTTP Integrated Filesystems Frames

On Apr 23, 3:43 pm, Aaron Watters aaron.watt...@gmail.com wrote:
 On Apr 23, 11:54 am, Johannes Bauer dfnsonfsdu...@gmx.de wrote:

  To sum it up, I think it's a neat idea, but it's not really intuitive.
  After being quite startled at first it got better after I read the why
  it's cool page.

 Thanks for taking the time to check it out and comment, Johannes.
 I think you bring up a very good point --
 some of directive names are confusing.  

In retrospect the names were more than confusing.  They were
simply awful.   Thanks to Johannes, Drew and others I decided
to rename the directives:

use-url becomes include,
use-section becomes use,
bind-section becomes reuse,
bind-url becomes use-include,
section becomes using,
parameter becomes require

These names are much less stupid (except for
use-include, but I couldn't come up with anything
better...).

Thanks Johannes and Drew!  There is a new release
with the new directive names linked from

  http://whiff.sourceforge.net

(What was I thinking?)

   -- Aaron Watters

===
KIDS MAKE NUTRITIOUS SNACKS
  (A real life newspaper headline)
--
http://mail.python.org/mailman/listinfo/python-list


OT: a metacomment on feedback comments

2009-04-23 Thread Aaron Watters
I just noticed this on my documentation
page.

http://aaron.oirt.rutgers.edu/myapp/docs/W.intro

This is quite possible the most confusing
web framework ever.   It really deserves
some kind of award in a special category.


This was posted just after someone on the same
computer (somewhere in Texas)
tried and failed to inject some javascript
into the page using a comment.

I don't see how this comment is helpful to
me or anyone reading the page.  How the
framework confusing?  Why should other readers dismiss
the project?  Can the documentation
or implementation be
improved, or is the whole thing beyond repair
and if so how or why?  Why do people bother
to write comments like this one?

Is there a link somewhere I can point to
to help people write useful or constructive
comments?

BTW: I just added support for several
Mootools javascript widgets and the
FCK wisiwig editor, checked in
to the repository and demoed in the
documentation, but not tarred up
in a release yet.

At least I'm having fun with it!

   -- Aaron Watters
  http://aaron.oirt.rutgers.edu/myapp/docs/W1500.whyIsWhiffCool

===
ban dhmo!
http://www.dhmo.org/
--
http://mail.python.org/mailman/listinfo/python-list


Re: OT: a metacomment on feedback comments

2009-04-23 Thread Aaron Watters
On Apr 23, 11:54 am, Johannes Bauer dfnsonfsdu...@gmx.de wrote:
 To sum it up, I think it's a neat idea, but it's not really intuitive.
 After being quite startled at first it got better after I read the why
 it's cool page.

Thanks for taking the time to check it out and comment, Johannes.
I think you bring up a very good point --
some of directive names are confusing.  I will think on renaming
them and I'd love suggestions.  For those who may be interested
please see the comments at the bottom of

http://aaron.oirt.rutgers.edu/myapp/docs/W1200_1200.config_template

for my initial thoughts inspired by J.B's comments.

[BTW: I had to back out a handful of mootools coolnesses
because they broke in horrible ways under IE8 -- I
apologize if you saw a blank page or any other weirdness.]

Thanks again!  -- Aaron Watters
  http://aaron.oirt.rutgers.edu/myapp/docs/W1500.whyIsWhiffCool

===
How do you get to Carnegie Hall?
Practice! Practice!
--
http://mail.python.org/mailman/listinfo/python-list


Re: Too early implementation

2009-04-18 Thread Aaron Watters
On Apr 18, 7:48 am, Filip Gruszczyński grusz...@gmail.com wrote:
 So, do you know some good methods to prevent myself from just starting
 coding (which I like very much) and do some thinking about the problem
 (which I like a little less ;-))?

There are a lot of ideas, some you've seen earlier
in this thread.  Below is a sketch of the
approach I prefer.

1) Know exactly what problem you are trying to solve.
Describe the problem to the client and make sure the
client agrees with your definition.

2) Code up the solution in the simplist possible way.
(Document the strategy with an architectural outline, maybe).

3) Write tests to exercise/debug
the code and make sure you solved
the problem.  Also demo the prototype to
the client and make sure the client agrees
you solved the problem.

Usually at this point the first time through
you realize that you didn't
solve the problem, or didn't solve the right problem,
so you should start over at (1) ideally making
use of the bad implementation you have for reference
only (except for parts which can be included
without modification).  [Thank yourself you didn't
try to optimize your wrong solution and that
you implemented it in the simplist possible way.]

If you did solve the right problem then...

(4) Okay, now you solved the problem. Do you need
to optimize anything?  If so, optimize, using the
test cases to make sure your optimizations don't
break anything.  If not, you are done: don't
optimize anything.

(5) Now document your APIs, and other
interfaces.

(Ahem).  For example WHIFF
http://whiff.sourceforge.net
is a descendant of a lot of libraries
and tools I've written to help me and people
I've worked with build web sites over the years.

It's been some months but I
think I started/restarted 3 times before
I was happy with the basic approach and could
move forward past step (3).

  -- Aaron Watters
http://aaron.oirt.rutgers.edu/myapp/docs/W1500.whyIsWhiffCool

===
Software time estimation rule:
How long could it possibly take?
Double that.
Switch to the next higher time units (days..weeks etc)
--
http://mail.python.org/mailman/listinfo/python-list


Re: WHIFF - was: Re: Using Python after a few years of Ruby

2009-04-16 Thread Aaron Watters
On Apr 15, 4:35 pm, Gerhard Häring g...@ghaering.de wrote:
 WTF?! This is weird stuff! Why the hell would I use this instead of a
 Python web framework like Django/Pylons/etc.

Ok folks. I've added a page:

  Whiff is cool because: How do you make a page
  like this using another package?

  http://aaron.oirt.rutgers.edu/myapp/docs/W1500.whyIsWhiffCool

This doesn't compare WHIFF to Django/Pylons/etc
except to make the unsubstantiated claim that you
can't do the stuff demonstrated on the page as
easily using any other package.

The claim may be wrong, but not to my
knowledge.  I'm looking forward to learning
otherwise.  Please don't be too harsh.

   -- Thanks,  Aaron Watters

===
If all the economists in the world
were placed end to end
they'd still point in different directions.
--
http://mail.python.org/mailman/listinfo/python-list


Re: Using Python after a few years of Ruby

2009-04-15 Thread Aaron Watters
On Apr 15, 3:49 am, Tim Hoffman zutes...@gmail.com wrote:

 There are plenty of python web frameworks, some have quite different
 approaches,
 what suits you will depend very much on your own bias, interest.

I've had a lot of luck with WHIFF
( http://whiff.sourceforge.net )
Of course I wrote it and just released it publicly
recently.

I'm a bit disappointed because I know a lot of people have looked
at the docs and demos and there have been a number of downloads,
but I haven't gotten one comment yet :( zilch nada.  (There is
one comment attached to one of the docs, but that was me testing
the comments feature :) ).

Back in the old days you could at least count on someone yelling
at you about how your design was such a bad idea

  -- Aaron Watters

===
HELP! HELP! I'M BEING REPRESSED!
--
http://mail.python.org/mailman/listinfo/python-list


Re: WHIFF - was: Re: Using Python after a few years of Ruby

2009-04-15 Thread Aaron Watters

 You should perhaps contrast WHIFF with the other offerings for creating
 web applications.

 -- Gerhard

You're right.  Thanks for visiting!  I'll have to think.
Basically I don't want something which takes over the controls.
I'll have to think about a better way to explain what I mean.

   -- Aaron Watters ( http://whiff.sourceforge.net )

===
Sisyphus got ripped.
--
http://mail.python.org/mailman/listinfo/python-list


Re: HTML Conversion in python

2009-04-13 Thread Aaron Watters
On Apr 13, 1:47 am, venutaurus...@gmail.com
venutaurus...@gmail.com wrote:
 Hello All,
 Is there any library defined in Python which can convert a
 given text file into a html page. Basically, I require functions for
 creating tables or filling background colours for the html pages etc
 instead of writing each and every tag in my script..

 Thank you,
 Venu Madhav.

At the risk of being annoying, I just announced
a suite of tools that includes a methodology for
building complex pages by combining simple page fragments.

Please have a look at the tutorial
  http://aaron.oirt.rutgers.edu/myapp/docs/W1100.tutorial

This is the configuration source for the tutorial page

{{use-url comments}}
   {{section title}} Tutorial {{/section}}
   {{section summary}}
  Walking through some examples will help you learn
  the organization and capabilities of the whiff
  package.
   {{/section}}
   {{section body}}
  These tutorials hope to introduce WHIFF by discussing a number
  of use cases, beginning with simple ones and progressing to
examples
  with greater complexity.
  p
  (UNDER CONSTRUCTION)
   {{/section}}
{{/use-url}}

The page generated from this source is much
more complex than that (take a look).  The
comments URL points to another WHIFF template
which defines the scaffolding for all WHIFF
documentation pages.  The comments page in turn
uses other fragments and scaffoldings...

There are many other
HTML generation approaches as indicated by the
Wiki link previously.  As far as I
know the WHIFF approach is the most compositional.
Please correct me if I'm wrong.

Thanks, -- Aaron Watters

===
'To join the Guild I had to kill somebody,
cruelly, with no mercy, and without reason
-- so I killed the dwarf, because she was
really annoying anyway.'
  -- World of Warfare talk, overheard.
--
http://mail.python.org/mailman/listinfo/python-list


Ann: WHIFF -- WSGI/HTTP INTEGRATED FILESYSTEM FRAMES

2009-04-12 Thread Aaron Watters
announcing:

WHIFF -- WSGI/HTTP INTEGRATED
 FILESYSTEM FRAMES

WHIFF is an infrastructure for easily building
complex Python/WSGI Web applications by
combining smaller and simpler WSGI components
organized within file system trees.

To read about WHIFF view the WHIFF documentation at

http://aaron.oirt.rutgers.edu/myapp/docs/W.intro.

To PLAY WITH WHIFF try the demos listed in the demos page at

http://aaron.oirt.rutgers.edu/myapp/docs/W1300.testAndDemo.

To DOWNLOAD WHIFF go to the WHIFF project
information page at

http://sourceforge.net/projects/whiff

and follow the download instructions.

To get the latest clone the
WHIFF Mercurial repository located at

http://aaron.oirt.rutgers.edu/cgi-bin/whiffRepo.cgi.

Why WHIFF?
==
WHIFF (WSGI HTTP Integrated Filesystem Frames)
is intended to make it easier to create, deploy,
and maintain large and complex Python based WSGI
Web applications. I created WHIFF to address
complexity issues I encounter when creating and
fixing sophisticated Web applications which
include complex database interactions
and dynamic features such as AJAX
(Asynchronous JavaScript and XML).

The primary tools which reduce complexity are
an infrastructure for managing web application
name spaces, a configuration template language
for wiring named components into an application,
and an applications programmer interface for
accessing named components from Python and
javascript modules.

All supporting conventions and tools offered by
WHIFF are optional. WHIFF is designed to work well
with other modules conformant to the
WSGI (Web Service Gateway Interface) standard.
Developers and designers are free to use those
WHIFF tools that work for them and ignore or
replace the others.

WHIFF does not provide a packaged cake mix
for baking a web application.
Instead WHIFF is designed to provide a set of
ingredients which can be easily combined to make
web applications (with no need to refine your own
sugar or mill your own wheat).

I hope you like it.  -- Aaron Watters

===
Why is a giraffe's neck so long?
Because its head is so far from its body!

--
http://mail.python.org/mailman/listinfo/python-list


Re: Data Model:

2009-04-12 Thread Aaron Watters
On Apr 12, 10:14 pm, Anthony alantho...@gmail.com wrote:
 I'm struggling on whether or not to implement GroupItem (below) with
 two separate models, or with one model that has a distinguishing key:

 Given:
 class ParentGroup:
     a group of values represented by class GroupItem

 class ChildGroup:
     a group of values represented by class GroupItem
     foreign-key to ParentGroup (many Children sum to one Parent)

 Option A:
 class GroupItem:
     foreign-key to ParentGroup
     foreign-key to ChildGroup
     GroupItemType in (ParentItem, ChildItem)
     value
     value-type

 Option B:
 class ParentGroupItem
     foreign-key to ParentGroup
     value
     value-type

 class ChildGroupItem
     foreign-key to ChildGroup
     value
     value-type

 What are my considerations when making this decision?

 Thanks!

It looks to me that the two designs
might be useful for different
purposes.  What are you trying to do?

  -- Aaron Watters


whiff.sourceforge.net
http://aaron.oirt.rutgers.edu/myapp/root/misc/erdTest

--
http://mail.python.org/mailman/listinfo/python-list


ANN: Nucular full text indexing 0.4

2009-02-05 Thread Aaron Watters
ANNOUNCING NUCULAR 0.4
==

This release adds a simple table space wrapper
which makes Nucular easier to use for some
purposes.  It also fixes a number of bugs.

WHERE IS IT?

Find documentation and downloads at

  http://nucular.sourceforge.net/

WHAT IS IT?

Nucular is a system for creating full text
indices for fielded data. It can be accessed
via a Python API or via a suite of command
line interfaces.

Nucular archives fielded documents and
retrieves them based on field value, field
prefix, field word prefix, or full text
word prefix, word proximity or combinations
of these. Nucular also includes features
for determining values related to a query
often called query facets.

FEATURES

* Nucular is very light weight.
Updates and accesses do not require
any server process or other system
support such as shared memory locking.

* Nucular supports concurrency.
Arbitrary concurrent updates and
accesses by multiple processes or
threads are supported, with no
possible locking issues.

* Nucular indexes and retrieves
data quickly.

* Nucular has a funny name.

NOTES

The file storage format for this release is
not compatible with older formats (the change
was needed to fix a bug).

On Windows XP I had to delete the old
package manually from the Python library
before the install for the new package
would work properly.

I hope you like it.

   -- Aaron Watters

===
Fear has several advantages over gratitude.
Gratitude is intrinsically limited,
if only by the finite creative capacity of
the scientific community. Moreover, as
pointed out by a colleague at MIT, appealing
to people’s gratitude and trust is usually
less effective than pulling a gun.
  -- Richard Lindzen
--
http://mail.python.org/mailman/listinfo/python-list


Re: search speed

2009-02-01 Thread Aaron Watters
On Jan 30, 3:49 am, Diez B. Roggisch de...@nospam.web.de wrote:
 alex23 gave you a set of tools that you can use for full-text-search.
 However, that's not necessarily the best thing to do if things have a
 record-like structure.

In Nucular (and others I think) you can do searches
for terms anywhere (full text)
searches for terms within fields, searches for prefixes in fields,
searches
based on field inequality, or searches for field exact value.  I would
argue this subsumes the standard fielded approach.
   -- Aaron Watters
===
Oh, I'm a lumberjack and I'm O.K...

--
http://mail.python.org/mailman/listinfo/python-list


Re: Project structure - Best practices

2008-11-30 Thread Aaron Watters
On Nov 30, 11:55 am, Filip Gruszczyński [EMAIL PROTECTED] wrote:
 http://jcalderone.livejournal.com/39794.html

 That's exactly what I have read before posting here ;-)

 --
 Filip Gruszczyński

I too would like to see a meatier discussion of best practices
for python packagizing.  I particularly object to jcalderone's
suggestion that all tests should be within the package.  Often my
test cases are 100 times the size of the code, if you include
sample data -- it doesn't make sense to install it, I think.

Lately I tend to have something like

root/
   setup.py
   README.txt
   packagename/
   main source modules
   submodules...
   test/
   test code and submodules
   doc/
   scripts/
   testdata/
   demos/
etcetera...  I have no real idea if this is a good
way to do it, but it works for me in isolation.

I'm completely confused about any implications related to
integrated system testing or easyinstall...

Wise, pragmatic advice would be appreciated.  (But if we
could avoid the buzzillion directories approach prevalent
in the java alternative universe, that would be nice.)
   -- Aaron Watters

===
Now we see the violence inherent in the system!
Help! Help! I'm being repressed!

--
http://mail.python.org/mailman/listinfo/python-list


Re: marshal.dumps quadratic growth and marshal.dump not allowing file-like objects

2008-06-18 Thread Aaron Watters


 Anywaymarshalshould not be used by user code to serialize objects.
 It's only meant for Python byte code. Please use the pickle/cPickle
 module instead.

 Christian

Just for yucks let me point out that marshal has
no real security concerns of interest to the non-paranoid,
whereas pickle is a security disaster waiting to happen
unless you are extremely cautious... yet again.

Sorry, I know a even a monkey learns after 3 times...

  -- Aaron Watters

===
http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=disaster


--
http://mail.python.org/mailman/listinfo/python-list


Re: STL multimap

2008-05-06 Thread Aaron Watters
I'm having trouble following your discussion
and I suspect you might be a friend of Mark V Cheney.
But I will focus on this one point.

On May 5, 11:14 pm, [EMAIL PROTECTED] wrote:
 If recursive generators are really useless (erect wall might not be),

I would like to have recursive generators --
for example to be able to traverse a tree
and yield the value at every node.  Right now
to do this you need to build a chain of generators
from each leaf to the root of the tree (or avoid
recursion by managing your own stack of nodes).
Every yield must bubble up the tree.

With stackless Python you create the equivalent
of a recursive generator by using channels
-- and you can do a lot of other cool stuff with
channels too.  The yield (which doesn't even
require a special keyword ;) ) goes directly to
the other endpoint of the channel, with no bubbling.
It's too bad the Python that comes
installed on Macs doesn't support channels :(.

I know I didn't address your question or comments...
  -- Aaron Watters


http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=ifdef+stackless
--
http://mail.python.org/mailman/listinfo/python-list


Re: STL multimap

2008-05-05 Thread Aaron Watters
Hi there.  Maybe a little more context would
help us figure out what you want here...

On May 5, 1:28 pm, [EMAIL PROTECTED] wrote:
 Is multimap just a syntax-checked dictionary of mutable sequences?

I think the equivalent of a multimap can be
implemented several different ways, depending on
what you need:

  for
   1 maps to 2,3
   5 maps to 7
  - dictionary mapping to lists
   { 1:[2,3], 5:[7] } # supports unhashable values
  - dictionary mapping to dictionary
   { 1:{2:None,3:None}, 4:{7:None} } # faster for certain lookups
and dense data
  - dictionary with tuple/pairs as keys
   { (1,2):None, (1,3):None, (4,7):None } # streamlined for
existence testing

If you search usenet (google groups) for multimap
you will find some nice discussions by Alex Martelli and others.

 Is def( a ): a[:]= [x] a trick or part of the language?  It looks
 pretty sharp in variable-width.

You lost me here.

python 2.6:
 def (a): a[:]=[x]
  File stdin, line 1
def (a): a[:]=[x]
^
SyntaxError: invalid syntax

All the best.  -- Aaron Watters

===
http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=gaping+security+hole
--
http://mail.python.org/mailman/listinfo/python-list


Re: Cookie Confusion - How to Set a Cookie

2008-05-02 Thread Aaron Watters
On May 1, 9:02 am, [EMAIL PROTECTED] wrote:
 On Apr 29, 3:35 pm, Aaron Watters [EMAIL PROTECTED] wrote:



   Thanks for the code, Aaron.  I will give it a try.

   I've been reading some more about cookielib and am not sure whether I
   should use Cookie or cookielib.  This is what I want to do:  a user is
   going to login.  Upon a successful login, I want to write their name
   and date/time of visit to a cookie file. Which is the correct python
   module to use?

  Cookie does parsing and generation of cookie strings
  for server-side applications like your CGI script.

  The cookielib module
  is designed for either implementing a client like a web browser
  or emulating a client/browser (for web scraping, for example).

  I think you want to use Cookie.
  The distinction could be made clearer in
  the docs, imho.

  Also, when you say write the cookie file I think you mean
  store the cookie to the client browser.  This should happen
  automatically when you send the cookie header to the client
  correctly (if the client is configured to cooperate).

-- Aaron Watters

  ===http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=default+does+n...

 Sorry for the slow replies.  I've been in  out with a sick child.

 I'm used to my javascript cookies.  They are automatically written to
 a cookie.txt file in a .mozilla dir under my user.  When I say to
 'write the cookie file' this is what I was referring to.  I was
 expecting my python cookie to automatically get written to the same
 file.  I have't seen this happen yet.

Hmmm.  I don't know how cookies are stored on the client.
I recommend using the standard cgi debug
environment dump after setting
a cookie to see if the cookie is coming back to the server.
If it is not something is wrong -- you are setting it incorrectly,
or the server or client is blocking the cookie.

Note if you are testing on one machine: some browsers
and servers have by default
special security restrictions on
localhost loopbacks -- it may be that this is causing
either the server or the client to ignore the cookie.

  -- Aaron Watters
===
http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=cooked
--
http://mail.python.org/mailman/listinfo/python-list


Re: Why is None = 0

2008-05-02 Thread Aaron Watters
On Apr 25, 8:17 pm, Jon Ribbens [EMAIL PROTECTED] wrote:
 On 2008-04-25, Martin v. Löwis [EMAIL PROTECTED] wrote:

  None is smaller than anything.

 According to Tim Peters, this is not true.

 See http://bugs.python.org/issue1673405

This is unfortunate.  I would advocate
something like ordering incomparable objects
by the name of their type or something
similar.

When building indexing structures it can be
very nice to be able to construct a list of
heterogeneous tuples and sort them without getting
an exception.  Implementing this using L.sort(cmp) where
cmp is implemented in Python can result in
a significant speed penalty.

What's up with Tim Peters anyway?  I haven't
seen much from him for a while.
   -- Aaron Watters

===
http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=quote+tim+peters
--
http://mail.python.org/mailman/listinfo/python-list


Re: best way to host a membership site

2008-04-30 Thread Aaron Watters

 We're about to start a couple somewhat similar projects here, and while
 our chief engineer is a definitive Ruby/Rails addict, we finally settled
 on Django. While it's not my own personal favorite Python MVC framework,
 it's still a very good one, and probably the more mature and stable so
 far. wrt/ the add more apps in the future concern, you may want to
 read this:http://www.b-list.org/weblog/2007/nov/29/django-blog/

Interesting link.  Django does seem to be a well designed
modular approach -- and I think if it had existed back in
'97 the history of web development would have been much
different.

I can't help feeling that it would be nice to have a
collection of tools that was even more orthogonal
and flexible, and WSGI
seems to possibly offer a nice base platform for constructing
tools like these.  Also I think it remains devilishly difficult
to implement ajaxy functionalities like smart data pickers,
in-form validation, partial form saving, chatty interfaces etc.

What are some good paradigms or
methodologies or ideas out there that the Python community
should steal? :)

warning: It's very possible that my understanding of Django is not
deep enough and that the answer is Django.
   -- Aaron Watters
===
http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=you+may+cheat
--
http://mail.python.org/mailman/listinfo/python-list


Re: best way to host a membership site

2008-04-30 Thread Aaron Watters
On Apr 30, 10:43 am, Jeroen Ruigrok van der Werven [EMAIL PROTECTED]
nomine.org wrote:

 Werkzeug -http://werkzeug.pocoo.org/ 

Wow.  An initial glance looks great!  I need help with pronunciation,
though :(.
(also, I'm a little disappointed because I made some notes that looked
a little
like this...)
   -- Aaron Watters
===
http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=slip+nibble
--
http://mail.python.org/mailman/listinfo/python-list


Re: Tremendous slowdown due to garbage collection

2008-04-30 Thread Aaron Watters

 I do not argue that Python's default GC parameters must change -- only
 that applications with lots of objects may want to consider a
 reconfiguration.

I would argue that changing the GC to some sort
of adaptive strategy should at least be investigated.
Having an app which doesn't need gc spending most
of its time doing gc is annoying, to say the least.

Of course any such change should be tested and
analysed thoroughly before it goes into Python 2.6.1
or whatever and it would be great if there
were several alternatives considered and compared.

Hmmm.  I think
this would make an excellent computer science Master's
Thesis topic.  Anybody looking for a topic?
   -- Aaron Watters


http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=use+while+fresh
--
http://mail.python.org/mailman/listinfo/python-list


Re: simple chemistry in python

2008-04-29 Thread Aaron Watters
On Apr 29, 8:41 am, baoilleach [EMAIL PROTECTED] wrote:
 This file is part of the Blue Obelisk Data Repository, an effort by
 several chemistry software developers to share common information

This ref is incredibly cool.  Is there a guide or
meta-index for similar open scientific data repositories
(not web search forms: downloadable complete data)?
   -- Aaron Watters

===
http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=valence
--
http://mail.python.org/mailman/listinfo/python-list


Re: Cookie Confusion - How to Set a Cookie

2008-04-29 Thread Aaron Watters

 Thanks for the code, Aaron.  I will give it a try.

 I've been reading some more about cookielib and am not sure whether I
 should use Cookie or cookielib.  This is what I want to do:  a user is
 going to login.  Upon a successful login, I want to write their name
 and date/time of visit to a cookie file. Which is the correct python
 module to use?

Cookie does parsing and generation of cookie strings
for server-side applications like your CGI script.

The cookielib module
is designed for either implementing a client like a web browser
or emulating a client/browser (for web scraping, for example).

I think you want to use Cookie.
The distinction could be made clearer in
the docs, imho.

Also, when you say write the cookie file I think you mean
store the cookie to the client browser.  This should happen
automatically when you send the cookie header to the client
correctly (if the client is configured to cooperate).

  -- Aaron Watters

===
http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=default+does+nothing


--
http://mail.python.org/mailman/listinfo/python-list


Re: Cookie Confusion - How to Set a Cookie

2008-04-28 Thread Aaron Watters
On Apr 28, 9:42 am, [EMAIL PROTECTED] wrote:
 I see the cookie in my HTTP header
 but do not get anything in the cookie text file.  I'm working on
 linux.

 print Content-type: text/html
 cookie = Cookie.SimpleCookie()
 cookie['Test'] = 'abc'
 print cookie
 print

 Are there rules about where in the header the set cookie line should
 be?

Hi Christian.  I think the cookie can go anywhere in
the header, but I usually put it before the content-type.
If you want to store the cookie to a file,
or even better, to a database of some sort, you have to
do it yourself, the Cookie module doesn't do it for you,
I hope.

  # store cookie to /tmp/cookie.txt
  file(/tmp/cookie.txt,w).write(str(cookie))

For parsing cookies, I stole and modified this from
the Django source (for use in a cgi script):

===
from Cookie import SimpleCookie
import os

# stolen and modified from Django
def parse_cookie(cookie=None, environ=None):
if cookie is None:
if environ is None:
environ = os.environ
cookie = environ.get('HTTP_COOKIE', '')
if cookie == '':
return {}
c = SimpleCookie()
c.load(cookie)
cookiedict = {}
for key in c.keys():
cookiedict[key] = c.get(key).value
return cookiedict

===
All the best.  -- Aaron Watters

===
http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=monster
--
http://mail.python.org/mailman/listinfo/python-list


Re: py3k concerns. An example

2008-04-27 Thread Aaron Watters

 shame
 1 a. a painful emotion caused by consciousness of guilt,
      shortcoming, or impropriety
 2 a condition of humiliating disgrace or disrepute

Sigh.  This is stupid (in the usual usage), but
I must reply because I can't control myself.  I meant
usage 5:

something regrettable, unfortunate, or outrageous:
it's a shame that he wasn't told.
   -- http://www.yourdictionary.com/shame

I think outrageous is appropriate here because
I think it's outrageous to change the basic
usage for things like dictionary.keys() when
it would be so easy to leave the old definition
and add a new method like dictionary.keySet().
This would save me personally a great deal of
painful tedium, I suspect (especially considering
that I've implemented a lot of dictionary-like
objects -- so I'll have to change the way their
keys method works -- or something -- I haven't
figured it out yet...).

I know that the designers of Python are motivated
by a desire to attain a Platonic ideal of
aesthetic perfection primarily with a weaker desire
to make lives easy for people writing libraries
and tools somewhere further down the list,
but from my perspective it's a shame^H^H^H^H^H
regretable and unfortunate that the aesthetics
so often trumps other considerations.

In C# and java, for example, this sort of issue
has never been a problem
in my experience: stuff I wrote many versions ago
still works just fine with no changes (but please
note that I don't write gui stuff, which is less
stable -- I'm speaking of algorithmic and system
libraries).
  -- Aaron Watters

===
btw: usage (5) for shame in the python source:
http://www.xfeedme.com/nucular/pydistro.py/go?FocusId=463FREETEXT=shame



--
http://mail.python.org/mailman/listinfo/python-list


Re: py3k concerns. An example

2008-04-27 Thread Aaron Watters
On Apr 27, 9:18 pm, Martin v. Löwis [EMAIL PROTECTED] wrote:

 An existing application of an existing dict-like
 object will continue to work just fine in Python 3,
 right?

Unless I mix my psuedodicts with standard dicts
in the same list, for example, or pass them to
functions intended to accept any dict-like object,
including the especially important case of standard
dicts.

Who knows?  Maybe I'm wrong about this being a much of
problem.  20+ years experience warns me strongly
to be very afraid, however.  It would be great if I
didn't have to think about it.

Can anyone recommend a good book on Ruby :)?
   -- Aaron Watters

===
http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=unnecessary+breakage

--
http://mail.python.org/mailman/listinfo/python-list


Re: py3k concerns. An example

2008-04-24 Thread Aaron Watters
On Apr 24, 10:10 am, Paul McGuire [EMAIL PROTECTED] wrote
 end point applications (I consider maintaining 2 branches to be in the
 not working category), but it does NOT WORK for people who maintain
 modules for other people to use, because those people may be on a
 range of Python versions that extend beyond 2.6-3.0.  So if I upgrade
 my module to 2.6, those running on earlier versions can no longer use
 it.  At some point in the future, I'll probably be able to say no
 more support for pre-2.6, but it is a bit early to start saying that
 now.

In my view using a conversion tool on an ongoing basis is
not an option.  It just adds a dependancy.  What happens when
the conversion tool is upgraded in a non-backwards-compatible
way?  Or do we have assurance that it won't be ;)?

Will changes to the converter
mean that the users of my
converted libraries have to start
using my tools in a different way?  Even if it breaks some
users in a very subtle way it's not acceptible.
I have no interest in adding additional dependancies,
with an additional degree of freedom to break.

This is all made worse because it's binary -- with
upgrades to C or C# you usually had the option of cross
linking between old style components and new style
components (and at least with C these could usually
be made to work) and you could port the older stuff
with care.  With py 3.0 and python 2.6 *everything*
either works with the interpreter or none of it does.
(Don't ask my users to install two interpreters:
they'll just give up and use something else.)

So if I want to support both I have to do everything
twice in the expected case and in the best case test
everything twice, at the same time, if I want to
support both versions and keep features in sync.
This is of course assuming that all the supporting
libraries do the same thing.  If they don't and
one of the libraries doesn't support 2.* and another
doesn't support 3.*... I guess I'm just screwed.

I still think it's a shame, and I think it's
different in kind from python 1.x-2.x. 2.x
broke very little as I recall.  Most 1.x code
just worked in 2.x and most of the rest required
very minor change.  I think this is not the case
for 2.x-3.x.

  -- Aaron (Scummy) Watters, hoping to shut up now.

ps: I didn't notice that % was vanishing later (3.3).
  that's a bit better (whew ;) ).

pps: I have to note that it would be nice if the
  ad-hominem (sp?) invective would drop out of
  these threads -- it doesn't add a lot, I think.

===

http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=garbage+left+over
--
http://mail.python.org/mailman/listinfo/python-list


Re: py3k s***s

2008-04-18 Thread Aaron Watters
On Apr 17, 12:27 pm, Michael Torrie [EMAIL PROTECTED] wrote:
 What's the big deal?

The big deal is that I would love to see Django
become the standard platform for web development,
for example.  That will be much less likely if
60% of the contributed tools for Django don't work
for Python 3000 and 20% don't work for Python 2.6.
Expecting volunteer contributors
to support both is not realistic.  It's hard enough
to support one adequately.  Even if you could hope
to support both with the same code, just testing in
both environments would be onerous.

It would be another matter entirely if py3k offered
major new functionality like full stackless microthreads
but it doesn't (afaik -- correct me please).
From my perspective it's just a pain in the @$$.
By the way, full stackless microthreads don't seem
to require breaking most (or any) existing code.

I really like developing in Python -- but it's hard
to keep doing it when the growth curve is so slow
and a so many people have deep reservations about it,
inspired in part, justifiably, by nonsense like this.
In fact, I basically stopped.  Then I came back. Now
I'm wondering if it was such a good idea...

   -- Aaron Watters


http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=stupid+bug
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Database vs Data Structure?

2008-04-18 Thread Aaron Watters

 My very humble opinion - based on several years of working experience
 with both the Zodb and many RDBMS - is quite clear : use a RDBMS and use
 it properly.

Yes, somewhere down the line you will want
to get a report of all the customers in Ohio,
ordered by county and zip code, who have a
rabbit cage project -- and if you just pickle
everything you will end up traversing the entire
database, possibly multiple times
to find it.  A little old fashioned
database design up front can save you a lot of pain.

   -- Aaron Watters

===
http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=ouch
-- 
http://mail.python.org/mailman/listinfo/python-list


py3k concerns. An example

2008-04-18 Thread Aaron Watters
Why is the migration to py3k a concern?
For example I have libraries which use string%dictionary
substitution where the dictionary is actually an object
which emulates a dictionary.  The __getitem__ for
the object can be very expensive and is only called when
needed by the string substitution.

In py3k string%dictionary is going away.  Why?
I have no idea.

The replacement is a string.format(...) method
which supports dictionary calling.
string.format(**dictionary)
But dictionary
calling doesn't support dictionary emulation.
So in the example below the substitution works
but the call fails.

=== code

class fdict(dict):
def __getitem__(self, item):
return got(+item+)

def fn(**d):
print d[boogie]

if __name__==__main__:
fd = fdict()
print attempting string substitution with fake dictionary
print
print hello there %(boogie)s % fd # -- works
print
print now attempting function call with fake dictionary
print
fn(**fd) # -- fails

=== output

% python2.6 dtest.py
attempting string substitution with fake dictionary

hello there got(boogie)

now attempting function call with fake dictionary

Traceback (most recent call last):
  File dtest.py, line 17, in module
fn(**fd)
  File dtest.py, line 7, in fn
print d[boogie]
KeyError: 'boogie'

 end of output

Consequently there is no simple way to translate
my code, I think.  I suspect you will find this kind of subtle
issue in many places.  Or worse, you won't find it
until after your program has been installed
in production.

It's a damn shame because
if string%dict was just left in it wouldn't be an issue.

Also, if making f(**d) support dict emulation
has any negative  performance implications
then I don't want it please.

sigh.  -- Aaron Watters

===
http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=crack+open
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: py3k concerns. An example

2008-04-18 Thread Aaron Watters

 Try coming up with a real standard for evaluation.
 How much of a performance hit will actually cause you trouble?  1% extra
 on string interpolation?  10%? 50%? 200%?

You misread my comment.  I don't want function calls to support
dictionary emulation if there is a speed penalty because this is
such a special case and function calls are so important.
I don't really know, but I think fixing the above issue for
string.format(...) might involve changing the representation of
every python stack frame... not worth it in this case if there
is any penalty (afaik there isn't).

An alternative is to provide an alternate interface to string.format
so
that you could pass in an object which might emulate a dictionary,
like string.formatDict(D) -- or you could even adopt a shortcut
notation like string % D -- hey there's an idea!
   -- Aaron Watters

===
http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=ignore+warnings
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: py3k s***s

2008-04-17 Thread Aaron Watters
On Apr 16, 3:33 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 Wow,   I'd venture that the division changes with ints are the only
 thing I'm really concerned about...

Oh I forgot about this one.  Yes, I think it's a mistake to
adopt a different convention for division than C/C++/java/C#/Fortran/
Basic...
Just another reason to throw your hands up in frustration, in my
book...

The implications of the string conversion is entirely unclear to me.
I'm betting the libraries will also get improved during porting,
either intentionally or accidentally
which means I'll have to carefully rewrite
and retest any code which uses the
new and improved libraries ... and the deprecated/removed
libs won't work anymore, so I can't just put them into
my package...

sigh.

   -- Aaron Watters

===
http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=sigh
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: py3k s***s

2008-04-16 Thread Aaron Watters
On Apr 15, 12:30 am, Sverker Nilsson [EMAIL PROTECTED] wrote:
 No one forces me, but sooner or later they will want a Python 3.0 and
 then a 3.1 whatever.

 I don't want that fuzz. As about the C versions, I am not that
 worried. What's your point?

 I just like want to write a program that will stay working.

Maybe I'll see the wisdom of py 3k eventually, if I don't die first,
but I have to agree with Sverker's general comments.  Just yesterday
I had a conversation with someone who thinks maybe Ruby is better
than Python -- the one really good argument Python
has against nearly all contenders is all the
stuff out there you can get so easily -- all the stuff that py3k
will break -- most of which won't get ported -- and if it does can
we be sure it will be tested properly?  No, probably you will end
up beta testing someone's quick port of what used to be rock
solid code...  This was quite rightly pointed out to me, and
I had to agree that it was a pretty good point.

In my opinion python's adherence to backwards compatibility
has been a bit mythological anyway -- many new python versions
have broken my old code for no good reason.  This is an irritant
when you have thousands of users out there who suddenly drop
your code, blame you and python, and move on to use something else.
Honestly, how hard would it have been to provide standard backwards
support for the old regex module as a standard module which simply
translated one regex string format to another, for example?

I don't get it.  It ain't broke.  Don't fix it.

At long last Python has a full head of steam and py3k
is just confusing everyone.

But I've been wrong before (twice).  I also once thought generators
were a mistake :) (but I still think full stackless would be
much better, which python seems to be very slowly moving
towards.)
   -- Aaron Watters

===
http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=nonsense
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: py3k s***s

2008-04-16 Thread Aaron Watters
On Apr 16, 9:16 am, Marco Mariani [EMAIL PROTECTED] wrote:

 Do you mean Ruby's track in providing backward compatibility is better
 than Python's?

 Googling for that a bit, I would reckon otherwise.

I can't comment on that.  Ruby is a lot younger
-- I'd expect it to still be stabilizing a bit.

What I'm saying is that, for example, there are a lot
of cool tools out there for using Python to manipulate
postscript and latex and such.  Most of those tools
require no maintenance, and the authors are not paying
any attention to them, and they aren't interested in
messing with them anymore.

My guess is that there are few
such tools for Ruby.  However, I wouldn't be too
surprised if porting them to Ruby and testing them
properly is not much more difficult than porting them
to py3k and testing them properly...  Especially
since the basic treatment of strings is totally
different in py3k, it seems.

Maybe there is a secret desire in the Python
community to remain a fringe minority underdog
forever?
   -- Aaron Watters
===
http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=reap+dead+child
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: py3k s***s

2008-04-16 Thread Aaron Watters
On Apr 16, 11:15 am, Gabriel Genellina [EMAIL PROTECTED] wrote:
 On 16 abr, 09:56, Aaron Watters [EMAIL PROTECTED] wrote:

  In my opinion python's adherence to backwards compatibility
  has been a bit mythological anyway -- many new python versions
  have broken my old code for no good reason.  This is an irritant
  when you have thousands of users out there who suddenly drop
  your code, blame you and python, and move on to use something else.
  Honestly, how hard would it have been to provide standard backwards
  support for the old regex module as a standard module which simply
  translated one regex string format to another, for example?

 Do you mean this?

 py import reconvert
 py help(reconvert)...

Yes I mean it.  Actually I was unaware
of/forgot reconvert, but it doesn't
matter because it doesn't solve the problem of code I wrote that
has long ago escaped into the wild no longer working.  There are
other examples too, having to do with things as simple as a name
change in a standard module that broke old
code of mine for what I regard as silly cosmetic reasons.

I hope you are right about py3k conversions being pain
free and routine.  I'm suspicious about it however.

   -- Aaron Watters

===
http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=cause+pain
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: py3k s***s

2008-04-16 Thread Aaron Watters
On Apr 16, 12:27 pm, Rhamphoryncus [EMAIL PROTECTED] wrote:
 On Apr 16, 6:56 am, Aaron Watters [EMAIL PROTECTED] wrote:

  I don't get it.  It ain't broke.  Don't fix it.

 So how would you have done the old-style class to new-style class
 transition?

I'd ignore it.  I never understood it and never had
any need for it anyway.  New-style classes and metaclasses
were a complicated solution to an unimportant problem in
my opinion.  And also a fiendish way to make code
inscrutible -- which I thought was more of a Perl thing
than a Python thing, or should be.

I must be missing some of the deeper issues here.  Please
educate me.
   -- Aaron Watters
===

http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=killer%20joke
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: py3k s***s

2008-04-16 Thread Aaron Watters

 Since you don't care about any of the changes or features, and you
 don't care if your users care, I'm not sure why you aren't just using
 python 2.1. It's not like it's being erased via time machine. Just
 keep using the old thing is a perfectly valid and extremely common
 futureproofing scenario.

Well for one thing newer versions of python are faster
and they come installed on other peoples linux and mac
boxes.  If I were only interested in the box sitting in front
of me it sure would be a lot simpler.  In reality even in
a simple environment I have to support 2.3 running on a 32
bit platform and 2.4 running on a 64 bit platform with the
same code.   This is more of a pain than it should be.

Don't get me wrong.  I like things like generators that actually
are useful (and amazingly fast also, I must say).  I'd also
love to be able to use stackless which would be even cooler
but I can't because no-one else uses it to a first order approximation
and I don't want to be responsible for installing it all over
the place...

I'm interested in developing software for/getting software from
the python environment, ecosystem and community.  In the short
term I foresee everything bifurcating into two separate code bases,
and I
think that's a shame, and I don't really see the need.
   -- Aaron Watters

===
http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=nightmare
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Profiling very small/quick functions, help!?

2008-04-16 Thread Aaron Watters
On Apr 16, 12:35 pm, [EMAIL PROTECTED] wrote:
 if __name__==__main__:
 try:
 from cProfile import run
 except:
 from profile import run
 for x in range(1, 1):
 run(power(10,10))

def test1():
for x in xrange(1,1):
test = power(10,10)

if __name__==__main__:
 try:
 from cProfile import run
 except:
 from profile import run
 for x in range(1, 1):
 run(test1())

all the best!  -- Aaron Watters
===
http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=jar


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: py3k s***s

2008-04-16 Thread Aaron Watters
On Apr 16, 1:42 pm, Rhamphoryncus [EMAIL PROTECTED] wrote:
   The only reason to not make the
 changes is that old, crufty, unmaintained libraries  applications
 might depend on them somehow.  If that's more important to you, what
 you really want is a language who's specs are frozen - much like C
 effectively is.  I hope python doesn't become that for a long time
 yet, as there's too much it could do better.

I'm feeling a bit old, crufty, and unmaintained myself,
but I'll try not to take offense.

There is a difference between something that works fine
until the rug gets pulled out and something that needs fixing.
It's a shame to junk stuff that works.

Also in the case of C/java etc changing the infrastructure
is less scary because you usually find out about problems
when the compile or link fails.  For Python you may not find
out about it until the program has been run many times.
Perhaps this will inspire improved linters and better coding
practices

I suppose if the py3k migration inspires tons of
insomniac young programmers to seek fame and admiration
by cleaning up ancient libraries, it would be a good
thing.  It seems to have happened in the Perl4-5
migration some years ago.  Could happen again.
   -- Aaron Watters

===
http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=repeatedly+hammer
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: py3k s***s

2008-04-16 Thread Aaron Watters
On Apr 16, 2:33 pm, Rhamphoryncus [EMAIL PROTECTED] wrote:
 The point is, you can't have it both ways.  Either you evolve the
 language and break things, or you keep it static and nothing breaks.

I disagree.  You can add lots of cool
stuff without breaking the existing code base, mostly.
For example the minor changes to the way ints will work will
effect almost no programs.

I don't see the urgency to clean up what are essentially
cosmetic issues and throw out or
require rewrites for just about all existing Python
code. Python 2.6 isn't fundamentally awful like Perl 4 was.
The cost paid for these minor improvements is too high in my
book.  But I suppose if it is going to happen do it sooner
rather than later.  Just *please* *please* don't
systematically break the pre-existing code base again for a
very long time, preferable ever.
  -- Aaron Watters

===
http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=whack
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: py3k s***s

2008-04-16 Thread Aaron Watters

  Also in the case of C/java etc changing the infrastructure
  is less scary because you usually find out about problems
  when the compile or link fails.  For Python you may not find
  out about it until the program has been run many times.
  Perhaps this will inspire improved linters and better coding
  practices

 Better coding practices such as extensive unit tests?

Greetings from Earth.  What planet are you from? :)

There is always the possibility that frustrated
programmers will decide that using something other
than python is a better coding practice.  I've seen
it happen.

  -- Aaron Watters

===
http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=alien

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Tremendous slowdown due to garbage collection

2008-04-15 Thread Aaron Watters
On Apr 14, 11:18 pm, Carl Banks [EMAIL PROTECTED] wrote:

 However, that is for the OP to decide.  The reason I don't like the
 sort of question I posed is it's presumptuous--maybe the OP already
 considered and rejected this, and has taken steps to ensure the in
 memory data structure won't be swapped--but a database solution should
 at least be considered here.

Yes, you are right, especially if the index structure will be needed
many times over a long period of time.  Even here though, these days,
you can go pretty far by loading everything into core (streaming from
disk) and dumping everything out when you are done, if needed
(ahem, using the preferred way to do this from python for
speed and safety: marshal ;) ).

Even with Btree's if you jump around in the tree the performance can
be
awful.  This is why Nucular, for example, is designed to stream
results sequentially from disk whenever possible.  The one place where
it doesn't do this very well (proximity searches) shows the most
problems with performance (under bad circumstances like searching
for two common words in proximity).
   -- Aaron Watters
===
http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=joys
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Tremendous slowdown due to garbage collection

2008-04-14 Thread Aaron Watters

 A question often asked--and I am not a big a fan of these sorts of
 questions, but it is worth thinking about--of people who are creating
 very large data structures in Python is Why are you doing that?
 That is, you should consider whether some kind of database solution
 would be better.  You mention lots of dicts--it sounds like some
 balanced B-trees with disk loading on demand could be a good choice.

Well, probably because you can get better
than 100x improved performance
if you don't involve the disk and use clever in memory indexing.
BTW, I think the default behaviour of the gc is
pretty silly.  I tend to disable automatic gc and explicitly put in
collections when I know I'm done with some big operation these
days.
   -- Aaron Watters

===
http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=dumb+slow
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Profiling programs/scripts?

2008-04-11 Thread Aaron Watters
On Apr 11, 2:49 pm, [EMAIL PROTECTED] wrote:
 how do i profile a program? i found out that there are some profilers
 included in the standard library but couldnt really figure out how to
 access/use them

I put this at the bottom of my main module:

=== cut
if __name__==__main__:
try:
from cProfile import run
except:
from profile import run
run(tests())
=== cut

Here tests() is the function I want to profile.  The cProfile
module, when available is better than the older profile module,
but it's only available in very recent Python installations.
The profile run function will run the tests function and print
a report on the timings and counts it found.

More info here:
  http://docs.python.org/lib/profile.html

  -- Aaron Watters
===
http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=emulate+perl
-- 
http://mail.python.org/mailman/listinfo/python-list


april fools email backfires

2008-04-02 Thread Aaron Watters
Grapevine says that an architect/bigot at a java/spring
shop sent out an April Fools email saying they had
decided to port everything to Django ASAP.

Of course the email was taken seriously and he
got a lot of positive feedback from line developers
and savvy users/managers that they thought it would be a great
idea; it's about time; gotta do something about this
mess...

  -- Aaron Watters

===
http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=other+surprises
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: object-relational mappers

2008-04-02 Thread Aaron Watters

  Try Rails' ActiveRecord. Your problems should reduce to (lg lg
 2)^(1/12).

python (log(log(2)))**(1.0/12.0)
Traceback (most recent call last):
  File stdin, line 1, in ?
ValueError: negative number cannot be raised to a fractional power

So you are saying the problems will get really complex? :)

  Seriously, you'll forget there's a relational database below. (there
 are even intefaces for relational lists, trees, etc.)

My experience with this sort of thing is that it is a bit
like morphine.  It can feel really good, and in emergencies
it can save you a lot of pain.  But if you use it too often
and too seriously you end up with really big problems.

   -- Aaron Watters

===
http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=mysterious+objects

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: april fools email backfires

2008-04-02 Thread Aaron Watters
On Apr 2, 11:07 am, Paul McGuire [EMAIL PROTECTED] wrote:

 Can you post a link?

 -- Paul

Sorry.  It came from private email.
And I don't want to get anyone in trouble...
   -- Aaron Watters

===
http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=secret+feature
-- 
http://mail.python.org/mailman/listinfo/python-list


object-relational mappers

2008-04-01 Thread Aaron Watters
I've been poking around the world of object-relational
mappers and it inspired me to coin a corellary to the
the famous quote on regular expressions:

You have objects and a database: that's 2 problems.
So: get an object-relational mapper:
now you have 2**3 problems.

That is to say I feel that they all make me learn
so much about the internals and features of the
O-R mapper itself that I would be better off rolling
my own queries on an as-needed basis without
wasting so many brain cells.

comments?

   -- Aaron Watters

===
http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=mild+exponential+growth
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: csv Parser Question - Handling of Double Quotes

2008-03-28 Thread Aaron Watters
On Mar 27, 6:00 pm, John Machin [EMAIL PROTECTED] wrote:
 ...The Python csv module emulates Excel in delivering garbage silently in
 cases when the expected serialisation protocol has (detectably) not
 been followed

Fine, but I'd say the heuristic adopted produces
bizarre and surprising results in the illustrated case.
It's a matter of taste of course...
  -- Aaron Watters

===
http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=mondo+bizarre
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: csv Parser Question - Handling of Double Quotes

2008-03-27 Thread Aaron Watters

 this;is;a;test

 Resulting in an output of:

 ['this', 'is', 'a', 'test']

 However, if I modify the csv to:

 this;is;a;test

 The output changes to:

 ['this', 'is', 'a', 'test']

I'd be tempted to say that this is a bug,
except that I think the definition of csv is
informal, so the bug/feature distinction
cannot be exactly defined, unless I'm mistaken.

What I would do is write roll my own
parser using very simple python and check
that it works for the examples of interest.
If, for example, you can assume that the
delimiter will never occur inside the
payload and the payload contains no
quoted characters you could do something like:

 cut
def trimQuotes(txt):
txt = txt.strip()
if txt:
start = txt[0]
end = txt[-1]
if start==end and start in ('', '):
return txt[1:-1]
return txt

def simpleCsv(lines, delimiter):
for line in lines:
fields = line.split(delimiter)
fields = map(trimQuotes, fields)
yield fields

def test():
lines = ['this;is;a;test']
for fields in simpleCsv(lines, ';'):
print fields

if __name__==__main__:
test()
=== cut

If you want fame and admiration you could fix
the arguably bug in the csv module and send
the patch to the python bugs mailing list.
However, I just had a perusal of csv.py
good luck :).
   -- Aaron Watters

===
http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=too+general
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Pycon disappointment

2008-03-19 Thread Aaron Watters
On Mar 18, 12:55 pm, [EMAIL PROTECTED] wrote:
 Amen on the diamond keynotes and lightning talks. The lightning talks
 were a great disappointment. Sponsor talks (or any such talks pitched
 at selling or recruiting) should go in their own, clearly labeled
 group so those of us who don't care about them can avoid them...

Seconded.  I haven't been at a Python Conf for a long time
but as a former attendee and (not very good) organizer I
have a couple suggestions based on my past experience and
mistakes:

- The conference is too long and it shouldn't be on the weekend.

- Almost all talks should be 10 minutes at most
  with prepared slides and extended abstract with references.

- With much shorter talks you should be able to accept just about any
  properly prepared talk (with abstract and slides) and this
  should reduce the politics and increase the attendance (with
  speakers and some colleagues and maybe broader interest).

I don't know about this conference, but in past conferences
I've been frustrated by people who give out a train of
conscience meander including popping in and out of various console
prompts, editors, web pages, guis... without conveying any useful
information (to me) in 30 minutes.  If you tell them they have
10 minutes and make them get organized in advanced
they are much more likely to get to the point and
everyone can see something else before they run out of
attention span.

   -- Aaron Watters

===
bye bye petroleum!  good riddance.
http://biofuels.usu.edu/htm/initiative

http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=pretty+boring
-- 
http://mail.python.org/mailman/listinfo/python-list


off topic: 2 videos on source control and open source development

2008-03-08 Thread Aaron Watters
I just wanted to send out links to 2 informative videos
regarding open source and change control systems.

The first is Linus Torvalds on git and how it contrasts
with subversion and other approaches (where he says
some nice things about Mercurial, btw).

http://www.youtube.com/watch?v=4XpnKHJAok8

This one is about managing the community dynamics
in the subversion project.

http://video.google.nl/videoplay?docid=-4216011961522818645

It only made me a little uncomfortable at certain moments :).

Good viewing.
   -- Aaron Watters

===
http://www.xfeedme.com/nucular/pydistro.py/go?FREETEXT=mileage
-- 
http://mail.python.org/mailman/listinfo/python-list


  1   2   >