Re: Edit Audio Using Python?

2007-06-20 Thread aaronwmail-usenet
On Jun 20, 12:21 pm, Ultrus <[EMAIL PROTECTED]> wrote:
> Ah! I found this on the official 
> website:http://www.python.org/doc/1.5.2p2/lib/module-audioop.html
>
> That should keep me occupied. If you think of anything interesting
> however, I would be happy to know. :)

I think you'll find that you have to put a lot of pieces together
to manipulate audio -- it's all there, but it's not straightforward.

I did it in my "skimpygimpy" audio components, which may help
(especially
if you ignore the stranger parts where I went off the deep end).

Start by looking at the "waveTools.toneFile()" method, which, I think,
writes out a wave file containing "concert A".

http://skimpygimpy.sourceforge.net -- follow link to downloads...

  -- Aaron Watters

===
an apple every 8 hours
will keep 3 doctors away.   -- kliban



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


Re: searching algorithm

2007-05-12 Thread aaronwmail-usenet
On May 10, 1:26 pm, Gigs_ <[EMAIL PROTECTED]> wrote:
> Hi all!
>
> I have text file (english-croatian dictionary) with words in it in 
> alphabetical
> order.
> This file contains 17 words in this format:
> english word: croatian word

Let's assume it's okay to have all the data in memory.
In my experience the very fastest way to do what you
want is to store the strings in a sorted list and use
the binary search library module bisect.  I once compared this
with doing something similar with tries and it was
much faster.  It's also the most simple way to do it, which
is nice too :).
  -- Aaron Watters

===
never eat anything bigger than your head -- kliban


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


Re: SkimpyGimpy PNG canvas w/ Javascript mouse tracking

2007-05-07 Thread aaronwmail-usenet
re: http://skimpygimpy.sourceforge.net

On May 7, 7:29 pm, James Stroud <[EMAIL PROTECTED]> asks:
> Can you advertise "CAPTCHA" as it is trademarked by Carnegie Mellon?
>
> James

I can easily forward them a generous portion of my earnings
from this project if needed :).

Actually I think the term is in common use like "Kleenex".
A quick glance at http://www.lanapsoft.com/products.html
shows no mention of CMU.

  -- Aaron Watters

===
sometimes if something doesn't seem to make sense
it's because it makes no sense



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


SkimpyGimpy PNG canvas w/ Javascript mouse tracking

2007-05-07 Thread aaronwmail-usenet
ANN: SkimpyGimpy PNG canvas has Javascript mouse tracking

The SkimpyGimpy PNG image canvas now can generate
Javascript data structures which allow HTML pages
to intelligently respond to mouse events over the
image.

Please read about the SkimpyGimpy Canvas and look at
the mouse tracking example here:

http://skimpygimpy.sourceforge.net/canvas.html

The SkimpyGimpy main page is here:

http://skimpygimpy.sourceforge.net/

BACKGROUND:

SkimpyGimpy is a collection of tools for generating
HTML visual, PNG image, and WAVE audio components
for use in web based applications including CAPTCHA
implementations (Completely Automated Public Turing
test to tell Computers and Humans Apart) and PNG
image creation tools with Javascript mouse tracking
support.

  I hope you like.  -- Aaron Watters

===

Sometimes say sometimes.

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


ANN: PNG image CAPTCHA with PNG canvas available (SkimpyGimpy)

2007-04-18 Thread aaronwmail-usenet
Announcing SkimpyGimpy Support for PNG image
CAPTCHA generation and PNG canvases.

You can now use SkimpyGimpy to generate
CAPTCHA text representations as PNG image files
in addition to preformatted text ASCII art, and
WAVE format audio streams, either from command
lines or within Python programs.

Also general support for drawing text and
graphics as PNG image files is available via a
"PNG canvas" drawing interface.

Enjoy!

Skimpy Main Page:
  http://skimpygimpy.sourceforge.net/

PNG Canvas documentation:
  http://skimpygimpy.sourceforge.net/canvas.html

Background Information:

Skimpy is a tool for generating HTML visual,
PNG visual, and WAVE audio representations for
strings which people can understand but which
web robots and other computer programs will
have difficulty understanding. Skimpy is an
example of a Captcha: an acronym for "Completely
Automated Public Turing test to tell Computers
and Humans Apart".

I hope you like!
  -- Aaron Watters

===
"Do you expect me to talk?"
"No, Mr. Bond, I expect you to die."

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


ANN: Skimpy CAPTCHA adds WAVE audio, and a problem

2006-12-27 Thread aaronwmail-usenet
SKIMPY CAPTCHA ADDS AUDIO, AND A PROBLEM

[or what I did over xmas weekend at the inlaws
-- python/web/audio experts skip to the bottom
and solve my problem please.]

Skimpy Gimpy CAPTCHA now supports WAVE audio
output to help people with visual impairments
answer Skimpy challenges.

Read more, try it out, download it here:

http://skimpygimpy.sourceforge.net

Skimpy is a tool for generating HTML visual
and WAVE audio representations for strings
which people can understand but which web robots
and other computer programs will have
difficulty understanding. Skimpy is an example
of a Captcha: an acronym for "Completely Automated
Public Turing test to tell Computers and Humans
Apart".

The visual HTML Skimpy program skimpyGimpy.py
and API (applications programmer interface) is
implemented in a single self contained Python
script (module). The input for Skimpy are words
or phrases. The output of the program and API
are strings containing HTML preformatted text.
The preformatted text contains "ASCII art" representing
the input phrase, which looks like somewhat
sloppy handwriting on a speckled page,
when viewed in an HTML browser.

It is intended that it is easy for a human to read
the word or phrase when rendered as HTML, but it is
difficult for a program to extract the word or phrase
automatically. The program uses a number of
techniques to make the output difficult for a
computer to interpret: curve interpolation, random
rotation, random skew, random scale adjustment,
"smearing", and addition of noise.

