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



Comments:

<0> as prophesized ;-)
<1> Yep...
<2> hello
<3> hiya there
<3> uhm... does anyone know a good tutorial on threading in python?
<1> Why do I always have to over-engineer everything I build? :-)
<1> Or rather, why do I chose to implement an algorithm which I'm not very familiar with in a language I'm unfamiliar with? And WHY do I keep restructuring it in order to find the most 'elegant' approach, when it's just an ***ignement?
<1> Well, at least I learn alot... :-)
<3> well, you are a hacker deep inside - you want to know it batter, have it faster and nicer...
<3> :)
<1> Well, that was a positive way of putting it. Thanks :-)
<3> hell, I do things like that all the time, so I had to find a nice excuse :)
<1> Heh, probably going to end up with another one of those 10+ page report for the poor teacher I guess...
<3> heh. what is your ***ignment, anyway?
<1> Implementing an A-star agent on a simple tile-based map...
<3> in Python?



<4> xarragon: well, you just *know* there is a smaller and more elegant solution to be found - if it was Java, it would inevitably by large and impossible to reduce in size
<1> Whatever language we choose.
<1> My Python skills were rudimentary at best, so I figured it would be a good choice to write in Python in order to further my skills.
<0> You should've chosen J >-)
<0> "what are these two lines?"
<3> well, writing in language you know the least is always nice :)
<1> Heh, yeah, I had Haskell as a prospective as well, but I've only toyed with it at best...
<0> stumping your teacher with 10 chars of J to solve the entire thing is even nicer :-P
<3> if it's a language, not some goddamn retardet attemp of mking one :)
<3> *retarded attempt
<1> We could use Lisp as well, but that's another language I'm a complete stranger to...
<0> APL?
<1> Huh? :-)
<0> Matrix manipulation languages. Known to be terse. Very terse.
<3> be a man, make the teacher cry - code it in brain**** ;)
<3> i'd really like to see his face :)
<1> Or implement it in a really low-level language, like machine code, and hand in a bunch of papers with ones and zeroes?
<3> Hm... then he could argue that it's not prtable
<3> *portable
<4> xarragon: so how is it going - nearly there?
<3> and brainfork would even allow you to have threads... :)
<1> pythonologist: Pretty much, there seems to be an issue with the handling of 'closed' nodes, it revisits them it seems, so it is stuck in a corner, wiggling around. Probably need another 'if' somewhere.
<1> Going to do some analouge debugging with pen and paper, probbaly some part of the algorithm is missing from the code right now.
<4> I'd say there are plenty of A* algorithms out on the web, most in Lisp
<1> There are plenty, in any language, Java, C, C++, C# acctually.
<1> The issue is probably from the fact that a map location is not the same as a graph node in my implementation. They are separate entitys, but I ***ociate a map location with a node using a dictonary.
<1> Since I'm not that skilled in Python, I've made some mistakes along the road here and there, which have confused me...
<1> But now I think I can get it together properly... (Hopefully)
<1> Yep, one discrepancy found already. At one point I move locations to the closed list, without updating the diconary, which is the one being tested against...
<1> So, what are you guys working on, btw?
<3> well, i'm trying to make a simplistic but well documanted python IRC bot, and thus I'm currently researching threads :)
<5> fbehemot: is there really any good reason to write another IRC bot?
<6> twisted does irc, doesn't it?
<5> it does, but not as well as it could
<3> teratorn: well, it's only for my own education, really :)
<3> an excuse for learning threads :)
<5> and speaking of that, making the Twisted IRC support really awesome would be a very useful project
<5> fbehemot: let me save you the learning trouble
<5> fbehemot: you really don't need any threads to write IRC bots
<3> teratorn: I know, but I *can* use them :)
<5> yes, which is an entirely stupid reason, per se
<5> you just want to learn how threads work?
<3> yep.
<3> like, use one thread to handle the pingpong, another to handle the events, and another to support, cay, dcc file transfers :)
<7> TFK: thanks for the paste, this looks easy enough so I will port my existing cl***es to use this. Do you know if I can apply this approach to the function holding the operations I Want to do, or I need to change my whole cl***? this is the worker function in my cl*** : http://pastebin.com/584869
<5> fbehemot: it's late and I can't think of any good ideas for software that would need threads :(
<0> sivang, you don't need to change your cl***, you can just add another one in the module.
<0> you can also use nested function (define the generator inside a function) to achieve the same effect, now that I think about it.
<3> teratorn: oh bummer. i'll stick to my sill idea, then :)
<5> fbehemot: I've always found I actually learn more by writing real things
<5> *shrug*
<7> TFK: ah, add another function that will have __init__ and __iter__ ? sounds really cool and unobtrusive
<6> good use of threads is displayed (imo) by ipython when it invokes matplotlib to plot something. the image stuff goes in one thread, and the command-line comes back in another
<0> those are methods of a cl***
<0> sivang, that's a big function O_O
<6> the ipython/matplotlib stuff needs a bit of work too ;) it does seem to handle errors in the plotting backends all that well
<6> err, doesn't seem to handle, that is
<0> well, I got to go
<7> TFK: okay, thanks for the examples.
<7> TFK: (I didn't rget how you mean to make it sub of a function,but never mind - next time)



<1> Hum, what would be the best/easiest way to get the key for an ***ociated value in a dictonary?
<8> xarragon: with a loop
<1> TenOfTen: Okay, so there is no magic way which I'm unaware of then I guess?
<8> no, youre using the dict in the wrong way already. there can be multiple keys for that value for example
<1> TenOfTen: That's true, yes. I've got to account for that.
<1> Good point.
<9> hello
<9> i am new to python and i was wondering when i get a string from some data and i would like to break that up in to peaces or an array so say '/' that is used to split it so 5/8/2006 somthing like that what function do i need to use?
<8> .split()
<9> ahh k
<6> '5/8/2006'.split('/') gives ['5', '8', '2006']
<6> read up on string methods
<9> doing now :)
<10> :>
<11> def fun1(*pos_arg, **named_args):
<11> def fun2(*pos_arg, **named_args):
<11> So... now how do I call fun1 from fun2?
<8> fun1(*pos_arg, **named_args)
<12> What do you do to see how many files there are in the same folder that begin with a certian word? So triangle1 and triangle2 would show up as 2.
<13> does python have no function for flattening a list?
<13> like [(1,2),(3,4)] -> [1,2,3,4]
<11> TenOfTen: Argh. So simple. Thanks a lot.
<8> ndim: sorry to disappoint you
<8> inhahe: (1,2) is an immutable tuple, you would have to build a new list
<11> inhahe: If it's just question of iterating, writing a recursive iterator should not be too difficult.
<14> hello
<11> TenOfTen: Hehe, I'm just thinking too complicated.
<4> inhahe: def flatten(listOfLists): return list(chain(*listOfLists))
<4> inhahe: that's from the itertools module
<14> i'm looking for a python script to show a weather image from the web and udate it every 15 min. anyone know ?
<14> show it in console
<8> an image in a console, that'd be aalib
<11> I doubt that would look reasonably well.
<11> giacus: What kind of console?
<14> xterm
<15> for some reason IDLE for winxp wont work on my xp sys
<11> giacus: Why not show that image graphically then? (just wondering)
<14> ndim: http://digilander.libero.it/jackydgl0/shot9.png
<15> I just uninstealled activestate python 2.4.2 and installed the normal python 2.4.2 but IDLE wont run
<14> I'd like to use it in the bottom empy frame of my desktop
<14> at the right side of sunclock
<14> so, it should work in console
<14> for the same reason, I'd like to show in another small frame a webcam image from the web udateted every X minuts
<11> Ah, a fellow ion user. You'll never see reasonable image quality in a terminal window of that size.
<14> this could be done using karamba, but It doesnt work in wm other then Kde
<11> Display the image as an image, not as aalibbed text.
<16> hi, complete python newbie question, what do i put in the start of a script to let it know it's goint to be p***ed a variable ??
<16> start of a module i mean, i think
<11> q_w_e: how would you p*** a variable to a module?
<16> i have a file with python functions in it, what goes at the top of it to let tings in? :-S
<16> i've seen it in some reading, but can't think of what its called to google for it....
<17> q_w_e, maybe you're looking for the optparse module?
<11> if you have file aaa.py, you can "import aaa" in another python file bbb.py and then use "aaa.something()" to call the function something() defined in aaa.py?
<11> is that what you're looking for?
<18> q_w_e: or do you mean sys.argv?
<19> Hi all
<19> i need to create a "stack" of objects that I can iterate in two different way
<16> mmm still not sure..
<19> I need to be able to change the order of the objects in that stack as well
<20> finally! I've not been able to join for days, and did not know about the registration requirement.
<19> A simple list or dict won't cut it for me here, so I'm trying to figure out an efficient way of doing it
<19> Can anyone think of the best way?
<17> hakanw, it's great to have you back hakanw.
<20> SiggyF: thanks ;)
<16> hakanw: hello then :-)
<20> ciao q_w_e!
<17> ShortWave, why is a list not sufficient?
<19> Because it isn't.
<19> a detailed explanation of why would take too long, and I think I figured out a solution anyway
<11> another layer of indirection?
<17> Maybe encapsulate or subcl*** a list?
<19> Encapsulation, certainly
<19> I was actually thinking about going the whole route of defining a container cl***


Name:

Comments:

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






Return to #python
or
Go to some related logs:

#linux
iptables block irc file transfer
compiz-settings gentoo
sound intel ich7 82801G corrupted linux
#debian
tenoften
pexpect extract the line before a match string
#math
aotucad script
pluggable-functions.php Cannot redeclare get_userdata()



Home  |  disclaimer  |  contact  |  submit quotes