« first day (4102 days earlier)      last day (758 days later) » 

12:06 AM
National Honors Society
Just another useless thing to put on your college application to look good
@NewPosts Weird, why is the meta question tagged completed?
 
 
1 hour later…
1:35 AM
Sup guys
 
2:27 AM
@user ¯\_(ツ)_/¯ posts are put into the CM notification board, so they'll see that it isn't any more
 
3:06 AM
I saw a fun looking math problem in a youtube thumbnail and spent 45 minutes doing it :|
But I now know the areas of the individual parts of the deathly hallows symbol :p
 
 
2 hours later…
4:37 AM
Me listening to the same song 5 days in a row on repeat
 
 
4 hours later…
8:22 AM
@RadvylfPrograms waaaait
link pls
harry potter + maths = heaven
 
8:38 AM
@mathcat ∴ heaven - maths = harry potter
∴ heaven consists of harry potter!
 
hmm right
 
 
4 hours later…
12:59 PM
CMQ: What's harder? Finding bugs or killing bugs?
 
The former
 
finding bugs
 
^
killing them is quite easy, i just smash them with a newspaper
 
uff
 
@PyGamer0 Never works for me :(
 
1:14 PM
> did you mean: woof!
 
nope, because they are a cat
 
godbolt.org is very cool
 
meow
 
1:56 PM
I plan to get 10k rep by end of june on ELL
Prob over ambitious tho
And assuming that i dont lose interest
 
2:06 PM
You haven't posted in a month...
that's quite sad
We enjoyed your challenges
 
2:19 PM
@mathcat definitely finding.
 
Y'all have bad eyesight.
 
Once found, it's just a matter of redirecting all other processes towards the complete and utter destruction of the bug
We are talking about physical bugs right?
Because if we are then I just want to make it known that bugs are about 2nd on the list of animal species I extremely dislike
 
"bug" is not a single species
 
That doesn't matter.
Every species of bug is #2 on my list of disliked animals
 
There are about 80000 Hemiptera
What's #1 then?
 
2:22 PM
Birds.
Can't stand the little punks.
Standing there arrogantly, mocking you and reminding you of the terrible things they do like poop on car, steal chip and make excessively loud noise
Jan 5 at 12:52, by lyxal
I swear birds have gotten away with corrupting the justice system - they get away with things like property damage, aggravated assault, theft, jaywalking and being a public nuisance yet they never get arrested nor do they get sentenced/fined in court.
 
Yet birds get all the bread.
 
Hello all!
Is there an easy to read description of how to solve sudoku quickly in code?
 
2:42 PM
so like not a video?
 
A video would be fine if that exists
 
hmm
 
I think techwithtim made a sudoku solver video
 
Cool
 
2:50 PM
@ophact for a moment I thought your chat bio said "JavaScript's chocolate" and I got really confused why you were claiming to be browser-executed cocoa
 
@mathcat thanks
 
@lyxal To be fair, JavaScript is scripting coffee, so JavaScript chocolate = cocoa coffee which isn't too weird
 
@mathcat "9^81 is a massive number that is probably in the trillions".....hmmm :)
 
mathcat fails at math again?
or rather sends links to wrong math
 
2:55 PM
wait wat
 
9^81 is over 10^65 trillions
 
techwithtim? more like techwithmathsfailure
 
@mathcat :)
 
@mathcat Add it to your list of math failures in your profile
 
@ophact yep :)
 
2:57 PM
ah nice idea
 
Much larger than the number of particles in the universe
 
that's also wrong because there are at least 10^87 atoms (which are composed of several particles) in the observable universe
so definitely there are more than 10^87
particles
 
About 10^80 according to newscientist.com/lastword/….
So a little fewer than that you are right
 
Oh looks like I'm wrong then
but there are still more than 9^81 particles in the unvierse.
 
@ophact yes
Just not that many more
 
