« first day (4372 days earlier)      last day (472 days later) » 

12:59 AM
@Ginger you don't need to yield from, (i[n] for i in iter) is already a generator, so just return it.
@pxeger thanks
 
2:05 AM
Someone needs to create a programming language called "U" so it's package manager can be called the "Standardised U Software Sharing Yard" or SUSSY for short
 
2:38 AM
can anyone give feedback to this question codegolf.meta.stackexchange.com/a/25475/108879
hoping to get some feedback to make the spec clearer
 
you should probably explain the math behind it
with semitones and all that
 
 
4 hours later…
6:51 AM
WTF why does btao() in JS not accept values outside the ASCII range :/
 
because base64 doesn't accept values outside the ascii range
 
It does though? That's the entire point of base64, to encode values outside the range as things inside it
 
Base64, by design, expects binary data as its input. In terms of JavaScript strings, this means strings in which each character occupies only one byte. So if you pass a string into btoa() containing characters that occupy more than one byte, you will get an error, because this is not considered binary data.
you need to do a little handling of the strings first
 
It takes a string but expects it to be like a byte array
 
Yea I'm looking that up but all methods seem to be quite complex
And many I can find are really complex and still don't work for all multibyte characters
 
6:56 AM
basically, you'll have to encode your string into bytes somehow and then decode it again
function encode(obj) {
    return btoa(unescape(encodeURIComponent(JSON.stringify(obj))));
}
function decode(str) {
    if (str){
        return JSON.parse(decodeURIComponent(escape(atob(str))));
    } else {
        return [];
    }
}
those are what the vyxal online interpreter uses for turning the otherwise multibyte characters into base64
 
Unescape is depricated though
 
probably isn't needed then
 
btoa(String.fromCharCode(...[...'가나다'].flatMap(c=>{let a=c.charCodeAt();return [a>>8,a&255]})))
'rACwmLLk'
 
It's only purpose seems to be to reduce the length of unececairy long escape sequences for characters that would otherwise fit
@Bubbler Interesting, is this utf-16?
 
let s = atob('rACwmLLk');
let r = '';
for(let i = 0; i < s.length; i+=2) r += String.fromCharCode(s[i].charCodeAt()<<8|s[i+1].charCodeAt());
'가나다'
Yes, because JS is
but you might need some care if the receiving side doesn't use UTF-16 by default
 
7:28 AM
I finally found this: btoa(String.fromCharCode(...new TextEncoder('utf-8').encode(hash_value))); Seems to work ok for most most multibyte characters
@hyper-neutrino Does this mean they are working on area 51 :hype: ?
 
7:42 AM
TIL TextEncoder
 
 
3 hours later…
10:50 AM
0
Q: Knight to fork!

Mehan AlaviIn chess, fork means to target two pieces with just one piece and one of the best pieces for forking is knight. In this Challenge, You will be given three coordinate in a to h and 1 to 8(like a8 or e7) format. The first and second are for two other random pieces coordinate and the third is the kn...

 
@mousetail I think btoa(unescape(decodeURI(x))) is used, though unescape is deprecated
 
I know but I don't like it at all, the output is not compatible with anything else and is longer than it needs to be. I just want utf-8
 
11:23 AM
@NewPosts just saved 4 bytes by realising this isn't a decision problem
@NewPosts interesting variant would be to ask with knooks instead of horseys
 
@mousetail wat this is utf8
 
11:40 AM
No
 
@NewPosts Looks like 85 is good for js if two golfing languages have 50 and 52
 
What is the shortest way to intersect a set of sets in python?
 
you can't have a set of sets can you
since they aren't hashable
 
You can have a set of frozensets
 
ah
so yeah really good question
you can't just set().intersection(*s) like you can with union, plus intersection is really long to begin with
though you could s.pop().intersection(*s) or something like that, still... long
though i'm not sure that something that manages to use & could be shorter in a vacuum
 
12:04 PM
what'd I miss? :p
 
Intense
 
12:29 PM
Oh the chat bug post
 
You would think that 2 meta posts in the last 24 hours on Area 51, plus the recent A51 meta posts showing the struggles of using the site would convince the SE team that something needs to be done on A51
but they'll probably just say that "it was a goofy URL redirect error thing" and not fix it :/
 
