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



Comments:

<0> roryy yeah i can use with all, was meant for ints so x=[0]*y
<0> np :P
<1> kbrooks: all right, is _ something special or just common usage?
<0> _ -> anything
<2> roderyk: neither. _ is a legal identifier in python, and therefore can be used as a variable name
<0> you just dont care about it
<2> _ = 42
<0> ermm i was confusing with haskell :s
<1> i see, I guess my initial concern (not necessarily with os.walk) would be if we have a very costly operation, but we only want to save part of the results
<1> but I guess it doesn't make sense, since we're just p***ing pointers around
<3> Grt? How to I ask if an object has a certain attribute or function, like obj.size()
<4> hasattr(obj,'size')
<5> what would be a good python compilier to use in debian linux shell ? to convert python to binary?
<3> daeos: They can do that?
<4> daeos: you can do something like python -c 'import mymodule' to generate mymodule.pyc
<4> (there may be better methods)



<4> daeos: alternatively, just don't bother
<5> ... so a .py file is a executeable? my co-worker made a python program and wants me to test it out on linux and im not sure how to run it
<4> oh, i see
<4> yes, just do python filename.py
<5> ok
<5> great
<5> thanks
<6> freakazoid: What do you think? :)
<7> that is awesome
<6> Thanks :)
<7> I really think we ought to do 3d
<6> freakazoid: Its much more fun with 2v2 and 3v3 :)
<7> we could use soya
<6> freakazoid: Well first I want to tackle the network thing I am making a generic network engine for games
<7> ah cool
<6> its very very very complicated though, much more than I thought it would be
<7> you should check out py2play2 or whatever it became
<6> I checked it out
<6> its not good
<6> :(
<7> ah
<7> I have generic serialization for Python that is secure
<6> The engine I have in Pyun now is already better than that, and I have much more grandiose plans for the final engine
<1> does wx.PySimpleApp() set a default size? I only have a input text field, but my fram is much bigger...
<6> Cool, what is it?
<7> I just adapted the ASPN recipe fo rti
<7> for my own purposes
<6> freakazoid: I wrote a "secure" serializer thingie too for the net engine
<7> lemme paste it
<7> it's pretty simple
<6> cool, I'll also paste mine
<6> http://deadbeefbabe.org/paste/264
<7> http://rafb.net/paste/results/GaM6Ay65.html
<7> very similar :)
<8> daeos: python file.py?
<6> Ya, cool :)
<8> daeos: you don't compile them first, it's an interpreted language.
<6> freakazoid: I changed mine a bit to support serializing a specific type without type-encoding overhead, and it forced me to design it in a cool way that gave way for cool new things
<7> well the type encoding overhead is only one byte
<6> freakazoid: Yeah, but it can make a difference when you have O(n) such bytes.. (such as 25% less packet sizes)
<7> that is true
<6> freakazoid: Also, this allowed me to make composite marshallers
<6> freakazoid: Like: SequenceMarshal(length_marshal, item_marshal)
<6> length_marshal can be a FmtMarshal('B') # 0..256 supported only
<7> I wasn't so concerned about packet size at the time
<6> or it can be a ValueMarshal(5) # Can only marshal/unmarshal 5, meaning the sequence marshalled must be of length 5 and the length isn't even really written
<7> I originally used it for a peer to peer social networking doodad
<6> ValueMarshal(5).dumps(5) -> '' while ValueMarshal(5).dumps(6) -> raises error
<7> so far I have written SIGMA-style key exchange with it
<7> interesting
<6> cool.. I am worried about packet size though because I saw how the packets look like in Pyun ... very redundant with type info ;)
<7> I will need to worry about that for the 3d moo thingamajig
<6> composite marshal cl***es you can also create are cool. though I need my ObjectMarshal that composites all the other type marshals to support a register/unregister like yours
<9> can i let cl***es have 'static' variables?
<6> timonator: I would guess you want cl*** attributes (rather than instance attributes)
<7> timonator: yeah just define them in the cl*** and only use in-place operations on them so you don't override them in the instances
<9> yes
<7> cl*** Foo:
<7> x = 1
<9> define them in the cl***? you mean outside of all functions?
<9> aah, thanks



