Homework Statement
You want to rest on a hammock where the cords are damaged.
a) If you don't want to the cords to break during your nap, do you have to place the hammock at the horizontal or, on the contrary, put the knot of the first rope higher than the other ?
b) What is the curve made by...
Yeah it works ! Thanks guys !
I didn't use the strip() method, I have just replaced the if condition by if("blabla" in data) and now it works fine.
Thanks for the help guys.
Now I have tried to put data = data.decode() and it seems that I don't have the " b'*my data*\r\n' " thing anymore, but still, the if condition is note satisfied. Here is my code now :
import socket
HOST = ''
PORT = 8888
def main():
while 1:
s =...
All the data seems to be received as " b'*my data*\r\n' ". I didn't make a client code, I connect to the server by the Linux command "telnet localhost 8888".
The weirdest thing is that when I put print("#"+data+"#") as you said, I have the following error :
Traceback (most recent call last)...
I have tried to put print(data) before the if condition. It seems that the server is getting ---> b'quit\r\n'
How do I fix it ??
PS: if I add ##, the following code wouldn't be considered as a comment ??
Hi everyone, I have just started learning sockets in python and I have made the following code:
import socket
HOST = ''
PORT = 8888
def main():
while 1:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((HOST, PORT))...
Wikipedia says "An elastic collision is an encounter between two bodies in which the total kinetic energy of the two bodies after the encounter is equal to their total kinetic energy before the encounter."
So according to that, we will also have :
(1/2)ma*va² + (1/2) mb*vb² = (1/2)ma*va'² +...
Homework Statement
Homework Equations
I have thought about using the momentum formulas here.
The Attempt at a Solution
As the momentum is a conservative quantity, I have thought that p (before collision) = p(after collision).
Since p (before collision) = 12, I wanted to use that result to...
Homework Statement
"Find the direction and the variables which the electrostatic field depends on at all points of the plane (xOy) uniformly charged with the density of positive charges ϱ"
The Attempt at a Solution
So first of all, I have to study the Invariances of symmetry. I tried to...
I see now, so at the end, we will have the two capacitors C2 and C3 in series, which we can consider as a single capacitor Ca = 2/3.
By applying Q = Ca . V, we have :
Q = (2/3) . 60 = 40.
And since the two capacitors does have the same charge, C2 has a charge of 40. Is it correct ??
Thank you...
So if we have Ca = C2 + C4, the charge stored by that capacitor will be q = 2 x 60 = 120, right ?? But then what do I do ?? Isn't it the same thing that I had tried in my first attempt ?
The potential difference across C1 is 0 since C2 = C4 and C3 = C5.
I have thought about the fact that the voltage across C2 may be incorrect, but in that case how can I find it ? Kirchhoff's law doesn't seem to help in this case
Homework Statement
Question : How much charge is stored on the capacitor C2 ?
2. Homework Equations
Q = C . U
The Attempt at a Solution
[/B]
Since Q2, the charge stored on the capacitor, is C2 . (Va - Vb) , I thought that I just had to multiply 1.0 x 60 = 60.
But in fact, the expected...