It's really odd that the chat redirect to area 51 bug has happened 3 times, seems so specific
 
@lyxal take it out back and shoot it in the head
 
@UnrelatedString why would I golf python in a vacuum? That sounds like it would suck. /j
 
1:24 PM
We need more nominations for BOCGCC2022
 
@Ginger how did'ya get 160 rep?
 
@mathcat The chat bug
 
link?
I forgor
 
33
Q: Chat is redirecting to Area 51 (2023 edition)

GingerAny https://chat.stackexchange.com URL redirects to https://area51.stackexchange.com. This started a few minutes ago (as of this posting). This occurs for all three chat servers (chat.stackoverflow, chat.stackexchange, and chat.meta.stackexchange)

 
lmao funny
 
1:35 PM
Especially since it has happened at least 3 times before
 
I probably missed some specs.
 
I don't actually get what a super/subdiagonal is based on your specs
 
https://tio.run/##y0osSyxOLsosKNHNy09J/f8/OT@vOD8nVS8nP10jtSwxR0Pd0Dotv0gj09bAOlNX11rTWl1T8/9/AA
What env return undefined what return 1?
 
@mathcat is this just checking all diagonals?
 
firefox 1 chrome und
 
1:43 PM
@lyxal well kinda, but you got to sort out the main diagonal
 
does it matter if there are 1s on the main?
 
yeah, that's falsy
 
I think it's good to go
 
Exist K!=0, Forall ones (x,y), x-y=K
 
@lyxal thanks, I'll update the specs quick
 
1:45 PM
Need a case where all is zero
 
ah right, thx
 
to avoid someone test K in too large range
 
@mousetail Is "a diagonal with entries aij where j=i+k" better?
 
Yea adding that could be helpful
Also maybe consider formatting the test cases in proper 2d so it's easier to see what is happening
 
0
Q: Is this a shift matrix?

mathcatA Shift matrix is a binary matrix with ones only on one superdiagonal or subdiagonal, and zeros elsewhere. A superdiagonal/subdiagonal is a diagonal parallel to the main diagonal, which is not the main diagonal, i.e. all entries \$a_{ij}\$ where \$i=j+k\$ and \$k \neq 0\$. The main diagonal is de...

 
2:13 PM
The official "tips for gaining rep" post suggests using a less popular language but it in my experience it seems popular languages tend to gain way more upvotes
 
My tip is, and always will be, use scratch.
Mathcat's third law: No matter how bad your scratch answer is, it will always get twice the rep of your average answer.
 
Maybe because the colours attract the eye.
How about Piet?
 
@Adám could be
 
Scrach might win because: 1. Everyone knows it. 2. Feels esoteric, so people assume it will be hard to golf in. 3. Still quite readable, so people can tell what is going on
Brainfuck gets a lot of points but has only 1 and 2, python also and has only 1 and 3. Scratch is one of the few languages that has all 3
 
@NewPosts Seems I wrongly made "an array on a shiftdiagonal"
so u should add case on this
 
2:24 PM
a what?
 
0 1 0 0
0 0 1 0
0 0 0 0
0 0 0 0 is true
 
oh right
 
 
1 hour later…
3:54 PM
0
Q: Change the subject

Jacobcode-golfstringarraysorting Sometimes I feel like the conversation is going down the wrong path and take it upon myself to steer it in another direction. And this conversation is going wrong real fast, so I need to change the subject in as few characters as possible.1 Task Given a list of sentenc...

 
@Adám too tarpitty for more then a simple program
tho bubblers editor makes it easier
 
4:52 PM
okay, time to work on pypackage
19 hours ago, by Ginger
so as I was saying: I have reached the point with this project where I am toying with forces beyond my comprehension
to be more specific, I'm doing a little trolling with venv so it'll work nice with nested virtualenvs
 
5:05 PM
okay I have done a tiny amount of trolling and I have discovered that I probably need to steal borrow virtualenv's Python interpreter discovery code
cool, I'm sure this won't be a giant pain in my ass at all!
 
Any feedback on this?
 
@Ginger okay it's a giant pain in my ass
 
@TheThonnu It's been there for 4 days and hasn't got any votes yet
 
