« first day (2666 days earlier)      last day (2181 days later) » 

12:30 AM
@Dehodson d=>z=>document[l='querySelectorAll'](`#${d} tr`).forEach(x=>x[l]('td').forEach(y=>y.innerText!=z&&(x.style.display='none'))‌​) should work if you don't mind it not short-circuiting once a match is found
@Dehodson doesn't do exactly the same thing, but close enough: d=>z=>document[l='querySelectorAll']`#${d} tr`.forEach(x=>x[l]`td`.forEach(y=>x.hidden=y.innerText!=z))
wait, hang on :/
 
@ASCII-only: It doesn't seem to be working when I test it?
 
@Dehodson yeah i made a mistake brb
 
You're fine :) Yeah I couldn't get the tagged template literal version working
 
@Dehodson d=>z=>document[l='querySelectorAll']`#${d} tr`.forEach(x=>[...x[l]`td`].some(y=>x.hidden=y.innerText!=z))
@Dehodson that's not the problem >_> it's that the some is needed and it took me too long to realize that
 
@ASCII-only: I get
VM157:1 Uncaught DOMException: Failed to execute 'querySelectorAll' on 'Document': '#, tr' is not a valid selector.
when I use that version :c
 
12:40 AM
@Dehodson :| what did you do. how are you calling it
 
I'm calling it with f('tableId')('search string') in the chrome console
 
@Dehodson ah :| >_> i realized why it doesn't work
d=>z=>document[l='querySelectorAll'](`#${d} tr`).forEach(x=>[...x[l]`td`].some(y=>x.hidden=y.innerText!=z)) should work?
 
This version works though!
f=d=>z=>document[l='querySelectorAll'](`#${d} tr`).forEach(x=>x[l]('td').forEach(y=>x.hidden=y.innerText==z))
 
@Dehodson pretty sure the second one can be tagged (see ^^)
@Dehodson *!=z?
 
@ASCII-only ooh good catch :D
@ASCII-only yeah should be !=z (facepalm)
 
12:43 AM
@Dehodson also it should be [...x[l]`td`].some
@Dehodson Actually, try d=>z=>document[l='querySelectorAll'](`#${d} tr`).forEach(x=>x[l]`td`.forEach(y=>x.hidden|=y.innerText!=z))
 
@ASCII-only should it be every instead of some? The some version is hiding the entire table
 
@Dehodson oh, oops. brb
@Dehodson d=>z=>document[l='querySelectorAll'](`#${d} tr`).forEach(x=>x.hidden=![...x[l]`td`].some(y=>y.innerText==z)) maybe?
 
@ASCII-only That works!
@ASCII-only This version is the same length:
d=>z=>document[l='querySelectorAll'](`#${d} tr`).forEach(x=>[...x[l]`td`].every(y=>x.hidden=y.innerText!=z))
 
1:01 AM
@StewieGriffin There are quite a few. But I guess a lot of high-rep users don't go in chat often
 
oh god what happened to GitHub
the moved everything
 
yes they did
@GitHub why is sidebar on the wrong side now
 
Anonymous
People go to the home page of GitHub on purpose?
 
@Mego not exactly. but some people use it to access a repo, or to see what other people are starring
 
1:18 AM
Is the jQuery-style element selector syntax a real part of JavaScript or just available in the chrome console?
 
Anonymous
$("#foo") is roughly equivalent to document.getElementById("foo")
 
@Dehodson console
 
Anonymous
Oh that's what you're asking, ok
 
Damn. Thought of a way to golf that a bit more with it.
 
@Dehodson yeah if it was a part of actual JS I would have used it :P
it looks like that's basically as far as you can golf it
actually, can you pass in the node itself instead of id as d? @Dehodson
if you did then you could to d[l='querySelectorAll']`tr` :P
 
1:22 AM
@ASCII-only Nah, that'd be switching up the functionality of it D:
 
@Dehodson functionality?
 
@ASCII-only yeah, cause then it'd be a function that takes an element instead of a string. Sorry if I'm using the wrong terminology when I say functionality. I guess specification is what I mean?
 
hmm. fair enough
 