In order to allow CAPTCHA tests that are usable by
people with visual empairment, Skimpy also provides
an audio implementation. The audio WAVE Skimpy
program waveTools.py uses a compiled audio sample
file waveIndex.zip. The input of the program are words
or phrases and the output are the words or phrases
spelled as individual spoken characters in an
audio stream.

It is intended that a human can understand the
audio stream but a computer program will not be
able to analyse the stream and extract the
letters. To make the audio stream more difficult
to automatically analyse (without making it
unintelligible) the program randomly overlaps and
stretches/shrinks the input samples, among other
things.

The Skimpy tools are far easier to install, use,
and embed than other similar technologies.

THE PROBLEM

Unfortunately there is a problem with using Firefox
and Quicktime with the Skimpy audio.  If you save the
audio to a temporary file and stream from there
everything works fine, but if you try to stream directly
from the CGI or mod-python module via HTTP Quicktime
TRUNCATES THE AUDIO TO ABOUT 3 SECONDS.  This ONLY
happens under Firefox afaik -- IE, for example has
no problems.  Am I doing something wrong?  Please inform.
The skimpygimpy1.1 download has all the relevant source
code if you'd like to have a look. Help!  Thanks
in advance.

I'm leaving the bug demonstrated in my sample web scripts
for now, but if no one comes up with a fix I will hack around
it in a few days... probably...
  -- Aaron Watters

===
Later on, we'll perspire
as we stare at the fire
and face so afraid
the bills left unpaid
walking in a winter wonderland
 -- seen in "For Better or Worse"

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


ANN: Skimpy Gimpy ASCII Web Challenge CAPTCHA

2006-12-18 Thread aaronwmail-usenet
Please check it out and try it:

   http://skimpygimpy.sourceforge.net/

Find examples, documentation, links to demos
and download links there.

Skimpy Gimpy is a tool for generating HTML
representations for strings which
people can read but which web
robots and other computer programs
will have difficulty understanding.
Skimpy is an example of a  Captcha:
an acronym for "Completely Automated  Public
Turing test to tell Computers and Humans Apart".

The Skimpy program and API
(applications programmer interface)
is implemented in a single
self contained Python script (module).  The
input for Skimpy are words or phrases.
The output of the program and API are strings containing
HTML preformatted text.  The preformatted
text contains "ASCII art" representing the input
phrase, which looks like somewhat sloppy handwriting
on a speckled page, when viewed in an HTML browser.

It is intended that it is easy for a human to
read the word or phrase when rendered
as HTML, but it is difficult for a program to
extract the word or phrase automatically.
The program uses a number of techniques
to make the output difficult for a computer to
interpret: curve interpolation, random rotation,
random skew, random scale adjustment,
"smearing", and addition of noise.

The Skimpy tool is far easier to install, use,
and embed than other similar technologies.
All you need is python installed and the
skimpyGimpy.py source file.

Enjoy and happy holidays!  -- Aaron Watters
===
there ain't no sanity clause!

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


Re: Gadfly server startup error

2006-10-02 Thread aaronwmail-usenet

[EMAIL PROTECTED] wrote:
> > Is anybody out there who has used the server+client operation
> > mode successfully?
>
> Well, several years ago, yes.

I looked into it and it was mainly a documentation and
test issue, I think.  The code seems to work.

Please go

  http://gadfly.sourceforge.net/gadfly_server_test.zip

and look at the readme.  I will try to fold this in to the
distribution sometime soon.

from the README in the zip:

==
gadfly_server_test readme

