@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20



Comments:

<0> how would i implement a "static Arraylist" in Python?
<1> i think with WNOHANG os.waitpid is nonblocking if there are no pids to wait for and even if there are some?
<2> blackthorne: They have disgusting coffee there :(
<3> oops
<3> nevermind again.
<1> blackthorne: is a static arraylist an immutable list?
<1> if so you might have a look at tuples
<2> blackthorne: You mean, shared between all objects of a cl***?
<2> timonator: I'm pretty sure it's mutable.
<1> hmm ok
<0> yes
<0> Arafangion, my problem is the arraylist itself
<2> blackthorne: What behaviour do you want?
<0> Arafangion, arraylist or a Collection. Basically a Generic type
<2> blackthorne: Just use a list.
<1> woah



<2> blackthorne: Those []'s. They can store anything.
<2> blackthorne: And are also growable.
<1> calling os.waitpid(0, os.WNOHANG) makes my process use 95% of my cpu...
<0> Arafangion, yes. I know. But i should i choose them instead of dictionaries ?
<0> *why
<4> timonator: you are forking a lot ?
<1> koollman: not really, but the program is meant to run really long
<2> blackthorne: I don't know how you're going to use them.
<1> like: turn computer on, start program, shut computer down and stop program
<4> timonator: you can just fork, and use wait or wait pid when the parent process is 'idle' (but it depends a lot of what you really want)
<1> hmm ok
<0> Arafangion, i am creating a cl*** that represents /etc/fstab. (not quite, but the problem would be the same). each mounpoint should be inside the list or dictionary. I need the options to add and remove each one.
<5> Does anyone know of a package that can create visualizations of graphs (a tree-like graph, not a chart-like graph)
<2> blackthorne: Using a dictionary indexed by mount path would allow you to ensure that no two entries use the same mount point.
<6> anyone good with wxpython? I know I'm using SplitterWindow all wrong here, but I don't know why. http://rafb.net/paste/results/sBT3Oj77.html
<0> Arafangion, thanks. I was thinking about dicts but unsure
<1> KyleGoetz: maybe there is a py binding to graphviz?
<6> if anyone could look that over and point me in the right direction
<2> blackthorne: Essentially, think of a python dict and a python list as a java hashmap and java arraylist that accepts any Object, with automatic boxing.
<2> synic: Hey synic :)
<7> Arafangion, what's boxing?
<2> kbrooks: A java term.
<6> Arafangion: heya :)
<5> That would be nice. I was just reading about GraphViz. Is it open source? I'm trying to create a script to visualize dynamic graphs whose nodes are clickable, and link to pages on a site I'm working on.
<2> kbrooks: Essentially a work around for strict typing.
<7> Arafangion: I see
<8> hello all
<9> KyleGoetz: I use it, and just make a script and p*** it to graphviz, and read back the graph it generates
<8> I'm not really a python programmer, just have a python program
<8> it finds images using regular expressions, and I'm trying to figure out how to do something
<5> What does graphviz generate? Images of graphs?
<2> kbrooks: Essentially, in java, an int, array, and other basic types are not objects. They must be "boxed" up into an object in order to be put into a container.
<5> Excellent, it's open source.
<9> KyleGoetz: see Google.
<5> Erwin, timonator, thanks a bunch.
<8> I need it to match abc123.jpg and sometimes have one of 2 letters at the end before the extension
<2> synic: Just a sec, checking documentation.
<1> KyleGoetz: :D
<8> I've already got the \d\n.{ext} section, how can I include the posibility of l|h|(nothing)?
<6> Arafangion: python is spoiling me.
<2> synic: It is nice.
<0> Arafangion, i've read a book about python but i still have this dought. Are dictionaries appendable?
<3> dijix, I did it!
<2> synic: Using sizers spoils me :)
<3> dijix, at least to a few digits
<8> would [l|h|] work?
<2> blackthorne: You mean, can you add new entries?
<0> yes
<2> blackthorne: ie, mydict[newkey] = newvalue?
<2> blackthorne: Or, mydict[newkey].append(newvalue) ?
<0> no need for imports?
<7> at all.
<2> blackthorne: If it is the later, the value in mydict[newkey] must be a list, which you then call append(newvalue) (That's what that line does)
<6> Arafangion: this whole "I'm a functional language" too keeps having me think "oh, I did this the long and typie java way, it could have been a lot easier"
<2> synic: And used alot less memory, and loaded alot faster :)
<2> synic: JBother really should've been Pother ;)
<3> How can I have something calculate out forever, not stoping after like 20 float values?
<6> Arafangion: perhaps, but now I know java.
<3> That happens for any calculation I make
<0> Arafangion, http://docs.python.org/lib/typesmapping.html - i don't find it :/
<2> blackthorne: What's wrong with the third entry there?



