« first day (4138 days earlier)      last day (36 days later) » 
00:00 - 22:0022:00 - 00:00

12:43 AM
@cairdcoinheringaahing i feel like outside of something quick and dirty there's no reason not to have a vector class, whether it's for fixed or arbitrary dimensions
if you're doing something in 3d space you better have a dedicated 3d vector type
 
Depends on what you're doing with the vectors
@UnrelatedString A lot of the time, you can represent 3d space better with 3x3 matrices
 
like if you have points in 3d space to worry about
individual points
which is probably most of the time in like a game engine or whatever
 
game engines are definitely the main place where youd use some sort of vector3 class, unity has its own builtin one for sure
 
1:00 AM
Sandbox posts last active a week ago: Bold Words for Profit, Generate Fibonacci Primes Quickly
 
 
1 hour later…
2:03 AM
thank you copilot for all these helpful fields
 
Oh god the comic sans
 
comic mono
2 days ago, by lyxal
ever since one of y'all linked me to comic mono, I've been unironically using it for IntelliJ
 
I once spent a whole day using a non-monospace font (Atkinson Hyperlegible) in my editor and honestly, it was usable
 
with or without syntax highlighting?
 
2:08 AM
yeah, I can see that it'd be usable
 
The readability was lower since proportional fonts are a lot denser than monospace ones, but it wasn't awful
 
that's what I thought when I tried just comic sans with intellij
non-monospace really does need syntax highlighting though
because without the colour guide, it becomes confusing
at least that's how I see it
(no pun intended)
Don't mind me dropping some lore about @user
As you can see, he originates from the browser session and is a UserBean
that's all. Thank you for attending my TED talk
 
2:41 AM
hello, not sure it fits the code golf chat but it sort of does i think, I'm looking for a code legend's name... sort of one of the code golf buffs...
 
3:05 AM
@lyxal My favourite is commendsComments
Most valuable field
 
@IanDelord any? or a specific one?
 
3:30 AM
any language they're associated with, any particular feats, ...
 
3:42 AM

 Superior Simple

Superior Simple: A 2D programming language. See github.com/Sup...
o/ gotta go
 
4:14 AM
@Seggan me,, but i use it for everything
 
5:14 AM
Any feedback? (specifically, the last point in the meta section)
 
posted challenge
 
hmmmm
 
completely blanked to save space without hiding it from non-10k+ users
 
ok, hmm
 
5:21 AM
There's one particular incentive not to delete sandboxed posts: Badge progress :|
 
:111945 hmm, inactive
 
lmao
 
With enough time, you could get a gold from only the Sandbox
 
@emanresuA techncally yes
 
m90
@graffe Yes: tio.run/…
 
Yep
 
though i suppose this is an especially bad example
 
That's some pretty clever golfing though - especially the f-string part
(your golf on it)
 
writing a helper lambda to call it once, inequality check with the last value in the relevant range, accumulating a string and printing it, python ternary expression, excess digits on magic numbers
thanks :P
i golfed it in steps of just performing the most obvious reduction at any time and at one point before i got rid of the ternary i forgot that f-strings tie str() and tried to see if that could golf it, so they were fresh on my mind once i had gotten rid of the ternary
 
Well, 65 I think
 
5:48 AM
(i replaced the ternary with list indexing then thought "wouldn't it just be too funny if i could make it flat fstring indexing" so i did)
 
The min(_, 9) // 1 is probably there for a reason but it seems to be unnecessary?
 
oh nice
wait do you actually not have to floor it
 
Nah, because the rest just extends into the string
 
ohhhhhhhhhhhhhhhh
fuck that's smart
i knew the fstring was cheeky but i did not think it could be that cheeky
 
Also, I took the -96 logic away partially
 
5:49 AM
smart
 
Welp, together we halved their code lol
 
and the min(_, 9) was necessary at one point but i guess it stopped being necessary after we golfed the magic constants
which raises the question of how they actually came up with the magic constants in the first place
 
Lol
 
6:35 AM
tfw copilot tries to put a shell script in .gitignore
 
7:15 AM
hey look i can js const range = (x,y) => x>=y ? [] : [x].concat(range(x+1,y));
 
Neat but inefficient :P
 
@emanresuA how can i improve it
 
It's pretty clever and simple, however, it will run into the recursion limit.
 
yeah it will
hmm what will be the tail recusive version of that (js doesnt optimize that right?)
 
yeah :P
It's in the ES6 standard but almost no one has implemented it
 
7:21 AM
quick regex question if anybody knows
 
@emanresuA because its hard to implement?
 
' is my escape character, and i need to remove it from a string, is there a more obviously better way to do it than /(?<=(?<!')('')*)'/
 
