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



Comments:

<0> sproingie he loses spases
<0> ce
<1> Sgeo: how strict is the maintaining of the whitespace requirement? what kinds of variations might there be?
<2> Nutssh why do have a function and an variable attribute of the same name ?
<3> argh, my odbc/jdbc/jython/xmlrpc/python bridge broke
<2> Nutssh this is not common lisp
<0> import re; re.split(" ", "Hello world how are you?")
<4> Actually, it's just a throwtogether script
<2> Nutssh self.valid() function will overwrite self.valid attribute
<0> Sgeo thats your answer
<5> the method is called setValid() --- This is a model of the problem, not the exact problem.
<1> cause if you want to just maintain spaces between words, that's easy, but if you're wanting to keep double-spaces and tabs and such, then it'll take a different approach..
<2> Nutssh to get the stack:
<2> Nutssh: sys.excepthook(*sys.exc_info())
<4> I think just spaces and punctuation
<5> Sgeo, Can you split on a word boundary? That way you'd get snippets of text that would be either words or non-words?



<1> AND punctuation?... sheesh.. scope creep already..
<5> Perl's RE has that ability. I don't know if Python's does.
<6> python re allows word boundary splitting
<7> not going to be any easy way to do it. regexes will make it a lot easier for sure
<2> Nutssh: acutally only works when catching a execption
<2> Nutssh: to get the stack just use: raise 1
<7> not sure i know of a split that preserves the junk text
<0> Sgeo didnt i just give you the answer ?
<4> Punctuation can't be part of it, although I can change the function to strip out punctuation
<0> right
<4> Or put it to the side I guess
<0> but you have your answer
<5> ne78, thats not quite what I need, I want to store the stacktrace somewhere, and merrily continue execution. Later, when i detect that the bad call, I will then print it out.
<5> Split on word boundaries and you'll get something like ["The", " ", "quick", " " ..... ] and make your code not modify any of the non-word components.
<7> word boundary being \b?
<8> \b for \boombastic
<9> will python ever decide on whitespace or tab
<10> meta-ridley, it did. But some people don't care.
<7> meta-ridley: long as you're consistent, python doesn't care
<9> whitespace?
<8> i always have vim convert tabs to spaces anyway
<5> sys._getframe is almost what I want!
<2> Nutssh I have a solution for you
<2> Nutssh ugly but work for me
<11> i think if you make your nickname 'whitespace' in this channel you get kickbanned
<4> I still can't seem to split on word boundaries
<9> what about tab
<4> >>> re.split(r'\b',"Hello. How are you?")
<4> ['Hello. How are you?']
<2> try:
<2> raise 1
<2> except:
<2> bak=sys.stderr; sys.stderr=file("logfile.txt","a"); sys.excepthook(*sys.exc_info()); sys.stderr=bak
<5> ne78, does that dump out the calling function's context?
<2> Nutssh yesp in the logfile
<2> How can i get the url_scheme ? wich is either "http" or "https" from the $_SERVER var ?
<2> mmh i'm not used to irssi
<12> looks like you belong in the php channel.
<2> acutally i'm making a bridge between php and python
<13> ne78: try os.environ
<12> a bridge?
<6> just ditch php completely
<6> thank me later
<9> quote of the day
<2> nope i have been using it for month
<14> ne78: PHP has parse_url function, Python has urlparse.
<2> i'm just updating it to WSGI to publish it
<12> meta-ridley: haha, indeed.
<6> if its a cgi'ish enviroment there will be an os.environ value that will tell if you its HTTPS
<2> parks: i'm bulding the environ
<14> ne78: Ah, it's not about getting scheme given URL?
<5> ne78, I only get the frames in the middle, I dont' get the parent frames.
<2> it's about providing it
<14> I don't understand wat you're trying to do.
<14> what
<2> sanxiyn: i'm coding a WSGI (web serveur side)
<14> Okay, what's the problem?
<2> sanxiyn: to run WSGI apps inside
<6> why reinvent the wheel?
<14> parks: For fun and profit.