5:24 PM
I may have just created my new favorite esolang of mine
Well, I've created my favorite esolang encoding of all time...just need to make the language itself now lol
Only problem is, the encoding is the whole thing that makes this lang cool, I don't want to distract from it or make it feel unnecessary by having some useful text format that just gets transpiled into a less readable format
Ooh! I could use ES5 JavaScript as the readable version, which gets transpiled into a bytecode which is then encoded
 
@emanresuA Re: your best-of-2022 nomination here, the implied chronology is a bit wrong. Nibbles is actually the newest fractional-byte golflang other than the ASCII-only irrational-bytes ones. It was announced in December 2021, just before the meta question about fractional bytes was asked.
@mousetail For what it's worth, my five highest-scoring code-golf answers are in Charcoal, Pip, BitCycle, Pip, and Charcoal.
(Hey, it's a palindrome!)
 
5:43 PM
0
A: Sandbox for Proposed Challenges

l4m2Generate a random halting Brainfuck code Generate a random valid halting brainfuck program using []+-<>. Every halting program should be possibly outputted. Sandbox Notes: What should I add? Is it a duplicate?

 
Mine are rust, python, python, tips, python
 
@mousetail Some of those aren't , tho
 
Mine are tips, javascript, javascript, trianguish, javascript
 
you know it's good when you're writing functions with names like monkeyPatchExecutable
 
Two factors that seem to contribute to getting lots of upvotes on an answer: 1) if it solves a seemingly non-trivial challenge very easily because it happens to be the right language for the job, and 2) if it has pictures.
 
5:55 PM
Yea only 3 are code golf
tip for gaining rep: Answer non-code golf challenges
 
Mine are Jyxal, C, Java, Vyxal, and Jyxal
 
Humor also gets upvotes
 
followed by Carbon, Vyxal, Vyxal, and Fig (all of these + the last 2 above with 5 upvotes)
ive got 146 answers 👀
 