¯\_(ツ)_/¯ probably
 
ok true
 
how does tinylisp implement TCO?
 
7:24 AM
IIRC it mantains a scope stack and substitutes the call?
 
hmm why can js do that?
 
idk
It's simpler to do with tinylisp because only statements directly returned or in an if-case need to be TCO'd
 
> Stock Python implementations do not perform tail-call optimization, though a third-party module is available to do this.[33] Language inventor Guido van Rossum contends that stack traces are altered by tail-call elimination making debugging harder, and prefers that programmers use explicit iteration instead[34]
o_O
 
7:54 AM
Not having TCO to maintain stack traces is like leaving all your print debugging on in production because "It might error". It's very stupid.
 
8:05 AM
Python has a stupid amount of introspectability, and it's kind of a sunk cost that they won't remove it because a lot of code now relies on it
It's about as impure a language as you can get, because almost every operation can do really strange things
 
Oh yeah, it's absolutely a bad idea to change now. The real solution is to stop using Python for anything critical.
 
@WheatWizard exactly
the most programming languages you know, the more frustrating it gets to use programming languages...
 
Yeah, it's sort of a curse.
 
let me try learning scala (@user will now be happy :P)
 
Scala is interesting.
 
8:20 AM
Indeed it is
 
8:41 AM
@WheatWizard Like it or not, a lot of useful stuff is built on Python. It's here to stay.
For example, Youtube, many forums, and Emscripten are all written in python
 
That's really not why python is here to stay.
Python is here to stay because people keep writing new stuff in it anyways.
 
@WheatWizard I'd say for anything *performance-*critical
 
No I'd say anything critical at all.
Python code is hard to maintain at any scale and has a tendency to produce nasty bugs.
 
At the extreme, for something like a script that needs to run once a day in O(1) time where performance really doesn't matter, it's perfectly fine
 
Python's performance isn't really a problem.
 
8:44 AM
I don't think it's fair to blanket-describe any language as hard to maintain
 
I think it absolutely is.
 
Why?
 
Why is it fair? Because language design choices effect how easy it is to maintain something. Python has a bunch of issues that mean that Python does not age well.
Nothing ages great, you always have to put in effort, but Python requires more effort than a lot of the alternatives.
 
I don't think Python has anywhere near as many footguns as many other languages
I'd love to have everything written in Haskell with dependent types, but you have to find a middle ground between pure footguns and pure bulletproof glass
For all its faults, Python does that somewhat succesfully
 
I don't know how it compares to the absolute average, but of the languages I've worked with professionally Python is certainly below the average. The only language that's worse has been JS. Dart, Go, Kotlin, Java, Clojure all have issues, but they don't age as poorly as Python.
 
8:54 AM
@WheatWizard scala has a weird function syntax
object Main {
  def main(args: Array[String]): Unit =
    println("Hello, Scala developer!")
}
i dont like that syntax
apart from that, scala looks fine
 
which bit of the syntax do you object to?
the = for expression-like functions?
 
yeah
 
IIRC, you can also write them using { return }
but = is in many ways a more natural syntax for functions which are expressions
 
and it's nice not to have to
^
 
obligatory @user mention
 
9:01 AM
A big part is
1. Python has no real design direction, if you look at say e.g. the zen of python it's actually very vague, Python is successful because it's a big tent, this means that Python libraries aren't very uniform and code lacks a strong style, it uses some principles from OOP, but it's not fully OOP, it uses some principles from FP but not that much. It's a weird mixture and it's hard to write good code in the long term for that sort of environment.
2. everyone knows how to write Python (not necessarily well), this contributes in much the same way. Paradoxically it's harder to te
 
42 mins ago, by PyGamer0
let me try learning scala (@user will now be happy :P)
 
lol
scala is my fave jvm language thanks to user
 
@pxeger Agreed
@WheatWizard You have to go looking for JS's weirdness, and TypeScript's wayyy better :P
 
@pxeger hmm well can't i just use nameless functions at that point?
 
@WheatWizard I agree with these points, but I still don't think they're really a reason to never write Python
@PyGamer0 What exactly do you mean by nameless functions?
 
9:06 AM
@pxeger lambdas?
args => body
 
it's a tim toady thing
having more than one way to do it
 
It's fine to write Python for little scripts. I just wouldn't use it for anything critical. It's not even that Python is that bad, it's just that for whatever there's usually something that does it better. Ruby is pretty good for example, at a lot of the stuff Python tries(?) to do.
 
Is JS good for large programs?
 
@emanresuA Oh we used mostly TS with some extensions I just call it JS.
 
9:09 AM
worst thing about python: sympy has ace exploits
 