<2> parks: mine works without ANY configuration at all
<2> parks: it's a php file
<6> that launches a pyhton script?
<2> parks: yes
<14> ne78: So you want to populate wsgi.url_scheme?
<2> sanxiyn: yes but know i found how to get the scheme
<14> ne78: Yup. $_SERVER['HTTPS'], actually.
<2> sanxiyn: right
<14> ne78: Good luck with the project.
<15> I'm trying to create a Python cl*** whose methods and attributes are secure from malicious modification. If I define method __setattr__(), is that sufficient to let me filter all attempts to modify cl*** and instance attributes?
<2> sanxiyn: it's done
<6> which is pulled directory from the requests envrioment, filled in by apache
<14> yes yes
<6> if os.environ['HTTPS'] == 'on': wsgi.url_scheme = 'http' else wsgi.url_scheme = 'http
<15> I suppose I'll need to define __delattr__() too.
<16> franl: malicious? Whatever you do, you cannot write "secure" code
<16> franl: Try using mxProxy instead.
<15> Erwin, got a pointer to info about mxProxy?
<16> Zope also has some module (also in C) for restricted execution.
<16> Google.
<12> http://www.egenix.com/files/python/mxProxy.html
<15> Thanks.
<15> So I take it that __setattr__ and __delattr__ are not sufficient to prevent client code from directly modifying instance attributes?
<16> They can access things via obj.__dict__
<3> argh, eggs annoy me
<15> But if I do "__slots__ = []" in the cl*** definition, doesn't that prevent __dict__ from existing?
<3> why the fsck does pysqlite need to make $HOME/.python-eggs and do stuff in there before accessing a database?
<17> franl, impossible
<17> python and perl are fully introspectable-- any script can reverse engineer any other code written in those languages just by probing the mechanisms of the language
<14> halley: Is that a feature or a bug?
<17> sanxiyn, it's a design goal of both, so I wouldn't call it a bug.
<12> in any case __slots__ does prevent __dict__ from existing.
<17> java has very deep introspection but also a security layer, so it's not quite as crackable, but most things are still accessible.
<10> The last time I did any introspection in Java it was a hideous nightmare
<10> But that was like six years ago so maybe it has improved
<7> reflection is still pretty heinous
<15> Just curious ... how does client code access an instance attribute if the cl*** does "__slots__ = []" and defines __setattr__() and __delattr__()?
<14> Jython works for introspecting Java library.
<14> I used it to learn POI, by the way.
<5> ne78, figured it out. I want to use something like: "".join(traceback.format_list(traceback.extract_stack(limit=9))) to get the stack.
<14> Basically, Jython knows minute details about Java reflection and does them for me.
<12> franl: no instance attributes can exist is __slots__ is defined, with the exception of the names given in __slots__.
<12> s/is/if
<15> sysfault, yes, but __getattribute__ and __setattr__ can conspire to fake the existence of instance attributes, right?
<12> __getattr__ and __getattribute__ can, __setattr__ actual modifies the instance's __dict__ which is impossible, since __dict__ doesn't exist.
<15> Ah. OK.
<2> Nutssh ah yes, mine was a total hack :)
<18> i just wasted three days looking for an off-by-one error in my dynamic programming code...
<18> ...until i just now realized that i had the indices reversed
<19> debugger
<20> golly.
<17> franl, and "secure" depends on how far you want to go-- the bytecode can be acquired and the method of faking attributes determined.
<1> datazone! you're working tomorrow, aren't you?
<19> yep
<7> eigenlambda: thus the original rationale for hungarian notation
<19> and, i have a lot of work to do too
<7> eigenlambda: rowFoo, colFoo
<19> but i will be there friday1
<19> come hell or high water
<1> yea, I didn't exactly get everything I needed done, either..
<1> I'm there starting tomorrow :)
<19> it didnt help that monday was a holiday, and i had to babysit a vendor thursday and friday
<19> 3 days of lost work
<19> ah, the tutorials are over rated
<1> ugh
<10> Hee hee hee: http://groups.google.com/group/comp.lang.python/browse_frm/thread/6b727a16cf569bd5/e8a9d9157281aba2?lnk=raot#e8a9d9157281aba2
<19> do you know what talks you are going to on friday?
<12> Brend: haha.
<21> Hey guys, how would I convert a date/time string such as "2006-02-23T02:19:00+00:00" to seconds?
<21> (unix seconds, that is)
<1> heh.. I haven't really planned... I guess I should look :)
<22> does the smtp module allows ssl connections?


Name:

Comments:

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






Return to #python
or
Go to some related logs:

automatix_5.5-2_i386.deb
tbss mismatches non-TLS reference in tcpserver.o
yast 3003 error
#css
installing eclipse on dapper
make[5]: *** [drivers/usb/net/zd1211/zddevlist.h] Error 1
#math
#linux
#gentoo
debootstrap megaraid



Home  |  disclaimer  |  contact  |  submit quotes