« first day (3627 days earlier)      last day (1512 days later) » 

00:08
@NewMainPosts Hey look, the answering closed questions bug happened again :P
 
3 hours later…
03:03
@cairdcoinheringaahing This isn't a bug, it always takes six people to delete via a review.
03:15
I personally think that answering a question you've VTC'd is generally not good, not necessarily because it's like a special case of bad practice but more so because there's usually no good reason you should do that.
5
as in, if you've voted a question closed, then that question has something about it that makes answering it a bad idea.
04:01
I'm going to write a program to find the odds of getting a Yahtzee (all five dice the same) assuming optimal play (after each of the first two rolls, keep the dice that appear most often). I estimate there are only about 2 billion possibilities that need to be searched.
I'm thinking it'll be around 1 in 250, any other guesses?
04:32
i'm not exactly sure what yahtzee actually is so i can't give a guess :p
brb looking up how to play
@HyperNeutrino hth have you never played Yahtzee?
Like seriously how?
i've maybe heard people mention it like twice? and maybe once was irl, if at all
It's that game where you roll 5 dice and try and make the best roll out of 3 rolls
looked it up on wiki and it is confuse
Each turn, people get 3 rolls
Each roll, the player can keep as many of the dice they want
and roll the rest
At the end of the three turns, whatever dice roll they have is scored
E.g. Roll 1: 4 2 5 5 1 (I want to keep the third and fourth dice)
Roll 2: 3 5 [5] [5] 2 (The brackets indicate dice i didn't roll. I want to keep the second die as well now)
Roll 3 (Final Roll): 5 [5] [5] [5] 5
Because I have 5 of a kind, I say I got a Yahtzee
04:38
oh, okay i see
video poker but with dice
how are there 2B possibilities
i count ~10M. but i could just be misunderstandin gthe whole thing
3 rolls, you can roll 5, 4, 3, 2 or 1 dice
.
i did misunderstand the whole thing
You can have 1 roll, 2 rolls or 3 rolls
And you can unkeep a die and roll it in the next roll
04:40
oh huh, okay
I'm about 40% done with testing all possibilities
By hand, of course :p
I think there are a lot more than 2 billion possibilities, but I'm only counting the optimal ones
It seems I messed up the implementation...it's giving me 1 in 54000
Oh, I think I found the mistake. I'll see if I can make some optimizations, it's pretty slow at the moment.
05:06
so what is the strategy?
roll 5, take any mode and keep all copies of it, reroll all others, keep any mode and reroll all others again?
Exactly
Of course, that's only optimal for getting Yahtzee, not necessarily for winning the game :p
Also I just realized I could have used some statistics to make this process at least ten times faster
huh
i think the number of probabilities is not that large then
the first roll only has 5 possibilities
(not evenly weighted)
Yeah, that's what I realized
lol
i could try this but i'd probably mess it up
I'm 90% done with the brute force, so I might as well keep using that
1 in 193
0.5719%
That means any player can expect a Yahtzee about once every 15 games, and getting two Yahtzees in one game will happen to a player about every 500 games
05:23
how many rounds are there in a game
I love how the scoring sheet has space for up to 4 Yahtzees when the chance of that happening is around one in two million lol
well if it's a popular game (which it must be if it's weird that i've never played it) then that's gotta have happened :P
@HyperNeutrino I feel like dice games like this one are really popular in some circles and not at all in others
05:28
Better than someone in your family being struck by lightning I guess, which is about equally as probable
@RedwolfPrograms this suddenly got dark
It's a pretty common comparison :p
like, I've definitely heard of Yahtzee, but never played it and half of my friends have probably never played it
People who are on codidact, bit of help needed here: codegolf.codidact.com/posts/280242
@Razetime guess who just made an account like 10 minutes ago 😎
05:30
My family doesn't like strategy games so I end up playing a lot of dice/card games. The most strategic game I can get them to play is catan
i rarely play board/card games with my family and never dice games
@UnrelatedString Yes I saw your answer 😎
@RedwolfPrograms i would say that's a shame but you mentioned that they do play catan so that's still a win
Speaking of catan I absolutely suck at catan
So when I play, I tend to be the resource guy for another person
05:33
I'm working on a KoTH based around it
"Settlers of KoTHan", maybe
I always end up losing, so I like to add a bit of fun to my loss
it's been like two years since the last time i played catan with my friends but "sheep for sheep" is going strong as an in-joke
@UnrelatedString "wheat for wheat" is ours
Ours here being the board game club at my old school
I usually just made OP trades with the teacher
05:35
My school's clubs are all super boring
I was pretty good at King of Tokyo though
@RedwolfPrograms 4.60%
Where'd you get that number?
Wikipedia
> On average one will succeed 4.60% of the time
Interesting, I guess I trust the sum of all human knowledge more than my 20 line brute force program lol
@RedwolfPrograms the only club i remember from my school was the programming club that i cofounded with people i played league of legends with where we nominally prepared for a competition but really we just ate lunch in a closet while shitposting on a miniature whiteboard and then did well anyways because 80% of the teams were using java and had barely even learned it
05:48
@HyperNeutrino have you ever been in a psychedelic rock band?
Asking because I'm trynna trick Akinator
I'm going to say "don't know" because you probably wont answer for a while
uh...
no... lol...
there's a slight difference between redwolf and wikipedia's strategies
@HyperNeutrino Are you often depressed?
Do you hate traffic?
if you roll 2-2-1 redwolf will discard 3 and wiki only discards 1; if you roll 2-3 wiki just stops?
that doesn't sound right...
@Lyxal yes
not sure anyone particularly likes it :p
05:54
Do you have 10k+ tiktok followers?
What is your mother's maiden name, the name of your first pet, and the street name you lived in as a child?
i do not have a tiktok account, so unless something particularly strange has happened, i think i don't have 10k+ followers
Do you have an afro?
(Q68)
these are some peculiar questions
no i do not
05:58
I sense a bluff
my experimental simulation is getting ~1.3% success
hm. i'm probably doing something wrong
Hehe I won
i mean
i'm not exactly famous
It asked for a description and I wrote Code Golf Moderator
i'm pretty much only known by cgcc people and some irl ppl probably
at least, by "HyperNeutrino"
my real name may be more well known but even then i doubt that
06:02
Hehe I won again
If anyone wants to compare, here's my brute forcing program. Sorry for the one letter variable names, I liked the color palette
It didn't know I was guessing me
this was how i tried to experimentally determine it
@RedwolfPrograms apologises for having 4 one letter variables and many other longer/descriptive variables
seems wrong though... perhaps i am bad
06:03
I'm gonna try dennis brb
:o dennis
if akinator doesnt know dennis then its a trash game
> Is your character a porn actor?
@Razetime :thonk:
wtf akinator
06:04
I got is your character obsessed with white breasts, which is sort of worse I guess
@RedwolfPrograms wth is the coloured specified?!
there is a child mode fyi xd
> The incognito guy
> A smart guy who always answers "Don't know"
@Razetime so you answered yes I presume?
\s
06:06
lmao
No, it all makes sense!
i tried and got linus .-.
(tried for dennis)
From LTT or Charlie Brown?
ltt
forgot more than 1 reasonably well known linus existed lol
It got steamed hams
06:09
dennis is now on akinator woo
poggers
gotta love how it asks me if my char is from the backyardigans after clearly answering that my character was real on Q2
Dah it got diamond sword from minecraft
what are you trying to get it to guess lmao
I stopped trying to get it to guess things because there's like six ads on that site.
adblock
06:36
@HyperNeutrino objects
it got both objects right
@RedwolfPrograms i probably would have thought of torvalds before tech tips lol
07:07
actually wait it was torvalds not ltt i was distracted when i answered you
lmao
How was there not already a Canvas FB posted?
Also, 2.75% of all FizzBuzz catalogue answers are mine lel
08:06
@ngn could you say something about your latest update please?
 
1 hour later…
09:10
In the olden days there used to be lovely Haskell answers to fastest-code questions. No Haskell experts here any more?
 
2 hours later…
11:35
1
Q: Golfing Advent of Code 2020, Day 3

double-beepI thought it'd be interesting to turn AoC day 3 puzzle into a Golfing Challenge, so here it is. Task Find the number of # you'd encounter in an 11x11 grid (consisting of # and .) that repeats itself (to the right side), starting at the top left corner, which is always a .. You will need to check ...

@Lyxal so is TNB's inside joke "wheat wizard for wheat wizard"?
@Lyxal ok nerd
how many is that even btw
12:42
0
A: Sandbox for Proposed Challenges

NeilIsosceles triangle truncations Most triangles are not isosceles. Here is an example: A ____ C | / E| / | /D |/ B However, we can cut this triangle into two smaller triangles, one of which is isosceles. We can do this in a number of ways: By cutting from C to E, we create isosceles triangl...

12:54
0
Q: Sql query to list in java

HellipI would like to pass a query in sql to a java list, I am working on this code: public List<Foro> getForo () throws SQLException { List<Foro> foro = new ArrayList<Foro>(); Statement stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery("SELECT foros.id, foros....

@Anush You need to wait a while, or make a better question
ngn
ngn
13:07
@fomin it's an improvement on my initial version: make edits at positions i and j only for i<j
14:07
@ngb There is also assembly!
14:39
Let's define how "controversial" a challenge (with net score ≥ 5) is by how close the ratio of upvotes : downvotes is to 2 (i.e. it has upvotes, so it's probably not a bad challenge, but it also has a substantial downvote count). What's your most controversial challenge?
My first question has that exact ratio, but then you added the >= 5 requirement right as I typed this lol
I've got a 1.83, for my extremely broken card game KoTH
Yeah, I was thinking that +2/-1 would be a "perfect" controversial challenge, but it's needs to be somewhat popular to be controversial :P
That's why I think min(upvotes * 2, downvotes) ** 2 / max(upvotes * 2, downvotes) would be a better formula
That's slightly harder to calculate in one's head :P
An SEDE query using that might work tho
I found a SEDE query, modified it slightly and e.g. codegolf.stackexchange.com/questions/201537/… is infinitely controversial
14:44
I'm surprised that's from so recently ago
Seems like that'd be a challenge from 2014 or something
 
2 hours later…
17:05
bah, I had to go to the details of the "happy new year" hat to see that it only applies if your message gets starred... sigh...
@ngn I see you updated your C and now it has ASM in it as well :O
ngn
ngn
@rak1507 it's just a couple of lines to get rid of stdlib's overhead
@Neil I think last year you just had to chat, no starring involved, and Social Distancing has definitely been the "easy" hat this year
@ngn Aah! My program's competitive advantage is shrinking!
Ah, is it still slower than the C++? @ngn
ngn
ngn
17:12
@rak1507 yes, still slower, but i have one other idea i'd like to try, so stay tuned
Exciting!
I wonder if it's the same idea I have but do not want to implement, but if I ask about it ngn might implement it and win.
lol
MD5 hash it in some agreed format
I thought about that, but it's very difficult to agree on a format for ideas :)
Yeah :(
17:28
@wizzwizz4 how is your code going?
@thedefault. "Both write the shortest APL code that outputs the idea, then MD5 hash it"
haha
17:57
@Anush I've written the hard parts; now I just have to add the output generation.
So far I have “insert” and “insert insert”.
Hang on – within a Hamming distance of S includes distance 0 as well!
So we need to output the original string.
Glad I didn't miss that! It would've been embarrassing.
ngn
ngn
18:23
@thedefault. i'm not afraid of revealing mine: write 3 functions that generate all edits (deletes, changes, inserts) for a given string using gather-scatter indexing
i think i can end up at least within a factor of 2 from your solution and thus save face :)
My solution is embarrassingly parallel, but I'm not clever enough to actually make it parallel.
Once I finish it, somebody else is going to factor-of-ten it.
ngn
ngn
18:43
@wizzwizz4 there isn't much time - 22h left
19:14
What is gather scatter indexing?
Oh I see
ngn
ngn
@Anush for(int i=0;i<n;i++)a[i]=b[c[i]]; and for(int i=0;i<n;i++)a[b[i]]=c[i];. simd instructions can do this amazingly fast
19:44
It's frustrating when I know more than the compiler about my program.
Because I know a lot less than the compiler about the processor.
If I could just tell the compiler what I mean, so it could access the knowledge of the CPU geniuses that wrote it…
Have you tried the new #i_want_to_do_this_thing_just_english_is_fine_i_am_tired_of_c_thanks
@RedwolfPrograms I did.
But it turned out that English was not fine.
It took three weeks to compile, then produced a program that did something that wasn't actually what I was after.
If not for -Wno-oxford-comma I would've gone spare.
@ngn very nice speed ups!
@ngn if you add -Wall -Wextra it says you have unused variables
`#define M1(x) #x
#define M2(x) M1(x)`
What's the purpose of this?
> If you want to stringize the result of expansion of a macro argument, you have to use two levels of macros.
19:57
@thedefault. the real magic for your code is the 0.00 sys time that time reports
how did you do that?
Ah thanks
@rak1507 I've still got that section of the GCC manual memorised, even though I haven't done C for years, because I had to go back to it so many times.
@ngn thedefault's code takes basically the same amount of user time but his takes 0 sys time, somehow
@fomin Buffering, then sending it all at once, means the kernel can just go “oh, this is for /dev/null; I won't bother”.
@wizzwizz4 interesting
19:59
You still have the cost of filling the buffer, though.
@wizzwizz4 how close are you now?
@fomin Here's the list of stuff I've thought of implementing:
///////////
// No-op ////
//   No-op
// Insert  ////////
//   Prepend
//   Insert
//   Append
// Insert insert //
//   Prepend prepend
//   Prepend insert
//   Prepend append
//   Insert insert
//   Insert append
//   Append append
// Insert delete (also includes Substitute)
//   Prepend predel
//   Prepend delete
//   Prepend appdel
//   Insert predel
//   Insert delete
//     Insert delete
//     Substitute
//     Delete insert
//   Insert appdel
//   Append predel
//   Append delete
//   Append appdel
I've got as far as “Delete insert”.
There's still regular “delete” missing after that, and all the combinations involving substitute (other than “single substitute”).
But that's not too much to do!
that looks like good progress!
If it were Hamming distance 3, I'd've given up by now.
you mean edit distance I hope!
20:06
Yeah, Levenshtein.
phew :)
:)
The way I'm doing it, I basically need to special-case operations at the beginning and the end.
Which is slightly faster for the computer!
what is appdel ?
The deletion equivalent of “append”; delete the end of the string.
I couldn't be bothered to look up the actual name for that.
ah ok
20:08
Truncate?
yes that sounds right. right truncate and left truncate maybe
@wizzwizz4 for edit distance 3 I would have to make the alphabet smaller as the output gets too large
@fomin Just > /dev/null.
@wizzwizz4 i guess it's ok if people don't store it in RAM
they would have to avoid doing that
It would be a different problem.
@wizzwizz4 yes
I am slightly surprised no one has just copied thedefault's code into their favorite language
20:13
I kind of am, in the sense that I'm using a similar technique.
cool
Except I'm doing it all in one go.
So it's not really the same thing.
I might switch to thedefault's method if my fingers fall off.
what do you mean you are doing it all in one go?
Unless I'm misunderstanding thedefault's code, there're pre-caching stages.
I am; that's a really elegant method.
oh maybe i didn't understand it
I only know C so anything C++'ish I have ignored
20:15
No, I'm the one who didn't.
I don't know C++ either. :-p
:)
Though I do know it well enough to know I wouldn't like it, except in the “write incomprehensible code” sense; it's a very nice language for obfuscation.
C++ scares me. I don't want to know about templates
Templates are fun!
Ever wanted to allocate memory in the compiler's VM?
Well now you can.
Rust macros are just normal Rust code that gets an AST and plops out an AST.
20:19
@JohnDvorak Procedural macros, yes.
macro_rules is a different kettle of fish.
It is a whole new language stapled to Rust, for the sole purpose of manipulating AST in a not-quite-Turing-complete way, and they're planning to replace it.
I just want to write English and have the computer understand what I meant :)
@fomin Learn Lojban.
:)
20:24
@fomin Probably not a good idea, as English is quite ambiguous and context dependent. E.g. what is "twice three plus one"?
@Adám I'd read that as 8
@cairdcoinheringaahing how about "three added to one twice"?
This. Statement. Is. False.
Don'tthinkaboutit Don'tthinkaboutit Don'tthinkaboutit Don'tthinkaboutit
@Adám That's 7.
Depends on your stress emphasis.
Ooh! Write English in IPA; that's (nearly) unambiguous.
20:27
I'd loathe to program in a language where I had to spell out emphasis.
Isn't that what ()s are for
@Adám Then just dictate.
@wizzwizz4 No, actual standard IPA isn't very precise when it comes to tone for English, though there are markers one can add that make it a nightmare to type.
ngn
ngn
@fomin as someone once put it: the best thing about computers is that they do exactly what you tell them to. the worst thing about computers is that they do exactly what you tell them to.
nightmare to type you say
20:28
@rak1507 When writing APL, you use an APL keyboard.
There are no IPA keyboards.
I am aware
Oh really?
I thought there would be
@wizzwizz4 C'mon there must be for linguists.
@Adám Given that you often write your APL explanations as symbol -> word "translations", that kinda surprises me
@Adám You'd think so.
The nice thing about COQ is that if your program compiles, it's definitely correct.
The ugly thing about COQ is that it's because your program definitely won't compile.
ngn
ngn
20:29
@JohnDvorak :D
@cairdcoinheringaahing The explanation is often ambiguous without context, and I indent too, which is kind of like tone.
What about
	writing all code
		a bit like this?
				sounds like a plan!
