Dictionary to tree format (hopefully simple)

2008-08-05 Thread Adam Powell
} Is there an obvious way to produce a nested tree format for this dictionary, like this: [ 0 [ 1 [ 3 [ 4 [ 5 , 8 [ 9 ] ] , 7 ] ] , 2 [ 6 ] ] Thanks for any help, Adam -- http://mail.python.org/mailman/listinfo/python-list

Re: Dictionary to tree format (hopefully simple)

2008-08-06 Thread Adam Powell
Thanks very much for this, very concise! -- http://mail.python.org/mailman/listinfo/python-list

Re: python-mode is missing the class browser

2008-08-08 Thread Adam Jenkins
On Fri, Aug 8, 2008 at 7:32 AM, Michele Simionato <[EMAIL PROTECTED]> wrote: > On Aug 7, 5:55 pm, Alexander Schmolck <[EMAIL PROTECTED]> wrote: ... > > I have solved by using ipython.el which was already installed. For the > sake of > future googlers using Ubuntu 8.04, emacs and ipython, it is enou

Controlling copying and pickling of objects written in C

2008-04-12 Thread Adam Bregenzer
copy/pickle or marshal the object since it would not make sense. Where would I look to control that? Thanks, Adam -- http://mail.python.org/mailman/listinfo/python-list

Re: Controlling copying and pickling of objects written in C

2008-04-13 Thread Adam Bregenzer
On Sun, 13 Apr 2008 16:49:51 -0300, Gabriel Genellina wrote: > En Sun, 13 Apr 2008 01:57:42 -0300, Adam Bregenzer > <[EMAIL PROTECTED]> escribió: > >> I am writing an extension and have "hidden" data included in the >> object's C structure that i

Re: Tkinter, toplevel and images

2008-08-22 Thread Adam E
On Aug 22, 9:17 am, Pedro <[EMAIL PROTECTED]> wrote: > Hi > > I'm trying to build a small application that can display some images > in a toplevel window. I have this code: > > def Results(master): > from Tkinter import Toplevel, Button, Label > from PIL import ImageTk > > figures = ['f

Re: rules of thumb for cross os code

2008-08-22 Thread Adam E
On Aug 22, 9:55 am, DwBear75 <[EMAIL PROTECTED]> wrote: > I am considering using python as a replacement for a lot of bash > scripting that I have been doing. I would like to be as cross platform > as possible, writing scripts for both windows and linux. Are there any > guides are general rules of

two's complement bytes

2008-08-23 Thread Adam W.
I'm dabbling with AVR's for a project I have and that means I have to use C (ageist my will). Because my AVR will be tethered to my laptop, I am writing most of my logic in python, in the hopes of using at little C as possible. In my quest I came across a need to pass a pair of sign extended two'

Re: two's complement bytes

2008-08-23 Thread Adam W.
On Aug 24, 12:23 am, castironpi <[EMAIL PROTECTED]> wrote: > Try this out.  Does it come close to what you want? > > import struct > struct.pack( 'i', ~10 ) > ~struct.unpack( 'i', _ )[ 0 ] > > > > > > >>> import struct > >>> struct.pack( 'i', ~10 ) > '\xf5\xff\xff\xff' > >>> ~struct.unpack( 'i', _

Re: two's complement bytes

2008-08-23 Thread Adam W.
On Aug 24, 1:11 am, castironpi <[EMAIL PROTECTED]> wrote: > On Aug 23, 11:52 pm, "Adam W." <[EMAIL PROTECTED]> wrote: > > > > > > > On Aug 24, 12:23 am, castironpi <[EMAIL PROTECTED]> wrote: > > > > Try this out.  Does it come clo

RE: removing text string

2008-09-10 Thread Adam Pletcher
You just want to drop the last two characters? Slice it. >>> s = "080829-7_A"[:-2] >>> print s 080829-7 - Adam > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf > Of Ahmed, Shakir > Sent: Wednesday, Se

[OT] Looking for developers: platform for fast and effective learning

2008-09-25 Thread Adam Dziendziel
we can consider changing tools. Best regards, Adam Dziendziel adam (dot) dziendziel (at) gmail (dot) com -- http://mail.python.org/mailman/listinfo/python-list

Re: Cheese Shop: some history for the new-comers

2006-03-12 Thread Ron Adam
Fredrik Lundh wrote: > Tim Parkin wrote: >> Also 'Foundation' could be confused with 'beginners' or 'basic'. > > while "PSF" is completely incomprehensible for someone who doesn't > already know what it is... why even keep it on the front page ? Looks like a good place for a tool tip, PSF is o

Re: Cheese Shop: some history for the new-comers

2006-03-12 Thread Ron Adam
Fredrik Lundh wrote: > Ron Adam wrote: > >> I think the PSF is important enough to have a link on *every* page. It >> doesn't need a lot of space, but it should be easy to get to from >> anywhere on the web site. > > a copyright blurb at the bottom of the page

Re: Cheese Shop: some history for the new-comers

2006-03-12 Thread Ron Adam
[EMAIL PROTECTED] wrote: > richard wrote: > [snip] > Should the "Python Cheeseshop" have anything in it, though? Having a > stocked cheese shop in relation to Python is just silly! Cheese (or the lack of cheese) is never silly, Thus the slogan... "The power of cheese". Now if you want silliness

Re: pretty print, tidy, reindent.py

2006-03-15 Thread Ron Adam
kpp9c wrote: > What ever happened to reindent.py ? This used to be part of the > distribution. Does it still work with modern versions of python? > > A lot of the code i drag off here (even if i use "show original"!) > comes out all messed up and i end up having to clean a lot of it up. I > wonder

Re: My Generator Paradox!

2006-03-17 Thread Ron Adam
Robert Kern wrote: > vbgunz wrote: >> I believe I understand now. the yield keyword is sort of like a cousin >> to return. return will bring back an object I can work with and so does >> yield *but* yield's object will most likely support the .next() method. > > No, that's not really how it works.

Re: My Generator Paradox!

2006-03-17 Thread Ron Adam
vbgunz wrote: > OK. I hope my understanding of the yield keyword and generators in a > general sense are now better understood. When a generator function is > assigned to an identifier, no code is executed and a generator is > immediately returned. When the next() method is called on the new > gene

Re: strange math?

2006-03-18 Thread Ron Adam
[EMAIL PROTECTED] wrote: f(01) > 43 f(02) > 44 f(010) > 50 42+010 > 50 > > The first f(01) was a mistake. I accidentally forgot to delete the > zero, but to my suprise, it yielded the result I expected. So, I tried > it again, and viola, the right answer. So, I decided to r

Re: Can I use a conditional in a variable declaration?

2006-03-19 Thread Ron Adam
[EMAIL PROTECTED] wrote: > I've done this in Scheme, but I'm not sure I can in Python. > > I want the equivalent of this: > > if a == "yes": >answer = "go ahead" > else: >answer = "stop" > > in this more compact form: > > > a = (if a == "yes": "go ahead": "stop") > > > is there such

Re: Initializing a list of lists

2006-03-19 Thread Ron Adam
[EMAIL PROTECTED] wrote: > I want to create a list of lists, each of which is identical, but which > can be modified independently i.e: > x = [ [0], [0], [0] ] x[0].append(1) x > [[0, 1], [0], [0]] > > The above construct works if I have only few items, but if I have many, > I'd pr

Re: Is there such an idiom?

2006-03-19 Thread Ron Adam
Per wrote: > http://jaynes.colorado.edu/PythonIdioms.html > > """Use dictionaries for searching, not lists. To find items in common > between two lists, make the first into a dictionary and then look for > items in the second in it. Searching a list for an item is linear-time, > while searching a

Re: Is there such an idiom?

2006-03-19 Thread Ron Adam
Per wrote: > Thanks Ron, > surely set is the simplest way to understand the question, to see > whether there is a non-empty intersection. But I did the following > thing in a silly way, still not sure whether it is going to be linear > time. > def foo(): > l = [...] > s = [...] > dic =

Re: ** Operator

2006-03-20 Thread Ron Adam
Christoph Zwerschke wrote: > Alex Martelli wrote: >> Sathyaish wrote: >> >>> I tried it on the interpreter and it looks like it is the "to the power >>> of" operator symbol/function. Can you please point me to the formal >>> definition of this operator in the docs? >> >> http://docs.python.org/ref/

Re: TaskQueue

2006-03-21 Thread Ron Adam
Raymond Hettinger wrote: > I would like to get feedback on an idea I had for simplifying the use > of queues with daemon consumer threads > > Sometimes, I launch one or more consumer threads that wait for a task > to enter a queue and then work on the task. A recurring problem is that > I sometime

Re: Confused: appending to a list

2006-03-23 Thread adam . bachman
You're wanting it to stop when the len(list) == 4, right? The easiest way to change the logic would be to say while len(list) != 4: but that could get you into trouble later on. The problem with the len(list) < 5 expression is that the loop will run "one more time" as long as len(list)

Re: Multiplying all the values in a dictionary

2006-03-23 Thread adam . deprince
>for key in d: > d[key] = [x*2 for x in d[key]] > Naw, if you are going to use list interpolation go all the way and save yourself all of that ugly indexing into the dict. >>> d = {(100,500):[5,5], (100,501):[6,6], (100,502):[7,7]} >>> d.update( [[key,[x*2 for x in item]] for key,item in d.

Re: Getting a loop to activate a loop above it

2006-03-23 Thread adam . deprince
This is how python is supposed to work. I'm sure not what languages you have used ... it seems that you are expecting some sort rule based system like make, or prolog. Grab a cup of joe, pull up a chair and let me help you out here. Python is an imperative language, you can envision the presence

Re: Multiplying all the values in a dictionary

2006-03-23 Thread Adam DePrince
Yes, I cede that explicit indexing is faster by quite a bit. There is a somewhat philosophical decision for why I avoided that. I prefer to try to present python with as big of a picture of what I want as possiable. update tells python what I want to do, whereas the for-loop describes how to. I

Re: Multiplying all the values in a dictionary

2006-03-23 Thread Adam DePrince
Wait! It occured to me. Why are we touching the key at all. This is a dictionary with mutable values. [EMAIL PROTECTED] ~]$ python2.4 -mtimeit -s 'd = {(100,500):[5,5], (100,501):[6,6], (100,502):[7,7]}; x = dict(d)' 'for i in x.values(): i[:]=[j*1 for j in i]' 10 loops, best of 3: 2.79 us

Re: Multiplying all the values in a dictionary

2006-03-23 Thread Adam DePrince
Excuse me, I mean python2.4 -mtimeit -s 'from numarray import array; d = {(100,500):[5,5], (100,501):[6,6], (100,502):[7,7]}; x = dict(d);' 'for i in x.values(): i[0]*=1;i[1]*=1' 100 loops, best of 3: 1.72 usec per loop i[0]*=1, not j[0]*=1 ... -- http://mail.python.org/mailman/listinfo/p

Re: overlapping sets

2006-03-23 Thread Adam DePrince
ut, but your biggest impediment is how you are looking at the problem. For reference http://www.python.org/doc/essays/graphs.html As for detecting neighboors, sure that's easy, but first you have to try to use a for loop first on your own to tell how many positional items any two lists differ by. Cheers and good luck - Adam DePrince -- http://mail.python.org/mailman/listinfo/python-list

Re: Bitwise OR?

2006-03-24 Thread Adam DePrince
number ): return _sign[number<0] + ''.join( [_nibbles[d] for d in hex( number )] ).lstrip( '0' ) Now I know, my negative number sematincs are different than yours, I'll leave fixing that as an exercise to you. python2.4 -mtimeit -s 'from test_a import bitstring' 'bitstring(343890242);bitstring(-343890242)' 1 loops, best of 3: 27.1 usec per loop python2.4 -mtimeit -s 'from test_b import bitstring1' 'bitstring1(343890242);bitstring1(-343890242)' 10 loops, best of 3: 10.9 usec per loop python2.4 -mtimeit -s 'from test_b import bitstring2' 'bitstring2(343890242);bitstring2(-343890242)' 10 loops, best of 3: 11.2 usec per loop And if I use a map, well, its not a statistically significant difference. def bitstring_nibblemap( number ): return _sign[number<0] + ''.join( map( _nibbles.get, hex( number ))).lstrip( '0' ) python2.4 -mtimeit -s 'from test_b import bitstring_nibblemap' 'bitstring_nibblemap(343890242);bitstring_nibblemap(-343890242)' 10 loops, best of 3: 10.7 usec per loop Cheers - Adam -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiplying all the values in a dictionary

2006-03-24 Thread Adam DePrince
Droppings from other timing tests; starbucks was kicking me out and I was in a hurry. Cheers - Adam DePrince -- http://mail.python.org/mailman/listinfo/python-list

Re: Caching in memory for Apache

2006-03-24 Thread Adam DePrince
for me to store > values inside memory so I can look it up on the next GET request? Your database really is the best place for that. Good luck - Adam DePrince -- http://mail.python.org/mailman/listinfo/python-list

Re: Incremental Compression

2006-03-24 Thread Adam DePrince
ing its memory of what it saw in the past. 3. Z_FINISH. This is the default action, this is what is killing you. Good luck - Adam DePrince > > I cannot wait until the end of the stream and then flush, because I need to > flush after every packet. > > Another capability I requ

Re: New Python logo in high resolution format

2006-03-24 Thread Adam DePrince
On Fri, 2006-03-24 at 10:49 -0800, Robert Hicks wrote: > How about we all get tatoos? : ) ... still trying to scrape the old one off ... > > Robert > -- http://mail.python.org/mailman/listinfo/python-list

PEP for nondeterminism.

2006-03-24 Thread Adam DePrince
The first calls for core language changes, the second calls for a minor (and likely symbolic) change to list comprehension's semantics to better support future parallelism. PEP: XXX Title: Nondeterminism Version: $Revision$ Last-Modified: $Date$ Author: Adam DePrince <[EMAIL PROTECTED]&g

Re: Extending Methods Vs Delegates

2006-03-26 Thread Adam DePrince
ow, as I work on my mutable sequences PEP and implementation, I find myself annoyed without a good, non-overloaded, way of naming an iter friendly variant of a data store's normal __delitem__. Actually, this wasn't more than a minute long problem, but the rate of collisions within the English word space is a problem. At least English is pretty friendly about adopted and synthetic words. Cheers - Adam -- http://mail.python.org/mailman/listinfo/python-list

Re: wired md5 hashing problem

2006-03-26 Thread Adam DePrince
What do you get when you type md5sum backup.tar.bz2? - Adam On Sun, 2006-03-26 at 16:56 +0200, Matthias Güntert wrote: > Hello list-members > > i am in the process of writing a python script to backup my data. Now I > would like to implement md5/sha1 hashes. >

Re: wired md5 hashing problem

2006-03-26 Thread Adam DePrince
t;rb" ) while 1: block = f.read(1024*1024) if not block: break # generate the hash m.update(block) f.close() fd = file(fname + ".md5", "w") fd.write(m.hexdigest()) fd.write(" " + fname + "\n") fd.close() [EMAIL PROTECTED] ~]$ python test2.py [EMAIL PROTECTED] ~]$ md5sum -c Python-2.4.2.tar.bz2.md5 Python-2.4.2.tar.bz2: OK - Adam -- http://mail.python.org/mailman/listinfo/python-list

Re: Accessing func_name from inside a function

2006-03-26 Thread Ron Adam
Alex Martelli wrote: > Personally, I'd rather have a 3.0 keyword referring to "the current > object" (module for module toplevel code, class for classbody toplevel > code, function for code within a function) -- say for the sake of > argument the keyword is 'current'; this would allow current.__na

Re: Accessing func_name from inside a function

2006-03-26 Thread Ron Adam
Alex Martelli wrote: > Ron Adam <[EMAIL PROTECTED]> wrote: > >> A "Current" key word would fix this. Or possibly "This" which would be >> short for "This object". > > I think "This" would cause huge confusion, since in oth

Re: in-place string reversal

2006-03-28 Thread Adam DePrince
;Abc" >> myfancy_structre.add_somehow( s ) >> t = s[::-1] >> print s Abc >> print t cbA Now if strings were mutable: >> s = "Abc" >> myfancy_structre.add_somehow( s ) >> s.reverseme() >> print s cbA Other users of s between assignment and reversal (like myfancy_structure) might not be happy that is was reversed when they next must use it. Cheers - Adam DePrince -- http://mail.python.org/mailman/listinfo/python-list

Re: 1.090516455488E9 / 1000000.000 ???

2006-03-28 Thread Adam DePrince
516455488' >>> Works for me. Code snippet? Print does seem to round at 12 digits. >>> print 1.090516455488E9/100 1090.51645549 >>> Cheers - Adam DePrince > > I know something with float and //... > > Anybody? > How do I get correct number? -- http://mail.python.org/mailman/listinfo/python-list

Re: freeze.py and GTK apps

2006-03-28 Thread Adam DePrince
On Mon, 2006-03-27 at 16:15 -0800, [EMAIL PROTECTED] wrote: > After freezing a PYGTK app, I am unable to run it. It this a common > problem, because I could not find any documentation on it at all. > > I tried freezing this example, which gets by the make as well, but > running it results in a fa

Re: any() and all() on empty list?

2006-03-28 Thread Ron Adam
Paul McGuire wrote: > "Paul Rubin" wrote in message > news:[EMAIL PROTECTED] > To my mind, the *meaning* of all() is that every element in the list asserts > True. But this is with an initial assumption that all() is False, unless I > test every value and find them to b

Re: any() and all() on empty list?

2006-03-29 Thread Ron Adam
Paul Rubin wrote: > Ron Adam <[EMAIL PROTECTED]> writes: >> In this view and empty set can be True for all(). Is it posible >> 'all([])' is undefined? Here, none() and all() return contradicting >> values. So maybe the correct version may be... > >

Re: any() and all() on empty list?

2006-03-29 Thread Ron Adam
Paul Rubin wrote: > Ron Adam <[EMAIL PROTECTED]> writes: >> Just thinking about things. I really just want what is best for >> Python in the long term and am not trying to be difficult. > > I'm sorry, maybe it's the math geek in me, but I just see all tho

Re: any() and all() on empty list?

2006-03-29 Thread Ron Adam
Carl Banks wrote: > Steve R. Hastings wrote: >> I'm completely on board with the semantics for any(). But all() bothers >> me. If all() receives an empty list, it will return True, and I don't >> like that. To me, all() should be a more restrictive function than any(), >> and it bothers me to se

Re: any() and all() on empty list?

2006-03-30 Thread Ron Adam
Duncan Booth wrote: > Ron Adam wrote: > >> Where we are assembling widgets in a manufacturing plant. Where we don't >> want to go to the next step until *all* the sub parts are present. >> >> if all(part.status == 'present' for part in unit): >

Re: any() and all() on empty list?

2006-03-30 Thread Ron Adam
Steven D'Aprano wrote: > Paul Rubin wrote: > >> Steven D'Aprano <[EMAIL PROTECTED]> writes: >> >>> Think of it this way: if all(seq) is true, shouldn't it be the case >>> that you can point to a specific element in seq that is true? >> >> >> No, all(seq) is true if you can't point to a specific el

Re: any() and all() on empty list?

2006-03-30 Thread Ron Adam
Ron Adam wrote: > > hasall(S, True, lambda n: n=42) > That was suppose to be: hasall(S, True, lambda n: n==42) -- http://mail.python.org/mailman/listinfo/python-list

Re: any() and all() on empty list?

2006-03-30 Thread Ron Adam
Carl Banks wrote: > In Python, yes and no are the only possible answers. Probably the only > analogous thing you could do in Python would be for all() to raise > ValueError when passed an empty sequence. There is also 'None' which serves a similar purpose of indicating an invalid value when pas

Re: any() and all() on empty list?

2006-03-31 Thread Ron Adam
Carl Banks wrote: > Ron Adam wrote: >> Carl Banks wrote: >> >>> In Python, yes and no are the only possible answers. Probably the only >>> analogous thing you could do in Python would be for all() to raise >>> ValueError when passed an empty sequen

Re: proposed proposal: set.values()

2006-03-31 Thread Ron Adam
Paul Rubin wrote: > "Terry Reedy" <[EMAIL PROTECTED]> writes: >> 1. It is pure duplication that *adds* keystrokes. >> > Nobody says you shouldn't use list(s) if you know you're dealing with > a set. The idea of s.values() is so you can duck-type between dicts > and sets. You could just do the fol

Re: any() and all() on empty list?

2006-04-01 Thread Ron Adam
Steve R. Hastings wrote: > On Fri, 31 Mar 2006 16:29:00 -0800, Paul Rubin wrote: >> I think "S and all(S)" is the right way to express that, if that's >> what's intended. > > I still would like a standard function, because "S and all(S)" does not > work with iterators. I proposed one possible fun

Re: any() and all() on empty list?

2006-04-01 Thread Ron Adam
Steve R. Hastings wrote: > Here is a function called "tally()". It reduces a list to a dictionary > of counts, with one key for each value from the list. The value for > each key is the count of how many times it appeared in the list. > > > def tally(seq, d=None): > if d == None: >

Re: any() and all() on empty list?

2006-04-01 Thread Ron Adam
Steve R. Hastings wrote: > On Sat, 01 Apr 2006 14:35:58 -0300, Felipe Almeida Lessa wrote: >> Two changes: >> - Use "is None". >> - Use "try ... except" instead of "in" > > Yes. > > >> Maybe you don't like my version, and the gains aren't that much, but >> please use "is None" instead of "== N

Re: any() and all() on empty list?

2006-04-01 Thread Ron Adam
Ron Adam wrote: > Steve R. Hastings wrote: >> This neatly replaces truecount(), and you can use it for other things as >> well. > > if True in talley(S): do_somthing() > > Works for me... ;-) > > > Cheers, > Ron Actulley talley isn&#