@mathcat I have not found JS fun on large programs
 
yet to try typescript and purescript but i assume they ease some of the pain
@lyxal possible that it's an ATO problem?
 
@Razetime okay
I'll use scala then
 
what are you using scala for?
 
9:12 AM
Web stuff
 
on a static page?
 
@Razetime it is
 
@Razetime yes
 
@Razetime TS and PS are very different. I've barely touched PS, but it was pretty nice. I'm not sure if PS is actually a great web language, but it seems like a decent general purpose language and it can do web stuff.
 
9:30 AM
@emanresuA How could you post "twice (or more) in a row"? You would have to crack your own challenge, right?
 
slaps face
There's some stuff I probably should've thought aboout before copying
 
but nice challenge, looks fun
 
Yeah, I'm quite excited about it
So, what's the winning criteria?
 
I don't know what the winning criteria could be tho
ups
I got ninja'd
 
Honestly considering making it a popcon
 
9:38 AM
yeah maybe
 
10:37 AM
0
A: Sandbox for Proposed Challenges

mathcatScribble Pad for Nerds. aka. implement an easier version of 05ab1e's canvas element. Description The canvas element is used to draw ASCII lines on the screen. The (easier version of the) canvas element takes a list of integers and returns a multi-line string (or a list of strings). The integers m...

 
10:51 AM
@emanresuA lowest delta of bytes added in the answer?
or just "most safe answers"?
also, what happens if someone forgets to mark their answer as safe and reveal what language it's in?
 
Ah, frick
 
11:25 AM
A moment from history:
Congrats on making the Hot Network Questions list! :D — Alex A. May 21, 2015 at 18:56
o/
 
o/
CMQ: In a practical language, should lists be immutable?
 
Yes, as should almost everything.
 
11:59 AM
okay
 
Lists here are linked lists right?
 
12:14 PM
yes
 
 
1 hour later…
1:44 PM
Aww, missed a discussion tangentially involving Scala
@pxeger You actually need = there too. Blocks are just expressions in Scala. It's more consistent that way, although it's debatable whether that consistency is even needed
Kotlin does, however, let you do fun foo(...) {...}
Actually, Scala used to allow def foo(...) {...} too, but that was only for methods returning Unit, which was an odd kind of rule. That syntax is deprecated in Scala 2 and removed in Scala 3
@PyGamer0 Those don't directly allow recursion (you can do it, it can just be mildly annoying). It also doesn't really save bytes if that's what you care about
 
2:36 PM
yeah I've seen that one
 