3:15 PM
@graffe Here's a blog post about solving a miracle sudoku using Z3. You should be able to use it for normal sudokus too
There's quite a few articles about constraint satisfaction online if you're interested in that
Very cool topic
Also, Algorithm X looks cool (and not just because it's named X)
 
@user I think Z3 is kinda overkill for sudoku lol
 
@user oh cool thanks
@user I am!
@pxeger ortools might be faster. I tried its cp-sat recently and it seemed faster than z3
 
It will surely depend on the problem
 
@pxeger I am not sure. cp-sat is multithreaded where Z3 isn't to start with
There is a competition called minizinc that ortools seems to win
I wonder what happens if you make the sudoku puzzle really large
 
3:41 PM
@pxeger I mean yeah, but doing a sudoku solver first isn't a bad way to learn about Z3 before using it for things that it isn't overkill for
@graffe Oh, interesting, I'd never heard of cp-sat before
Should try it
 
@user it seems very impressive but if you do try it please let me know. I am just learning how to use it
 
@graffe It'll depend on how the multithreading is implemented and your computer but I assume both of those are good
@graffe I'll be sure to do that
 
@user thanks
 
I'm just starting to get into constraint satisfaction despite wanting to for like two years now
 
@user I think ortools actually tries different heuristics in different threads where Z3 is just single threaded
@user cool
 
3:44 PM
Oh interesting
So it's trying entirely different solvers in those threads instead of just different paths or whatever?
 
If they use SAT solvers they don't seem to use multithreaded ones
@user yes
 
How long has this been a thing?
 
It's quite sobering to try maximum matching or maximum clique in these tools.
What you learn is that a smart algorithm is still infinitely better
 
3:57 PM
CMQ: How easily distinguishable (at small sizes) are the following characters for you? aȧä
 
@pxeger its been there for as long as I can remember
 
Huh
 
4:54 PM
is there any Python module that has Algorithm X implemented?
 
5:09 PM
@pxeger Pretty distinguishable
 
I need to fill in time sheets for work. This just means a table with start time and end time for each day I worked. What's the easiest way to make a document with a table I can fill using code?
 
plain text?
csv?
 
@pxeger distinguishable, as long as you dont get something like àá involved
 
You could maybe use Google Apps Script with Google Sheets, not that painful, but CSV is probably best ^^
 
5:30 PM
in an attempt to help keep this chat on topic: heres a problem related to a current code golf I'm working on that I would appreciate insight on: is there a good way to compress a really long dict in python, knowing that the dict does contain a limited number of characters if stringified (basically just {}()",0-9A-Z)
 
You mean you want to serialize something like {"foo": 1}?
May I ask what the parentheses are for?
 
do you know much about the keys? if the keys share a lot of prefixes you might be able to encode it into a trie, though in general i highly dount that'll be a save
 
What's the challenge btw?
Maybe there's a better strategy than hardcoding the dict? (I assume you're hardcoding a dictionary)
 
so my keys are all the ASCII letters in either uppercase or lowercase, and the values are tuples of tuples
 
Oh
 