<0> i didn't thought obvious that was appending
<0> i thought that as replacing
<0> thanks again
<3> How can I have something calculate out forever, not stoping after about 20 float values?
<2> blackthorne: It is replacing.
<2> blackthorne: Perhaps what you really want is:
<0> it's both!?
<3> like 2/3
<2> a[k] = []; a[k].append(v)
<3> 4/3 etc
<2> blackthorne: That would allow you to use multiple values per key.
<0> Arafangion, oh. could i paste 5 lines in your pvt?
<2> blackthorne: Sure.
<1> threading.Timer(120, reapZombies).start() --> error: can't start new thread <-- ??
<3> Seriously, does anybody know how to have a calculation go out forever and not stop after just a few digits?? ex - 4/3
<1> Eleaf: no problem here.
<1> >>> print 4/3
<1> 1
<3> lol
<3> timonator, I want it to go on forever
<1> lol
<1> while 1:
<1> print 4/3
<3> timonator, 4/3 = 1.33333333333333333333333
<1> :)
<1> dunno
<3> I know how to make it say that forever
<1> print "1."
<3> but not go on to 1.33333333333333333333 forever
<1> while 1:
<3> yes...
<1> print "3",
<1> :o
<3> I want it to say 1.3333333 forever...
<1> but that would be "1.3 3 3 3 3 3 3 3 3 3 3 3 3 3 "...
<9> Eleaf: That's not possible in binary floating point.
<3> Erwin, alright, any ideas how to get around that? Because all my calculations just stop after 9 digits or so..
<10> timonator: nah, print "1." + "3" * 1000
<3> lol
<1> teratorn: 1000 is not really "forever"!
<3> oop
<10> close enough!
<9> Eleaf: well, first you need to use a float in your x/y unless you have asked for real division
<1> i got an idea
<1> num = 0
<11> can Python be described as a functional language?
<1> while 1:
<3> Erwin, I'm using __future__
<1> num += 1
<12> tweek__: sure
<11> I heard Scheme described in cl*** today and I kept thinking, 'this looks really familiar'
<8> ok, I probably asked my question really poorly, but what it boils down to is this: how can I use a regular expression to say "use this quantifier 0 or more times", and the answer is to use the *: [h|l]*
<1> print "1." + "3" * num
<9> Eleaf: So what precision do you want? Doubles give you a 64-bit binary floating point.
<8> just in case anyone was wonder...:-D
<9> Eleaf: You want something more precise? Use libgmp or the decimal module
<13> a
<3> Erwin, alright, I'm trying to do a pi calculation, my pi calculation only goes out to 3.1415926535897936
<1> threading.Timer(120, reapZombies).start()
<1> does noone know why this tells me that it cant start another process??
<9> >>> from decimal import *; getcontext().prec = 100; print Decimal(1)/Decimal(3)
<3> Erwin, how do I use the decimal module?
<9> 0.3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333
<1> "error: can't start new thread"
<3> ok
<2> synic: What is wrong with your program?
<9> Eleaf: You didn't even bother to look up the documentation, did you?
<1> Erwin: couldnt one just say int = Decimal in py? :D
<3> Erwin, yes I did.
<9> timonator: sure, but when you say 42, you are not calling int('42')
<1> hmm... ok
<14> anyone good with GL in python?
<1> that makes sense
<15> distutils really is quite good


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #python
or
Go to some related logs:

#fedora
TOtorrentdeserialise. torrent is zero length
python kill subprocess
#gaim
gentoo mask emerge phpmyadmin
emerge kde missing x11.pc
mb_internal_encoding() phpize install
#perl
#python
#bash



Home  |  disclaimer  |  contact  |  submit quotes