@ASCII-only Golfed it a bit further B) 101 bytes!!
d=>z=>[...document.getElementById(d).rows].forEach(x=>x.hidden=[...x.cells].every(y=>y.innerText!=z))
 
@Dehodson *.map instead of .forEach
 
1:27 AM
@ASCII-only Oh duh... Nice! 97 bytes!
 
@Mego yes :| why not
 
1:45 AM
@ASCII-only if this is valid, it brings it down to 80 bytes. Takes advantage of the fact that you can access an element by its id as a variable in the global scope d=>z=>[...window[d].rows].map(x=>x.hidden=[...x.cells].every(y=>y.innerText!=z)‌​)
 
:| hang on it's actually valid
@Dehodson this instead of window maybe? should work as long as function is on top level
 
@ASCII-only Yep, just tested it and it works. That shaves off another two bytes :D
 
2:41 AM
Alright, two more bytes: d=>z=>[...this[d].rows].map(x=>x.hidden=!x.innerHTML.match(`<td>${z}</td>`))
 
@Dehodson O_o how do you manage to keep golfing it
 
@ASCII-only Thanks lol, I have a lot of spare time xD If inexact matches aren't a problem then d=>z=>[...this[d].rows].map(x=>x.hidden=!x.innerHTML.match(z)) is only 62
 
@Dehodson :| yeah that's probably a problem
 
@ASCII-only True :P it'd be interesting to see if it can be trimmed down from the 76 byte solution though
 
@Dehodson d=>z=>[...this[d].rows].map(x=>x.hidden=!x.innerHTML.match(`>${z}<`))
assuming you don't have text in weird places
@Dehodson well actually this won't work if the text has characters that need to be escaped
so I'd probably go with the 78 byte one
 
2:55 AM
@Anush 52 what?
 
 
2 hours later…
4:30 AM
Why lately my PC keeps shocking me after I plug it out?
 
@Soaku laptop or desktop? It sounds like the ground is getting disconnected before the live wires.
Unless it's just a static shock.
 