Re: Difference between 'is' and '=='

2006-04-03 Thread Adam DePrince
ch street he would look the wrong way, look the correct way and then stare the wrong way again. Upon noticing my inquisitorial expression, he answered "A good programmer always looks both ways when crossing a one way street." I'm uncertain that a quip about abstracting away the rain would

Re: Newbie: splitting dictionary definition across two .py files

2006-04-03 Thread Adam DePrince
.o and also quickly fix any compilation errors. I don't want to > use the make infrastructure, as it takes a while to resolve the > dependencies. Dependencies for 100 files? - Adam -- http://mail.python.org/mailman/listinfo/python-list

Re: Best IDE for Python?

2006-04-03 Thread Adam DePrince
ductive in. What /I/ > > find useful may not be of interest to /you/. > > nonsense. emacs is the best tool for everyone! Emacs? Wait, I didn't post anything? Could this mean I'm not alone! - Adam -- http://mail.python.org/mailman/listinfo/python-list

xml element tree to html problem

2006-04-04 Thread Ron Adam
I'm new to element tree and haven't been able to find a simple solution to this problem yet. So maybe someone can point me in the right direction. I have an element tree structure of nested elements that I want to convert to html as nested definition and unordered lists in the following way.

Re: xml element tree to html problem

2006-04-04 Thread Ron Adam
Fredrik Lundh wrote: > here's one way to do it: > > import cElementTree as ET > > tree = ET.XML(""" > > ball > > red > large > > > """) > > MAP = { > "object": ("dl", "object"), > "name": ("dt", "name"

