On Apr 7, 2005 1:15 AM, Greg Ewing <[EMAIL PROTECTED]> wrote:
> Scott David Daniels wrote:
> > Aahz wrote:
> >
> >> You just can't have your cake and eat it, too.
> >
> > I've always wondered about this turn of phrase. I seldom
> > eat a cake at one sitting.
>
> You need to recursively subdivide
my CS classes (I graduated last May)
While I'm at it though, I want to thank Tim for that post. It was one
of those posts where afterwards you say "of course!" but beforehand I
was totally thinking of it the wrong way. Brought me right back to
Abstract.
Peace
Bill Mill
bill.mill a
n
or
#by implication
assert j not in seen
just to really frustrate the guy reading your code.
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
like its
recursion really slows it down (but I haven't been profiled it). Does
anyone know of a non-recursive algorithm to do the same thing?
And, while I'm asking that question, is there a good reference for
finding such algorithms? Do most people keep an algorithms book handy?
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
lst.append(math.sin(i) * i)
t1 = timeit.Timer('test1()', 'from __main__ import test1')
t2 = timeit.Timer('test2()', 'from __main__ import test2')
print "time1: %f" % t1.timeit(100)
print "time2: %f" % t2.timeit(100)
09:09 AM ~$ py
print "time2: %f" % t2.timeit(100)
>
The results change slightly when I actually insert an integer, instead
of a float, with lst[i] = i and lst.append(i):
09:14 AM ~$ python test.py
time1: 3.352000
time2: 3.672000
The preallocated list is slightly faster in most of my tests, but I
still
ocument on python
> coding style.
>
the authoritative coding style guide is pep 8:
http://www.python.org/peps/pep-0008.html
Of course, there are style points that are debatable, but for
comments, you should definitely be using triple-quotes. Pep 8 points
you to pep 257, which is all about docstrings:
http://www.python.org/peps/pep-0257.html
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
noted that running the win32 bc from cygwin messed up my
terminal, so I recommend running it from a cmd window (which worked
fine).
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
On 4/14/05, César Leonardo Blum Silveira <[EMAIL PROTECTED]> wrote:
> Yeah that is happening to me too! Almost all my python-list e-mails go
> to the Spam box.
> Maybe we should contact the gmail admins?
>
I've already contacted the gmail admins. There was no response.
Pe
On 4/14/05, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> Bill Mill wrote:
>
> > > Maybe we should contact the gmail admins?
> >
> > I've already contacted the gmail admins. There was no response.
>
> have you tried reading the newsgroup via
ning. Here's to b*tching on c.l.p actually
solving something !
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
e bit-twiddling operators
to get at your data. These should be *very* fast, as well as memory
efficient.
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
eractive
> sessions, complete with ">>>" and "..."), but nits can always be picked
> and I'm not the gatekeeper to Python's documentation.
>
I'd suggest that he actually make an effort at improving the docs
before submitting them.
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
think this is more intuitive, since most people (including
> > mathematicians) start counting at "1". The reason for starting at
> > "0" is easier memory address calculation, so nothing for really high
> > level languages.
>
> Personnaly I would like to ha
On 20 Apr 2005 13:39:42 GMT, Antoon Pardon <[EMAIL PROTECTED]> wrote:
> Op 2005-04-20, Bill Mill schreef <[EMAIL PROTECTED]>:
> > On 20 Apr 2005 12:52:19 GMT, Antoon Pardon <[EMAIL PROTECTED]> wrote:
> >> Op 2005-04-20, Torsten Bronger schreef &
ve he meant obfuscating bytecode for a commercial product, to
try and avoid decompilation, which is often a desirable function for
commercial entities.
(Not that I have the technical knowledge to agree or disagree with
what he said, I'm just trying to help clear up what's become a fairly
t; t = 2
>>> [(lambda n: t**n)(n) for n in range(4)]
[1, 2, 4, 8]
>>> t = 3
>>> [(lambda n: t**n)(n) for n in range(4)]
[1, 3, 9, 27]
I just thought that was kinda neat. If you wanted to obfuscate some
python, this would be an awesome trick - hide the value of t somewhere
early in the function then pull a variation of this out later.
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
On 4/25/05, Leonard J. Reder <[EMAIL PROTECTED]> wrote:
> Hello Mark,
>
> I took your three day course here at JPL and recall that you said
> something was wrong with the implementation of threads within Python
> but I cannot recall what. So what is wrong with threads in Python?
I'm going to gue
ar. Once that happens, we can tell
people who ask the OP's question that [genexp] is just another way to
spell list(genexp), and he should use it if he wants the entire list
constructed in memory.
> Jeremy> should be relatively simple), it's not worth breaking that
> J
v, t[1]) for t in tab]) for v, tab in zip(vals, tabs)]
[((1.0, 1), (1.0, 3), (1.0, 4)),
((2.3439, 2), (2.3439, 0),
(2.3439, 9)),
((4.23420004, 4), (4.23420004, 3),
(4.23420004, 1))]
Peace
Bill Mill
bill.mill at gmail.com
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
http://mail.python.org/mailman/listinfo/python-list
wing+komodo&rnum=3#3a118074c68f1f35
http://groups-beta.google.com/group/comp.lang.python/browse_frm/thread/2225676eb7e1b4e/cdee764dfa2b5391?q=best+IDe&rnum=1#cdee764dfa2b5391
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
rch?q=python%20web%20framework .
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
" in it. Typing
"am" leaves only row 1, since "gamma" has the substring "am" in it.
The key here is that this works instantaneously as you type, even with
very large lists with many elements per row. I'd like the employee list
in my current application to be s
for i in range(3)]
>>> y
[[], [], []]
>>> [id(b) for b in y]
[168611980, 168612300, 168611916]
Or, replace x[0] with a new list, instead of modifying the one already there:
>>> x[0] = [2]
>>> x
[[2], [], []]
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
key(patch):
print "Sun recommends patch %s" % patch
for patch in serverx:
if not sun.has_key(patch):
print "Serverx has unnecessary patch %s" % patch
def diff_revs(sun, serverx):
for patch, rev in sun.iteritems():
if serverx.has_key(
n the system is
> heavily loaded. Otherwise, you're going to hit per-process limits. In
> the latter case, adding RAM or swap won't help at all. Raising the
> per-process limits is the solution.
>
A quick google shows it to be mac os X, and a pretty frequent error messa
element %s" % (n, x)
Earlier:
n = 0
for x in lst:
print "iteration %d on element %s" % (n, x)
n += 1
And you shouldn't use list as a variable name; list() is a built-in
function which you'll clobber if you do.
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
On 5/6/05, Bill Mill <[EMAIL PROTECTED]> wrote:
> On 5/6/05, Florian Lindner <[EMAIL PROTECTED]> wrote:
> > Hello,
> > when I'm iterating through a list with:
> >
> > for x in list:
> >
> > how can I get the number of the current iteratio
got xyzzy text xyzzy yeah yeah yeah"
>>> token
'xyzzy'
>>> for rep in L:
... source = source.replace(token, rep, 1)
...
>>> source
"11 text we've got 22 text 33 yeah yeah yeah"
And, if I may, I recommend the Python Tutorial at
http://docs.python.org/tut/tut.html .
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
t; import re
>>> locals()
{'__builtins__': , 're': , 'x': 12, '__name__': '__main__', 'z': 13, '__doc__': N
one}
>>> locals().keys()
['__builtins__', 're', 'x', '__nam
w if these recordings exist and, if so, where they are?
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
y different format:
>>> zip(range(10), range(20, 30))
[(0, 20), (1, 21), (2, 22), (3, 23), (4, 24), (5, 25), (6, 26), (7, 27), (8, 28)
, (9, 29)]
> Sorry if it seems an homework assignment.
It'd be one heck of a short homework assignment. I hope you've read
the python
form to at least linux and windows.
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
willl
recursively search any directory in AFMPATH, so you only need to
specify a base directory if multiple subdirectories contaning '*.afm'
files.
Peace
Bill Mill
bill.mill at gmail.com
>
> Tschö,
> Torsten.
>
> [*] because of the "pslatex" backend, which means t
On 5/11/05, Torsten Bronger <[EMAIL PROTECTED]> wrote:
> Hallöchen!
>
> Bill Mill <[EMAIL PROTECTED]> writes:
>
> > On 5/11/05, Torsten Bronger <[EMAIL PROTECTED]> wrote:
> >
> >> Fernando Perez <[EMAIL PROTECTED]> writes:
> >&
uiltin types, so that you'd find "float (builtin)", "string
> > (builtin)", "dict (builtin)", etc. in the appropriate alphabetical
> > positions.
>
> +1
>
> TJR
>
+1
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
re writing
your own interpreter, it should still be syntactically invalid.
Could you perhaps repeat your question with an example of what
behavior is surprising you?
Peace
Bill Mill
bill.mill at gmail.com
>
> "Fredrik Lundh" <[EMAIL PROTECTED]> escribió en el mensaje
> ne
x27;, '0x13', '0x14', '0x15',
'0x16', '0x17', '0x18', '0x19', '0x1a', '0x1b', '0x1c', '0x1d', '0x1e', '0x1f',
'0xe8', '0xe9', '0xea', '0xeb', '0xec', '0xed', '0xee', '0xef', '0xf0', '0xf1',
'0xf2', '0xf3', '0xf4', '0xf5', '0xf6', '0xf7', '0xf8', '0xf9', '0xfa', '0xfb',
'0xfc', '0xfd', '0xfe', '0xff']
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
On 19 May 2005 06:56:45 -0700, rh0dium <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> While I know there is a zillion ways to do this.. What is the most
> efficient ( in terms of lines of code ) do simply do this.
>
> a=1, b=2, c=3 ... z=26
>
> Now if we really want some bonus points..
>
> a=1, b=2,
hon.
> for i, digraph in enumerate(sorted([''.join((x, y)) for x in alpha for
> y in [''] + [z for z in alpha]], key=len)):
>globals()[digraph]=i+1
>
> How do you implement this sucker??
Works just fine for me. Let me know what error you're getting
ord2tuple('ZZ14')
(13, 701)
>>> coord2tuple('ZZ175')
(174, 701)
>>> coord2tuple('A2')
(1, 0)
Are there cols greater than ZZ? I seem to remember that there are not,
but I could be wrong.
Hope this helps.
Peace
Bill Mill
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
7;key']
l2.sort(lambda a,b: cmp(f(a), f(b)))
return l2
l2.sort()
return l2
And from your other email:
> I need to go the other way! tuple2coord
Sorry, I only go one way. It should be transparent how to do it backwards.
Peace
Bill Mill
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
On 5/19/05, Peter Otten <[EMAIL PROTECTED]> wrote:
> Bill Mill wrote:
>
> >> Traceback (most recent call last):
> >>File"",line1,in?
> >> NameError: name 'sorted' is not defined
> >>
> >> I think you're probably usi
rly used. I like it especially for signatures like "def
change_coord((x, y))". It was one of those features, for me, where I
just tried it without knowing of its existence, assuming it would
work, and I was pleasantly surprised that it did.
Peace
Bill Mill
bill.mill at gmail.com
[1] htt
ome things you might not expect, including changing /r/n to /n. Try:
>>> f = file('d:/deleteme.txt', 'rb')
>>> f.read()
'testing\r\n1\r\n2\r\n3'
>>> f = file('d:/deleteme.txt', 'r')
>>> f.read()
'testing\n1\n2\n3'
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
rivate
> contract. But it's doable.
>
What about http://library.wolfram.com/infocenter/MathSource/585/ ?
Seems to be non-proprietary, or something different, but does it work?
I don't have Mathematica, so I don't know.
Peace
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
ists
working like this, and I believe that they need to recognize
themselves as a separate discipline with separate rules. I'd like to
see them open source their code when they publish papers as a matter
of standard procedure. I'd like to see them publish reports much more
like biolo
going to need to use the Win32 API.
As for how to use the win32 API, you could try asking on comp.os.ms-
windows.programmer.win32 (
http://groups.google.com/group/comp.os.ms-windows.programmer.win32/topics?lnk=srg
), because that's some fiendish stuff.
-Bill Mill
bill.mill at gmail.com
-
nd
walk would be helpful?
http://www.google.com/codesearch?q=compiler+walk+lang%3Apython&hl=en&btnG=Search+Code
It seems from a superficial look that some of those files would be
helpful as examples.
-Bill Mill
bill.mill at gmail.com
http://billmill.org
--
http://mail.python.org/mailman/listinfo/python-list
*?)\.)")
('beta',)
Failed
In [132]: test_re(r"(?:item2: (.*?)\.)?")
(None,)
(None,)
Shouldn't the '?' greedily grab the group match?
Thanks
Bill Mill
bill.mill at gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
James Stroud wrote:
> Bill Mill wrote:
> > Hello all,
> >
> > I've got a test script:
> >
> > start python code =
> >
> > tests2 = ["item1: alpha; item2: beta. item3 - gamma--",
> > "item1: alpha; item3 - gamma--&
Gabriel Genellina wrote:
> At Tuesday 16/1/2007 16:36, Bill Mill wrote:
>
> > > py> import re
> > > py> rgx = re.compile('1?')
> > > py> rgx.search('a1').groups()
> > > (None,)
> > > py> rgx = re.compile('(
Jason,
Can you give a little more detail on the problem? What's the directory
structure of a Klik package that's failing look like? What program is
trying to import what module from where that's failing?
-Bill Mill
On Jan 27, 2008 1:49 AM, Jason Taylor <[EMAIL PROTECTED]>
, I'm just posting it because I found it thought-provoking.)
-Bill Mill
http://billmill.org
--
http://mail.python.org/mailman/listinfo/python-list
101 - 154 of 154 matches
Mail list logo