« first day (4332 days earlier)      last day (503 days later) » 

12:12 AM
@hyper-neutrino how would you sort by string?
 
@Neil something like x.sort((a, b) => a.toString().localeCompare(b.toString())) or whatever it was
 
@hyper-neutrino yeah, but localeCompare is relatively recent and didn't exist when sort was invented
 
IMO sort should be able to take both monads and dyads
 
I see
also yes I agree, though if only one is to exist I think taking a comparator is better
you can have comparator-based sorting in Python using built-in sort but only if you create a new class and override the comparison operators
 
12:30 AM
0
Q: CGAC2022 Day 9: Playing with bits

BubblerPart of Code Golf Advent Calendar 2022 event. See the linked meta post for details. The Elves like playing number games. One day, Bin (a friend of Fen) suggests a new game: given a positive integer n, each Elf says a number which has exactly n runs of ones in binary. The first Elf must say the s...

 
 
2 hours later…
2:28 AM
eyyyy got klein to initialize a project with the new task system for the first time!
and time for me to go sleep, bye yall
 
 
5 hours later…
7:25 AM
@hyper-neutrino there's functools.cmp_to_key which does that for you
 
7:57 AM
chatgpt thinks mpmath has a polymul function but I don’t see it documented anywhere. Does it just have better versions of the libraries that mere mortals can’t access?
This is totallly surreal “ You are correct, the mpmath library does not have a polymul() function. I must have confused it with the polymul() function from the numpy library. The mpmath library does provide support for polynomial multiplication, but it does not have a dedicated function for this purpose.”
That’s from chatgpt
 
Literally 1984
 
Yep!
 
 
1 hour later…
Ok that pricing page is great
Rare positive bait and switch
 
One thing that's nice about copilot is its ability to learn new langauges
 
9:57 AM
@mousetail true
 
10:09 AM
Is there a easy way to check if a number is a exact power of some some smaller integer? And get the largest power
 
@mousetail I'd take the logarithms of the range, then find the largest integer.
@mousetail Wait, what is the largest power? If I find a few pairs mⁿ, are we looking for the largest m or the largest n?
E.g. 16 is 2⁴ and 4².
 
I'd want 2^4, the largest power
so 8->3, 9->2, 27->3, 16->4 etc.
Thanks, logarithm would work. Though I'll look a bit more if I can find a more efficient way. My numbers are 10-20 digits long
 
If you're not golfing, then restrict the search space to √t
 
Search space can be a fair amount smaller than that - You can only have sqrt, cbrt, 4th root, etc... At some point it becomes optimal to start searching logarithmically
 
10:24 AM
{⊃⌽i∩⍵⍟⍨1↓i←⍳⍵-1} in APL.
 
I'm not golfing, so restricting search space makes sense
 
 
1 hour later…
11:41 AM
CMC: Shortest regex to match a string literal which can contain escaped quotation marks (e.g. "abcdef" "this is a \"string\"" should pass, "no closing mark shouldn't)
 
"([^"\\]|\\")*"
assuming no other uses of backslashes
 
You can add |\\\\ to allow backslashes
 
12:23 PM
@lyxal MY GOD
I am 100% making a Klein plugin for that
but,,, like, how tf do they profit???
 
Pro services, eventually.
 
@Ginger not yet
@Ginger one very slight tiny problem that we covered last time I found something that was only half free (free for individuals)
closed source
 
$5/month: Will use var+=val instead of var=var+val
 
@Adám I'm confused, "pro services" implies that we, the simpleminded nonpaying plebs, don't have some super cool features that the "pros" do have, but that looks like it's offering everything already
@lyxal for [$$!$]'s sake
 
@Ginger might be more advanced features like replit's ai coder has
 
12:25 PM
Yes, the Pro features are not yet implemented.
 
@lyxal which you always have to pay for, they kicked me out
I guess I could send them (Codeium) an email and ask them nicely if I could make an extension?
 
you could
but then you also have to implement account authentication to allow users to use the extension
now sure that's just talking with their servers and (probably) storing an authentication key
but that's still something to consider
 
easy, it looks like they can use Google OAuth so I'll just embed a webpage into the extension or smth
 
not all people use Google OAuth with it though
 
how'd'd've'd you logged in with their extension when you installed it?
 
12:29 PM
redirect to their site
 