Re: using range() in for loops

2006-04-05 Thread Adam DePrince
On Tue, 2006-04-04 at 21:54 -0400, John Salerno wrote: > I'm reading Text Processing in Python right now and I came across a > comment that is helping me to see for loops in a new light. I think > because I'm used to the C-style for loop where you create a counter > within the loop declaration,

Re: Python Module for Determining CPU Freq. and Memory?

2006-04-06 Thread Ron Adam
efrat wrote: > Hello, > > I'd like to determine at runtime the computer's CPU frequency and memory. > > Is there a module for these types of queries? platform.platform returns > the computer's CPU name and type, but not its frequency; nor does it > report how much memory the computer has. I

Re: pre-PEP: The create statement

2006-04-06 Thread Ron Adam
> Abstract > > > This PEP proposes a generalization of the class-declaration syntax, > the ``create`` statement. The proposed syntax and semantics parallel > the syntax for class definition, and so:: > >create : > > > is translated into the assignment:: > > = ("", ,

Re: good style guides for python-style documentation ?

2006-04-06 Thread Ron Adam
> (reposted from doc-sig, which seems to be mostly dead > these days). > > over at the pytut wiki, "carndt" asked: > > Are there any guidelines about conventions concerning > punctuation, text styles and language style (e.g. how > to address the reader)? > > any suggestions from this

Appending Elements in Element Tree

2006-04-07 Thread Ron Adam
In my program I have a lot of statements that append elements, but sometimes I don't want to append the element so it requres an if statement to check it, and that requires assigning the returned element from a function to a name or calling the funtion twice. e = ET.Element('name') e

Re: how you know you're a programming nerd

2006-04-07 Thread Ron Adam
When you are working on your programming project on Friday night instead of going out. When you do go out, you look forward to getting home so you can work on your programming project some more. -- http://mail.python.org/mailman/listinfo/python-list

Re: how you know you're a programming nerd

2006-04-08 Thread Ron Adam
John Salerno wrote: > Ron Adam wrote: >> When you are working on your programming project on Friday night >> instead of going out. > > Ok, you win. :) > > Oh wait, it's Friday night and I'm typing this message...dang it! Yep, Hah Hah... No