4:46 AM
@NewMainPosts Dodos has no negative number :(
 
@Οurous Desktop
 
 
2 hours later…
7:05 AM
:| someone's got golfier solutions that me for lisp on code-golf.io
seems like that's because they've found a way to print with a newline after
 
7:53 AM
1
Q: The Ever-Increasing Graph

Rik van der VlistConsider a one-dimensional sequence of numbers within a fixed range, i.e. [1, 2, 4, 6, 8, 0, 2, 7, 3] in range [0, 10⟩ The Ever-Increasing Graph* is a line that connects all the points in this sequence left to right, and always goes upwards. If necessary, the line wraps around from top to bott...

 
@ASCII-only oops, sorry, hadn't noticed.
 
@ASCII-only what did you use it for?
 
@Anush cheating
 
@user202729 the 52 was listed as not found in your tio with 1,3,9,27 I think
@ASCII-only aha :)
 
8:12 AM
1
Q: Where is that snake going?

AdelinWrite a function (using as little bytes as possible) that takes a bi-dimensional array of any number of columns and rows in which: 0 represents empty block, 1 represents snake block. The function must return the number of possible paths the snake traveled. Example 1: Input: [ [1,1,1,1,...

 
@user202729 1,3,9,27,81
 
The linked TIO was for 1,1,3,9,10 which is not a satisfying set. You can change the std::vector<int> ns = {...} in line 7 to other sets.
According to the other brute forcer there are no "reasonable' set of size 4 that satisfies the condition. (reasonable: either have all elements non-negative integers less than 100 or have all elements integers in range [-40,50])
 
@user202729 that's very interesting!
I was wondering if another challenge could be to define new binary operators
so that you can get 0..100 with 4 integers
if that is possible of course
 
8:39 AM
does anyone know any good resources for introducing a child to python?
fun tasks etc.
 
 
3 hours later…
11:17 AM
@Anush How old is the child? What got me into coding in middle school was finding out I could use it to do my math homework for me :)
 
@Dehodson :| you can?
what really got me into coding is PPCG >_>
 
@ASCII-only Some math homework are easier than others. (solve quadratic equation, etc.)
 
which explains why basically all my projects are languages >_>
@user202729 yeah but you still need to show working
 
@ASCII-only Yeah, my middle school math homework? xD I had a quadratic equation solver that showed all its work
 
@Dehodson :|
but is it not faster to just do it manually
 
11:22 AM
@Dehodson I learnt bash by trying to curl a website (and process the result) to conjugate french verbs
 
@ASCII-only Now, I can't put myself into the mind of my 13 year old self so I don't really know if it would have been faster :P But I remember I hated doing them and there was a worksheet of like 30 problems that I had to do, which lead me to program something to do them for me
 
@Cowsquack :| you can't possibly have learnt much of bash from that though
 
@ASCII-only Btw, golfed that solution one more byte: d=>z=>this[d].rows.forEach(x=>x.hidden=!x.innerHTML.match(`<td>${z}</td>`))
 
:| but wouldn't it take so much longer if you consider the time it takes to write the program (not even considering the time it takes to learn the program)
 
I learnt bash because Python os.system is too much of a mess.
 
11:24 AM
@Dehodson this doesn't work if z contains e.g. < btw
@user202729 os.system?
 
@ASCII-only I learnt streams and piping, $()'s, conditionals, variables, functions, ...
 
@Cowsquack :| that's a very complicated bash program
you must have been a bash expert by the end of that lol
clearly perl is the right shell for that though
 
then I started golfing in bash
 
you what
 
@ASCII-only I tried to make it usable, by introducing command line args, config file and stuff
 
11:28 AM
@Cowsquack all in bash? :/
 
@ASCII-only But you have to type them into the calculator anyway (unless you're very good at mental calculation, that would be faster).
 
@user202729 this is quadratic equations.
assuming they're not like >2 digits it should be fine
 
@ASCII-only What if they are...
 
@user202729 not like you'll actually get that as a homework question more than once
 
@ASCII-only well not pure bash, I did use sed (and perl for regex substitutions because I couldn't figure out how sed worked :P)
 
11:30 AM
@Cowsquack O_o perl +1 (also isn't perl regex basically the same as sed >_>)
 
(and yes, I parsed html with regex)
 
@Cowsquack :|
:| :| :|
well actually perl regex is way more than powerful enough to parse HTML with a clearly understandable regex >_>
also: yay lost my mouse dongle >_> i'm very smart
 
@ASCII-only I couldn't figure out how to chain substitutions :/ (looking at it now the code is awful)
 
@Cowsquack | sed | sed | sed :P
 
@ASCII-only I did try to learn perl, but gave up soon, I should start again
 
11:34 AM
@Cowsquack on code-golf.io :P
 
@ASCII-only well even better, separate sed commands with ;
@ASCII-only also at that time the only sed I knew was s/blah/bleh/flags
 
@Cowsquack can't you use that to chain substitutions though
 
how do you mean?
you can separate them with semi-colons
 
or just sed multiple times. unless that's not what you meant by chain?
 
also idk what I was thinking at the time :P
 
12:16 PM
0
Q: Random numbers with fixed sum

AngsYour task is to write a program or a function that outputs n random numbers from interval [0,1] with fixed sum s. Input n, n≥1, number of random numbers to generate s, s>=0, s<=n, sum of numbers to be generated Output A random n-tuple of floating point numbers with all elements from the inte...

 
12:42 PM
@Dehodson that is a nice idea...9 years old
 
@NewMainPosts Jelly doesn't have random real :/
(it has random integer anyway, so the temporary solution would be: multiply by a big number, random, divide)
 
@Anush I can't say I've read it, but this book says it is designed to be readable by kids aged 10-12, and I think games programming is a great way to get kids interested in python: amazon.com/Making-Games-Python-Pygame-Sweigart/dp/1469901730
 
@Dehodson thanks! The problem with games and python is that it's all a little complicated these days. I mean you have to worry about events don't you?
I mean in BASIC it was trivial to move a block around the scheme
that's just to draw a dot!
 
12:59 PM
CMC: Similar to NMP, but doesn't need to be uniform. Degenerated is fine.
 
1:23 PM
0
A: Sandbox for Proposed Challenges

UmbrellaRotonyms 1 A "Rotonym" is a word (pair) that ROT13s into another word (in the same language). For example: ROT13('Terra') == 'Green' The Challenge Write a program or function that accepts a dictionary/word list and prints or returns a complete list of rotonyms. Order doesn't matter. Result...

 
Perl 6 is a highly capable, feature-rich programming language made for at least the next hundred years.
O_o
 
2:03 PM
@ASCII-only who said this
 
:44687572 idk. a website i looked at
clearly cream puff will be 100x superior to perl 6
 
2:16 PM
I am wondering how to pose a challenge around using en.wikipedia.org/wiki/Akra%E2%80%93Bazzi_method
 
@Anush "Given a recurrence relation output its asymptotic growth"? Need a lot of input format specification.
 
@user202729 right.. or give random pairs of recurrences with their solutions
recurrences that can be solved using akra-bazzi that is
hard to specify exactly what random means there
but that could be fun
 
BMO
3:05 PM
1
A: Sandbox for Proposed Challenges

BMOTree rotations Balanced binary search trees are essential to guarantee O(log n) lookups (or similar operations). In a dynamic environment where a lot of keys are randomly inserted, trees might degenerate to linked lists which are horrible for lookups. Thus there are various kinds of self-balanci...

Any feedback for that challenge?
I tried to cover all test cases, but it's easy to miss one..
 
Looks good. / Some thoughts: For suitable representation this is trivial in some languages.
 
BMO
It's not a difficult challenge but I wouldn't say it's trivial. What language do you have in mind?
I don't really want to restrict the representation too much since that's part of the choice a programmer needs to make to implement data structures.
 
... "rotate around a node"? Looks like I misread the spec so I thought it was easier...
 
BMO
Well idk terminology, hehe
What would you call it?
 
All keys are distinct?
 
BMO
3:13 PM
Hmm wikipedia says, "rotate on [node]" or "rotating rooted at [node]"
@user202729 Yes
That's implied since we can assume it's a search tree ;)
I'll clarify and fix the terminology
 
 
2 hours later…
5:12 PM
Anyone know of a good place to discuss esolang development?
 
Here
 
CMC: Given a string S and a number N, print/return the Nth character of S directly followed by S. E.g.: N = 0, S = "asdf", yield "aasdf"
 
C#: s=>n=>$"{s[n]}{s}"
 
J, {,]
 
APL: {⍵[⍺],⍵}
 
5:19 PM
@ConorO'Brien V, bytes: À|yl|P
 
ah, bytes
 
@Pavel ⌷,⊢
 
¯\_(ツ)_/¯
 
@ConorO'Brien hahahaha
6 of them to be specific
 
memory GAP, 160 bytes: 13b5bfe96f3e2fe411c9f66f4a582adf01abfc750a0c942167651c40d088531db5eda0a74558a34‌​2cf659187f06f746fc68271a63ddbc431c307beb7d2918275c68271a63ddbc431c307beb7d2918275‌​
 
5:23 PM
Japt, 5 bytes : gV +U
 
¯\_(ツ)_/¯
 
CMC: Given a positive integer n, apply the digit sum to it until the digit sum does not change, and return that
eg N=12345678 → 36 → 9
 
ngn
@Cowsquack k: {+/.:'$x}/
 
tio?
 
ngn
I replaced / with \ so you get intermediate results too
 
5:27 PM
it's interesting how back-slash works on non-arrays
 
ngn
@Cowsquack this is k, not apl
 
hence my observation :)
 
ngn
monad\ is converge (with intermediate results)
/ and \ can mean many things in k
 
ngn
dyad/ and dyad\ are like apl - reduce and scan
n monad/ x and n monad\ x are apply n times (the former is like apl's power operator)
ints/ints and ints\ints are decode and encode, like apl's uptack and downtack
 
5:32 PM
@Cowsquack APL 8 bytes: 1+9|¯1+⊢
 
ngn
/ is comment (must be preceded by a space or at the beginning of a line) and \ is system command
 
@H.PWiz nice, that was the intended algorithm
@H.PWiz 1+9|-∘1
 
Nice :)
 
ngn
@Cowsquack 9-9|-
 
nice one :)
 
5:42 PM
@ngn does it work in K?
 
ngn
@FrownyFrog no, it was an improvement on H.PWiz's and Cows quack's APL answer; in k it would be {9-9!-x}
 
are there trains in k?
 
I just noticed it works in J so I thought maybe that’s not the end of it
 
ngn
@Cowsquack Not like APL/J trains. In k juxtaposition of verbs is composition, or at least it would be if I had implemented my parser properly...
so in (the original) k you can remove the final noun of a long expression, and have it as a function: 1+2* is like {1+2*x}
 
@Riker it's a trap!
 
ngn
5:55 PM
@flawr int escalator(){return 1;} // todo: implement
 
@ngn haha :D
 
@Cowsquack Pretty new here, what's CMC stand for? _ _ Challenge?
 
@Dehodson chat mini challenge
 
@flawr Neat, thanks! :)
 
28
A: What are the PPCG specific abbreviations and terms?

AdámSee also Stack Exchange Glossary - Dictionary of Commonly-Used Terms. Abbreviations marked with a star (*) are chat specific. Catalog: A type of simple on-topic challenge where the challenge's aim not so much to find a winner as it is to create a catalog of solutions in many languages. CG: Cod...

 
6:11 PM
@Laikoni Thanks for the informative link!
 
6:57 PM
 
@Cowsquack SOGL, 2 bytes: 9‰
 
wow
 
ngn
7:23 PM
@flawr what's wrong with Finland, they don't like döner kebab?
 
7:40 PM
@flawr 9/10 not enough doner kebab
 
I don't have anything against kebabs but there are a lot of foods I'd rather eat instead.
 
7:58 PM
Ah. I had to look up what a doner kebab was, because it looks a lot like shawarma, and turns out that it is similar.
Also, we've somehow strayed onto "food" as a topic again. Hehe.
 
It's 'cause food is delicious
 
@AdmBorkBork it's fully processed "meat" :)
 
I'm from the US. Most meat is "meat."
 
no one really knows what it is made of
@AdmBorkBork :)
 
And meat that is not "meat" is rather expensive.
 
8:12 PM
notice how this meat comes in one large cylinder
 
ngn
8:35 PM
@Anush the triumph of chemistry over biology, I like to call it :)
 
