« first day (3599 days earlier)      last day (1541 days later) » 

02:12
What's the consensus for counting non boolean flags?
I have a solution that uses flags -naF-|:?\s but counting this as zero seems like cheating
03:22
@Razetime Yes. I'd honestly rather pay 1 byte/flag and compete in the 'Ruby' category rather than compete in the
"Ruby -naF-|:?\s" category
if it's more on an honor thing then you can just take a byte per flag, right?
That's what I'm wondering
Anyways, I found a better golf without the flags, so it's moot for now
03:57
@Sisyphus gamer
04:09
Here‘s a thought: occasionally, I‘ll post an answer/question which I think deserves more attention than it actually gets. With the Best of 2020 coming up, thoughts on a „Underappreciated Post“ category? If I get support, I’ll post an answer to the (future/eventual) Best Of categories post
Yes.
Maybe even two, one for questions and one for answers
@RedwolfPrograms If it’s a single category, I guess both questions and answers would be fair game
04:25
Unrelated, I made this ranking of the top 25 most used programming languages in 2020, based on a custom scoring algorithm.
04:50
AOC in 10...
6
04:57
More like 2.5
04:59
.5
YESSSSSSSSSSSSSSSSSSSSSSSSSSS
server please
Both parts have a built-in in Factor :DDDDDDDDDDDDDDDD
193
05:04
I don't know why it says I'm wrong...
138/37
which gives the global score of 64
to me
that was quick
05:05
I got 448/180
94/109. i'm down to 82 global now :(
rank 207 part 2
I counted newlines :(
because it turns out i messed up with my script that takes the input
what the hell am I doing wrong
05:07
i spent so long typing the alphabet lmoa
That would only affect your part 2 score
or, at least, I wrote part 1 without having to type the alphabet
777 part 2
best day yet
lol
forgot that most languages don't have intersection builtin
05:09
wait wot i needed alphabet in part 1 or something
im probs just dumb tbh
sets for the win
intersection hmmm
js has set but i wasnt smart enough to think of that
okay my input method is the problem
I used sets for part 1, but couldn't figure out how for part 2
as to how?
05:10
just intersection vs union right
i do not know
yeah
@UnrelatedString what does your input method do
i thought i fuckin owned star 2 because i literally just had to change a | to an & but then 1. I realized I'd have to start with something nonempty 2. ?????
For union you can reduce starting with an empty set
I don;t know why document.body.textContent.split("\n\n").map(l=>[...new Set(l)].filter(x=>l.split("\n").every(p=>p.includes(x))).length).reduce((a,b)=>a+b,0) doesn't work :(
(part 2)
05:11
i take the input already split on newlines
for intersection you need a reduce1, or need to start with the set of alphabets
and i have to manually flag the end of the input
@UnrelatedString bruh split on double newlines
and apparently it changes everything if i have a blank line between the last group and the explicit terminator
05:13
l = l.intersection(m) -> l &= m
@ASCII-only bruh it's day 6 not 7
yea i uhh
you didn't see anything
so yeah let's look at that personal stats page
Day       Time  Rank  Score       Time  Rank  Score
  6   00:02:55   197      0   00:10:19  1207      0
05:15
I had a SUPER weird error and I have no idea why it happened
i'm using a file tomorrow
Day       Time  Rank  Score       Time  Rank  Score
  6   00:02:27    94      7   00:04:39   109      0
what language
python lmao
oh him
@RedwolfPrograms explain
@UnrelatedString no, u
see be dumb like me, do it on devtools on the page itself
that's how you be fast
05:17
The last input gave me 0, when it should have been 1, and it was the only one like that...it was c\n0c
My code was document.body.textContent.split("\n\n").map(l=>[...new Set(l)].filter(x=>l.split("\n").every(p=>p.includes(x))).length).reduce((a,b)=>a+b,0)
sounds like a jsy kind of thing
I was expecting a much harder task today.. or maybe I didn't felt it in ruby?
oh no this was easy as shit
05:17
@RahulVerma we all were
      -------Part 1--------   -------Part 2--------
Day       Time  Rank  Score       Time  Rank  Score
  6   00:02:39   138      0   00:03:31    37     64
unless you're using stdin instead of a file like me
like day 4 was hard. 5 and 6, not so much
I messed up on part 1 by converting my set to an array by habit, and JS uses different .length method names for them :(
05:18
oh lol
Not even going to look at what my rank was
Day 5 was actually harder than day 4 according to the leaderboard
Lost half a minute for part 1 by forgetting imports
i really need to just like
import functools in my boilerplate
so i can just use fucking folds
5 was "harder" only because many didn't make the link between the question and binary
@UnrelatedString yea you kinda really do, that's why i have an iterator lib imported on every single webpage by default
05:19
I got 2100th on part 1, worst I've ever done by like 1700
on day 3 i started late so i got 2.4k on part 1 :(
because if i'd just foldl1'ed by union instead of doing a for loop thing the only problem would be my retarded input code and not having to initialize the accumulator
i don't even know what the function signatures are in python's functools lmao
Oops, I was accidentally looking at last year's stats, you're right than days 5 and 6 were easier than 4
One good thing about Factor is that arrays and strings accept set methods and returns the same kind of object, duplicates removed
06:00
@Bubbler oh that's nice
Oh hey @sporeball is here
@sporeball get pinged lol
you remembered!
cute
of course i did
one does not simply forget trolling other people
@Lyxal cover yourself in oil
@Razetime see that's the spirit!
CMQ: What's your favourite arity?
06:12
As in number of arguments to a function?
As in, do you prefer niladic things, monadic things, dyadic things or some other arity not listed here
@RedwolfPrograms yee
niladic
no argument
@Razetime ba dum tss
Was that pun intentional
monadic because it gets confusing when you bring haskell into the conversation
06:14
Mine is personally monadic, with triadic coming in at a close second place
@RedwolfPrograms absolutely intentional
dyadic. &self and a closure.
I mean ... lambda
Variadic, obviously
variadic functions don't work well with type checkers
(that said, I do like Ruby; that said, I never made a variadic function in it, except for using default arguments)
06:31
You can make it work in a language with dependent types
Rust has macros, but I'm yet to learn how they work
(and every function is variadic in JS)
JS is just doing it's own thing
Javascript doesn't have a compile-time type checker. It relies on RTTI.
Same with Ruby (though Ruby 3 does plan to change things).
Javascript is like a bunch of people wanted to make a programming language but they didn't share any common goals or philosophies, but they all pushed the code to the same repository and made it work somehow
06:37
Historically it's the result of two groups trying to make their own language fully compatible with the other language's code and then some.
07:00
Dang it, I just realized a trailing newline on the puzzle input is what made my program not work
07:10
Trying to golf part1 of day 6 advent of code in bash. Any suggestions to improve: awk -v RS= '{$1=$1}1' | while read x; do <<<"$x" fold -w1 | sort -u | grep -v ' ' | wc -l; done | paste -sd+ | bc?
Don't really know Bash, but there looks like a heap of whitespace worth removing; though I assume you already guessed that.
Yeah I don't care about that. I'd like a way to avoid that while read loop. Basically the cumbersomeness stems from the unix uniq tools being line-oriented.
I could probably also cram together a pure awk procedural solution that shorter than the above but that's not really in the spirit of what I'm trying to do, which is chain together simple commands to get the final result.
 
4 hours later…
11:36
@Jonah instead of calculating the sum, you can just put wc -l outside the loop. And not sure if better, but I like xargs instead of while read. Latter gives me headaches. awk -v RS= '{$1=$1}1' | xargs -I {} sh -c 'echo -n {} | fold -w1 | sort -u' | wc -l
@Jonah how about fmt -w 2500 | while read x; do <<<"$x" fold -w1 | sort -u; done | tr -d ' \n' | wc -c?
12:08
apparently you can use GNU parallel but the version on TIO doesn't take input on STDIN sadly
 
3 hours later…
14:43
22
Q: Additive Persistence

Kevin BrownThe shortest code to pass all possibilities wins. In mathematics, the persistence of a number measures how many times a certain operation must be applied to its digits until some certain fixed condition is reached. You can determine the additive persistence of a positive integer by adding the d...

 
2 hours later…
16:13
I made a 2d esolang based on conveyor belts in a factory. First answer in convey: codegolf.stackexchange.com/a/216048/95594 (with animations!)
:-) Though there is probably a more interesting challange to show off more of the language.
I'll wait a few days to start the bounty, that way you can let me know if a different answer would be a better demonstration of the language (or if this one's fine)
Looks like a pretty neat language, and the animation is really interesting
17:14
@Neil Thanks. I like using fmt instead of awk for the first step a lot.
@xash I like the xargs idea too. To make i work I had to make the following adjustment to remove the "sort of blank" lines before the wc step: awk -v RS= '{$1=$1}1' | xargs -I xx sh -c 'echo xx | fold -w1 | sort -u' | sed '/^\s*$/d' | wc -l
17:56
@RedwolfPrograms I think pascal's triangle is a good showcase for some features and showing the list handling: codegolf.stackexchange.com/a/216052/95594
18:29
@xash Bounty started
Thank you!
 
3 hours later…
22:03
0
Q: bash php golf poly

user1747036Quite new to this, I've got this small code I'd like to be able to execute in bash and php. #!/bin/bash <<a <?php $sqldb = "one"; $sqluser = "two"; $sqlpass = "three"; /* a sqldb="one" sqluser="two" sqlpass="three" return 0 */ ?> It works in bash if sourced (return), but I can't se...


« first day (3599 days earlier)      last day (1541 days later) »