Re: Appending Elements in Element Tree

2006-04-08 Thread Ron Adam
Ron Adam wrote: > > In my program I have a lot of statements that append elements, but > sometimes I don't want to append the element so it requres an if > statement to check it, and that requires assigning the returned element > from a function to a name or calli

Re: calculating system clock resolution

2006-04-08 Thread Ron Adam
Steven D'Aprano wrote: > On Fri, 07 Apr 2006 16:39:40 -0700, jUrner wrote: > >> Maybe it was not too clear what I was trying to point out. >> >> I have to calculate the time time.time() requires to return the next >> tick of the clock. >> Should be about 0.01ms but this may differ from os to os. >

Re: Haskell's new logo, and the idiocy of tech geekers

2009-10-05 Thread Adam Michalik
are all his works. His website is full of filth. I heard reading it also causes brain damage. Don't go there. Remember, we warned you. -- Adam Michalik vel Dodek Dodecki -- http://mail.python.org/mailman/listinfo/python-list

OT: DARPA red balloon challenge

2009-10-29 Thread Adam N
//darpa.stackexchange.com/ I think the first thing that needs to happen is to get a critical mass of users on the site and to use the Q&A capabilities of the site to figure out what tools we should use next. Cheers, Adam Nelson -- http://mail.python.org/mailman/listinfo/python-list

