@# 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



Comments:

<0> znh: sure there is
<1> x/window 5
<1> Blackb|rd: such as?
<2> you just have to connect a pipe to it
<3> hi guys.. any ideas on how to create an algo to detect subnet overlaps?
<4> emlprime, polpak: i might be doing this very inefficiently, but wasn't expecting someone to tackle the actual problem
<0> znh: you could redirect stderr (2) to stdout(1) of mount. and then pipe that to your programs' stdin.
<0> znh: i.e. mount foo 2>&1 | yourprogram.py
<5> eugenekim15, it's much easier to work with concrete examples than with total abstracts. It's very difficult to give a good, concrete solution to an abstract problem
<1> Blackb|rd: aha :)
<0> znh: 2>&1 means "put FD2 to where FD1 is"
<1> Blackb|rd: it's so damn easy :>
<4> emlprime: polpaknot an ai, it's known that 20 is the maximum number of cards that contains no set..
<0> znh: Shell basics :)
<4> emlprime: polpak, and i'm just trying to find how many such 20 cards there r.. just smart brute forcing
<5> znh, use the subprocess module and specify subprocess.PIPE for stdout and stderr args to the Popen constructor, then you can read the errors, or the output directly from the proc.stderr or proc.stdout



<4> so question goes back to.. http://deadbeefbabe.org/paste/579,, is there a more efficient way to do the first one in the example?
<5> eugenekim15, is it too slow?
<1> polpak: right. I'll look into that later. First need to fix my crashed harddisk \o/
<4> polpak: ya.. unbearably.. maybe my approach is wrong, but since i'm copying list, it could be great speedup if i can eliminate it
<5> eugenekim15, and why are you doing both recusion and iteration?
<6> i have program which has some kind of an autoUpdate function - the question is - how can I close the program and rerun it again_
<7> freecraft, since it's python, just run it again and close the older one
<6> can I do something with the "os.system" with atexit or is it impossible?
<7> that is, os.system("python myscript.py"); sys.exit(0)
<6> AKX: it has to be done automaticaly
<7> Yes.
<4> polpak: if u think about it, say u lay down 80 cards, and pick 20 cards, u can't just pick in order, u have to consider cases where u skip middle cards
<6> ah ok
<4> polpak: so looping is for the skipping
<6> but the current program must stop because it has some connections opened :P
<7> Ok, how about a lock file the old version creates before shutting down and a parameter that makes the new process wait until there is no lock file?
<5> eugenekim15, no, I don't follow that ;p
<4> polpak: if it were not clear, u want to examine 123 124 125, but also want to consider 134
<7> You close all the connections etc, then remove the file
<7> Or just close all your connections first of course ;)
<6> AKX: huh maybe if there isn't anything simplier
<7> It's not that difficult. if "-waitforlock" in sys.argv: while os.path.exists("lockfile"): time.sleep(1)
<8> eugenekim15: So let me test my understanding: You know that 20 is the maximum number of cards that do not make a set, and you're trying to figure out which permutations of cards can make that group of 20?
<5> freecraft, use exec
<7> Oh yes, system blocks, right...
<6> polpak: I will try =)
<4> emlprime: yes how many of them, which i think can be found out actually trying out some portion of it
<5> freecraft, http://docs.python.org/lib/os-process.html
<7> Any way... good luck freecraft
<4> is there a faster way to do http://deadbeefbabe.org/paste/579 ?
<8> eugenekim15: I could be terribly wrong here, but I instinct is that there's only one "pattern" that produces the no set through this data-cube, and you can find the 4 different permutations by rotation the dimensions
<8> eugenekim15: gotta go, but I'll think more on this later
<4> emlprime: thanks
<6> polpak: ty
<9> eugenekim15: What are you trying to do? It looks like you're repeating several combinations.
<10> also, why are you doing that recursively, eugenekim15 ?
<4> ..
<9> ...
<9> ...?
<4> emlprime: i have other arguments in the function, pretty sure it's what i want though.. i'll have to double check
<4> psino: maybe u r right, i might not need recursion, but seemed easir this way..
<11> can you do something like where you have a folder called SomeThings in the folder your app is running from, and be able to do import SomeThings and access modules in that folder like SomeThings.SomeMod ?
<12> add SOmtThing to your path var
<12> *SomeThing
<11> right..but then i am just doing import SomeMod
<11> right?
<12> yeah
<13> make somethings a package
<13> (put __init__.py in there)
<14> hi, where would i get the subprocess module from?
<11> Juhaz: yeah.. i just figured that out.. hehe thanks
<12> it come with python
<14> hmm, i''m running a python program that needs it, but can't find it
<13> it's only included in 2.4
<14> ok, that woud explain the problem
<14> gues i'l install 2.4
<13> should work in earlier versions if you can find the module separately, but if you don't have any obstacles for installing 2.4, it's probably the best option
<6> why do I always get "OSError: [Errno 8] Exec format error" ?
<6> is execv supported under windows anyway?
<12> is buffer a keyword in python?
<6> Tantalum: nope



