« first day (377 days earlier)      last day (2117 days later) » 

01:18
@LyricLy Done.
 
10 hours later…
11:13
@AndrewSavinykh Hm, I can't seem to repro that. Can you give me a link?
 
1 hour later…
12:33
@Dennis can you pull 05ab1e please?
 
3 hours later…
15:30
@Dennis can you pull Tampio, please?
15:46
@EriktheOutgolfer @fergusq Syncing.
Okx
Okx
15:58
@Dennis could you guide me on how use tio to evaluate some code in some language? I've asked about this before but the links provided by Andrew no longer lead me anywhere
@Okx Unless fill out the fields and click run answers it, I'm afraid I don't understand the question.
Okx
Okx
well, basically how to use the api
i didn't word that very well
@Dennis thanks now I can use ÅP :)
16:23
@Okx Requests consist of 6 different commands. You need three of them (create File, declare Variable, and Run) for a simple request. V must be followed by a NUL-terminated variable name, an array length n (decimal, then NUL), then n NUL-terminated strings. F must be followed by a NUL-terminated file name, a file size (decimal, then NUL), then the contents of the file. You need at least Vlang to pick a language and F.code.tio for the code. R runs the state.
Okx
Okx
i see and where do i make the request
Okx
Okx
and POST?
and an example request would be extremely helpful
Yes, POST.
@Okx You can run stateToByteString() in your browser's console to see what would get sent to the browser.
Ah, I forgot, you have to DEFLATE the command string after building it.
deflate(stateToByteString()) shows the result of that.
Okx
Okx
what do you mean see what would get sent to the browser? i don't believe browsers can trivially make post requests
16:37
Of course they can. TIO does.
They can, jquery and such with ajax
Or simply XMLHttpRequest.
Okx
Okx
oh i get what you mean now nvm
but you saying 'browser's console' meant that i could do it in the browser without code
Okx
Okx
17:03
So, I think I have a good request, but I get
Date: Sun, 03 Sep 2017 17:03:01 GMT
Server: Apache/2.4.27 (Fedora) OpenSSL/1.1.0f-fips
Access-Control-Allow-Origin: *
Content-Length: 0
Connection: close
Content-Type: application/octet-stream
This is not in a browser so there is no stateToByteString()
That's not the complete response. I see no status code.
Okx
Okx
it's all the headers i get
ah status code
400
that means bad request so i'll give you my post Vlang\0001\000Neim\000F.code.tio\0001\0002\000R
\000 is Java's null byte
17:19
Neim should be neim. Lengths and sizes are in decimal, so 1 instead of \0001. I see no code. What are you trying to execute?
@Okx Oh, and it has to be tio.run/cgi-bin/run/api. Sorry about that.
Frickin' chat. https://tio.run/cgi-bin/run/api/ (note the trailing slash)
Okx
Okx
ahah i get ETFbD7zMIykv0hvT i assume that is deflate?
No, DEFLATE would look like gibberish, not alphanumeric. That's the internal separator.
Is that the entire response? What are you sending now?
Okx
Okx
just lowercased the neim
\0001 is NULL + 1
Right, octals.
Okx
Okx
new headers are Date: Sun, 03 Sep 2017 17:27:40 GMT
Server: Apache/2.4.27 (Fedora) OpenSSL/1.1.0f-fips
Access-Control-Allow-Origin: *
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: application/octet-stream not sure how to decode the response
17:29
Well, what response did you get? If it's just ETFbD7zMIykv0hvT, the response is empty.
Okx
Okx
mL68/Icxw78FuqVk now
Yes, it's pseudo-random.
The content of files isn't NUL-terminated. F.code.tio\0001\0002\000R should be F.code.tio\0001\0002R.
Okx
Okx
ah
Because there is none. 16 bytes means there is no response.
Okx
Okx
i get Esj4adaiwafFKY6q then
hmm
My parameter is now "Vlang\0001\000neim\000F.code.tio\0001\0002R" and the response is 9aFCLD55HzmteORB which is 16 bytes
17:36
No repro.
$ printf 'Vlang\u00001\u0000neim\u0000F.code.tio\u00001\u00002R' > req
$ zopfli/zopfli --deflate req
$ cat req.deflate | curl --data @- --silent tio.run/cgi-bin/run/api | zcat
XXnzRoT7Yr/CC+6A2XXnzRoT7Yr/CC+6A
Real time: 0.240 s
User time: 0.206 s
Sys. time: 0.029 s
CPU share: 97.96 %
Exit code: 0XXnzRoT7Yr/CC+6A
Okx
Okx
what's this zopfli/zopfli --deflate req doing?
DEFLATE the request.
Okx
Okx
should i add any headers to my request?
Any moderately high-level API should add all the required headers by itself.
What exactly are you executing when you get the 16-byte response?
Okx
Okx
what i said "Vlang\0001\000neim\000F.code.tio\0001\0002R" my library doesn't seem to add any headers by itself
17:42
Not the string, the actual code.
Okx
Okx
HttpClient httpClient = HttpClientBuilder.create().build();

HttpPost request = new HttpPost("https://tio.run/cgi-bin/run/api/");
StringEntity params = new StringEntity("Vlang\0001\000neim\000F.code.tio\0001\0002R");
request.setEntity(params);

for(Header header : request.getAllHeaders()) {
System.out.println(header.getName() + ": " + header.getValue());
}

System.out.println("Executing...");

HttpResponse response = httpClient.execute(request);


for(Header header : response.getAllHeaders()) {
You're not deflating the request.
Okx
Okx
i didn't realise i had to deflate the request :P
1 hour ago, by Dennis
Ah, I forgot, you have to DEFLATE the command string after building it.
Okx
Okx
hey i got it to work
NGu3TRc1uFDN9H102NGu3TRc1uFDN9H10
Real time: 0.300 s
User time: 0.243 s
Sys. time: 0.030 s
CPU share: 91.06 %
Exit code: 0NGu3TRc1uFDN9H10
now what do i do with that garbage? :P
ah it must be deflate encoded
hmm that doesn't seem to work @Dennis
18:00
The first 16 bytes specify the separator. You have to split the output at its occurrences.
Okx
Okx
ah i get it!
tysm
<separator>2<separator>
Real time: 0.300 s
User time: 0.243 s
Sys. time: 0.030 s
CPU share: 91.06 %
Exit code: 0<separator>
@Okx np
Okx
Okx
and how do i do input? Is it a variable named input?
A file named .input.tio.
(No trailing dot.)
Okx
Okx
ah thanks
18:37
Arguments are harder, I presume.
Not really. Arguments come from Vargs, compiler flags from VTIO_CFLAGS, and command-line options from VTIO_OPTIONS.
 
1 hour later…

« first day (377 days earlier)      last day (2117 days later) »