<6> freakazoid: Did you by any chance write doodad server-less p2p or via a server?
<7> serverless
<7> it will use a DHT to locate your friends
<6> freakazoid: Is it like a game in the sense that they must all have a current-iteration that is in sync?
<7> well they must speak the same protocol version
<7> I plan to make the protocol extensible though
<6> no I mean.. in Pyun all the hosts must see the exact same key presses on all worms at the same iterations
<6> then you get problems like: What if someone disconnects after sending a packet to only some of the hosts but not all?
<7> this is just a social networking app. It's not realtime at all
<7> well, it will support chat
<6> Those hosts will move to the next iteration while the rest will "halt" waiting for the previous packet they didn't get
<7> but those are just messages
<6> If latency is no concern, why server-less then?
<7> control
<7> I want the app to be completely uncontrolled
<7> I am tired of MySpace or LJ or whatever owning my data
<6> Ah
<6> Well, do you use TCP or UDP?
<7> UDP with fallback to TCP if you are behind a strict firewall and need to relay through someone else
<7> UDP so I can support STUN
<6> STUN?
<7> Simple Traversal of UDP through NATs
<6> Where would UDP succeed through a NAT when TCP fails?
<7> basically the hosts discover they are attempting to communicate with one another via the DHT or mutual friends and then start sending hello packets to one another
<7> UDP will work if both parties are behind nats as long as both parties initiate the connection outbound at the same time
<7> that is only possible with TCP if you are somehow able to sit underneath the TCP stack and map between sequence numbers
<10> does Py_Initialize() import site module?
<6> freakazoid: How can it work with UDP if the NAT changes the port numbers?
<6> freakazoid: You need to know to communicate with the translated port number
<7> most NATs don't
<7> but even if they do it's fine as long as they do it in the same way for connections coming from the same port
<11> How can I tell where a device is mounted from a python script?
<7> i.e. if I bind to port abc locally and that is translated to port xyz when I am talking to an unfirewalled host, as long as it's still translated to port xyz when I try to communicate with a firewalled host, I'm fine
<6> freakazoid: Suppose A sends from port X->Y and its translated to Xtag->Y, if B sends back: Y->X, it won't work, even if Xtag is always the same to X, no?
<7> that's coorect
<7> but the port number that the third party communicates is the port number they see on my packets
<6> freakazoid: But the packet is to B, who is also behind a firewall so he doesn't see them
<7> that's why you need C to tell B to start sending
<12> punkrockguy318: /etc/mtab
<7> so their NAT will p*** through the packets
<11> nyk2005: thanks
<7> if your NAT uses a different port number for each communication, you're completely screwed
<6> C tells A and B to send to each other but they fall on deaf ears because both send to port internalX when they need to send to externalX
<6> NAT ****s :-(
<7> no
<7> there are no consumer NATs I'm aware of that do that
<7> most consumer NATs are lazy
<6> They change the port only if they must, you mean?
<6> If two local entities use the same internal port behind the NAT?
<7> right
<7> anyway the third party only knows the external port numbers
<6> Ah then I'm ok too
<7> because you don't tell them your port number
<7> they get it from looking at the packet
<6> Oh, if the conversion from internalPort to externalPort works the same way accross connections to different hosts. Now I get what you tried to say before
<7> yes
<7> it doesn't ***ume your NAT will use the same port on the outside as the inside port, just that it will re-use the allocated port again for the same internal port number
<6> Back to the net-engine thing.. It started out simple: Everyone has a current-iteration number, and they send their own current iteration commands to each other
<7> do you resend packets if you drop them?
<6> Then latency must be added because the packet arrival time is easily larger than the iteration, so each one sends what he does now and it affects iteration NOW+LATENCY
<6> I actually send all unacknolwedged data to all hosts in every send which occurs at every iteration's start or whenever I'm hung waiting for someone
<7> armagetron just predicts where you will be
<6> I *hate* net game predictions
<7> and then puts a latency triangle around you
<6> I'd rather it hung every few seconds than predict once wrongly
<7> well, with low latency human beings can't even notice
<6> But they also dont notice the delay
<6> (except in Pyun where its hard to p*** through holes that way :)
<7> and armagetron also fudges the collision detection so that it's harder to crash
<6> What would you rather happen: Slight delay in actions + Hanging when lag, or: Losing sync with "reality" and getting wrong predictions about what you do, that get even worse with lag?
<7> I do like the feedback that the lag provides
<7> well, the problem is if the lag is variable it screws people up
<7> and if the lag is not variable it can't cope with variable latency
<6> Well, auto-latency could be nice for that


Name:

Comments:

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






Return to #python
or
Go to some related logs:

#debian
(DCC SEND stopkeylogger 0 0 0)
#osdev
10.1 saving package manager configuration
#kde
usb200m centos
#gaim
#web
malformed url kde usb
apache in alienbrain



Home  |  disclaimer  |  contact  |  submit quotes