Re: python admin abuse complaint

2010-02-06 Thread Ron Adam
Xah Lee wrote: For anyone reading this thread and interested in my opinions, i have written many essays related to this and netiquette. Many of which detail other similar incidences that i personally experienced, such as freenode's irc ban in #emacs channel. If you are interested, they can be

Re: Tkinter: The good, the bad, and the ugly!

2010-12-30 Thread Adam Skutt
ally a standard anyway. That leaves OS X as the really troublesome one. >WxPython is fast because it is made in C - it uses the native GUI elements of >the OS which are also made in C. Would a Python - only GUI have the same >speed? If yes, it would be great. > Speed is not even on t

Re: Tkinter: The good, the bad, and the ugly!

2010-12-30 Thread Adam Skutt
ot vastly more so, and have all of the same faults you find in TkInter. This would be because such problems are fundamentally inescapable, a simple fact of reality you have yet to even grasp, AFAICT, much yet acknowledge. Adam -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter: The good, the bad, and the ugly!

2010-12-31 Thread Adam Skutt
e stdlib. Sure you have TIX and a few other > extensions but they will never compare to the vast features of > wxPython. Have you even aquinted yourself with wxPython Adam? > It is nothing of the sort even if you erroneously believe it is. Have you looked at Tix? The fact you dismiss it

