« first day (2840 days earlier)      last day (2299 days later) » 

00:06
Is there any code highlighting mode that only does // and /* */ comments, as well as potentially numbers and single/double quote strings? I've been using lang-default for a while but it mangles let-before.
00:31
0
Q: Colors weave into a spire of flames

MichaelOk—jig's up—this one's only related to smash in name, but it'll give you something to burn your time with while you wait 'til December 7th Given a color string s of form #rgb(in hex, so #000000 to #ffffff, dont worry about the three digit ones: #123) you must average the rgb values, and turn it ...

 
5 hours later…
Anonymous
05:20
@AdmBorkBork Actually, 1 byte: ¥
Anonymous
Or 2: ♀+. Or 7: î@Z♂iÇk
08:59
0
Q: The first, the last, and everything between

TFeldGiven two numbers, output the two numbers, and then the range between them: Examples: Input Output 0, 5 -> [0, 5, 1, 2, 3, 4] -3, 8 -> [-3, 8, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7] 4, 4 -> [4, 4] 4, 5 -> [4, 5] 8, 2 -> [8, 2, 7, 6, 5, 4, 3] -2, -7 -> [-2, -7, ...

09:59
0
Q: Interview Question - Find pair of three Number

Harpreet SinghGiven the list of the number like 5,2,3,1,4 find the pair of three which have to agree this two condition Ri and Rj with Rk if the Both are not lesser or greater than Ri and Rj and i < k < j <= N. We just need the count. I need the solution with least time space complexity The solution of the g...

 
2 hours later…
11:41
0
A: Sandbox for Proposed Challenges

RosLuPDefinite Integral of one continue function It is give as input one continue function and one interval [a,b], the request is find and return the definite integral of that function in [a,b] or return one not a number value if it fail the computation. The value has to be exact as used programming ...

12:29
-2
Q: nextElementSibling: how to jump to the needed element through the parent's tab?

firstsecondnameI have a list with my elements and all is ok if needed element is right after my checkbox with function. But with more tags It doesn't work. If I try var content = document.getElementsByClassName("content"); - it doesn't work either, because I also have a list of "content". Can I jump to the nee...

12:41
@Dennis hahaha, ninja
:P
oh wait whoops
13:06
> He who haw haws last, haw haws best.
@Dennis exactly!
(frantically tested that, phew...)
btw, it was your answer that made me reconsider a bit...
Funny how a challenge that was at +1/-1 in the sandbox is so popular on main.
13:21
alright, why does it look like I invented the new *2-1 over there? ...
Cython is one weird mix of Python features. This shouldn't work in 2 or 3.
0
Q: Is this a Major Scale (or equivalent)?

Luis felipe De jesus MunozSandbox The major scale (or Ionian scale) is one of the most commonly used musical scales, especially in Western music. It is one of the diatonic scales. Like many musical scales, it is made up of seven notes: the eighth duplicates the first at double its frequency so that it is called a higher ...

13:37
@Dennis f-string?!
> Cython is one weird mix of Python features.
but... seriously, it's that weird
like, f-strings aren't supposed to exist at all in normal Python 2...
and yeah, that stupidity regarding *x,... resulting in a complaint isn't there :P
But range is a list, so it's definitely 2.
Or 2-ish.
btw, did you just go around experimenting with every Python implementation in TIO to see where it will work? :P
I was very annoyed that I had an almost-solution that didn't quite work in 2 or 3, so yes, that's exactly what I did.
13:43
cmp was a useful function, yeah... ;-)
Non-named arguments after *expression, range returning a list, cmp, and f-strings, all in the same answer...
well, the last one is technically in the TIO test suite
but yeah, what a mess
Oh, and print is not a function.
All we need are braces
13:58
if newline + ';print f' ever becomes a possible substring in a Python program... well
hm... what kind of python has human teeth? ;-)
What kind of Python has braces?
@Dennis Beautiful.
@Dennis {'t': 'h', 'i': 's', ' ': 'o', 'n': 'e'}
and also {'t', 'h', 'i', 's', ' ', 'o', 'n', 'e'}, for us golfers ;-)
CMC: Output {'t', 'h', 'i', 's', ' ', 'o', 'n', 'e'} :P
14:03
no, you can't use a set to output that
Tis a joke, I should probably delete it lol
wait don't delete it I got this
Lol ok
print({*'this one'})
@Dennis nope
what exactly is {' ', 'e', 't', 's', 'n', 'o', 'i', 'h'}? :-D
sets are unordered...
14:05
The same set. That's how sets work.
I can't edit anymore, but let's say the string "{'t', 'h', 'i', 's', ' ', 'o', 'n', 'e'}" then just for kicks
nevermind I can't in JS get any closer than just outputting the string as is
I was trying to screw around with splitting the string and stuff but nah no luck
Hmm.. what would be the best (read: golfiest) way to get the deltas of an array in JS?
14:21
and then, somebody thinks of the obvious >_<
This can be applied to standard Python 2 at 37 bytes, making it the shortest answer yet: lambda x:x+range(*x+[-cmp(*x)|1])[1:]. Nice solution — Jonas Ausevicius 3 mins ago
14:40
CMC: Given a list of names and a list of values (all strings, if you so desire), generate the corresponding object or its object notation. E.g.: ["greeting","name"] ["Hello","World"]{"greeting":"Hello","name":"World"}
As in, make a hashtable?
@AdmBorkBork If you want. You could also just use transposing and string manipulation.
More fun to make a hashtable. :)
PowerShell, 43 bytes Try it online!
@Adám JavaScript, 46 bytes Try it online!
15:19
@Adám Python 2, 22 bytes: lambda x:dict(zip(*x))
if the list was transposed, it would've been 4 bytes: dict
ngn
ngn
15:32
@Adám k, 1 byte: !
15:53
There's been a flood of answers on one of my old challenges.
0
A: Sandbox for Proposed Challenges

