Arnold Palmer

 The Nineteenth Byte

The Nineteenth Byte: General discussion for codegolf.stackexc...
Aug 4, 2018 17:19
I'll check out my options around that
Aug 4, 2018 17:17
And I guess I could just reopen the file
Aug 4, 2018 17:17
Atom supports a handful of different encodings for stuff like cyrillic and arabic and stuff. I think the only latin option is UTF8
Aug 4, 2018 17:11
But regardless of how it's interpreted and displayed in the editor, that shouldn't change the actual data I get in my variable
Aug 4, 2018 17:09
They do. The entire alphabet is above 0x7f
Aug 4, 2018 17:08
yep
Aug 4, 2018 17:08
It did read the 0x00-0xff file correctly though
Aug 4, 2018 17:08
Maybe :/
Aug 4, 2018 17:06
I'm trying to do it all in the editor since that seems to be the limitation of a plugin at this layer. I guess I should have been clearer and said that all of the characters of the file are printable ASCII characters, once they've been transcoded from EBCDIC. For some reason the first two characters in my test are being interpreted as a unicode character by js, so my string gets out of whack after that
Aug 4, 2018 16:58
Yeah. I'm trying to turn some C code stored in EBCDIC into ASCII, so it will always be 100% printable characters
Aug 4, 2018 16:54
I've hardcoded my test case to be a hand done transcoding of "Hello, world!", so it shouldn't be a problem with control characters
Aug 4, 2018 16:22
What I'm trying to figure out is how to convert it to a byte array. That would solve all of my problems. All of my attempts so far have resulted in bad characters showing up in the output
Aug 4, 2018 16:10
Sorry @Soaku, I haven't found anything on stackexchange after about an hour of looking, so I figured the people who hang out here might be able to give me a push in the right direction.

And I'm getting the input as a string via another function call, so I can't get anything other than a string. My hope would be to treat that string like binary data so that I can do a conversion
Aug 4, 2018 15:51
Anyone online that could answer a JavaScript question?
Aug 2, 2017 02:05
My Python still runs in less than a tenth of a second
Aug 2, 2017 02:02
That bumps it up to 381 :/
Aug 2, 2017 01:59
That's a good point
Aug 2, 2017 01:55
The issue with the raw_input is it's supposed to act like a Brainfuck program, so it's single character input, so no quotes allowed
Aug 2, 2017 01:53
Thanks man
Aug 2, 2017 01:53
I never know man. I've only been here for a bit so I don't want to come off as a jerk for posting over someone's post
Aug 2, 2017 01:52
Sweet
Aug 2, 2017 01:52
I mentioned using the same mechanic as another Python post, but it's not really an exclusive trick
Aug 2, 2017 01:51
My code I just posted for the Brainfuck challenge
Aug 2, 2017 01:50
Seems reasonable enough
Aug 2, 2017 01:50
At what point does an improvement to someone's answer become its own answer and not a comment?
Aug 1, 2017 02:07
And a Telnet client
Aug 1, 2017 02:07
PuTTY is customizable
Aug 1, 2017 02:06
At least one of those is obviously not a candidate
Aug 1, 2017 02:05
My guess is TTY significantly predated PuTTY, and they just tacked on the Pu since it made a real word
Aug 1, 2017 02:05
According to the page, it means nothing lol
Aug 1, 2017 02:04
Found that on the PuTTY wiki page
Aug 1, 2017 02:04
The more you know
Aug 1, 2017 02:03
"though 'tty' is sometimes used to refer to the Unix terminals, as an acronym for 'teletype'"
Aug 1, 2017 02:03
Sounds good man. I'm doing the fermatness question and the only ways I see doing it are either exponentiation or logarithms. I have a "working" solution, but it breaks for numbers larger than 7-8 digits
Aug 1, 2017 01:58
@ATaco Is that a thing that is resolvable?
Aug 1, 2017 01:53
Like 7-8 digits of accuracy on exponentiation
Aug 1, 2017 01:51
Like 2^32 isn't calculated properly and gives 4294967300 instead of 4294967296
Aug 1, 2017 01:49
@ATaco So RProgN 2 also doesn't look like it does too hot with large numbers
Jul 31, 2017 22:10
I'm with you. Luckily, I realized I was stupid, and doing it the other way around is actually a lot easier (at least in Python)
Jul 31, 2017 21:51
@ATaco Dang :/ I was hoping to use that for the Fermatness problem, but being unable to take accurate logs with large numbers is just about a deal breaker
Jul 31, 2017 15:16
@ATaco It looks like your Š operator isn't quite right in RProgN 2. If you try and take log_2(2^128) it returns 127.99999999... Don't know if that's a limitation of what you're using on the backend, or just cutting off of precision
Jul 27, 2017 19:10
@ATaco @ATaco, I know this is a little late, but I haven't been able to get on in a while since I'm so busy at work. The doc page looks pretty good. Maybe think about specifying how your for loop works since I had a bit of trouble figuring that one out. Like the fact that it does (i = a; i <= b; i+=c) instead of the "normal" i < b
 

 The Break Room

Discussion for the Stack Exchange Stock Exchange KotH
Aug 4, 2018 16:51
I think it has something to do with the fact that, for my test case, my first two characters are being interpreted as a unicode character instead of just single byte characters

And okay
Aug 4, 2018 16:49
Like my conversion process correctly grabs that file's raw binary
Aug 4, 2018 16:48
It seems to output the same thing
Aug 4, 2018 16:42
This is the API page for the editor window I have access to: atom.io/docs/api/v1.29.0/TextEditor
Aug 4, 2018 16:35
So this is all happening in an Atom plugin I'm trying to make to save myself time. I have an instance of the current editor widow and retrieve my text via a .getText() call. The idea is that I have files I want to read that are encoded in EBCDIC, so I want to open them then run the plugin so that it converts it to viewable ASCII text
Aug 4, 2018 16:00
The problem is that since my JS instance uses UTF-8 strings, when I do "message.charCodeAt(i)", I don't get the true binary value. I just want the literal binary representation of the string
Aug 4, 2018 15:56
I'm trying to take a string that's in EBCDIC and transcode it to ASCII
Aug 4, 2018 15:54
Anyone online who could answer a JavaScript question?