ok, I can do that
 
and you log in there
 
I'll just do whatever the other extensions do
 
but then it has to open some sort of link back in Klien
 
Klein can open a popup with the site and do minor amounts of trolling to detect when the authentication is done
 
12:31 PM
no no the codeium site opens a link that redirects back to Klein
 
wait does it like ask you "Codeium wants to open a link in VSCode" or smth?
 
it does
 
even easier!
 
no tomfoolery needed, just a bit of URI-handling
 
12:32 PM
oh cool
 
oh yeah I can do that easily (kinda)
although if they offer another way I might use that instead
 
well see what they say
 
well I'm not emailing them just yet, seeing as Klein can't do very much right now :p
I'll email them once I have the first beta release out that includes extension support
 
user image
2
 
but you don't because Klein doesn't work yet
that's my point
 
12:35 PM
on a feedback survey on the FAQ page under the heading "Will there be code editors other than VSCode and Jetbrains?"
 
@lyxal Yeah, I program on a klein bottle too.
what even is that
 
I'm 99% sure they'll want a version that at least works before they do anything else
 
@Ginger obviously, but that could be a way to suggest klein if enough people submit responses :p
 
also I'm not sure how much they'll like my requirement to have every plugin be Python and therefore open-source
@mathcat Klein is an IDE I'm working on
as in I created it
 
oh right I remember
 
12:38 PM
Hm, I prompted Codeium with // Amend the Array prototype to add ceil and floor methods which map over the Array and it added:
// prototype.
Array.prototype.ceil = function() { return Math.ceil(this.length); };
Array.prototype.floor = function() { return Math.floor(this.length); };
 
It's kinda what you asked for???
 
No, I expected
 
well at least if I make a beta account it'll always be free for me :p
 
Array  .prototype.ceil=function(){return this.valueOf().map(e=>Math.ceil(e))}
OK, // Amend the Array prototype to add ceil and floor methods which act on each element of the array. worked.
 
hmm, I tried to get it to make a function to iterate over an iterable pairwise and (after importing itertools) the solution it gave me was identical to the top-voted SO answer
at least it saved me looking it up :b
 
1:27 PM
hiya
@Ginger what lang is Klein being built on
 
Python
 
wait a second what is Klein supposed to be? I'm reading transcripts but still don't understand
 
it's an IDE that I'm making
 
for which lang?
 
lots
 
1:31 PM
can I add my own lang to it?
once it's out
 
if you have a language server made for it and you're willing to write the plugin yourself, sure
 
what would open(klein.py, 'w').write("\n# some random lang code here") do?
 
it'd raise a syntax error because you didn't put klein.py in quotes
 
open("klein.py", 'w').write("\n# some random lang code here")?
 
like inside a file being loaded as a language plugin?
 
1:36 PM
yeah
how bout you try it?
 
it'd raise a FileNotFoundError
why are you asking me these questions?
 
cuz... I'd like to see if it's dynamic
 
what?
 
like you can add your own programs
 
...
 
1:38 PM
i mean, langs
 
what are you talking about?
 
mainly trying to do stuff on klein
like... adding your own langs
 
a language plugin doesn't contain the interpreter code, it just tells Klein how to run the interpreter
 
and then putting your own lang open-source
@Ginger ah I see
well also because just now i realised
 
look, once I release Klein I'll include documentation for writing language plugins and then you can use that
@UndoneStudios tell me, what exactly is this language you want to add?
 
1:52 PM
@Ginger something called dterm
 
hmm
 
similar to turtle, but you get control of pixels
and is very... verbose
 
does it (or will it) have a language server? that's a requirement
 
@Ginger not yet
 
@Ginger ooh that'll be nice
 
1:55 PM
besides I just realised
 
Because there's a very distinct lack of clear tutorials on how to make a language server on the Internet
 
@lyxal yeah, the last thing I'm going to do before release is spend a day or two documenting every single public-facing API
 
open("klein.py", 'w').write("\n# some random lang code here") empties klein's source code
before typing the comment
you're lucky it terminated with an error
i should've used mode 'a' rather than 'w'
sorry
... not sorry!
 
@Ginger sounds good to me
 
@Ginger and besides if I have time I'll write a virus too
 