5:38 PM
{"A":((3,),(),1,()),"B":((1,3),(),1,()),"C":((2,),(),1,()),
  "D":((2,),(),1,(1,)),"E":((),(5,7),0,()),"F":((),(5,),0,()),
  "G":((),(1,9),0,()),"H":((1,3),(),1,(0,2)),"I":((),(1,),0,()),
  "J":((3,),(1,),0,()),"K":((),(4,9),1,(8,)),"L":((2,),(1,),0,()),
  "M":((),(0,2),0,()),"N":((),(1,),1,()),"O":((),(),0,()),
  "P":((1,),(1,),0,()),"Q":((2,),(),0,()),
  "R":((1,),(1,9),0,()),"S":((1,3),(),0,()),"T":((),(4,6),0,()),
  "U":((1,),(),1,()),"V":((1,),(1,6),1,()),
  "W":((0,2),(1,6),1,()),"X":((),(1,6),1,()),
this is what the full dict looks like
 
Perhaps you can use a list instead of a dict?
And then tuples like (3,) can become [3]?
And to get the letters you can just do chr
 
I am doing that in the actual version, I copied this out of an older, less golfed version thats actually formatted
My main thought is finding a better way to store the values, and then iterating over "ABCDEFGHIJKLMNOPQRSTUVWXYZ" to construct the dict
 
Oh ok
 
although that too might be hard
 
Is chr not golfy enough?
 
5:40 PM
that might work honestly
like chr(i) for i in range(blah blah blah) where blah blah blah is the right range to get all uppercase ascii chars
 
I was thinking enumerate
 
I already have two uses of range in this program so that would let me golf that down to r and save some bytes
 
Ah
I like that Python just lets you do r=range
 
hmmm enumerate isnt actually a bad idea though, I had forgotten that function
python lets you do a lot of very stupid stuff
 
I mean, it's good for golfing
 
5:43 PM
it certainly is
python conditionals are ridiculous
 
Much better than doing int r(int x){return range(x);}
lol yeah
But they're also kinda useful irl sometimes
Sometimes
 
you should actually take a look at the answer im golfing, theres a good show of some python ridiculousness in it
 
Looking at it rn
Love the abuse
 
yep
I think im using over half the possible 1-byte variable names in this
 
Btw, you use 60 multiple times. Perhaps you could use a variable for that too, defined with a walrus?
 
5:47 PM
I'm pretty sure I calculated that that wouldnt save any bytes
 
Aww
 
IIRC I need to use a 2 digit int 5 times to save a byte walrusing it, and I only use 60 4 times
 
I think you'd only need to use it 4 times to save a byte
a:= adds 3 bytes and would take away a byte every time you use the number
 
but you dont take away a byte on the first use
 
Yeah
So you'd need to use it 4 times
 
5:49 PM
use 1 becomes a:=60 so the others can become a
 
Wait nvm using it 4 times doesn't add bytes but it doesn't save either
 
4 times is the break-even point, because you add 3 bytes on the first use, and save 1 on each of the other 3
yep
so I could do it purely to make my code more unreadable, but that doesnt quite feel necessary
 
Yeah it's pretty unreadable already
 
I so wished I could have used the tuple fake ternary thing for the conditionals on the long line, but unfortunately I need shortcircuiting
one of the big problems with python golfing is no short ternary operator
 
Accurate description of Vyxalers
 
5:52 PM
unless..... I can do some horrible bullshit involving strings and exec
hold on
I'm about to commit python sins
 
Oh dear
You've committed enough already
You can use a walrus for range(n%6) btw
Saves only 1 byte
Actually, I think that whole line could be turned into for i in range(a:=n%6):z=lambda r:(x+r*sin(a:=2*pi*i/a),x+r*cos(a));l(s,A,z(8+n//6*8),z(x))
 
my eval sins worked but were a good 10 bytes longer :(
@user oh good one!
UnboundLocalError: local variable 'a' referenced before assignment
 
Yeah just use b:=n%6 or something
And then use b in 2*pi*i/a
I just chose the first letter that came to mind
 
oh duh youre using two as
just gotta figure out which letters i can use here
hmmm somehow the output is upside-down now, time to poke into your math and see whats wrong
there we go, messed up sign
 
6:36 PM
@mathcat I didn't watch it, so no link
 
6:57 PM
0
Q: The Binary Eyes

LWS SWLA binary eye is a odd set of digits, with all of its digits except the center one set to 1 or 0, and the center one set to the opposite of the others. Thus, there are two binary eyes for a given odd number of digits: | x | eyes | | - | ---- | | 1 | 1,0| | 3 | 101,010 | | 5 | 11011,00100 | | 7 |...

 
7:33 PM
Is there a simple way to use the python base64 module to encode a really large int as a base64 or base85 string? I feel like that should be possible but I cant figure out exactly how
 
I think you'd be better off writing your own encoder
 
ugh thats not useful for the golfing problem im trying to solve
 
I thin​k you'd be better off writing your own encoder
Actually, I forgot about the int.to_bytes method
although it requires an explicit length
 
oh perfect that should do the trick
now to figure out how many bytes i need
 
len(bin(x)[2:])//8 is one way
If you don't mind extra leading zeroes, you can use the "safe" upper bound of n itself (but which doesn't work for n=0)
 
7:54 PM
I ended up using half the length of the int in hexadecimal, which im pretty sure also works out right
I'm pretty sure this is the biggest abuse of python I've ever committed, and its probably not even as golfy as I'd like
T='1234567890(),'
D=lambda a,b:D(*divmod(a,13))+T[b] if a!=0 else T[b]
dict(zip(map(chr,range(65,91)),eval(D(*divmod(int.from_bytes(b85decode('1I4$AG^!ES_HeL)X2~Of79ExFC_6^uiLRYztX@6>+bEgKbEh;RB2T(R(*^>bw&yaOg|zb~s(~0+qW$y9Cvwq_q%!U+?tz=a|MWT);M~>WocxX3`Zi7N`JF4+wk4ezU3OB@oJNMRx3Z5;BKgQ=wVM9_=MoZDs#bA6B$9uY-A8GxL6Nh<@~b+p?Da}XU;dXf@;-=xOuB?6K=iUECy1017gR?QfD*skwpiNRCC8mE@E^}3n2ZX@oDBH'),"big"),13)))))
 
What question is this for?
 
wait no this is 61 characters shorter than the dict I'm using in that right now
abuse of python: complete
 
@des54321 D=lambda a,b:(a*"1"and D(*divmod(a,13)))+T[b]
 
oh good one
hold on I think if I re-arrange T and recalculate the big b85 string I can golf more off by not needing the divmod call in the args of D
 
I think you can probably get rid of dict(zip(map(chr,range(65,91)) if you convert from letters to alphabet integers in the lookup instead of while constructing the dict
 
8:00 PM
oh good idea
i think this is what qualifies as pornographic code
 
lol
The lookups in the arguments to L can be simplified to the following, by using a separate lookup for each argument instead of several tuples:
[[3],(1,3),[2],[2],I,I,I,(1,3),I,[3],I,[2],I,I,I,[2],[2],[1],(1,3),I,[1],[1],(1,3),I,I,I][p:=ord(t[i])-65],[I,I,I,I,(5,7),[5],(1,9),I,[1],[1],(4,9),[1],(0,2),[1],I,[1],I,(1,9),I,(4,6),I,(1,6),(1,6),(1,6),(1,9),[6]][p],[1,1,1,1,0,0,0,1,0,0,1,0,0,1,0,0,0,0,0,0,1,1,-1,1,1,1][p],{3:[1],7:(0,2),10:[8]}.get(p,I)
There's got to be a shorter way to do the [1,1,1,1,0,0,0,1,0,0,1,0,0,1,0,0,0,0,0,0,1,1,-1,1,1,1] bit
Also, ...,I=...,() can be changed to ...,*I=...
 
wow thank you for all of this, its gonna take me a sec to figure out how all of this works together in the actual code
im still working on getting the whole b85 translation working
 
That assignment line can be shortened to A,c,l,S,d,T,U,W,Y,*I="red",draw.circle,draw.line,Surface,display,(w:=16,4),(x:=32,0),(v:=48,60),(y:=64,y);V=w,60;Z=x,y;X=x,x - you can remove some of the parentheses by using more than one =
 
@pxeger well thats gonna be made irrelevant by my terrifying base85 nonsense, because I is only used to golf down all the literal ()s in the hardcoded dict
 
 
1 hour later…
9:18 PM
0
A: Sandbox for Proposed Challenges

ShibRotate a point code-golf Rotate a point on the coordinate plane. The formula for rotation(about the origin) is: $$(x,y)\mapsto(x',y')=(x\cos\theta-y\sin\theta,x\sin\theta+y\cos\theta)\,$$, where θ(I can't do inline math) is the angle, (x, y) is the starting point, and (x',y') is the rotated point...

 

« first day (4102 days earlier)      last day (758 days later) »