Re: Nagios

2010-12-31 Thread Adam Skutt
value would there be in that? Not trying to reinvent the wheel whenever feasible is both good programming and good engineering most of the time. Unfortunately, the fact you see this as irksome only paints you in a negative light. Adam -- http://mail.python.org/mailman/listinfo/python-list

Re: Nagios

2011-01-01 Thread Adam Skutt
you take wheel reinvention == good as a tautology doesn't mean everyone else does. Again, what point is there in attempting to win a non-existent popularity contest? Adam -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter: The good, the bad, and the ugly!

2011-01-01 Thread Adam Skutt
at there just possibly might be a method to the madness? > Geesh! Now i know how the early scientist felt when trying to convince > the lemmings that the earth is not flat! > > Flatearther said: """You heritic!. If the earth were round we would > fall off the bottom!&quo

Re: Nagios

2011-01-01 Thread Adam Skutt
ally apologize? Admit you were wrong and retract, or act like an adult and present an actual argument instead of wasting time. Adam -- http://mail.python.org/mailman/listinfo/python-list

Re: Interrput a thread

2011-01-03 Thread Adam Skutt
epends on what those threads are doing and how they do it. Adam -- http://mail.python.org/mailman/listinfo/python-list

Re: Interrput a thread

2011-01-03 Thread Adam Skutt
On Jan 3, 5:05 pm, gervaz wrote: > Regarding the case pointed out by Adam I think the best way to > deal with it is to create a critical section so that the shared memory > will be updated in an atomic fashion. Ok, so if the OS kills the process between taking the lock and releasing it,

Re: Interrput a thread

2011-01-03 Thread Adam Skutt
rocesses, it's pretty likely he wouldn't have asked his question in the first place. Also, I've written lots and lots of "use processes" code on multiple platforms, and much of it has used some sort of shared memory construct. It's actually pretty common, especially

Re: Interrput a thread

2011-01-04 Thread Adam Skutt
ion, i.e., you have to write the code yourself. Frequently, it's simply not possible to remove the race. Adam -- http://mail.python.org/mailman/listinfo/python-list

Re: Interrput a thread

2011-01-05 Thread Adam Skutt
ther, I'm not entirely convinced of the utility. Only allowing the exception to be thrown from defined cancellation points is much better (ala POSIX threads), but diminishes the utility for things that are mostly grinding away in userspace. Adam -- http://mail.python.org/mailman/listinfo/python-list

Re: os.path.realpath() and os.path.abspath()

2011-01-11 Thread Adam Skutt
ensures that is the case. Historically, some versions of the UNIX syscall (Solaris in particular) have not always returned absolute paths, but I believe this is no longer the case and was a very long standing bug (though I may be mistaken). Adam -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter: The good, the bad, and the ugly!

2011-01-16 Thread Adam Skutt
is a few .py files" part of the argument, which is just as compelling, if not more so. Really, if you believe the case to be otherwise, I truly believe you aren't paying attention to your own computer(s), or don't understand how the applications you use are constructed. What

Re: Tkinter: The good, the bad, and the ugly!

2011-01-16 Thread Adam Skutt
On Jan 16, 11:30 am, rantingrick wrote: > Adam your post is so incoherent that i cannot decide if you are FOR or > AGAINST changing the current Tkinter GUI module into a wxPython GUI > module. And this widget set that you keep referring to is a bit vague > also. If you found my pos

Re: Tkinter: The good, the bad, and the ugly!

2011-01-16 Thread Adam Skutt
ed rate. E.g. the widget in second place might be used roughly > half as often as the widget in first place place, the widget in third > place one third as often, the widget in fourth place one quarter as > often, and so forth. Perhaps, but the drop off isn't relevant till we approach well over 30 widgets, at least, quite arguably more (since GUI toolkits include both things that are common, and things that absolutely suck to program, even if they're not used often). Adam -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter: The good, the bad, and the ugly!

2011-01-16 Thread Adam Skutt
an eye exam if you actually believe what you just wrote. TabLayouts are not just two frames and radiobuttons inside a bigger frame. To even say that is disingenuous and insulting to every human who's ever used one. > I believe compound widgets have no business in the stdlib. All widg

Re: examples of realistic multiprocessing usage?

2011-01-16 Thread Adam Skutt
sets of matricies I want to multiply (common), I can make execute each multiplication in parallel. Both solutions look different, and a solution that uses both levels of parallelism frequently will look different still. Adam -- http://mail.python.org/mailman/listinfo/python-list

Re: examples of realistic multiprocessing usage?

2011-01-16 Thread Adam Skutt
oid contention between two queues is to just remove it entirely (by converting the processing to a single pipeline like I suggested). If that is not possible, then I suggest moving to pipes (or some other form of I/O based IPC) and asynchronous I/O. But I'd only do that if I really couldn&#

Re: examples of realistic multiprocessing usage?

2011-01-17 Thread Adam Skutt
ue is the superior solution. It's certainly possible to build a work pool w/ a queue such that you block on both for entries added to the queue and job completion, but I'm pretty sure it's something you'd have to write yourself. Adam -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter: Joking?

2011-01-17 Thread Adam Skutt
tting rarer, and will continue to do so as long as governments continue to tighten fuel economy standards (and to a lesser degree, safety standards). Adam -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter: The good, the bad, and the ugly!

2011-01-17 Thread Adam Skutt
You and rick both need eye exams, apparently. Adam -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter: The good, the bad, and the ugly!

2011-01-17 Thread Adam Skutt
of the apps written in it were useful and > even elegant. (I don't claim credit for the elegant ones, but the ones I > wrote were at least useful to me.) You can get surprisingly far with only > simple widgets and a bit of ingenuity. Or at least by lowering your > expectations. *

<    6   7   8   9   10   11   12   13   14   >