ZgarbRecognize the hardest context-free language code-golf decision-problem string grammars A context-free language is a class of strings that can be recognized by a pushdown automaton, or equivalently produced by a BNF grammar. In her 1973 paper, Sheila Greibach showed that there exists in some s...

hi all
16:12
@Adám perl -M'List::MoreUtils qw(zip)', 12 bytes: sub f{zip@_}
Actually, zip@{shift},@{shift}
In Perl, (1, 2, 3, 4) and (1 => 2, 3 => 4) are equivalent.
Wait, what am I doing. 3 bytes, zip
16:30
every function deserves a lambda wrapper
@primo How do you do a lambda or equivalent in Perl?
I know there are code blocks like {...} but I'm not sure how they work or how they take arguments
Like when passed to sort it takes args from $a and $b, but to other subs it takes an arg as $_
(sub { ... })->()
arg is always @_ though
No that makes sense
What's the block you pass to sort, then?
magic? never really though about it
Seems to be a spacial case in the interpreter
16:40
"If the subroutine's prototype is ($$) , the elements to be compared are passed by reference in @_ , as for a normal subroutine. This is slower than unprototyped subroutines, where the elements to be compared are passed into the subroutine as the package global variables $a and $b."
yeah, i think the sort method sets the globals
0
Q: Kindly explain why it is not impossible to read the minds of users who voted to close a question citing "unclear what you're asking"

guest271314The users who voted to close this question Fastest algorithm to output array containing all integers in range excluding duplicate digits have left no clarification as to what is not clear to them at the question. Kindly explain why it is not impossible to read the minds of users who voted to clo...

16:58
"not impossible"
if only we had a word for that
@Skidsdev We do, unimpossible
@Pavel If I could upvote this comment more than once I swear I would do it.
I thought it was imimpossible
antiunpossible?
@DJMcMayhem that would be more correct if you follow the etymology of the word (both im- and possible come from Latin)
17:05
ininconceivable
Quartossible
animpossible? like anaerobic?
ngn
ngn
expossible
17:35
for a given array A of length n, with integers in the range 1..s , let f(A) be the sums of all the (contiguously indexed) subarrays of A. For a given s what is the largest n so that there exists a sequence of length n with distinct subarray sums?
18:00
does s = n+1 always work?
18:37
hm... for anyone who sees this, some feedback here would be appreciated
18:49
@EriktheOutgolfer Maybe I'm dumb, but how does it differentiate EOF from 0?
by having a correct implementation... ;-)
it's a built-in for a reason, you can't do without it
although I might change that
it's not like recognizing EOF is crystal clear in all languages
Gotcha.
I feel a new tricky challenge coming on :)
For a given array A of length n, with integers in the range 1..s , let f(A) be the sums of all the (contiguously indexed) subarrays of A. For a given s find the largest n so that there exists a sequence of length n where all the sums in f(A) are distinct?
19:49
question posted!
long live :)
0
Q: Find arrays with distinct subarray sums

AnushConsider an array A of length n. The array contains only integers in the range 1 to s. For example take s = 6, n = 5 and A = (2, 5, 6, 3, 1). Let us define g(A) as the collection of sums of all the non-empty contiguous subarrays of A. In this case g(A) = [2,5,6,3,1,7,11,9,4,13,14,10,16,15,17]. T...

20:07
@EriktheOutgolfer does G just return one of its arguments at random?
@Skidsdev you mean the example gate? yeah, it's a choice between A and B, i.e. its arguments
@EriktheOutgolfer maybe I'm missing something then, how are gates defined?
nevermind I'm actually blind
so a gate is essentially a function?
ok now I understand
they're called gates, but they take arguments (not strictly "inputs") and only have one "output"
note that the entire spec of the language is there, some stuff isn't necessary :-)
20:40
@EriktheOutgolfer M(A,0,1) is always redundant, right?
this language would be the worst for kolmog challenges
it's not really designed to be very golfy...
O(0|1)\n per bit, that's 40 bytes per character of output
well, not exactly
you might be able to use a loop if there are enough commands
20:43
hmm true
inb4 somebody implements an interpreter for LogiMuxi in LogiMuxi
not sure if it's Turing-complete
Pretty sure it's possible
I mean an if statement can be implemented with complex manipulation of looping
there's no "if statement" in this language
only conditional loops
right but that's what i mean
maybe something like this will make an if statement:
20:49
if you set up a conditional loop to run once if its condition is initially true, you have an if statement
T=X
T
 ...
 T=0
yup
now the fun part, you can make an elseif by setting a flag to determine whether the previous if statement ran
well
T=X
t=0
T
 <if...>
 T=0
 t=1
t
 <else...>
 t=0
yeah, those constructs are relatively easy to make
however, this language is written in ASCII, not bits
21:02
I hope someone gets interested in codegolf.stackexchange.com/questions/175548/…
@EriktheOutgolfer right, so you have to process inputs 8 at a time. Still doable, just a lot more work
expanding it with very basic OOP and functions-as-values would make it a lot easier, but also exponentially add to the implementation complexity
not even class definitions, just the ability to define abstract JS-style objects
which I guess really is just an associative array
21:49
@Mego I just added the announced step by step example for the Dirichlet convolution challenge.

« first day (2840 days earlier)      last day (2299 days later) »