ayyy extensions kinda work!
 
 
2 hours later…
4:53 PM
Random Youtuber: [Can you solve FizzBuzz in one line?](https://www.youtube.com/watch?v=jV0yhde5xY8)
Entire Code Golf Community: **YES.**
 
5:07 PM
0
Q: Whyte Notation Translator

HatsuPointerKunWhyte Notation is a classification method mainly for steam locomotive, that classifies by wheel arrangement. On a steam locomotive ( we're only focusing on non articulated locomotives here ), the wheels are generally disposed like this : you have a specific number of leading wheels, then a specif...

 
5:51 PM
@WheatWizard are you familiar with the North American Computational Linguistics Olympiad? You might like it, if that Uilta post is any indication.
 
@mathcat well now we obviously have to flood the comments with answers
 
6:02 PM
hello radvylf
 
aloha all, just wanted to get a last check on this before i post. rn it looks good to me but i just wanna be sure im not missing anything out the gate
 
@mathcat hold on lemme roll out the one-line form of my piet fizzbuzz program
 
i wonder if a true greenlight system would be good for our site :think: though we get a lot of posts so that might be unfeasible
 
i really do need to post that soon, although i still want to try to golf it a tiny bit more before i post it
 
CMC sample ten non negative integers uniformly that sum to ten
 
6:09 PM
wait my tables broke >_<
 
@m90 thank you. I am on my phone until tomorrow but will take a proper look in about 13 hours from now
 
how come my markdown tables look fine in editing but break in post
 
(the CMC is to write code that does that of course)
 
Fun Python tip: You can multiply numbers by boolean values! (True = 1, False = 0)
 
fixed it was a spacing issue.. weird
 
6:13 PM
@nitsua60 @WheatWizard There is also the International Linguistics Olympiad (just linguistics, not computational linguistics). They're kind of like logic puzzles
 
@Ginger classic
 
@thejonymyster the markdown preview seems to be more flexible with table syntax than when you actually post the answer; it's quite annoying
 
@pxeger indeed it is! lol
glad i caught that in sandbox then :]
 
I think you have to make sure to leave a blank line before and after the table?
 
i added two before and after
just to be extra safe XD
 
6:16 PM
@pxeger actually, looking at the NACLO, there doesn't seem to be a big difference in question style
 
Yeah, the ILO is the "parent" of the NACLO--same topics being addressed.
 
Have we had a challenge like my CMC?
 
how do you sample from integers uniformly again?
iirc theres a lot of them, so it might be hard to sample
 
@nitsua60 I'm aware of NACLO I did a lot of back exams at university.
 
6:35 PM
@thejonymyster in this case you don't need to worry about any bigger than 10
 
i dont understand the question then
 
6:53 PM
@WheatWizard Cool :thumbsup:
 
It's fun
 
I run an instance of it at may school, and about every-other year we have a kid go to the invitational round. They blow me away with how quickly and cleverly they can cut through some of these things.
(Probably doesn't hurt that they tend to be tri- or more-lingual, so they've got a lot more good ideas rattling around in their heads than I do!)
 
@thejonymyster sample ten non negative Integers that sum to ten. Which bit is not clear?
 
0
Q: Sample integers that sum to one hundred

graffeGiven a positive integer n, randomly output n non negative integers that sum to one hundred. Your random sample should be uniformly sampled from all lists of n non negative integers that sum to one hundred.

 
ah, "sampled from all lists of..."
right, thx
 
7:02 PM
Cool
 
... no sandbox?
 
It's a very simple question
Argh! Downvote
 
thats why sandbox :P
 
That doesn't stop the dowmvotes sadly
 
lol true im bein kinda silly
but yea its apretty striaghtforward challenge i get where youre coming from
 
7:12 PM
Thanks
 
7:47 PM
The set of sets of integers is countable, right?
 
maps to the rationals doesnt it?
or well, thats redundant of me
 
@emanresuA I think so
@thejonymyster given a set S, you can express it as a rational number of the form sum(S) / [index of S in the ordered list of sets having the same sum]
it's injective
 
I think it can be done because you can take the powerset of [0, 1, -1, 2, -2, 3, -3 ...]
 
8:51 PM
anyone here that knows JS and can help me figure out why something isnt working?
 
sure
 
My guess is the computer gnomes are angry
 
so im working on my Chat-on-Chat-on-Chat thing that runs (or will run) on top of Radvylf's Chat-on-Chat thing, and I just wrote the function that encodes strings into arrays of five-bit "quints" of data
the code i have is perfectly good javascript and works fine (and even does exactly what i want) when i paste it into the browser console and test it
but if its not commented out in the userscript, the entire thing breaks
i need to emphasize that this function never gets called yet in the actual script
 
Do you have a source code link?
 
hold on,,,, WHAT?? i just changed like a few spaces, updated the userscript, and its working now?
 
8:56 PM
Hmm
Btw, hould I make this a popcon? Or what?
 
a single space between elements of an array was somehow responsible for breaking everything
 
@emanresuA would this not be better as a cops and robbers meets answer chaining? Award points for successful cracks / safes
 
I guess?
 
okay my code is working again, but i dont know why
7
conclusion: the javascript gnomes were angry
 
9:21 PM
do any of yall happen to own a Wii?
 
yea but whats up
 
used to :/
still have a wii u though
 
niec
@thejonymyster do you happen to have any extension not in this list?
 
i don't have any extension that is on that list either :)
 
|:
there, I disambiguated
 
9:36 PM
extensions as in stuff that specifically plugs into the controller, right?
 
yup
 
doubtful, but ill look as good practice
 
thanks
 
nope, just nunchucks, wii motion plusses, and a pro con
i also have that one remote with the wii motion plus already in it, but thats not an extension
 
thanks anyway
 
9:41 PM
^)b best of luck
 
have you installed homebrew?
 
no i dont play a lot of video games
 
ok
 
never got around to it for that reason
 
appreciate your help!
 
9:42 PM
are any other extensions known to/ thought to exist? interesting rabbithole i imagine
 
plenty
I'm trying to document them
if anyone knows anyone who might have access to a rare extension please refer them to me
 
noted :] ill dig through my friend's controllers next time im ober
and steal it.
 
yay
 
0
Q: Invert a Non-commutative Function

thejonymysterIntro Imagine a list of elements and their outcomes when some non-commutative function is applied to them. For example, we will use the elements Rock, Paper, and Scissors, the outcomes Win, Lose, and Tie, and an operator * such that X*Y = what would happen if you played X against Y As a list, you...

 
phallenge costed
 
9:55 PM
Spimpressive oonerism
 
almost a real word too, "phalange"
which... for some reason my spellcheck doesnt recognize the singular form of
 
flange
 
00:00 - 22:0022:00 - 00:00

« first day (4138 days earlier)      last day (36 days later) »