@# 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> dataw0lf, I just hope your templates are edited by you or only be people you trust
<1> Jerub: thanks again
<0> by*
<2> Yango_: Well, I'm not letting strangers come in and edit the templates for my websites.
<3> every time they do, I paste the link to the search for that package on the open source vulnerability database.
<3> http://osvdb.com/searchdb.php?action=search_title&vuln_title=phpnuke&Search=Search <- for instance.
<0> Jerub, are you a defender of "the less vuln, the better is the software" thesis?
<0> s/vuln/vulns found/g
<2> Yango_: The common ***umption that files you're serving off of X webserver are vulnerable if edited by anyone is.. well.. common.
<3> Yango_: no, I'm a defender of, "I've yet to find a php application that someone has both recommended, and not had a vulnerabilty reported in the last 30 days" thesis.
<4> dataw0lf: Maybe you found something PHP could be useful for (templating)
<2> scox: Yea.
<4> dataw0lf: i always thought it was pure junk
<2> scox: It pretty much is. :)
<3> Yango_: also, I go and read the code for the self same ****ty php code and find the programmers have done their DB abstraction completely wrong.
<3> there are good db abstractions for php. no one uses them correctly.



<4> dataw0lf: but it's perhaps one of the most powerful template languages :)
<4> (if used as such)
<2> scox: But for templates with the need for basic logic that pull from a Python backend, whether by simple database access or an XML-RPC server, or a SOAP server, or whatever, it's pretty decent.
<3> dataw0lf: I really like 'kid' for python template.
<1> dataw0lf: another vote for 'kid' from me
<4> dataw0lf: i'm gonna try that someday, thanks for the tip
<2> Jerub: kid is pretty nice.
<2> scox: np
<1> dataw0lf: especially since you already have a py backend
<2> thebanana: I already have a python backend for my PHP sites.
<0> dataw0lf, that's what scares me... using php as a templating language that can be used as a server or whatever is kind of scary...
<2> Yango_: All it does is pull from databases built by Python or extract XML-RPC functions
<2> it's not inherently more insecure than anything else.
<1> dataw0lf: ? i know ... that's why i said 'since you already have a py backend'... to me, it makes sense to use kid vs php <shrug>
<2> thebanana: I'm sure you prefer kid, and it's built pretty well.
<2> but with my python backend I just need a default install of Python and PHP, which is available on most webservers.
<2> so my clients usually have it all ready to go
<2> I just install my tiny PHP client lib
<2> run the Python server out of a home directory or something
<2> and I'm good to go
<2> *shrug*
<2> but I gotta go finish building my workstation http://dataw0lf.phonese.cx/comments.php?1782
<5> annnddd another syllabus set in comic sans bold.
<2> cya guys tomorrow
<5> this is going to be a wonderful semester.
<0> dataw0lf, I'd say it opens the window a bit more... what if someone gets in, changes a bit on your template that logs all access, or whatever evil thing you can think of doing with php that is probably not directly possible with other templating languages without breaking the app (or modifying the templating engine itself, which should not doable for someone with only webserver privileges
<6> davidmccabe: that is the best font evar
<1> dataw0lf: later
<7> Jerub PHP is the VB of the unix world
<0> sadly it comes with no GUI builder :'(
<8> Yango_: "fortunately"--otherwise there'd be more of it
<7> doesnt glade et al support (UGH) php-gtk
<0> parks, I was talking about web gui's... desktop guis are no longer an issue... btw have you seen google page creator?
<7> yeah
<7> more blogs :(
<7> whats the yahoo UI kit like?
<9> crap. I'm trying to run psp pages and .py pages according to: http://www.python.org/pycon/dc2004/papers/14/ It does ALMOST get it, but fails to publish the right content. I have to download the new pages. Anyone have the "right" way to allow psp and .py pages to work with each other?
<9> I wish to keep design and application as seperate a possible.
<7> whats .psp ?
<7> Laidback_01 have you seen cheetahtemplate ?
<7> cheetahtemplate.org
<9> looking at it
<9> thanks
<10> How do I dynamically import all .py files in the current directory into the current module?
<1> you could use the builtin __import__() function which can accept a string as a module name argument
<11> can anyone suggest a way to remove surrogate pairs from a unicode string?
<1> but why are you trying to dynamically import all files? just curious
<11> ie. u'\uD834\uDD1E' ==> u'\U0001d11e'
<12> npmccallum: use from ... import
<12> npmccallum: iirc, as long as you have an __init__.py in the current directory, you can do from cur_dir import * (you will import yourself)
<3> idnar: encode/decode from utf-8 does it for me.
<3> len(u'\uD834\uDD1E'.encode('utf-8').decode('utf-8')) == 1
<10> AcidReign: is "cur_dir" a builtin?
<12> (cur_dir being the actual name)
<11> Jerub: yeah, that's the best I've come up with :/
<0> npmccallum, os.cwd() can get you near
<12> npmccallum: No.
<0> npmccallum, os.curdir()
<0> was what I meant
<12> Yango_: you can't use that in an import statement ;-)
<10> Basically, I have a plugins directory. If someone sticks a file in that directory, I want all cl***es in that file to be in the "plugins" module



<3> idnar: it's weird how repr(x) comes out with \U but it's actually len(2)
<11> Jerub: on the one hand, that's kind of nice
<0> AcidReign, oh, didn't see the context... even though with __import__ you might get away with it :P
<11> Jerub: on the other hand, it's really evil, because it hides the presence of the surrogates
<11> Jerub: of course, if your python is built with 16-bit unicode, then there will always be surrogates for "high" codepoints
<12> Yango_: I'm sure you can do it with from ... import, as long as you're in a package dir
<0> AcidReign, I meant using os.curdir
<13> Hey guys, I'm having a little problem. I'm trying to do a check on a file path to see if it is either a directory or a file. Is there a function to do that ?
<14> os.isdir
<14> er, os.path.isdir, that is
<14> along with isfile to check if it's a regular file.
<13> floam, very odd, i looked at all the functions in the os module...i didn't see "isdir"
<13> floam, although, i will try it...thank you very much.
<15> os.path.isdir offhand...
<13> :: sigh :: why didn't i venture further?? :(
<13> so os.path is a completely different module.
<14> MaestroTech: http://docs.python.org/lib/module-os.path.html
<13> thanks.
<13> floam, i'm already reading it. :)
<16> hi
<1> AcidReign: i didn't think you could use the "from <n> import <x>" syntax when <n> is a string
<17> gn8
<1> AcidReign: plus, i think <n> has to be an actual module name - not a package name
<1> AcidReign: unless of course, all the names you're importing are in <n>/__init__.py
<18> at what point is a python script a cgi script? is it after say - print "Content-type: text/html" or after <?xml version = "1.0" encoding = "UTF-8"?> etc
<19> After it finishes printing headers.
<19> Although even that's a bit simplistic.
<20> hmmm
<20> is there a function like 'os.file_exists("data.pickles")'?
<15> look in os.path.
<3> os.path.exists
<21> haha
<20> hmm
<20> the pickles module raises IOError if it can't read the file or if it's invalid?
<20> pickle*
<20> ah, nvm
<22> I'm fighting with python threads. Trying to get a nice shutdown working... so all my threads have a mainloop, where they check self.quit to become True. Then they leave their "run" method.
<22> with print statements I can verify that they all exit their run methods, and the main app also finishes. Still the app is stuck in a big semaphore, Ctrl+C doesn't help, I need to kill it.
<22> any idea what I might be doing wrong?
<23> i think you told us what's wrong eheh
<20> hmm
<20> do for's work with dictionaries?
<21> erich: you should be using threadinst.join() to verify that each thread has exited.
<22> sysfault: I do.
<24> yuriks: yes, they iterate over the keys
<22> sysfault: it's in join() where its stuck.
<25> Is there a shortcut for forming a list of Strings to remove the need to quote values?
<20> sciolizer: and how can I get the name of said dict entry?
<15> yuriks: eh?
<20> like:
<20> {'abc':123,'def':456}
<20> doing a for in it would iterate over 123 and 456, right?
<15> no, the keys, not the values
<20> how could I know the respective 'abc' and 'def'?
<21> cratuki: the only thing I can think of is to form a string with all the wanted values separated by some delimiter, then call the .split() method specifying the delimiter.
<15> yuriks: iterating over a dict is iterating over it's keys.
<20> ah
<21> that way you don't have to quote each value explicitly.
<15> yuriks: if you want both, do for k,v in dict_instance.iteritems() ...
<21> exalted> 'foo:bar:man:can:fan'.split(':')
<21> ['foo', 'bar', 'man', 'can', 'fan']
<25> sysfault: that mght be OK. Thanks. I'm familiar with the dict/**kwargs trick but thought there might be one here. What you suggest looks good. Thanks.
<20> bharring: ahhhh, I experimented and saw it retuerns the keys xD
<20> "Sorry for the inconvenient." ;)
<24> yuriks: if you want to mutate the dictionary as you're iterating over it, do "for key in dict.keys(): ..."
<22> Is there an easy way to wake a thread from Queue.get()?
<15> erich: doesn't really work that way...
<15> erich: consumer thread when it calls get goes to sleep if nothing is available (depending on block/timeout args)... at some point the producer will get to run, but trying to wake/signal the producer is indicative your design is a bit weird. :)
<22> bharring: well, I'd like to use block=True with no timeout because that makes the code easiest to read... I've mostly rewritten my code now to check if the queue is empty and sleep otherwise.
<15> erich: usual trick is to p*** a "die mr consumer thread" into the queue instead.
<15> or timeout on the queue.get call, and check a global to see if it's time for the consumer to die/join...
<22> the latter is basically what I'm doing now, except that 1 second is too slow for me. or can I p*** fractions to the timeout parameter?
<15> erich: try it and find out ;)


Name:

Comments:

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






Return to #python
or
Go to some related logs:

#perl
make-dpkg k7 optimized
disable + onpaste + javascript + textbox + firefox
apt-get install linux-headers-`uname -r` build-essential
#perl
initramfs.img
#math
#oe
#centos
#oe



Home  |  disclaimer  |  contact  |  submit quotes