2:04 PM
@UndoneStudios it would... were Klein stored in a single source file that happened to be located in the user's home directory
if you're going to make malicious code at least make it functional malicious code
 
@Ginger doesn't matter
that's a reincarnation of the same code I used to nearly wipe out your IDLE
 
@lyxal I probably won't make a language server writing tutorial :p
 
fear me
 
@UndoneStudios it's hard to fear someone so laughably inept
3
 
@Ginger well dang
 
2:06 PM
besides damaging one file damages the entire thing
 
seeing as your "IDLE wipeout code" was so blatantly obvious a baby wouldn't have been fooled, and wouldn't have worked even if I did have the requisite lack of braincells needed to run it
@UndoneStudios except Klein does not have a SINGLE file named klein.py
 
@Ginger similar to IDLE. IDLE uses multiple files, and destroying the center is enough
besides it could also have been __init__.py, so yeah, that's true
@Ginger it will
I have that kind of a mindset
oops did the mods see already?
 
just stop trying, please
 
@Ginger trying to what?
 
be a l337 h4x0r
 
2:10 PM
^
It's unfunny af
 
Try open(__file__,'w'), not only more effective, but much shorter
 
don't give him ideas, we're trying to make him stop
 
and besides you think IDLE is everything, and I have enough experience to declare the opposite
 
are you off your rocker
 
@Ginger It's equivelent to DDOSing 127.0.0.1
 
2:13 PM
@mousetail too obvious
 
@mousetail oh, I'm stupid lmao
I rescind my previous statement, keep going
 
@Ginger no I'm not, it's that it's just too bad to be a good IDLE
 
I think this conversation has reached a point where continuing it really won't benefit anyone. If y'all want to continue "arguing" for some obscene reason, go to OTTNB.
 
fine I will
 
it wasn't benefiting anyone from the start really, but yea I have better things to do with my time
 
2:17 PM
@UndoneStudios Maybe consider don'ting
 
send it to OTTNB!
 
@Ginger do it
I mean, @lyxal
where is it?
nah forget it
 
:/
 
what
you wanna continue
I'm fine
but not here
 
just stop, please
 
2:21 PM
fine then
oh wow py3.11.1 released gtg download it
 
py 3.11 has been out for a while already
 
.1
3.11 sucks though
so I hope the bugfix is better
 
Why does it suck?
The performance improvement is great
 
Firstly help terminates with an error if you get the query wrong by accident
that truly seems bad
cuz I'll have to type it again
@mousetail I would have noticed a speedup in my answer to graffe's repdigit question then
 
It's only really noticable in optimized code
 
2:32 PM
besides there aren't a lotta improvements I could use
I could easily port my 3.10 code to 3.11 without a character change
 
Yes, that's the point of a minor version bump. You could run 3.0 code in 3.11 without a change
This site explains how it works
 
is that a license or what
 
._.
 
No it's sematic versioning
It explains how versions work
 
@mousetail still looks like a license
 
2:34 PM
In what way does it look like a licence?
Have you ever even read a licencee
 
> a licensee
 
If anything it looks like a RFC
 
am I making a license or what
@mousetail Really Flippin' Cool?
 
RFC
You really need to improve your search engine skills
 
besides if I make a license I would make it a little more fun to read
 
2:36 PM
Why are you even discussion licenses? It has nothing to do with the topic
 
@mousetail what topic?
the 3.11 sucks thingy?
Why does Adobe Reader DC require a subscription just to turn a PDF?
 
2:57 PM
hiya
here to ask a question
what does "exactly n runs of ones in binary" mean?
 
001110 has one run, while 11100001110 has 2
 
like consecutive groups of ones?
 
Yes
 
so 11110011 has 2
right?
oh it does
my bad
can someone fix my IDLE I just updated, for something doesn't seem right:
 
3:22 PM
what is wrong?
 
Hello, World! is being printed in the beginning
idk why
 
why does it prints hello world there
do you have some script or something
how are you running it?
 
 
1 hour later…
4:40 PM
Yo @Steffan do ya have a hint for dividisors python? I've been looking at it for at least 3 hours now, stuck at 62
 
what's a dividisor
 
Whoops lmao
 
a dividisor is the opposite of a multiplipier
 
lol
 
5:00 PM
@DialFrost It took me a while to find it too
Let's say you're looking for divisors of 50. Is 50 divisible by 51? No. It doesn't hurt to check, does it?
 
