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



Comments:

<0> they're not in octal as such, it's just that there's only 3 bits of information
<1> you can convert from a string representing an arbitrary base, but you can't convert back to one
<0> the leading zero in chmod strings actually has other uses
<1> you can if you code up a function to do it... it just seems a little asymetrical
<0> it's just that it's normally zero and is ***umed zero if absent
<0> I think
<2> The leading 0 indicates that it's octal.
<0> maybe generally but not for chmod
<3> not for the 'chmod' command, no.
<3> since it just takes a string.
<0> yep
<0> the leading zero indicates that setuid, setgid, and sticky should all be zeroes
<2> OTOH, os.chmod() does.
<0> bleh
<0> it should always be a string anyway
<0> so the base of the number has no real meaning



<4> os.chmod('/temp2', b2i('111.101.001'))
<0> it's not like I ever used chmod with the decimal version of 755
<0> or the hex version
<0> so I don't see that giving it a base has any meaning
<1> giving what a base in what context?
<0> saying that chmod strings are octal
<0> they're not, they're strings
<1> well, yes
<0> coo, sticky is useful
<1> any base is just a way of representing numbers
<1> a number just a measure of how many pebbles you've got in your pocket at the end of the day :)
<0> ..
<0> I have no idea what I'm arguing about
<3> Patrick`: the chmod *command* takes a string. chmod(2), chmod in other languages and os.chmod in Python do not take strings.
<0> so I could legitimately call os.chmod with the decimal representation of 0755 and it'd work?
<4> Greatred: And complex-numbers are for your imaginary pebbles in the frequency-domain?
<3> os.chmod doesn't care about the representation, just the integer you p*** it.
<0> cool
<1> indeed, that's what i'd expect
<3> how you got that integer is of no consequence to it.
<0> but totally bizzare
<3> only if you are glued to the idea of chmod as a command.
<1> Pythy, beats me. i don't deal with real applications of complex numbers. i imagine they are application dependant :)
<0> the whole concept of chmod is bitpacking flags into a number
<1> aye
<0> having it in another base is just counterproductive
<5> there is no such thing as a number being in a particular base
<5> bases are representation
<5> that's all
<0> yep
<0> *however*
<0> if I wanted to make a file rwxr-xr-x I would use 0755, and not decimal 493
<4> There are many real applications of imaginary numbers---but, yes, there are more imaginary applications of real numbers.
<0> or 1EDh
<6> like int("0775",8) -> 509
<5> that's only because your brain handles it better as that
<0> the number is just a representation of what flags the program wants, suitably bitpacked
<0> so in order to produce the decimal one, you'd need to convert it from something else
<1> hehe. what are we arguing about specifically, again? :)
<0> I have no idea
<1> heh
<0> I'm avoiding exam revision
<1> \o/
<0> I think I was saying something about python
<0> and how too much OO programming has changed my brain
<0> litter.move(bin)
<0> why won't it GO
<5> incompadtible interface
<7> Patrick`: that doesn't make any sense.
<7> Patrick`: hand.take(litter); hand.put(litter, bin)
<7> ;)
<0> hand.append(litter); hand.move(bin); hand.pop()
<0> HandError: no free hands
<4> >>> os.chmod = lambda mypath, mode, os_chmod=os.chmod : os_chmod(mypath, b2i(mode))
<4> >>> os.chmod('/temp2', '111.101.101'), os.chmod('/temp2', 0755) # Will accept an int or a string
<0> cool
<0> it's just confusing then because the leading 0 in this case means "octal" to python
<8> does anyone have some experience or knowledge about python parallelization framework which could simulate cluster by using computers connected via network with paswordless ssh access as MPICH can do?
<0> but if it was p***ed to chmod (by typing 00755) then it'd mean something different
<4> eh?
<0> jaaroo: s/p***wordless/keyed



<0> 0755 <-- python sees this as the number 755, in octal
<0> 0755 <-- as a string, chmod reads this as "blank sticky, setgid, setuid"
<8> Patrick': yes :o)
<4> os.chmod('/temp2', '111.101.101') == os.chmod('/temp2', 00755) == os.chmod('/temp2', 0755) == os.chmod('/temp2', 493)
<8> Patrick': it makes no difference for user :O)
<0> indeed
<0> but if I wanted to explicitly use "0755" in chmod from python, I'd need to type it as 00755
<0> one zero to say "yoo hoo, I'm octal" and one to blank sticky setgid setuid
<4> I'm *not* p***ing 0755 as a string, I'm p***ing it they way you always it an int: as an octal int-literal.
<0> exactly
<0> ah
<4> So there's no confusion, nor any conflict with existing usage.
<0> if chmod gets 755, it'll ***ume the other one is zero anyway
<0> is python the same?
<0> i.e. if I use 0755 on a file with, say, "4644", it'll set it to "0755" same as "chmod 755" ?
<0> blah, my brain hurts
<0> I'm off
<9> hi
<4> Hello, Flo.
<6> a = access.user(read,write,exec).group(read,exec).other(read,exec); chmod(file,a)
<6> would that be useful convetion for managing permissions
<10> Pythy: According to this closure problem, I tried something else: http://pastebin.com/632449 - basically I stuffed the closure in another function with an own namspace - calling it from the outside should give an error - but it does not - why?
<4> eh?
<10> Pythy - sorry, this is the right link: http://pastebin.com/632454
<11> pyqwer: why don't you use the callable object solution that I gave?
<10> kosh: I'll do - but I'm just playing around with this closure thing so that a have a better understanding of Python...
<4> Pyqwer: Explain what you expected to happen and why, and exactly what surprised you about what did happen instead, and exactly why that violated your mental-model.
<12> is there a chance to embed python into java?
<7> pfote: sure. jython
<10> Pythy: When I execute my closure function in the end, there should be no instance "a" anymore - and there really is none - as if I do a "print a" in the last line, an Error is raised. However, the function seems to magically have a reference - how does that work?
<4> pyqwer: Because you still have a pointer to the foo-function you created,
<4> and that function has a connection to the ``free variable'' `a'. If `a' dropped out of scope,
<4> the rule is:
<10> Pythy - I see, so the function still has a pointer, but "a" is invisible to global namespace, right?
<4> What ever value was stored in `a' at the time its native name-space went {*poof*},
<4> is entombed forever, and, is the value the the function that has interred `a' will forevermore see as a's value.
<12> Jerub: sorry, mixed it up .. i need to embed java into a python process
<4> "but "a" is invisible to global namespace, right?" > `a' was never in the global namespace.
<4> pyqwer: (But you're doing good here.)
<4> pyqwer: Disclaimer: I haven't read the Python docs yet---my explanations are based on my own conclusions from running tests.
<10> Ok, that's clear to me now. This also explains the case when I define a global "a" at the top of my program - this way, the closure also uses the last value from "a" of the inner namespace.
<13> does anyone know of a good editor with syntax highlight for python and html, identation and that I could switch tabs with Ctrl+PgUp/PgDown?
<10> Xamusk: I like GNU Emacs
<13> pyqwer, does it have tabs?
<1> Xamusk, what operating system?
<13> Linux
<13> specially Ubuntu64
<1> nedit would have that
<10> Xamusk: XEmacs has tabs, but I don't know how to configure the keybindings. But there is a very helpful channel on FreeNode called "Emacs".
<10> Xamusk: Emacs (and I think also XEmacs) is available for nearly all UNIX-flavours and also for Windows. (Mac I don't know).
<1> kate should have that as well. the key bindings you could change easy enough
<13> I use gnome... gedit does not Ctrl+PgUp/Down... don't know how to change keybindings there
<1> Xamusk, yes i just looked at gedit. i couldn't find it either
<14> Xamusk, why do you need *exactly* those keybindings?
<13> TFK, I'm just too used to them... I tried gedit but alt+# got me confused, as all the other apps I am currently using for developing (firefox and gnome-terminal) also use those
<14> It is not too difficult to relearn a single keybinding!
<14> And white I'm at it, I think that SciTe supports those.
<4> "It is not too difficult to relearn a single keybinding!" > TFK: Yes, but, there are 104 keys on my keyboard!
<13> TFK, it would not, if I wasn't changing from one app to the other all the time
<15> hi all
<15> >>> def f1():
<15> ... return f1
<15> What exactly does this return?
<3> it returns the global variable 'f1'
<13> ???
<3> (since you don't ***ign to the name 'f1' in the function.)
<15> hmm
<15> what will it do if I say return f1()
<15> any ideas?
<13> payal, probably enter an endless loop
<15> why?
<0> it'll fail?
<0> try it


Name:

Comments:

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






Return to #python
or
Go to some related logs:

t
MySQP DROP
#ubuntu
MySQL server version for the right syntax to use near 'DEFAULT CHARSET=latin1
#asm
Parse error: syntax error, unexpected T_WHILE in
ubuntu + highpoint 370 + install
#debian
kopete DCC
x11vnc at bootup



Home  |  disclaimer  |  contact  |  submit quotes