#apache #archlinux #asterisk #centos #debian #gentoo #haskell #kde #kubuntu #lisp #math #mysql #perl #python #ruby-lang #rubyonrails #suse #ubuntu #vim #wikipedia 0 1 2 3 4 5 6 7 8 9 10 11 12 
Top Prev 6423 6424 6425 6426 6427 6428 6429 6430 6431 6432 6433 6434 6435 6436 6437 6438 6439 6440 6441 Next

#python

<marienz> Kjartan: or more specifically: that you have something like: "<4 spaces>try:" "<8 spaces>do stuff" "<3 spaces>except Blah:"
<marienz> Kjartan: or a mixture of spaces and tabs.
<marienz> Kjartan: I'm guessing you have to tell vim to indent with 4 spaces instead of tabs.
<ekimus> Kjartan: ':he expandtab' ':he retab' :)
<marienz> Kjartan: (or convert the entire file to tabs if you hate spaces a lot, but 4 spaces is the recommended indentation)
<marienz> ekimus: thanks, I can do that in emacs but I don't know the vim command :)
<Kjartan> Ah, yes. I retyped the four spaces now. Working now . :)
<marienz> sorry, forgot the /msg.
<Kjartan> Well... "working", it still doesnt do what I want it to do. But I'm not getting an error at least.
<pjd> ekimus: that's because the socket ends up in the TIME_WAIT state
<ekimus> marienz: _always_ know both of your enemies (vim and emacs are mine)
<pjd> to rebind it, you have to set the SO_REUSEADDR option
<pjd> see here: http://www.unixguide.net/network/socketfaq/4.5.shtml
<marienz> Kjartan: assuming that's still the same code I'll take a look
<pjd> also here: http://hea-www.harvard.edu/~fine/Tech/addrinuse.html
<flavioribeiro> i hate spaces too.. i use tabs
<ehird> does python have a built-in localization system?
<ehird> so i can just add a string prefix, and people can make translation files from the english
<insanekane> ehird: you can use gettext
<ehird> insanekane: stdlib?
<insanekane> ehird: no, gettext
<insanekane> its a module
<marienz> and it's in the stdlib :)
<ehird> ... sigh
<ekimus> pjd: thanks, for the info, so the code itself does what I expect (close the socket cleanly and make it available for other programs)?
<pjd> pretty much
<insanekane> marienz: LOL
<pjd> you can avoid the server-side TIME_WAIT by getting the client to close the connection first
<insanekane> :P
<evilx_> having a client close a connection. it will never work
<marienz> is TIME_WAIT an actual problem though?
<marienz> according to the stuff I read about it the main thing it does is clutter up the output of a bunch of tools and it's not normally harmful.
<pjd> it can become an annoyance on high-load servers
<ekimus> pjd: the clients should get delegated to the threads, where the client closes the connection. the server.accept() will always be closed by me. (recoding a bunch of labs i had to do last year in java for fun and learning experience)
<ekimus> hmm 'by me' meaning when someone shuts the listening process down (e.g. hitting ctrl-c)
<pjd> ekimus: right
<ehird> print _('This is a translatable string.') <-- ugh
<ehird> isn't there a string prefix?
<ehird> i.e. so i could do print _'blah'
<ekimus> well I'll just play around some more. experience doesn't come with chatting :)
<pjd> ehird: that would require a fundamental change to the language's syntax
<evilx_> ekimus, sure it does
<evilx_> ekimus, you need to learn to multi-task
<ehird> pjd: string prefixes are nothing new?
<ehird> they should just be user-definable :(
<ehird> gettext is quite complex
<fluxdude> is there any good function to find out if a file has the executable bit set so I can actually execute it?
<ehird> http://mail.python.org/pipermail/python-dev/2003-April/034535.html aw, this doesn't work any more
<Roey> hi
<Roey> er

Previous Page  Next Page

Search ircarchive.info