@pxeger ah yeah that was what it was called. yes I do know about that but under the hood it is still hacky :P (IIRC)
 
yeah it does exactly what you describe (but in C so it's faster)
 
ah
AI both impresses and scares me sometimes (and ik this isn't even close to the extent of what it's able to do)
 
@Steffan huh wait
I dont get it XD
 
5:18 PM
guys i need to award this bounty in a day but i got no answers yet
ill drop the 2 score requirement for yall
 
5:59 PM
0
Q: Rolling a 1x1x2 block

AlephSquirrelRolling a 1x1x2 block This challenge is inspired by the game Bloxorz. Like that game, there is a 1x1x2 block, which may be moved on a square grid in any of the four cardinal directions. It moves by rotating 90 degrees about one of its edges which is touching the ground. Initially, the block is st...

 
6:13 PM
@DialFrost Instead of using a range from 1 to i, you might as well use any number that is guaranteed to be >= i
 
@PyGamer0 that’s why I asked
@Seggan I’m stumped at golfing my answer
 
6:30 PM
@Seggan are you truly @Steffan’s alt?
 
we are one
 
@Steffan huh?
Me no understand
Why would u wanna go past i
I mean u can, but it doesnt save any bytes
 
6:57 PM
Yeah it does
You can reuse the range
 
7:14 PM
@Steffan huh?
Oh
Got it tysm
 
What are you doing up at this time
According to google, it's past 3am singapore time
 
Hint: I'm not in Singapore
 
sus
 
8:00 PM
süs
 
8:12 PM
@mousetail I think it's fairly common, actually
I've seen Vivaldi and a few other sites do it
 
8:29 PM
neat, vivaldi has a download option for ARM linux
 
 
2 hours later…
10:01 PM
@mathcat how is that sus
I'm in Omaha now
 
10:22 PM
visit or move?
oh cool, you're exact same timezone as me
GMT-6
I need to catch up on AOC, i haven't done the last few days lol
 
10:55 PM
0
Q: CGAC2022 Day 10: Help Santa sort presents!

mathcatPart of Code Golf Advent Calendar 2022 event. See the linked meta post for details. Santa likes to sort his presents in a special way. He keeps "uninterleaving" the pile of presents into smaller sub-piles until each sub-pile is either full of toys or full of coal. Your job is to, given a pile of...

 
Fun fact: You can use vim-style h/j/k/l keys to navigate google classroom attachments
 
11:14 PM
@Steffan visit
I going SF, omaha, Arizona and a couple others
LA too I think
 
Driving or flying?
Lots of distance between those places
 
@RadvylfPrograms Both
Either I mean
Telluride too
 
You going skiing?
 
I doubt there's much snow there right now
Oh huh, there was some snow recently apparently, and some of the skiing seems to be available: onthesnow.com/colorado/telluride/skireport
Guess the altitude makes a bigger difference than I thought, given that it's been like 30° all week here in Texas
 
@RadvylfPrograms I absolutely hate it when a website has a handy feature but they don't actually tell you they have it or document how it works
Like, okay, I've enabled keyboard shortcuts, now what? Do I just mash my keyboard until I find a new shortcut?
Why doesn't the search bar say that it has more advanced features and how do I use them?
They're supposed to be features, not easter eggs
 
11:29 PM
@RadvylfPrograms It's been snowing in a lot of resorts for weeks now :P
Not sure when opening day at Telluride is, but I think it's first week of December
 
Yeah, guess I'm just used to weather here where it doesn't even feel cool for more than a few days at a time until January
 
@cairdcoinheringaahing Nope, Thanksgiving apparently
@RadvylfPrograms We've been able to see our breath here for around a week now, I love it :P
 
I can't wait for college, both of the places I'm considering are way up northeast so I don't have to deal with 80° Christmases and stuff
 
Mind if I ask where you're considering?
 
Carnegie-Mellon and MIT
 
11:36 PM
Yo I’m going Tahoe for snowboarding :D
 
I'm really not sure which I'd rather go to honestly. Carnegie-Mellon accepts way more AP tests, so I could skip like a whole year of classes, but MIT's...MIT :p
And it'd cost half as much which is a big advantage
 

« first day (4332 days earlier)      last day (503 days later) »