<12> k just amking sure
<12> *making
<6> but it is a builtin
<12> what does it do
<15> Woah. Something scary!
<15> >>> help(buffer)
<12> thats what I'm doing
<15> Why :(
<12> because I need to make a buffer and I wanted to call it buffer
<15> Why do you need to make a buffer
<12> so I can buffer input
<15> What's wrong with using a list?
<12> its acutally going to be a string... I just wanted to call it buffer but I got an error and I wanted to see if buffer was something specal in python
<15> Why not use a stringIO?
<15> Or collect stuff in a list and then join() it later.
<12> because I'm buffering input from a socket
<15> That does not seem to be an answer to either of my questions
<6> can somebody help me with this execv or spawnv functions?
<6> I want to run file called RUN.py with any of those two functions but none of them works :P
<12> I dont want to use string IO because I'm not sure it will work correctly
<12> and why use a list when all I need is a string
<15> Because strings are immutable. Adding them together is expensive
<15> And I'm not sure buffer helps
<12> that should I just use a list of chars?
<15> I'd just use a list of strings. When you get some input, stick it in the list
<15> When you have as much input as you want, do "".join(yourList)
<12> i could do that
<15> Actually, twisted's LineReceiver protocol does just use a string: http://twistedmatrix.com/trac/browser/trunk/twisted/protocols/basic.py?rev=16923
<12> I know
<12> but I havent gotten the ok to switch to twisted ;-(
<15> Getting the okay would probably be a happier solution than rewriting half of it yourself :)
<12> they like costume made code here
<15> Silly people.
<12> more like old school people
<15> Well, there are some old school people who prefer to write correct software quickly than to maintain some kind of bizarre NIH ego trip :)
<16> NIH?
<15> Not Invented Here. The practice of rewriting things that already exist just to prove you can ;)
<12> well they do it because they trust there own developers more then open source ones
<17> do they also like custom bugs?
<12> and they love cistom bug because there almost impossiable to track down
<12> *custom
<15> Tantalum, shouldn't they then trust their own developers' decisions about whether a given piece of open source software is worth using? ;)
<17> that is a strange reason to love them
<17> they should just stomp on open-source bugs@
<17> s/@/!/
<12> they like the thrill of the hunt I guess
<12> ;-)
<4> can someone tell me the difference between these two? http://deadbeefbabe.org/paste/580
<15> eugenekim15, foo() modifies lst while it is iterating over it, which probably isn't a great idea.
<4> Brend, umm, i see that, it's just freaking me out, 'for i in lst: lst=lst[1:] print lst' works as i wanted, and i don't know what's happening after adding recursion
<15> eugenekim15, well, all the recursions use the same list. That is, they all have references to exactly the same list, and when they modify it, all other calls to the function will see the changes
<4> Brend, if that 'for i..' the simple example doesn't give u impression it's making a copy?
<4> scratch that 'if' in the beginning of the sentence plz
<15> Oops, AFK! Think about it.
<18> does __init__ on an object automitcally get run when you say newobj = obj ?
<19> is there a python for port for palm other then pippy?
<20> eugenekim15: a copy of the list you are iterating over? why would you have that impression?
<16> jsm: if you do a = b(), where b is your cl*** name, it calls init
<20> jsm: the object wont have a clue if you just bind it to another name like that. __init__ is for when it gets created, but you arent creating anything.
<21> jsm, newobj = objcl***()
<16> jsm: or a = b(args) if your __init__ method requires args
<20> jsm: are you missing the () or did you mean that exactly as you had it, with obj being an existing instance?
<18> thanks
<18> i didn't know that __init__ was run automatically.. i had it with the ()
<20> so you actually mean 'newobj = obj()'
<20> right?
<4> ironfroggy: http://deadbeefbabe.org/paste/581 .. this gives me impression the first one is making copy
<20> eugenekim15: copying it to where? you are creating a new list, yes.
<21> eugenekim15, it doesn't make a copy, it gets an slice... but after the first loop iteration, lst is no longer the same list object... on the second loop, lst2 is always the same object
<20> this might depend on what you think when you say it looks like a copy.
<4> so how does first one manages to loop 3times?
<20> because you are iterating over the original list.
<20> not the new ones you replace the name with.


Name:

Comments:

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






Return to #python
or
Go to some related logs:

thebalaabodu SSL
#math
prolificgnosis
wxglade easyubuntu
#perl
#perl
#kernel
#linuxhelp
fixmbr without windows
zend ZDE php popen



Home  |  disclaimer  |  contact  |  submit quotes