CMC: given N lists, return a list containing the elements of each list concatenated, collapsing matching ends and beginnings. E.g., [1, 2, 3, 4] and [3, 4, 5, 6] should be collapsed into [1, 2, 3, 4, 5, 6], removing the common prefix-suffix. Test case: [[1, 9, 4], [4, 3, 2], [4, 3, 2]] becomes [1, 9, 4, 3, 2]
 
why not [1, 9, 4, 3, 2]?
 
what does [[1, 2], [2, 3], [1,2,3]] give?
 
[1, 2, 3, 1, 2, 3]
that's the edge case I was trying to find, thanks
 
ngn
8:49 PM
@ConorO'Brien do we always have to collapse the longest suffix-prefix?
 
@ngn yes. so [1, 2, 3] and [1, 2, 3] is collapsed to [1, 2, 3]
 
ngn
@ConorO'Brien a better example: [1,2,1],[1,2,1]
 
should become [1, 2, 1] I think
 
So concatenation is right-to-left?
 
ngn
@TwiNight does it matter?
 
8:56 PM
I mean right-associative
If it is left-associative then [[1, 2], [2, 3], [1,2,3]] should give [1,2,3]
 
what if it's not right or left associative and you're just meant to do each pair separately
 
VTC unclear
 
@LeakyNun Hmm you're right
 
ngn
@TwiNight join [1,2] and [2,3] and remember that the last string had only 2 characters, then take that into consideration when joining further with [1,2,3]
 
@EriktheOutgolfer funny
 
9:04 PM
haven't you VTC'd a CMC before? :P
 
@ConorO'Brien Retina, 25
 
ngn
9:18 PM
 
10:12 PM
0
A: Sandbox for Proposed Challenges

eaglgenes101The Formic Forest - Ant QotH Contest grid king-of-the-hill javascript game Overview While the ants of the highlands gather food and walk around each other, their distant cousins live in the forests below, growing fungus and aggressively raiding the ground and other nests for food. But like t...

 
 
1 hour later…
11:27 PM
@TwiNight 13
 

« first day (2666 days earlier)      last day (2181 days later) »