This directory provides a proof of concept test run of the
gadfly server components. It requires gadfly to be installed
in the local python installation ( http://gadfly.sourceforge.net ).

Please see the doc string at the top of gfstest.py for details.

Example demo run sequence (in Windows installations the "python" prefix
is optional):

1. Set up the database.
 % python gftest.py dbtest

2. Start the server
 % python gfstest.py start

   This starts an infinite server loop in the current console.

3. SWITCH TO ANOTHER WINDOW and run test queries.
 % python gfstest.py queries

4. Shut down the server.
 % python gfstest.py shutdown
=

   -- Aaron Watters

===
There once was a man who said "Well!
Will nobody answer this bell?
I have pulled day and night
'til my hair has grown white
but nobody answers this bell!"
  -- Edward Lear

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


Re: Gadfly server startup error

2006-10-02 Thread aaronwmail-usenet
> Is anybody out there who has used the server+client operation
> mode successfully?

Well, several years ago, yes.

Since then the project was taken over by some volunteers
and they did an excellent job of
restructuring and modernizing (somewhat) the
*standalone* part of gadfly, but apparently they
didn't port the *client/server* component properly.
As it stands the client server portion is broken now.
(I hadn't tried it after the port, sorry).

I think if you find an older (pre-sourceforge)
tarball it will work.  I will try
to find time to fix this, unless someone else wants
to have a try.  Sorry!

Also, the reference to the new release on the
site refers to a mini-release I did a year or more
ago which fixed various bugs and also added
an xsdb interface component.

   -- Aaron Watters

===
There once was a man from Japan
whose limericks never would scan
when told this was so
he said "yes, I know,
but I always try to put as many words in the last line as I possibly
can."

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


Re: Need a compelling argument to use Django instead of Rails

2006-08-18 Thread aaronwmail-usenet

Damjan wrote:>
> Starting a new Apache process with python included (trough mod_python) is
> even worse than CGI.

Yes, but I think only for the first interaction
after being dormant for a period. In fact I've
noticed that hitting http://www.xfeedme.com
the first time is usually slow.  But once the
apache is up it seems to stay up until it has
been inactive for a good while, and it's fast.
I'm inferring all this from what I see using
"ps" and other indirect tools.

  -- Aaron Watters

===
as the poet said:
 "Everybody have fun tonight
  Everybody Wang Chung tonight"

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


Re: Need a compelling argument to use Django instead of Rails

2006-08-07 Thread aaronwmail-usenet

Damjan wrote:
> Yes, but your mod_python programs still run with the privileges of the
> Apache process, as are all the other mod_python programs. This means that
> my mod_python program can (at least) read files belonging to you -
> including your config file holding your database password

I think a standard solution to this is to
associate each virtual host server to a
different port and have the main apache
redirect to the port.  Inetd makes sure
that the vserver apache instance only
stays alive while it's needed.  It might be
complicated to set up, but it works.
Again, something like this is probably
advisable anyway to limit the ways one
vserver can damage another generally
speaking.
  -- Aaron Watters

===
It's not the years. It's the mileage.
   -- Indiana Jones

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


Re: Need a compelling argument to use Django instead of Rails

2006-08-04 Thread aaronwmail-usenet
Ben Sizer wrote:
> [EMAIL PROTECTED] wrote:
> > Paul Rubin wrote:
> > > A typical shared hosting place might
> > > support 1000's of users with ONE apache/php instance (running in a
> > > whole bunch of threads or processes, to be sure).
> >
> > You just need to run multiple apache
> > instances, which is advisable anyway.
> > The hosting service formerly known as
> > python-hosting has been doing this
> > for years.
>
> Would you need one instance per user? Is it practical to run 1000s of
> Apache instances on one server?
>

I'm almost certain Apache spawns instances as needed.
If they are all active at the same time you will need at least
that many threads anyway and I don't think processes
are really much more expensive than threads usually.
But I'm not an expert on virtual hosting or apache or
even thread/process internals.

However when I do a "ps -aef" on my shared server
(http://www.xfeedme.com) I only see the apache
instances that are active, and not the 50 dormant
ones, if I recall.

   -- Aaron Watters

===
She was flirty, dirty, musta been about thirty
   -- 70's stones lyrics
She was nifty, shifty musta been about fifty
   -- 90's stones lyrics

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


Re: Need a compelling argument to use Django instead of Rails

2006-08-03 Thread aaronwmail-usenet

Paul Rubin wrote:
> I didn't realize you could do shared hosting with mod_python, because
> of the lack of security barriers between Python objects (i.e. someone
> else's application could reach into yours).  You really need a
> separate interpreter per user.  A typical shared hosting place might
> support 1000's of users with ONE apache/php instance (running in a
> whole bunch of threads or processes, to be sure).

You just need to run multiple apache
instances, which is advisable anyway.
The hosting service formerly known as
python-hosting has been doing this
for years.  For example my http://www.xfeedme.com
site uses it (which seems to be down at the moment!
oh no! :( ).
   -- Aaron Watters

ps: little known fact: mod_python descends
from an NSAPI plugin implementation
I wrote as an example of embedding python in
the defunct "Internet Programming
with Python" book.  Books die, but software lives on.

===
if you are happy and you know it stick with your dosage.
   -- seen in the New Yorker

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


Re: Need a compelling argument to use Django instead of Rails

2006-07-26 Thread aaronwmail-usenet

Jaroslaw Zabiello wrote:
> On Wed, 26 Jul 2006 16:25:48 +0200, Bruno Desthuilliers wrote:
>
> > I have difficulty imagining how a language could be more dynamic than
> > Python...
>
> E.g. try to extends or redefine builtin Python classes on fly. Ruby is so
> flexible that it can be used to create Domain-specific Programming
> Languages.

This, of course, is really cool if you are working
all by yourself on a dissertation or something,
but can be completely disasterous if you are
actually working with other people who need to
know what the expressions of the programming
language mean and do.  Back in the day every
good Common Lisp programmer wrote in a
dialect completely incomprehensible to any other
Common Lisp programmer.  Kinda fun, but not
"best practice."
   -- Aaron Watters

===

Writing about music is like
dancing about architecture.
   -- Elvis Costello

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


Re: Need a compelling argument to use Django instead of Rails

2006-07-24 Thread aaronwmail-usenet
Steve Holden wrote:
...
> I wouldn't waste your time. "A man convinced against his will is of the
> same opinion still", and they already know they aren't interested in
> Python. There are probably many other matters about which they are
> uninformed and equally determined

This is too true.  Fortunately progress proceeds
slowly nonetheless.  For example C++ is much
less used these days where it is totally and
catastrophically inappropriate than in years past
-- maybe because the true C++ boneheads have
been promoted or are retiring...  Nevertheless I was
recently told by a new grad that I should translate
one of my (working, no problems) python apps to
C++ because C++ is "a higher level language."
But I'm sure he'll fall in line with the next stream
of lemmings rather than sink into the tarpit with the
dinosaurs.

   -- Aaron Watters

===
Paradigms shift when the old guys retire.  -- Kuhn (?)

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


Re: sum fonction in gadfly

2006-06-30 Thread aaronwmail-usenet

Robert Hicks wrote:
> [EMAIL PROTECTED] wrote:
> >  why are people so concerned
> > that it's not changing?
> >
>
> I didn't mean to be irritating and I wasn't concerned about it not
> changing but I could probably have stated the question a little better.
> For some reason I thought it was a dead project so maybe "still being
> maintained" would be a better statement. I dunno.

You're not the only one.  Why do I keep seeing "gadfly...dead"
in the same sentence?

What if it doesn't need maintenance?  Does that make it dead?
No offense to you personally, you are just repeating what
everyone else has been saying for years for reasons that
totally escape me.  Several times people have suggested that
gadfly be added to the python standard library and then the
question comes up... who will maintain it?  And I answer I'll
maintain it if anyone finds serious problems with it and then
a few months later I hear that it was decided that gadfly was
a dead project.  This has been going on since about '97.
It's irritating and tiresome.  Sorry, I'm grumpy today.

   -- Aaron Watters

===
my mazarati goes 185
I lost my license
now I don't drive   -- from "Life's been good"

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


Re: sum fonction in gadfly

2006-06-29 Thread aaronwmail-usenet

Robert Hicks wrote:
> I haven't been keeping up. Is Gadfly still in development?

I always find this question a little
irritating -- gadfly is perfect the
way it is :).  If it ain't broke don't
fix it.  At least until the python guys
make another non-backwards-compatible
change that makes a patch necessary
(speaking of things that irritate me...).

Seriously, there are a few problems
that could be fixed that I can
think of, but mostly it works for what
it is -- why are people so concerned
that it's not changing?

   -- Aaron Watters
 http://gadfly.sourceforge.net/ --perfect already
 http://xsdb.sourceforge.net/  --getting there

===
You'd be paranoid too if everyone was out to get you.

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


Re: Python's DSLs (was: A critic of Guido's blog on Python's lambda)

2006-05-10 Thread aaronwmail-usenet
Cameron Laird wrote:
> In article <[EMAIL PROTECTED]>,
> Alex Martelli <[EMAIL PROTECTED]> wrote:
... .
> >Of course, the choice of Python does mean that, when we really truly
> >need a "domain specific little language", we have to implement it as a
> >language in its own right, rather than piggybacking it on top of a
> >general-purpose language as Lisp would no doubt afford; see
> > for such a DSLL developed
> >at Google. However, I think this tradeoff is worthwhile, and, in
> >particular, does not impede scaling
>
> I'm confused, Alex:  I sure
> think *I* have been writing DSLs as specializations of Python,
> and NOT as "a language in its own right"

I think Alex is suggesting that if they used, for example, a version of
scheme
with a good optimizing compiler they could implement sawzall like
convenience
with almost the same performance, including startup, etc. whereas even
a
highly optimized python based approach would at least have a
comparatively
large startup penalty.  For an environment like Google where they
scrape
thru their logs of various sorts doing lots of trivial scans you can
probably save
a lot of money and time on lots of machines by optimizing such scrapes
(but keep your bactine handy).  And as the sawzall paper pointed out,
even static
type checks can prevent a lot of wasted machine bandwidth by avoiding
dumb
errors.

But the real question for someone like Rob Pike is why use scheme when
you
can invent another little language instead, I suspect :).

  -- Aaron Watters

===

Stop procrastinating soon.

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


Re: set partitioning

2006-05-01 Thread aaronwmail-usenet
Something like this, or am I missing something?

def partition(List, n, m, k):
 if n!=m*k:
 raise "sorry, too many or too few elts"
 D = {}
 for x in List:
  D[x] = 1
 if len(D)!=n:
 raise "sorry (2) you lied about the number"
 List2 = D.keys()
 result = []
 for i in range(m):
 result.append( List2[i*k: i*k+k] )
 return result
?

If this was a take home exam problem,
you should be ashamed of yourself!
   -- Aaron Watters

===

It's easy.  All you have to do is hit
the right keys at the right time and
the organ plays itself.  -- J.S. Bach

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


Re: Tried Ruby (or, "what Python *really* needs" or "perldoc!")

2006-03-14 Thread aaronwmail-usenet
hmmm.  Interesting about the wiki.
It's unusable in my version of IE.  Javascript error
on almost every keystroke :(!

http://wiki.python.org/moin/

It works in Firefox, which I have, of course, but
still...

And the patch procedure you described requires
a higher degree of motivation (and free time) than
most potential contributors might have on offer, imo.

   -- Aaron Watters

===
"I weep for you," the walrus said, I deeply sympathize.
With sobs and tears he sorted out those of the largest size.
Holding his pocket handkercheif before his streaming eyes.
   from "The Walrus and the Carpenter", Lewis Carroll

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


Re: Tried Ruby (or, "what Python *really* needs" or "perldoc!")

2006-03-14 Thread aaronwmail-usenet
I agree that more progress is needed on the Python documentation
front.  For example if you look at the "codecs" module documentation
there is no hint of what a codec is anywhere that I can see. Also
the distinction between an "encoder" and a "decoder" is not explained.
Even though I've used it many times and understand it, I still find
myself using the interactive interpreter to make sure I'm sending the
bytes in the right direction...

Perhaps some faqwiz/wiki-like tool to allow the broader community to
propose documentation enhancements would be useful?

  -- Aaron Watters

===

"I know what it's like to put food on my family."  G.W.Bush

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


Re: recycling internationalized garbage

2006-03-14 Thread aaronwmail-usenet
Regarding cleaning of mixed string encodings in
the discography search engine

http://www.xfeedme.com/discs/discography.html

Following 's suggestion I came up with this:

utf8enc = codecs.getencoder("utf8")
utf8dec = codecs.getdecoder("utf8")
iso88591dec = codecs.getdecoder("iso-8859-1")

def checkEncoding(s):
try:
(uni, dummy) = utf8dec(s)
except:
(uni, dummy) = iso88591dec(s, 'ignore')
(out, dummy) = utf8enc(uni)
return out

This works nicely for Nordic stuff like
"björgvin halldórsson - gunnar Þórðarson",
but russian seems to turn into garbage
and I have no idea about chinese.

Unless someone has any other ideas I'm
giving up now.
   -- Aaron Watters

===

In theory, theory is the same as practice.
In practice it's more complicated than that.
  -- folklore

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


recycling internationalized garbage

2006-03-08 Thread aaronwmail-usenet
Hi folks,

Please help me with international string issues:
I put together an AJAX discography search engine

http://www.xfeedme.com/discs/discography.html

using data from the FreeDB music database

http://www.freedb.org/

Unfortunately FreeDB has a lot of junk in it, including
randomly mixed character encodings for international
strings.  As an expediency I decided to just delete all
characters that weren't ascii, so I could get the thing
running.  Now I look through the log files and notice that
a certain category of user immediatly homes in on this
and finds it amusing to see how badly I've mangled
the strings :(.  I presume they chuckle and make
disparaging remarks about "united states of ascii"
and then leave never to return.

Question: what is a good strategy for taking an 8bit
string of unknown encoding and recovering the largest
amount of reasonable information from it (translated to
utf8 if needed)?  The string might be in any of the
myriad encodings that predate unicode.  Has anyone
done this in Python already?  The output must be clean
utf8 suitable for arbitrary xml parsers.

Thanks,  -- Aaron Watters

===

As someone once remarked to Schubert
"take me to your leider" (sorry about that).
   -- Tom Lehrer

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


AJAX example code available

2006-02-05 Thread aaronwmail-usenet

I've published sample code that uses Python
on the server side to implement AJAX
type ahead completion for web forms.  Please see
documentation with links to examples and downloads at

http://xsdb.sourceforge.net/xFeed.html

"Type ahead completion" is a form of AJAX
(asyncronous javascript with XML) functionality
where the page attempts to suggest completions
for partial form values by consulting a
web server component in the background.  Google Suggest
is a famous example.  For examples using
my python code please see

http://www.xfeedme.com/zip/zipcompletions_async.html or
http://www.xfeedme.com/xsdbXML/xFeed/BookMatch.html.

These pages must be viewed with a recent browser such
as FireFox 1.5, Safari 2.0, or IE 6.0.

The AJAX server component is configured for use
either as a Python CGI script or as a Apache server mod-python
module.

I hope you enjoy it and use it well :).
Please let me know if you have problems with it
or other comments.

  Thanks!  -- Aaron Watters

===
Chemistry may lead to a better life,
but Biology is more fun.  -- seen on a teeshirt

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


ANNOUNCE: xsdb release with N/A support and more

2005-04-01 Thread aaronwmail-usenet
The new xsdbXML_cs_java_py_01 release adds a
"not applicable" attribute restriction and
completes the same/ifknown/otherwise implementations
as well as some bugfixes including a fix for
a performance bug in the java implementation.

The xsdb framework provides a flexible and well defined
infrastructure to allow tabular data to be published,
retrieved, and combined over the Internet.

There are three separate implementations: a Python
implementation, a C#/.NET implementation, and a
java implementation. For all implementations all
source code is distributed using SourceForge.

Read more and download at
http://xsdb.sourceforge.net

Thanks,  -- Aaron Watters

===
KIDS MAKE NUTRITIOUS SNACKS
  -- a "real life headline"
  http://www.anvari.org/shortjoke/Newspaper_Headlines

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


Re: ANN: xsdbXML python release with C#/.NET port

2005-03-02 Thread aaronwmail-usenet
Yikes...  A couple people pointed out that the upload had no
csharp code.  That was because sourceforge was uploading the
wrong file (but reporting the right filesize).  I think it's fixed now
(uploaded from paris and minnesota).  Sorry!!!
--- Aaron Watters

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


ANN: xsdbXML python release with C#/.NET port

2005-03-01 Thread aaronwmail-usenet
ANN: xsdbXML release with C#/.NET port

Part I: Announcement

There is a new release of xsdbXML which provides
bugfixes to the Python implementation and also
provides a completely separate implementation in C#/.NET.

The xsdb framework provides a flexible and well defined
infrastructure to allow tabular data to be published,
retrieved, and combined over the Internet.

Read more and download at
   http://xsdb.sourceforge.net

Part II: Discussion
===
The C# implementation is primarily a transliteration
of the Python implementation.  I hope to also do a java
transliteration of the C# code.  Some brief observations:

- Development:
Using python for the first implementation was the
right way to go because it made it easier to backtrack
and refactor the implementation.  If I had tried this
in C# backtracking would have been much more painful.
Testing Python code, especially during development, is also
much easier in part because you can write
{"a": [1,2,3], "b": MyClass("argument")}
in a few keystrokes whereas a C# analogue runs to many
lines.
Interestingly, however, the C# port exposed several
nasty bugs in untested code paths of the python
implementation (incorrect calling sequences) because of C#
static typing, even before the C# code was running or
even compiling.
For the most part the transliteration was
straightforward, except where the python implementation
leans on the python expression parser (the parser had
to be "hand rolled" in C#).

- Libraries:

The python http services are more "bare bones" than the
.NET libraries and this is a *GOOD* *THING* (tm).  The
.NET libraries seem to do all kinds of nice things under
the surface where I can't influence their behavior (even
in principal because of the type system information hiding).
The python implementation pretty much allows me to
modify any part of the implementation, and the default does
as little as possible.  My reservations about the C# http
services didn't actually cause problems in this case, but
it made me nervous.

On the other hand it's nice in C# to not have to guess about
which XML library to use.  As any python programmer can
attest it is not fun trying to decide which of several
implementations is the best and will stay alive, etcetera.
I just arbitrarily chose the one I knew already, but I
really should switch to something else, dunno what.
In C# there is only one choice.

- Environment

What can I say. VS/.NET is really nice and there is
nothing close in Python AFAIK.

- Conclusion

Don't have any.  I'm just making comments :).

  Thanks for your attention -- Aaron Watters

===
% if I had a ( for every $ bush spent how many ('s would I have?
too many ('s

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


Re: On benchmarks, heaps, priority queues

2005-01-27 Thread aaronwmail-usenet
re http://xsdb.sourceforge.net/bench/pq3.py

Tim Peters:
> If you repair that, and
> instrument mixBench() to keep track of queue size statistics, you'll
> find that even at 100, the queue at the top of the loop never
> exceeds 30 entries, and has a mean size less than 3.

Aha.  Now that is embarrassing :(.   If I fix it then I do see greater
differences
at sizes of 10+.  Below that, PQ0 still looks better on my machine,
which I
still consider weird.  Thanks!
-- Aaron Watters

War dims hope for peace  -- a "real life headline"

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


Re: On benchmarks, heaps, priority queues

2005-01-27 Thread aaronwmail-usenet


(re: http://xsdb.sourceforge.net/bench/pq3.py)

nsz> ...bisect is not so fast for large data...

Yes I know in theory the insertion sort approach should be bad for
large enough values, but the weird thing is that if you mix inserts and
deletes (with enough deletes) even 1M elements is not a large enough
value.  Anyway, for 10K or less the insertion sort priority queue
implementation seems to always be better.

Weird.  -- Aaron Watters

===
Hypothetical performance improvements are the root of all evil.
-- Bill Tutt (paraphrased)

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


Re: On benchmarks, heaps, priority queues

2005-01-27 Thread aaronwmail-usenet

me> PQPython23 - the Lib implementation
me> PQ0 - my insertion sort based variant
me> PQueue - my "heap" based variant
me> (like PQPython23, but different).

Tim D:
> First of all, you should be running these benchmarks using Python
2.4.
> heapq is considerably faster there ... (Raymond Hettinger rewrote it
all
> in C).
> http://www.python.org/2.4/highlights.html
> Tim Delaney

WHOOPS. Okay after getting past my initial embarassment I tried this,
and it turns out it doesn't make much of a difference.  In particular
PQ0 is still always better if you intersperse many deletes with inserts
or in all cases of size <1.  Of course other machines will probably
have different characteristics (and yes my py24 contains the _heapq
extension module).

The nasty behavior of PQ0 for insertBench at >10
I think has to do with large list reallocation.

Hmmm.  This makes me wonder if my bplustree implementation(s) are
faster
than the bsddb modules too...

-- Aaron Watters
===
SOMETHING WENT WRONG IN AIRLINE CRASH, EXPERT SAYS
-- a "real life headline" (that'll be $50,000, please)


ENCLOSURE: Python 2.4 run of
http://xsdb.sourceforge.net/bench/pq3.py on my machine.
===

BENCHMARKS FOR 1000

insertBench
__main__.PQPython23 on 1000 elapsed 0.019809265 got 1000
__main__.PQ0 on 1000 elapsed 0.0099046326 got 1000
__main__.PQueue on 1000 elapsed 0.032098083 got 1000

mixBench
__main__.PQPython23 on 1000 elapsed 0.0 got 502
__main__.PQ0 on 1000 elapsed 0.0099046326 got 502
__main__.PQueue on 1000 elapsed 0.0 got 502

BENCHMARKS FOR 1

insertBench
__main__.PQPython23 on 1 elapsed 0.26017984 got 1
__main__.PQ0 on 1 elapsed 0.21038147 got 1
__main__.PQueue on 1 elapsed 0.35895096 got 1

mixBench
__main__.PQPython23 on 1 elapsed 0.071716614 got 5003
__main__.PQ0 on 1 elapsed 0.050999879837 got 5003
__main__.PQueue on 1 elapsed 0.069332428 got 5003

BENCHMARKS FOR 10

insertBench
__main__.PQPython23 on 10 elapsed 3.26499986649 got 10
__main__.PQ0 on 10 elapsed 7.8814196 got 10
__main__.PQueue on 10 elapsed 4.8161226 got 10

mixBench
__main__.PQPython23 on 10 elapsed 0.65099978447 got 5
__main__.PQ0 on 10 elapsed 0.461000204086 got 5
__main__.PQueue on 10 elapsed 0.66113351 got 5

BENCHMARKS FOR 20

insertBench
__main__.PQPython23 on 20 elapsed 6.9900954 got 20
__main__.PQ0 on 20 elapsed 28.5010001659 got 20
__main__.PQueue on 20 elapsed 10.384905 got 20

mixBench
__main__.PQPython23 on 20 elapsed 1.29099988937 got 11
__main__.PQ0 on 20 elapsed 0.922000169754 got 11
__main__.PQueue on 20 elapsed 1.3420763 got 11

BENCHMARKS FOR 30

insertBench
__main__.PQPython23 on 30 elapsed 11.697267 got 30
__main__.PQ0 on 30 elapsed 70.3009998798 got 30
__main__.PQueue on 30 elapsed 16.884629 got 30

mixBench
__main__.PQPython23 on 30 elapsed 1.9338774 got 15
__main__.PQ0 on 30 elapsed 1.3915995 got 15
__main__.PQueue on 30 elapsed 1.9635913 got 15

BENCHMARKS FOR 40

insertBench
__main__.PQPython23 on 40 elapsed 15.5419998169 got 40
__main__.PQ0 on 40 elapsed 127.25321 got 40
__main__.PQueue on 40 elapsed 23.062638 got 40

mixBench
__main__.PQPython23 on 40 elapsed 2.64399981499 got 20
__main__.PQ0 on 40 elapsed 1.9536866 got 20
__main__.PQueue on 40 elapsed 2.7336758 got 20

BENCHMARKS FOR 50

insertBench
__main__.PQPython23 on 50 elapsed 20.881144 got 50
__main__.PQ0 on 50 elapsed 246.95424 got 50
__main__.PQueue on 50 elapsed 35.960657 got 50

mixBench
__main__.PQPython23 on 50 elapsed 3.5559428 got 25
__main__.PQ0 on 50 elapsed 2.4834005 got 25
__main__.PQueue on 50 elapsed 3.48500013351 got 25

BENCHMARKS FOR 100

insertBench
__main__.PQPython23 on 100 elapsed 44.694057 got 100
__main__.PQ0 on 100 elapsed 1400.5940001 got 100
__main__.PQueue on 100 elapsed 70.661409 got 100

mixBench
__main__.PQPython23 on 100 elapsed 6.6311444 got 51
__main__.PQ0 on 100 elapsed 4.7366104 got 51
__main__.PQueue on 100 elapsed 6.8292371 got 51

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


On benchmarks, heaps, priority queues

2005-01-26 Thread aaronwmail-usenet
I've been wondering about benchmarks recently.

What is a fair benchmark?

How should benchmarks be vetted or judged?

I decided to see what you folks thought, so for discussion I
compared two priority queue implementations I
published for Python in 1995 against the "heap" priority
queue implementation added to the python distribution
recently (python 2.3+).

My implementations and the benchmark code are in

http://xsdb.sourceforge.net/bench/pq3.py

(benchmark code near the bottom of the file). The python
standard implementation should be in your Lib/ directory.

Below please find the numerical results of the benchmarks.
They compare the implementations

PQPython23 - the Lib implementation
PQ0 - my insertion sort based variant
PQueue - my "heap" based variant
(like PQPython23, but different).

There are 2 benchmarks used.

insertBench
-- which does insertions followed by deletes.
mixBench
-- which does insertions and deletes mixed together.

Here is my summary of the results:

1) For sizes less than 1 the insertion
sort PQ0 is always better.

2) For insertBench sized >1 PQ0 is very
bad and the other two are comparable with
PQPython23 always a little faster.

3) For mixBench both of my implementations are
better than the Python23 implementation for
all sizes tested, but PQ0 is far superior.

Here is my analysis of the results:

1) The python23 implementation is best when you
expect to be doing mainly inserts with few deletions
and the expected size is >1 (otherwise use pq0).

2) PQ0 is best if you expect to be doing many deletions
interspersed with many inserts.

3) PQueue is generally worse than the other two
unless you want to use a non-standard comparison
function (which the others don't support).

My questions to you:

Are my conclusions valid?

What is a better way to perform and publish benchmarks?

-- thanks,   Aaron Watters

===
JUVENILE COURT TO TRY SHOOTING SUSPECT
-- a "real life headline" (that should work)

ENCLOSURE: run of
http://xsdb.sourceforge.net/bench/pq3.py on my machine.
===

BENCHMARKS FOR 1000

insertBench
__main__.PQPython23 on 1000 elapsed 0.03961853 got 1000
__main__.PQ0 on 1000 elapsed 0.0099046326 got 1000
__main__.PQueue on 1000 elapsed 0.029713898 got 1000

mixBench
__main__.PQPython23 on 1000 elapsed 0.0099046326 got 502
__main__.PQ0 on 1000 elapsed 0.0 got 502
__main__.PQueue on 1000 elapsed 0.0099046326 got 502

BENCHMARKS FOR 1

insertBench
__main__.PQPython23 on 1 elapsed 0.261000156403 got 1
__main__.PQ0 on 1 elapsed 0.20799728 got 1
__main__.PQueue on 1 elapsed 0.36161035 got 1

mixBench
__main__.PQPython23 on 1 elapsed 0.059427795 got 5003
__main__.PQ0 on 1 elapsed 0.051907349 got 5003
__main__.PQueue on 1 elapsed 0.069332428 got 5003

BENCHMARKS FOR 10

insertBench
__main__.PQPython23 on 10 elapsed 3.24500012398 got 10
__main__.PQ0 on 10 elapsed 7.9309428 got 10
__main__.PQueue on 10 elapsed 4.8260273 got 10

mixBench
__main__.PQPython23 on 10 elapsed 0.64132425 got 5
__main__.PQ0 on 10 elapsed 0.47056131 got 5
__main__.PQueue on 10 elapsed 0.65122888 got 5

BENCHMARKS FOR 20

insertBench
__main__.PQPython23 on 20 elapsed 6.9801907 got 20
__main__.PQ0 on 20 elapsed 28.3209998608 got 20
__main__.PQueue on 20 elapsed 10.4350001812 got 20

mixBench
__main__.PQPython23 on 20 elapsed 1.29099988937 got 11
__main__.PQ0 on 20 elapsed 0.91140872 got 11
__main__.PQueue on 20 elapsed 1.3321717 got 11

BENCHMARKS FOR 30

insertBench
__main__.PQPython23 on 30 elapsed 10.9159998894 got 30
__main__.PQ0 on 30 elapsed 69.631144 got 30
__main__.PQueue on 30 elapsed 19.3279998302 got 30

mixBench
__main__.PQPython23 on 30 elapsed 2.443782 got 15
__main__.PQ0 on 30 elapsed 1.5824469 got 15
__main__.PQueue on 30 elapsed 2.14300012589 got 15

BENCHMARKS FOR 40

insertBench
__main__.PQPython23 on 40 elapsed 16.263114 got 40
__main__.PQ0 on 40 elapsed 153.66113 got 40
__main__.PQueue on 40 elapsed 24.786134 got 40

mixBench
__main__.PQPython23 on 40 elapsed 2.9143433 got 20
__main__.PQ0 on 40 elapsed 1.8630001545 got 20
__main__.PQueue on 40 elapsed 2.7336758 got 20

BENCHMARKS FOR 50

insertBench
__main__.PQPython23 on 50 elapsed 20.1890001297 got 50
__main__.PQ0 on 50 elapsed 246.383999825 got 50
__main__.PQueue on 50 elapsed 30.104916 got 50

mixBench
__main__.PQPython23 on 50 elapsed 3.2650001049 got 25
__main__.PQ0 on 50 elapsed 2.3522561 got 25
__main__.PQueue on 50 elapsed 3.3254768 got 25

BENCHMARKS FOR 100

insertBench
__main__.PQPython23 on 100 elapsed 43.032648 got 100
__main__.PQ0 on 100 elapsed 1376.3983 got 10

Re: OT: google groups bug, or worse?

2005-01-08 Thread aaronwmail-usenet

Bengt Richter wrote:
> What did you google with? Is this it?
>
http://groups-beta.google.com/groups?hl=en&ie=UTF-8&q=%22The+xsdbXML+framework+provides+a+flexible+and+well+defined+infrastructure%22&qt_s=Search+Groups

That was my *reply* to one of the original posts using Google,
which I faked up when I couldn't find it (posted using google).
The two originals aren't there.

hmmm.   -- Aaron Watters
===
You'd be paranoid too, if everyone was out to get you!

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


OT: google groups bug, or worse?

2005-01-07 Thread aaronwmail-usenet
I'm concerned that google groups is not correctly reflecting the
python lists.  A month ago I announced the xsdbXML framework to the
python list and the python-announce list.  As you can see from the
links
below the python announce submission was approved by the moderators
(thanks!)
and the python list submission also went out, but the messages cannot
be found at google groups.

http://mail.python.org/pipermail/python-list/2004-December/254479.html
http://mail.python.org/pipermail/python-announce-list/2004-December/003583.html

Is it a google bug?  Or is it something darker, like an anti-Python
conspiracy at google?

Inquiring minds want to know.

-- Aaron Watters

===
There are 3 kinds of people, those who can count and those who can't.
-- folklore.

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


Re: mathmatical expressions evaluation

2004-12-22 Thread aaronwmail-usenet
> have a task of evaluating a complex series (sorta) of mathematical
> expressions and getting an answer ...

If we assume that you are looking for functionality and speed is
secondary,
please have a look at the technique in


http://cvs.sourceforge.net/viewcvs.py/xsdb/xsdbXML/xsdbXMLpy/functions.py?view=markup

which uses the python parser to generate a parse tree for an arbitrary
expression and then imposes its own semantics on the tree.  In fact
take
a look at xsdb use guide under "Computing other derived values"

http://xsdb.sourceforge.net/guide.html

since xsdbXML implements general computations over xml inputs.
Let me know if you have any comments/questions/suggestions.
-- Aaron Watters

===
Later on we'll perspire, as we stare at the fire
And face so afraid, the bills left unpaid
Walking in a winter wonderland.  --stolen from "for better or worse"

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


RE: xsdb does XML, SQL is dead as disco :) (oops)

2004-12-14 Thread aaronwmail-usenet
Some people pointed out that bighunks of my HUGE
ZIP file contained junk that could be regenerated.
Thanks!  It's now much smaller.  Sorry for the
screw up.  -- Aaron Watters

I wrote:
>  xsdb does XML, SQL is dead as disco :)
>
>The xsdbXML framework provides a
>flexible and well defined infrastructure to
>allow tabular data to be published, retrieved,
>and combined over the Internet.
>
>It's a little bit like the daughter of the
>Gadfly SQL engine in the buff,
>on steroids.  This is a major departure from
>the previous releases of xsdb.
>
>Please read about it and download it from
>http://xsdb.sourceforge.net
>
>Note that the download is over 90%
>documentation and example data files --
>the software itself is small.
>
>The xsdb framework makes all of
>the following assertions true.
>
>Database queries over web distributed data:
>  Databases may be broken up into multiple
>  files or servers on multiple machines
>  and queried as a single resource.
>Simple Publication:
>  Publishing a queriable collection of data
>  (a context) can be as simple as
>  placing an XML document on a web server.
>Sophisticated Publication:
>  Large and complex databases may
>  also be published using server software
>  which provides indexing and other optimizations.
>Heterogeneity:
>  Published data collections may be built
>  using parts of remotely defined data collections.
>External Data:
>  A data context may make reference
>  to another arbitrary web object.
>Open formats and definitions:
>  Databases may be constructed and
>  queried using standard formats and standard
>  web protocols using any programming language
>  in any computational environment.
>Simple formats
>  The content of a database or query may be
>  expressed in a manner which is easy
>  to parse and interpret (both for human readers
>  and for computer programs). Data,
>  queries and query responses are represented
>  using the same language of expressions.
>Clear definition
>  The meaning of database entries and queries
>  are defined using simple mathematical
>  definitions. 
 >
 > 
 > There ain't no sanity clause

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


