It always disconnects. And when I try to re-loggin, it says "this user is already online"
I resarted firefox, I deleted cookies and the cache and nothing helps
Last edited by LiFaytheGoblin (2012-09-03 13:30:29)
Offline
Last edited by Hardmath123 (2012-09-04 09:52:10)
Offline
MathWizz wrote:
Banning is implemented. >:)
D:
Offline
Is there any way this could work on iOS?
Offline
Hey, I'm trying to connect to testchat.cloudno.de, port 9153 via Python sockets. It isn't working:
import socket s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(("testchat.cloudno.de", 9153))
It just goes into an infinite loop... help?
Offline
Hardmath123 wrote:
Hey, I'm trying to connect to testchat.cloudno.de, port 9153 via Python sockets. It isn't working:
Code:
import socket s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(("testchat.cloudno.de", 9153))It just goes into an infinite loop... help?
try this?
s = socket.create_connection(("testchat.cloudno.de", 9153))
anyway, what do you mean by inifinite loop? you lose respond or it raises RecursionError?
Offline
roijac wrote:
Hardmath123 wrote:
Hey, I'm trying to connect to testchat.cloudno.de, port 9153 via Python sockets. It isn't working:
Code:
import socket s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(("testchat.cloudno.de", 9153))It just goes into an infinite loop... help?
try this?
Code:
s = socket.create_connection(("testchat.cloudno.de", 9153))anyway, what do you mean by inifinite loop? you lose respond or it raises RecursionError?
WebSockets have a different protocol. -.-
Offline
So... how do I access it? I wanted to write my own client for iOS.
Offline
Hardmath123 wrote:
So... how do I access it? I wanted to write my own client for iOS.
I was playing with a Python websocket library — I think it was ws4py. I'd send you what I have so far, but I appear to have misplaced the code...
Presumably, though, you'll want to use Objective-C; so I'd have a look for something similar for C/Obj-C.
[You could always implement the websockets protocol yourself, if you really wanted to; but it looks reasonably complicated.
Last edited by blob8108 (2012-09-06 11:00:44)
Offline
I didn't grok a word of that. I assumed websockets were just an interface for accessing normal sockets via JS...
Offline
Hardmath123 wrote:
I didn't grok a word of that. I assumed websockets were just an interface for accessing normal sockets via JS...
I thought that too, for a long time
Have a look at that Wikipedia article...
Offline
fg123 wrote:
You'll probably have to wait for MathWizz to release an API of sorts so you can connect, because I'm pretty sure right now, it's ultra secure so no one can just randomly connect to the web server.
I managed to connect to it from my own Python code very happily
Offline
/for i 0 10000000 1 {say $i}
Offline
Nope, the $ is actually PHP. It's used to reference variables.
Like a variable named foo would be referenced and created in php as $foo.
Hardmath was posting an example of the code you can use in Chat.js, which nXIII Implemented. He decided to set variables like the way php did them, so that's why Hardmath's code has that $ in it.
tl;dr: It's not python.
Offline
Actually this code simply posts the first 10000000 whole numbers. Replace "1" with "-1" for an infinite loop.
Last edited by Hardmath123 (2012-09-08 03:16:02)
Offline
Yep. Because the value of the variable i will never reach the condition set by the for loop. Although, I'm fairly certain that it could overflow if it went low enough... 1 is the value you change i by every iteration, right?
[C code]
for (int i = 0; i < 100000000000; i++) { printf("%d", i); }
Last edited by amcerbu (2012-09-08 11:24:02)
Offline
Hardmath123 wrote:
Actually this code simply posts the first 10000000 whole numbers. Replace "1" with "-1" for an infinite loop.
/for will throw an error for infinite loops.
EDIT:
The variables are not really like PHP. $<word> is a shortcut for an invocation of (var <word>) to make commands more readable. There's no shortcut for (set <word> <value>) (e.g., $<word> = <value>) because there are no infix operators.
Last edited by nXIII (2012-09-09 00:19:12)
Offline
nXIII wrote:
Hardmath123 wrote:
Actually this code simply posts the first 10000000 whole numbers. Replace "1" with "-1" for an infinite loop.
/for will throw an error for infinite loops.
Yeah, I noticed a DOM_ERROR_11 or something. What's up with that? Did you code that in, or does HTML5 somehow catch it?
Offline
Hardmath123 wrote:
nXIII wrote:
Hardmath123 wrote:
Actually this code simply posts the first 10000000 whole numbers. Replace "1" with "-1" for an infinite loop.
/for will throw an error for infinite loops.
Yeah, I noticed a DOM_ERROR_11 or something. What's up with that? Did you code that in, or does HTML5 somehow catch it?
It should log "infinite /for loop" to the console:
> /for i 0 100 -1 { log $i }
< Error: infinite /for loop
The DOM_ERROR_11 was probably something else.
EDIT: here
Last edited by nXIII (2012-09-09 15:48:44)
Offline
I'm forever alone here
Offline
Alone.
Offline