Michael J. Fromberger michael.j.fromber...@gmail.com added the comment:
Thank you for setting me straight.
I see now that I misunderstood the scope of `CFUNCTYPE`, as I was using
it as a general wrapper when in fact it's only needed for callbacks.
Mistakenly, I inferred from reading section
New submission from Michael J. Fromberger michael.j.fromber...@gmail.com:
A segmentation fault is generated in _ctypes.so when calling a function that
returns a char pointer on a system
with 64-bit pointer types. The attached crash dump is from a Python 2.6.3
built from MacPorts (port
Changes by Michael J. Fromberger michael.j.fromber...@gmail.com:
Added file: http://bugs.python.org/file15155/crash-report.txt
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7160
Michael J. Fromberger michael.j.fromber...@gmail.com added the comment:
I believe this error occurs because a pointer value is being truncated to
32 bits. The exception code is
KERN_INVALID_ADDRESS at 0x002fe020
If you add a diagnostic printout to the body of get_message(), you
Michael J. Fromberger michael.j.fromber...@gmail.com added the comment:
Ned Deily writes:
--enable-framework and --enable-shared are mutually exclusive options.
Aha, I did not realize that, though I suppose in retrospect it should have
been obvious. Removing --enable-shared from my build
New submission from Michael J. Fromberger michael.j.fromber...@gmail.com:
Checkout:
http://svn.python.org/projects/python/tags/r262
Configure:
env CFLAGS=-I/opt/local/include LDFLAGS=-L/opt/local/lib sh
./configure --enable-framework --enable-shared --enable-readline
Build:
make
Michael J. Fromberger michael.j.fromber...@gmail.com added the comment:
Sorry, I managed to not copy the error message. It is:
i686-apple-darwin8-gcc-4.0.1: Python.framework/Versions/2.6/Python: No
such file or directory
make: *** [python.exe] Error 1
means
2 ** (2 ** (2 ** 2))
... and not
((2 ** 2) ** 2) ** 2
... as you seem to expect. As usual, you can enforce different
associations by explicitly including the parentheses.
Cheers,
-M
--
Michael J. Fromberger | Lecturer, Dept. of Computer Science
http://www.dartmouth.edu
near the bottom of the page.
Example:
zip([1,2,3], [4,5,6], [7,8,9])
== [(1, 4, 7), (2, 5, 8), (3, 6, 9)]
Cheers,
-M
--
Michael J. Fromberger | Lecturer, Dept. of Computer Science
http://www.dartmouth.edu/~sting/ | Dartmouth College, Hanover, NH, USA
--
http://mail.python.org
? Once you have done so, you will also be able to
get rid of the extra accumulating parameter, and then you will have what
you wanted.
I hope this helps.
Cheers,
-M
--
Michael J. Fromberger | Lecturer, Dept. of Computer Science
http://www.dartmouth.edu/~sting/ | Dartmouth College
marked(self):
| return self._mark
Generally speaking, you should only have to override .next() and
.marked() to make a useful subclass of marker -- and possibly also
__init__ if you need some additional setup.
Cheers,
-M
--
Michael J. Fromberger | Lecturer, Dept. of Computer
it
in place. Also, you should probably read about the sorted function
here:
http://docs.python.org/lib/built-in-funcs.html
Cheers,
-M
--
Michael J. Fromberger | Lecturer, Dept. of Computer Science
http://www.dartmouth.edu/~sting/ | Dartmouth College, Hanover, NH, USA
--
http
://docs.python.org/ref/genexpr.html
Cheers,
-M
--
Michael J. Fromberger | Lecturer, Dept. of Computer Science
http://www.dartmouth.edu/~sting/ | Dartmouth College, Hanover, NH, USA
--
http://mail.python.org/mailman/listinfo/python-list
specification did not constrain this case.
To call this, pass a file-like object to parse_folders(), e.g.:
test1 = '''
[New client].
Won't work with the dot on the end.
My mistake. The period was a copy-and-paste artifact, which I missed.
Cheers,
-M
--
Michael J. Fromberger
'''
from StringIO import StringIO
result = parse_folders(StringIO(test1))
As the documentation suggests, the result is a nested dictionary
structure, representing the folder structure you encoded. I hope this
helps.
Cheers,
-M
--
Michael J. Fromberger | Lecturer, Dept
have multiple names (e.g., EAGAIN and EWOULDBLOCK)
so that this lookup may not return exactly the name you're expecting.
Cheers,
-M
--
Michael J. Fromberger | Lecturer, Dept. of Computer Science
http://www.dartmouth.edu/~sting/ | Dartmouth College, Hanover, NH, USA
--
http
-- these expose a file-like API,
including a .name attribute.
Assuming tempfile.mkstemp() is implemented properly, I think what you
are doing should be sufficient to avoid the obvious file-creation race
condition.
Cheers,
-M
--
Michael J. Fromberger | Lecturer, Dept. of Computer Science
/gdmodule.html
I do not know, however, whether or not the Python wrapper supports the
animated GIF portions of the library. You'll probably have to do some
digging.
Cheers,
-M
--
Michael J. Fromberger | Lecturer, Dept. of Computer Science
http://www.dartmouth.edu/~sting/ | Dartmouth
are after.
Cheers,
-M
--
Michael J. Fromberger | Lecturer, Dept. of Computer Science
http://www.dartmouth.edu/~sting/ | Dartmouth College, Hanover, NH, USA
--
http://mail.python.org/mailman/listinfo/python-list
In articleâ [EMAIL PROTECTED],â¬
â [EMAIL PROTECTED] wroteâ:â¬
â â¬Hiâ,â¬
â â¬I'm trying to get wikipedia page source with urllib2â:â¬
â â¬usockâ =
â¬urllib2â.â¬urlopenâ(â¬httpâ://â¬en.wikipedia.org/wikiâ/â¬
â â¬Albert_Einsteinâ)â¬
â
and its descendants also behave in this manner, as do the
AND and OR of Lisp or Scheme. It is possible that beginners may find it
a little bit confusing at first, but I believe such confusion is minor
and easily remedied.
Cheers,
-M
--
Michael J. Fromberger | Lecturer, Dept
to the dictionary, you may also
use the following:
value = d.setdefault('sex', 'unknown')
This returns the same value as the above, but also adds the key 'sex' to
the dictionary as a side-effect, with value 'unknown'.
Cheers,
-M
--
Michael J. Fromberger | Lecturer, Dept. of Computer
the hard work be somebody
else's problem.
Cheers,
-M
--
Michael J. Fromberger | Lecturer, Dept. of Computer Science
http://www.dartmouth.edu/~sting/ | Dartmouth College, Hanover, NH, USA
--
http://mail.python.org/mailman/listinfo/python-list
properties
that:
1. It works on lists of any hashable type, not just strings,
2. It preserves the order of the unfiltered items,
3. It makes only two passes over the input list.
Cheers,
-M
--
Michael J. Fromberger | Lecturer, Dept. of Computer Science
http://www.dartmouth.edu/~sting
key from each element
in the source list.
Cheers,
-M
--
Michael J. Fromberger | Lecturer, Dept. of Computer Science
http://www.dartmouth.edu/~sting/ | Dartmouth College, Hanover, NH, USA
--
http://mail.python.org/mailman/listinfo/python-list
.
In the state of the onion address?
http://www.perl.com/pub/a/2006/09/21/onion.html
There is also this:
'But I think the basic Perl paradigm is Whatever-oriented programming.'
But what this really means, in practise, is dis-oriented programming.
-M
--
Michael J. Fromberger | Lecturer
build of Python 2.5.
For reference, I have done a framework build of Python, and it seems to
work fine for everything else I have tried. Do you have any idea what
might be causing this trouble? I'd be grateful for your insights.
Cheers,
-M
--
Michael J. Fromberger | Lecturer
of the existing exception types, then perhaps you
can catch the exceptions from functions called by f, within f itself,
and raise some other error (or suppress the errors, if appropriate).
Cheers,
-M
--
Michael J. Fromberger | Lecturer, Dept. of Computer Science
http
In article [EMAIL PROTECTED],
Michele Simionato [EMAIL PROTECTED] wrote:
Michael J. Fromberger ha scritto:
Consider the following class hierarchy in Python:
snip
Is there a better (i.e., more elegant) way to handle the case marked
(**) above?
Curious,
-M
--
Michael J
for the imprecision. However, for the
purposes of this example, the distinction is irrelevant.
Cheers,
-M
--
Michael J. Fromberger | Lecturer, Dept. of Computer Science
http://www.dartmouth.edu/~sting/ | Dartmouth College, Hanover, NH, USA
--
http://mail.python.org/mailman/listinfo/python
,
-M
--
Michael J. Fromberger | Lecturer, Dept. of Computer Science
http://www.dartmouth.edu/~sting/ | Dartmouth College, Hanover, NH, USA
--
http://mail.python.org/mailman/listinfo/python-list
down the names of) the ancestors
of C in order to dispatch to superclass methods in D, since C and D
share no common ancestors south of object.
Is there a better (i.e., more elegant) way to handle the case marked
(**) above?
Curious,
-M
--
Michael J. Fromberger | Lecturer, Dept
/local/lib so that the build could
use the version of GNU readline I installed via Darwin ports. The Tk
headers allow pythonw to build properly.
Having configured, I built and installed via:
make
sudo make frameworkinstall
I hope this may be helpful to you.
-M
--
Michael J. Fromberger
)
# See the .month, .day, and .year fields of yesterday
Cheers,
-M
--
Michael J. Fromberger | Lecturer, Dept. of Computer Science
http://www.dartmouth.edu/~sting/ | Dartmouth College, Hanover, NH, USA
--
http://mail.python.org/mailman/listinfo/python-list
regular expressions from language theory.
Cheers,
-M
--
Michael J. Fromberger | Lecturer, Dept. of Computer Science
http://www.dartmouth.edu/~sting/ | Dartmouth College, Hanover, NH, USA
--
http://mail.python.org/mailman/listinfo/python-list
but I can't seem to find a good example.
Here's one possibility:
list(reduce(lambda s, t: s + t, zip(L1, L2), ()))
-M
--
Michael J. Fromberger | Lecturer, Dept. of Computer Science
http://www.dartmouth.edu/~sting/ | Dartmouth College, Hanover, NH, USA
--
http://mail.python.org
] in dict2)
Cheers,
-M
--
Michael J. Fromberger | Lecturer, Dept. of Computer Science
http://www.dartmouth.edu/~sting/ | Dartmouth College, Hanover, NH, USA
--
http://mail.python.org/mailman/listinfo/python-list
will
converge more quickly for atan(1/5) and atan(1/239).
(LaTeX: \mathrm{atan}(x) = \sum_{i=0}^\infty\frac{(-1^i)x^i}{2i+1})
Cheers,
-M
--
Michael J. Fromberger | Lecturer, Dept. of Computer Science
http://www.dartmouth.edu/~sting/ | Dartmouth College, Hanover, NH, USA
--
http
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] wrote:
Michael J. Fromberger:
I can send you a Python implementation I wrote, if you like; but if
you're interested in better understanding how the transform works,
I would recommend you try writing your own implementation.
I'd like
/bwt/bwt.htm
I hope this helps you get started.
-M
--
Michael J. Fromberger | Lecturer, Dept. of Computer Science
http://www.dartmouth.edu/~sting/ | Dartmouth College, Hanover, NH, USA
--
http://mail.python.org/mailman/listinfo/python-list
of the Python source
tree.
Cheers,
-M
--
Michael J. Fromberger | Lecturer, Dept. of Computer Science
http://www.dartmouth.edu/~sting/ | Dartmouth College, Hanover, NH, USA
--
http://mail.python.org/mailman/listinfo/python-list
://pages.cpsc.ucalgary.ca/~aycock/spark/
You might also find the following an interesting read, if this sort of
thing interests you:
http://www.python.org/sigs/parser-sig/towards-standard.html
Cheers,
-M
--
Michael J. Fromberger | Lecturer, Dept. of Computer Science
http
confusion.
Cheers,
-M
--
Michael J. Fromberger | Lecturer, Dept. of Computer Science
http://www.dartmouth.edu/~sting/ | Dartmouth College, Hanover, NH, USA
--
http://mail.python.org/mailman/listinfo/python-list
be great if there exists a library already written to do this,
and if there is, can somebody please point me to it??
I recommend you investigate PyCrypto:
http://www.amk.ca/python/code/crypto
http://sourceforge.net/projects/pycrypto
Cheers,
-M
--
Michael J. Fromberger | Lecturer
of detecting and automatically handling this kind of substitution.
Naturally, you might well ask, why would you do such a fool thing? To
this I can only respond: Never underestimate the ingenuity of fools.
-M
--
Michael J. Fromberger | Lecturer, Dept. of Computer Science
http
modules! Where do you draw the
line? Do you really want to hard-code user opinions into the language?
Right now, we have a nice, simple yet effective mechanism for
controlling the contents of our namespaces. I don't think this would be
a worthwhile change. -1.
-M
--
Michael J. Fromberger
in
. which each key is a substring of s to be replaced and the
. corresponding value is the string to replace it with.
.
. exp = re.compile('|'.join(re.escape(x) for x in r.keys()))
. return exp.sub(lambda m: r.get(m.group()), s)
Cheers,
-M
--
Michael J. Fromberger
, 2, 3]))
== [[1, 2, 3], [2, 3, 1], [1, 3, 2], [3, 2, 1]]
Notably absent from this list are [2, 1, 3] and [2, 3, 1]. The problem
gets worse with longer lists. The basic problem is that x needs to be
able to occur in ALL positions, not just the beginning and the end.
Cheers,
-M
--
Michael J
.
Personally, I'd be pretty suspicious of the quality of a compiler that
produced radically different code for these two constructs without some
damned good reason.
-M
--
Michael J. Fromberger | Lecturer, Dept. of Computer Science
http://www.dartmouth.edu/~sting/ | Dartmouth College
the input sequence
exactly once, and requires storage proportional to the length of the
input.
-M
--
Michael J. Fromberger | Lecturer, Dept. of Computer Science
http://www.dartmouth.edu/~sting/ | Dartmouth College, Hanover, NH, USA
--
http://mail.python.org/mailman/listinfo/python
') ## == True
print isset('varname') ## == False
print isset('lloc')## == False
lloc = foo!
print isset('lloc')## == True
Perhaps this is not the most elegant solution, but I believe it handles
scoping correctly.
-M
--
Michael J. Fromberger | Lecturer, Dept
51 matches
Mail list logo