ANN: xsdb does XML, SQL is dead as disco :)

2004-12-11 Thread aaronwmail-usenet
 
The xsdbXML framework provides a flexible and well defined infrastructure to allow tabular data to be published, retrieved, and combined over the Internet.
It's a little bit like the daughter of the Gadfly SQL engine in the buff, on steroids.  This is a major departure from the previous releases of xsdb.
 
Please read about it and download it from    http://xsdb.sourceforge.net
Note that the download is over 90% documentation and example data files --the software itself is small.
 
The xsdb framework makes all of the following assertions true. 
 
Database queries over web distributed data:   Databases may be broken up into multiple files or servers on multiple machines   and queried as a single resource. Simple Publication:   Publishing a queriable collection of data (a context) can be as simple as   placing an XML document on a web server. Sophisticated Publication:   Large and complex databases may also be published using server software   which provides indexing and other optimizations. Heterogeneity:   Published data collections may be built using parts of remotely defined data collections. External Data:   A data context may make reference to another arbitrary web object. Open formats and definitions:   Databases may be constructed and queried using standard formats and standard   web protocols using any programming language in any computational environment. Simple formats   The content!
  of a
 database or query may be expressed in a manner which is easy   to parse and interpret (both for human readers and for computer programs). Data,   queries and query responses are represented using the same language of expressions. Clear definition   The meaning of database entries and queries are defined using simple mathematical   definitions. 
thanks for your attention!
    -- Aaron Watters
   There ain't no sanity clause.
 
 -- 
http://mail.python.org/mailman/listinfo/python-list