Wow.
No.
@wizzwizz4 Looks convenient.
@rak1507 You mean use Python? No way!
20:31
@rak1507 disliked that
@Adám Do chorded input methods count?
@wizzwizz4 That's almost what I use for APL.
Does IME count as a keyboard?
I guess.
Gŗéåŧ!
ngn
ngn
20:34
there was an html page with a js script for typing ipa created by a user in this chat, but i can't remember what it was called..
@ngn This and this seem to work.
      three←3 ⋄ added←+ ⋄ to←⊢ ⋄ one←1 ⋄ twice←⍣2
      three added twice to one
7
      twice←2∘× ⋄ plus←+
      twice three plus one
8
Sometimes APL shines.
ngn
ngn
May 28 '18 at 20:44, by ngn
there's an online tool to type IPA by Doorknob, very cool
^but the domain seems to have expired
@Adám all code should be written like this
Although using two different definitions of twice feels cheaty
Back in the old days, a lot of APL "applications" were actually DSLs implemented like that, and the end-users had no idea they were using an APL REPL.
20:41
@rak1507 The point of that is exactly to show that English isn't a very good language, as here "twice" is used with two entirely different meanings. Repeat something twice or double the value of something?
Hm can you not have default left operands to a dop?
How come this +{⍎'⍺⍺⍣2⊢⍵'}3 doesn't work?
@rak1507 Because the only occurrence of ⍺⍺ is in a string, so the interpreter doesn't know that you mean an operator.
You can tell it, just by adding ⋄⍺⍺ ― it won't be executed.
Right, my point was to try and circumvent it syntax erroring when I had an operator with no left argument
20:49
It wouldn't work syntactically. How would the interpreter know if -{your code with def left operand} should use - as operand or apply it to the result?
ngn
ngn
@Adám all natural languages have and can tolerate some ambiguity
@ngn and no sane programming languages can tolerate any ambiguity
2
ngn
ngn
except c and its "undefined behaviour" :)
Well, except that just means that code isn't part of the programming language that is available to you.
ngn
ngn
yeah, ok, you said "sane".. :)
20:51
@Adám I was trying to make twice behave like 2×⊢ when used like twice 4 but behave like ⍣2 when used like 1 + twice ⊢ 3
@rak1507 If you try to put those phrases into larger statements, you'll see it can't work.
ngn
ngn
@Adám it is available. one example is signed int overflows.
@Adám :(
@rak1507 Almost:
      twice←{2=⎕NC'⍺⍺':⍵ ⍵⍵⍨2×⍺⍺ ⋄ ⍺←⊢ ⋄ ⍺ ⍺⍺⍣2⊢⍵⍵ ⍵} ⋄ on←⊢ ⋄ increment←1∘+
      4 twice + 1
9
      increment twice on 3
5
21:11
@Adám I get four both times
@Neil In what base? How many 4s each time?
ngn
ngn
@Adám it's a very literal interpretation :D
Aha, I get it.
22:01
@ngn I clicked that and got sent to a page where I had 3 attempts to get $1000.
1
Q: How long till Halley's Comet returns?

DingusHalley's Comet is the only comet that may appear (i.e. become visible to the naked eye on Earth) twice in a human lifetime. The orbital period of Halley's Comet is not constant: it has varied between 75 to 79 Earth years since the first definite apparition was recorded in 240 BCE. This variabilit...

ngn
ngn
@Lyxal @wizzwizz4 sorry. i got just text - "This domain currently does not have any sponsors for you."
just text.. or so i hope

« first day (3627 days earlier)      last day (1512 days later) »