@# 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> cr3: why are you postfixing a space at the end of the string as well?
<0> nevermind, i was thinking text was one line, not several.
<0> cr3: but how much cleaner could that be?
<1> ironfroggy: if I account for the boundary case where I'm also adding a space at the end of the string, it makes it that much uglier :(
<2> with httplib. how do I use the integer status codes?
<1> ironfroggy: perhaps I should do something like "\n".join([" %s" % i for i in text.split("\n")])
<2> evermind
<2> hmm.. httplib does not seem to listen to http_proxy variable
<0> cr3: thats a pretty wasteful use a string formatting operation in a loop.
<2> I'd like to use httplib. but I cannot connect to the internet directly. Is it possible to define a http proxy?
<3> is there some simple way to change [(1, 2), (3, 4)] to [(2, 1), (4, 3)] ?
<4> Is there a way to define a method as final ? So that subcl***es can not override ?
<5> qk: [reversed(x) for x in list]
<5> AnKiMo: no. any barriers you put up could themselves be defeated anyway
<6> znh, export http_proxy=""http://IP:port";; export ftp_proxy="$http_proxy" and then python's httplib will silently use that IP as proxy ;)
<5> does distutils support any scm system other than svn for grabbing dev versions?



<5> i'm looking at darcs
<5> er i guess it's setuputils
<0> AnKiMo: why in god's name would you want to do that?
<7> anyone know any kind of security scanner made in python ?
<8> ironfroggy: its a standard capability of certain other object oriented programming languages and its use in those languages is natural
<0> rocky: i know that its present in other languages. but it doesnt have any practicle purpose in the context of python.
<2> eugene_beast, it's being ignored
<0> AnKiMo: is there some usecase where you think you would benefit from being able to do this?
<5> i suspect with some metacl*** hacking one could imagine a @final decorator. not that it wouldn't be trivial to defeat
<5> anyone who had the ability to code such a beast probably wouldn't see a need for it
<4> We need that to prevent other programmes to subcl*** methods from our base cl***es. On big softwareprojects this is very handy.
<5> AnKiMo: so is static typing. also absent in python
<6> znh, dunno what's the problem, it just works for me
<5> AnKiMo: in fact, final methods exist pretty much only to enforce cl*** invariants that don't make sense for bases -- that java has no "friend" cl***es is part of the reason for final
<0> AnKiMo: how is that handy? just, you know, dont redefined the method if you dont want to.
<5> AnKiMo: can you think of a concrete use case for python?
<9> Hello !
<5> AnKiMo: you'll note that C++ gets along just fine without final
<4> I have a problem and i want to get rid of it. Doesn't matter what works for other peple i have to find a way. And in our case the decleration of a final method what handle all we need.
<5> i think final is also microsoft's way of saying "don't extend this through inheritance, we'll come up with something else someday"
<5> AnKiMo: regardless, it doesn't exist in python
<0> AnKiMo: when moving to python there are often huge amounts of unlearning people need to do. usually, you have to unlearn more things than you need to learn. we're only trying to help.
<10> sproingie: also popular: don't extend this or we'll sue the **** out of you.
<5> Blackb|rd: that's nice. have a cookie.
<0> AnKiMo: how do you find a need for a final method declaration? do you have a case where vandals are breaking into your repository and subcl***ing things in the middle of the night?
<11> how well does pygtk do for medium sized application (say, like Gaim)?
<5> ironfroggy: actually that kind of describes large scale development sometimes
<10> sproingie: well, I don't give a flying freep in a rolling donut about what kind of extended pistol somebody who uses my code shoots his foot with
<12> anyone able to help me prevent this from triggering the ***ert in certain timezones? http://pastebin.com/753491 (this is to fix this debian bug: http://bugs.debian.org/328098)
<9> I have a multithreading issue : I have a thread that listen on socket, gets data, and adds songs to playlist. and another thread that montiors the playlist and when there's something in it it retrieves a filepath from it and streams the file. But for what ever reason I have the first thread that blocks on sock.recv(2048) until the second thread has finished streaming the song... Do you have any idea on that ? Could you point me to good documentatio
<9> oss threads ?
<13> Is there any function in the standard lib for generating a uuid? I can't find anything.
<0> Ceran: i have had a terrible time finding a _real_ uuid function.
<4> ironfroggy: Yes. You can call it this way. If you have a lot of programmers in different countries working on a project. You have that.
<14> rixxon, probably fine
<0> AnKiMo: im honestly curious what problem you are hoping to solve with this. do you have programmers redefining methods incorrectly?
<5> ironfroggy: i have need of uuid's myself, tho i'll probably just rely on pgsql or oracle or something to generate 'em ... where'd you find one?
<9> Anybody ?
<15> why is "if varname not False:" illegal syntaxt?
<16> Ceran, perhaps http://sourceforge.net/projects/pyuuid or http://zesty.ca/python/uuid.html
<10> pabs3: hm, your weekday fluctuates?
<9> :p
<11> Juhaz: wouldn't feel the least laggy compared to "real" programs?
<0> sproingie: actually, i dont remember that i ever did. all i could find were recipes where people just made random hex numbers and called it a UUID, forgetting that its actually a defined specification.
<14> rixxon, there's jabber client written in pygtk, if you want to see how it would work in im application. http://www.gajim.org/
<17> eleftherios: the syntax is 'x is not y'. In this case, use 'not varname'
<5> AnKiMo: you'll find that when asking for features from language XYZ "because XYZ has it", you'll get a lot of flaming. actually asking for a feature without a really well-prepared use-case tends to get you that regardless.
<15> Yhg1s, yes
<15> Yhg1s, thank you
<11> Juhaz: gaim was just a random example ;)
<5> ironfroggy: yah, i guess i'd have to find a DCE RPC library or something
<4> ironfroggy: It is only a matter of keeping code clean. You force your people to keep methods.
<12> Blackb|rd: no, the hour is the main one
<5> ironfroggy: i guess CORBA IOR's also work, if you don't mind UUID's that are 5K or so ;)
<18> hello
<10> pabs3: the ***ert comparse tuple item #6.
<10> pabs3: according to my docs that's the weekday.
<18> are there any examples of http posts with images (or other files) somewhere?