My highest scoring answers are in Python, Haskell, Mathematica, Scala, and Haskell (for a while, my top 5 answers were in languages I'd never used (I think Haskell, Unary, Husk, and something else))
I guess answers in trendy languages like Haskell get upvotes too, even if your answer isn't very well golfed
 
@DLosc Risky's the oldest frac-byte-oriented one I'm aware of, but it pads its full programs to an int number of bytes
 
5:58 PM
And LotM languages
Wait, Risky was in 2021?
<insert time drug quote>
 
No clue, anything from late 2019 to early 2022 is a blur
 
2020 and 2021 were cancelled.
 
My whole life is a blur
 
Looks like June 2021 for Risky yeah
 
When I die, an album of my most embarrassing moments will flash before my eyes. Those are my most well-preserved memories
 
6:01 PM
I'm trying to find Poetry's code for locating interpreters but Poetry is like 500k sloc and I have no clue where to start
 
You could maybe just ask on SO
 
oop I found it
@user I'd end up having to do something like this anyway, even if I hadn't decided to switch to using venv; the switch just means I have to do it now instead of later
alright so I have a bit of a dilemma here
pypackage only supports Python versions >=3.9, maybe >=3.8, but there is technically nothing stopping me from letting it recognize and use older Python versions to make virtualenvs with, if the package requires it
should I have a minimum Python version for pypackage packages?
 
6:50 PM
If you are going to make it work for python 2 good luck
 
I'm not :p
 
My top 5 answers are in HTML/SVG, Vyxal, <><, Vyxal, Javascript
 
Mine are Jelly, Triangular, Jelly, /// and Jelly
But, only counting code golf, we get Jelly, Jelly, ///, Jelly and Husk
 
You have variation?
Mine are Python Python Python Python Python
 
shakespeare, brachylog, brachylog, brachylog, jelly
 
7:06 PM
me when <generator object PythonLocator.installedPythons.<locals>.<genexpr>.<genexpr> at 0x7f6fd9c6f6f0>
okay, here's probably the most ridiculous line in pypackage so far: return itertools.chain(*map(set, ((os.path.join(dirpath, executable) for executable in executables if executable in filenames) for dirpath, _, filenames in itertools.chain(*map(os.walk, os.get_exec_path())))))
it looks like a code golf solution :p
 
 
1 hour later…
8:32 PM
@mousetail mine are scratch, vyxal, vyxal, vyxal and vyxal
Don't judge me, I do know other langs
 
8:59 PM
like jyxal? :b
 
uh.
I know how to program in snap.
 
9:15 PM
wow, that meta post got me like 350 rep
 
My least favourite javascript feature is the separation between var and let. I have never wanted var's unique behaviour over let's, but I prefer the keyword var :(
 
and I bet it has nothing to do with the e in let
 
@ATaco I'm a ES6 guy, but I don't like the seperation either
 
9:31 PM
I prefer let
var seems ugly to me
 
I'm used to var from C#.
 
9:49 PM
I never use any of those.
 
imagine needing to use a keyword for assignment
this post was made by Python Gang
 
10:17 PM
Imagine using assignment
This post was made by the Jelly gang
 
imagine using
this post was made by the
 
10:43 PM
Imagine
this post
 
Im in
 

 
@ATaco var is utterly useless
 
10:59 PM
let seems kinda mathy. It'd feel more appropriate if it were for immutable variables
 
11:27 PM
Huh, my top 5 answers are GoL, APL, Zalgo, APL, APL
Protip: pwn someone else's challenge by sheer luck
 
My top 5 are Keg, Scratch, Keg again, Vyxal and Vyxal
 
@Bubbler ಠ_ಠ
 
hehe
 
@user LET is the keyword for variable assignment in BASIC. :P
20 LET X = X + 1
 
Actually all 5 have some reason to be at the top. The first three have insane score in or , 4th has some crazy math, 5th has some crazy mixed base trick
 
11:37 PM
I limited my top 5 to because my #1 answer by a long shot is a Python answer to a I FGITW'd
 
lol
how to win a pop con: fgitw
 
My top 5 are clever, FGITW, clever FGITW, FGITW, high-effort
 
My top 5 are APL, APL, APL, Brainfuck, Hexagony
(mathy fgitw, mixed base trick, mathy fgitw, bf fgitw, a best of winner)
 
My top 5 are TI-BASIC, APL+J+K, QuadR, dzaima/APL, NARS2000. Kind of ironic.
 
@emanresuA It is true that all of my top 5 answers were posted within 36 hours after the question was posted. None of them are within the first five answers to the question, though. One of them is even on the second page (sorting by oldest first).
 
11:47 PM
so if you want votes on problems, answer quickly and in obscure languages?
i've only written solutions in javascript and japt so far
actually i do have 99 bottles of beer in TS types lol
 
Language doesn't matter too much if you can quickly write a clever answer
 
@Jacob Quickly definitely helps. It's not so clear to me whether obscure languages are better or popular languages are better.
 
ok good to know
i've been using the site just for a while but the only way i've really gained any rep is posting challenges
 
Somewhat mathy language is better to show off such an answer though imo
gaining rep by posting challenges is certainly good
 
would you recommend learning more langs if i want to get good at code golfing?
 
11:50 PM
Come learn Vyxal
 
I think answers that look impressive to a lot of people tend to score higher. That can include 1) a good answer in a well-known language, 2) an answer that is far shorter than the other answers because you found a golflang that has convenient builtins for the challenge, 3) an answer in a famously hard-to-use esolang, 4) an answer with a thorough explanation including pictures of the code in action, etc.
Equally, you can have an answer that fits any of those criteria that never gets upvotes because it didn't get noticed for whatever reason.
@emanresuA [flag as spam] ;P
 
5) use a ton of MathJax
 
@emanresuA is Vyxal hard? all the stack stuff feels intimidating >.<
 
It's... different. It's designed to be easy to learn though.
 
@Jacob Depends what your goal is. If you want to get good at golfing in JavaScript, I'd recommend golfing a lot in JavaScript (and perusing the tips page). If you want to be able to post the shortest solution to a challenge, I'd recommend learning Jelly and/or Vyxal. If you want to have fun golfing, I'd recommend doing whatever you find fun. :)
 
11:56 PM
well i guess i'll go for the last option :D
 
Fig is also very competitive with them
(full disclaimer: i am Fig's developer)
 
@Seggan Yeah, I haven't been paying much attention to the golf scores the recent non-integer-byte languages have been getting, so I didn't include them on the list, but I get the impression that Fig and Nibbles are pretty golfy.
Also Husk, 05AB1E, Japt, sometimes Brachylog...
 

« first day (4372 days earlier)      last day (472 days later) »