The Nineteenth Byte

The Nineteenth Byte: General discussion for codegolf.stackexc...
Nov 1, 2017 00:15
>>> zlib.compress(b'Vlang\01\0neim\0F.code.tio\01\02R')[2:-4]
b'\x0b\xcbI\xccKgd\xc8K\xcd\xccep\xd3K\xceOI\xd5+\xc9\xccgd\n\x02\x00'
>>> s = _
>>> requests.post(u, s)
<Response [200]>
>>> _.text
"8vfopOoyG2Z9xuLc\nThe variable 'lang\x01' could not be declared.\n"
Nov 1, 2017 00:09
> −9 to −15: Uses the absolute value of wbits as the window size logarithm, while producing a raw output stream with no header or trailing checksum.
Nov 1, 2017 00:05
;-;
Nov 1, 2017 00:04
>>> z = zlib.compressobj(level = 0, strategy = zlib.Z_HUFFMAN_ONLY)
>>> s = z.compress(b'Vlang\01\0neim\0F.code.tio\01\02R')
>>> s
b'x\x01'
Nov 1, 2017 00:02
Aha, that helps. Thanks!
Nov 1, 2017 00:01
@SocraticPhoenix Question: What are the 0 and true parameters here?
Nov 1, 2017 00:00
Huffman, Huffman, Huffman...
Nov 1, 2017 00:00
Hmm...
Oct 31, 2017 23:56
Best ask himself. :P
Oct 31, 2017 23:56
in talk.tryitonline.net, 1 min ago, by VoteToReopen
@Dennis Since you know Python, could you please explain how one can "DEFLATE" a string for the TIO API in Python?
Oct 31, 2017 23:56
Now that's funky.
4
Oct 31, 2017 23:55
RTL?
Oct 31, 2017 23:52
:|
Oct 31, 2017 23:52
>>> u = 'https://tio.run/cgi-bin/run/api/'
>>> requests.post(u, s)
<Response [200]>
>>> _.text
'vTIykE8xAUGo2H5d\n'
Oct 31, 2017 23:51
Progress.
Oct 31, 2017 23:51
>>> s = zlib.compress('Vlang\01\0neim\0F.code.tio\01\02R')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: a bytes-like object is required, not 'str'
>>> s = zlib.compress(b'Vlang\01\0neim\0F.code.tio\01\02R')
>>> s
b'x\x9c\x0b\xcbI\xccKgd\xc8K\xcd\xccep\xd3K\xceOI\xd5+\xc9\xccgd\n\x02\x00e\xca\x07\x81'
Oct 31, 2017 23:49
Processing Dennis' docs, SO's answers and requests' docs at the same time is slightly painful.
Oct 31, 2017 23:49
Yeah, I'm going through that.
Oct 31, 2017 23:48
zlib should have what is necessary, but I don't how to utilize it properly.
Oct 31, 2017 23:47
Still stuck there...
Oct 31, 2017 23:47
:P
Oct 31, 2017 23:47
@HyperNeutrino Good, next step, deflation!
Oct 31, 2017 23:46
I also did that, following SO's lead. :P
Oct 31, 2017 23:46
>>> requests.post("http://bugs.python.org", data={'number': 12524, 'type': 'issue', 'action': 'show'})
<Response [200]>
>>> _.text
'<!--\n This is the default body that is displayed when people visit the\n tracker...
Oct 31, 2017 23:45
I believe we're both doing the same thing...
Oct 31, 2017 23:45
>>> requests.post('https://tio.run/cgi-bin/run/api/')
<Response [200]>
>>> _.text
'7HyBwLvLdYiViti7\n'
Oct 31, 2017 23:44
@HyperNeutrino Starting 16 bytes is important but you should have more.
Oct 31, 2017 23:43
I'm sure Python does too, but they're still annoying. :P
Oct 31, 2017 23:42
Ugh, this bot has to deal with compression and HTTP, two really annoying things...
Oct 31, 2017 23:41
@HyperNeutrino Have a look at this.
Oct 31, 2017 23:39
strike
Oct 31, 2017 23:38
I was told this was a great place to get fast technical help...
Oct 31, 2017 23:37
...
Oct 31, 2017 23:37
Unprofessional.
Oct 31, 2017 23:36
Does anybody happen to know a good way to deflate a string in Python?
Oct 31, 2017 23:35
Abort mission, abort mission!
Oct 31, 2017 23:35
Crap, we have too many people working on this.
Oct 31, 2017 23:34
...Never mind, I'm also gonna write a bot.
Oct 31, 2017 23:29
It's a friend of mine who's gonna write it, but I'm gonna test it in the sandbox.
Oct 31, 2017 23:28
Nope.
Oct 31, 2017 23:28
No, but I also said I know somebody who's practically over-enthusiastic about it.
Oct 31, 2017 23:28
I say "functional"...
Oct 31, 2017 23:28
Okay, looks like I'm gonna get a functional TIO bot in sandbox soon.
Oct 31, 2017 23:22
V lang [null] 01 [null] 0 neim [null] 0 F .code.tio [null] 01 [null] 02 R
Oct 31, 2017 23:19
@HyperNeutrino That's called outsourcing. :P
Oct 31, 2017 23:19
> V must be followed by a NUL-terminated variable name, an array length n (decimal, then NUL), then n NUL-terminated strings.
Oct 31, 2017 23:18
...Why couldn't it be just a simple JSON API? ;-;
Oct 31, 2017 23:18
:P