<12> Blackb|rd: ah, so it is. however, the hour differences would also trigger the ***ert
<0> a while back when that Termite distributed LISP varient came out, one of the people went and wrote a fake UUID generator for it to remove the libuuid dependancy, and i wrote him to complain about it.
<18> or can I just p*** it together with all other data to the "urlencode" method?
<0> AnKiMo: how is there something wrong with just documenting the fact? also, because of the nature of python there are cases where final wouldnt fit into certain idioms. for example, perhaps someone will want to subcl*** a SelfLoggingMixin cl*** that wraps all the methods up to log themselves everytime they are called. although it would be changing what the function instance was, it wouldnt change what it did.
<10> pabs3: well, I'm a bit stumped, too. By how much are they off usually?
<14> rixxon, sure, but still. lagginess would depend on how well you manage to separate any slowish python processing from the GUI, the bindings themselves shouldn't slow down things too much, they're pretty thin layer after all
<17> AnKiMo: 'we' don't force anything, Python does. Python is like that, yes. If you don't want that kind of approach, don't use Python.
<12> Blackb|rd: me too. its always 1 hour, see the tracebbacks in this: http://bugs.debian.org/cgi-bin/bugreport.cgi/no-patch.txt.bz2?bug=328098;msg=39;att=3
<11> Juhaz: so with some threading it would be fine?
<17> AnKiMo: I'm not kidding. don't use it. Python enforces very little. It believes that if programmers really want to mess their program up by not following convention, it should let them.
<5> Yhg1s: I like to borrow perl's quote: "it would prefer you stayed out of its living room because you weren't invited, not because it has a shotgun."
<9> I have a multithreading issue : I have a thread that listen on socket, gets data, and adds songs to playlist. and another thread that montiors the playlist and when there's something in it it retrieves a filepath from it and streams the file. But for what ever reason I have the first thread that blocks on sock.recv(2048) until the second thread has finished streaming the song... Do you have any idea on that ? Could you point me to good documentatio
<9> oss threads ?
<4> ironfroggy: IMaging you have one method breaking your method in diffrent submethods. The submethods are normally subcl***ed, but your main method should allways do the same, because all your programmers are used to it. Then it is handy to force this method to be final.
<17> Kmirno: sorry, my advice doesn't go beyond "well, don't do that then". Apparently, one of your threads is blocking the other. don't use threads, just use non-blocking I/O.
<5> Kmirno: we saw your question before. google will be better at finding documentation for your specific module (the name of whicy you didn't mention)
<12> Blackb|rd: actually, I take that back, its sometimes 2 hours off
<10> pabs3: I suspect it's when you cross a DST border in the timezone. That would account for a lost or superfluous hour.
<9> Yhg1s: well it's not possible in this case, as one of the sockets is encapsulated in a lib
<17> AnKiMo: no, it isn't. if someone wants to override it, to do useful things, while keeping the semantics the same, who are you to deny them that ability? But the argument is futile. Python isn't going to change, and you simply cannot enforce this in Python.
<13> benji: Thanks.
<17> Kmirno: then that lib may not be allowing other threads to run.
<10> pabs3: why not test the function with all currently-defined timesonez and look for patterns?
<9> sproingie: I came hear after 7 hours of efforts (yes this includes googleing and 2 times application riwrite)
<9> Yhg1s: oh ?
<5> AnKiMo: actually, the main method is the ripest candidate of all for subc***ing, since it may ***emble its components differently. this is right out of my software engineering cl***.
<12> Blackb|rd: I did, haven't looked for patterns tho: http://bugs.debian.org/cgi-bin/bugreport.cgi/no-patch.txt.bz2?bug=328098;msg=39;att=3
<9> Yhg1s: there's a possibility in python to tell other threads not to run ? how the hell ? (i'm not useing mutex thingy)
<4> Yhg1s: Anarchy !!! ;)
<0> AnKiMo: final is a poor excuse for documenting the intention of your code, and there are lots of ways you might redefine a method in a subcl*** without changing the interface of the method in the slightest, and thus break nothing.
<5> AnKiMo: python is not going to give you many tools to force engineers to do things one way or another. if you make them code to certain conventions, those can be statically analyzed. the way you're asking your questions however makes me suspect that your project really isn't large enough to warrant them
<14> rixxon, well, threads open a whole other can of worms, but either that, or preferably just spinning a main loop few iterations every now and then while doing something to keep the interface updating
<17> AnKiMo: it would be, if all Python code executed in a single address space. Since each process is its own country, in effect, it's just self-determinism.
<10> pabs3: I'm drawing a blank.
<5> AnKiMo: i suggest looking at PyProtocols for python's idea of discipline. like all things python, it's optional however
<17> PyProtocols isn't "Python's idea of discipline", just PyProtocol's idea.
<11> Juhaz: threads and worms, how do you mean?
<12> hmmm, spose I should scrap that and figure out how to re-implement it
<5> Yhg1s: all right, it's an idea of discipline in python
<10> pabs3: maybe you're trying to solve the wrong problem. or someone else's
<5> AnKiMo: i do suggest that you gain familiarity with how formal engineering is conducted with python. it is quite possible, but applying a cookie-cutter approach in treating all languages like they were Java is doomed to fail
<12> Blackb|rd: someone elses :) upstream of the code I'm trying to fix isn't all that active on this code tho (guido's brother)
<0> i have been sitting at this desk for like 15 hours straight.
<5> AnKiMo: google and nasa quite successfully use python for production use
<0> got home at 7 last night, and ive been here working every since.
<9> sproingie: well It's a replacement for mediabox404 and ices alltogether (it does gui, socket listening for commands, it does audio streaming to icecast, it does reencoding etc..) , it's large enought for needing multithreading ... but maybe I should go for fork as multithreading might not be it... I just don't understand how to share an object throught fork (as fork just copies it) .. maybe shared memory, but it threatens me hehe
<10> pabs3: I really don't know what to make of the pattern of the failing TZs
<5> Kmirno: goodness no you don't want to use fork
<9> sproingie: I'm positively failing to see what should I do ;-(
<5> Kmirno: if you don't mind a learning curve like mt kilimanjaro, give twisted a look. asyncore might be more apropos to your app tho
<0> yay twisted
<19> Morning all.
<19> Question regarding the output of lists.
<14> rixxon, threads are overtly complicated and messy, and juggling with python threads, GIL, and a C library that has it's own threads definitely doesn't make things any clearer.
<17> the GIL makes them a bit more reliable though, as they at least won't be messing up Python objects ;)
<5> shared state multithreading is unbelievably messy and difficult
<11> Juhaz: i don't see what it has to do with worms though :P
<14> oh
<17> Juhaz: that's just an english expression.
<17> eh,
<19> I have a list of values I want to write out in plain text to a file, is there a way I can do this without having to fuss with striping the surrounding brackets and such from the list?
<17> rixxon: ^
<4> sproingie: PyProtocols seems to be very interesting. Usually we use only twisted like interfaces. But still this doesn't really help. And no doubt about it python is a very good language for large software projects.
<17> wamd: well, the list doesn't have those brackets, just the representation of the list does.
<9> sproingie: yep I had a look at twisted, but I don't need it to manage async protocol, I got that, where I fail is in the why the f*** libshout blocks the over thread and how I can make it stop doing that... I'll continue lookging in libshout and threading. Thank you for your help.
<17> wamd: don't print the list, print the elements of the list.
<17> wamd: for instance, "\n".join(thelist) will give you a string that consist of all the elements of the string, separated by a newline.
<17> Kmirno: you will probably need to change the libshout wrapper to release the GIL when appropriate.
<9> Yhg1s: GIL ?
<5> AnKiMo: pyprotocols is sort of the uber-interfaces implementation, but any of the interfaces implementations will usually suffice. it's an exercise to the reader to write a static analyzer that ensures that your objects actually implement the methods and conform to test behavior. if you write such a tool, a grateful world would love to receive it
<19> You learn something new everyday. :D And yes, I am a Python noob. I thank you. I first dabbled with Python in 1996 and only started with it again this year.
<19> Thanks alot. :D
<17> Kmirno: the global interpreter lock.


Name:

Comments:

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






Return to #python
or
Go to some related logs:

ubuntu cannot boot selected partition
#mysql
#linux
MAILER-DAEMON postsuper awk
#centos
mupad+installing+gentoo
megahertz in a gigahurtz
naim suse 10.1
#php
lucidasans debian



Home  |  disclaimer  |  contact  |  submit quotes