« first day (3072 days earlier)      last day (1772 days later) » 

Anonymous
12:32 AM
Survey: what would you call the collection of types that are not functions (e.g. int, float, number, string, and arrays of those)?
 
1:01 AM
0
Q: Golf my iteration function

Simply Beautiful ArtHere is my ungolfed Ruby code for a function I want to try and golf: Iter =-> k { str = "" (0..k).map{|m| str += "-> f#{m} {"} str += "f#{k}.times{f1 = f0[f1]};f1" (2..k).map{|m| str += "[f#{m}]"} eval(str + "}" * (k+1)) } The best I can do to golf this is essentially short...

 
 
2 hours later…
3:09 AM
@Mego datatypes?
 
3:34 AM
I am poking my head in here to get help on how to ping users. Sorry if this is disturbing others.
 
 
2 hours later…
5:08 AM
@UserA put @ in front of their name, or hover over the right side of their message, then click ↳ and chat will insert a :dddddddd tag which both will ping the author, and indicate what you're responding to.
 
6:00 AM
@NewMainPosts Maybe it should be explicit on the tag wiki that questions should be restricted to a certain language
 
@UserA There's also a chat room specifically for testing chat features: chat.stackexchange.com/rooms/1/sandbox
 
@DJMcMayhem Although it isn't very suited to test pinging, as it is complicated to ping oneself.
 
 
1 hour later…
7:35 AM
0
Q: "Featured on meta" has gone crazy

Peter TaylorThe "Featured on meta" sidebar currently shows three posts: two of which are actually featured, and the third of which (Cast your vote for “Best of PPCG 2018”!) ceased to be featured 40 days ago. That seems a bit too long to be just a caching problem.

 
 
4 hours later…
11:58 AM
bah, I've got two JavaScript classes, and I want to inherit parts of both into a third class...
 
12:15 PM
0
A: Sandbox for Proposed Challenges

User ATips for golfing in H As for H as described here, what general tips do you have for golfing in H? I'm looking for ideas which can be applied to code-golf problems and which are also at least somewhat specific to H (e.g. "remove comments" is not an answer). Please post one tip per answer. (I am...

 
12:40 PM
@Neil it sounds like you want the mixin pattern
Object.assign may be useful for that purpose, or $.extend / _.extend if you use the respective libraries.
 
 
2 hours later…
2:36 PM
@LuisMendo Have you tried something like that in 3d?
 
3:07 PM
@flawr Nope. That sounds like a good idea, except that visualizing it is going to be hard
 
 
1 hour later…
Anonymous
4:09 PM
@MilkyWay90 That works, thanks
 
5:25 PM
0
Q: `sort` alias for Powershell

mazzySource answer Intro Powershell introduced by Microsoft in 2006 for Windows OS. Since earlier versions, Powershell provides predefined aliases for commands. For example, alias sort for command sort-object. Microsoft has released Powershell for Linux in 2018 (Powershell 6.1+). Powershell 6.1+ fo...

 
5:49 PM
CMC: Write a CMC where the shortest answer in a golfing-language g of your choice is longer than the shortest answer in a non-golfing language p of your choice. If a language has been used in a previous answer, it may not be used again unless you "crack" the answer by golfing the g code to be shorter than the p code.
Cracking an answer makes it so that both g and p may be used again. Cracking an answer is worth 2 points and submitting an answer that does not end up cracked is worth 1.
 
6:01 PM
By the way, Google still caches the site name as PPCG
 
:50852471 Given an n dimensional matrix and a set of the first n natural numbers, transpose the matrix according to the set. That's a one-byter in APL and a two-byter in J, and I think that's shorter than in Jelly?
 
... that's cheap.
 
Also, do you consider Arnold-C (for instance) a golfing language or just an esolang?
 
Also, J considers itself a serious language.
 
@JohnDvorak DJ deleted his last comment to use APL or J as the non-golfing language
So I wasn't referring to J as a golfing language at all
 
6:06 PM
Ah. You meant that Jelly is the golfing language in your answer. Still keckuva cheap to use APL as the non-golfing one ;)
 
@J.Sallé Yeah, I realized that makes it easier not harder
@J.Sallé Esolang
Also you must submit the jelly version for it to count
 
Another cheap answer: "output the numbers 00 through 99 in sequence, separated by spaces". Easy in Ruby, but Bubblegum fails horribly.
 
@DJMcMayhem It was just an example, I have absolutely no idea how that'd be done in Jelly tbf
@JohnDvorak also very easy in APL if you don't require it to be specifically 00 instead of just 0
 
Dang, I almost had a V/brain-flak answer for triangular numbers, but then I golfed the V from 19-13 bytes
 
Those goshdarned golfing skills, eh
If only you were bad at golfing in V
 
Anonymous
6:20 PM
I like that challenge concept, except for the need to categorize langs into esoteric and not
 
A list of what's considered actual golfing languages versus just esolangs would be handy
 
If I went to that much effort, I'd put this on main
 
I'm not opposed to maining(?) it though
 
I'm not either, it would just be hard to come up with that list lol
 
Yeah, it figures. I think there's a list of languages created by PPCG users somewhere in meta though?
That'd be a good starting point, I think
 
6:23 PM
There are golfing languages not made by PPCGers though (golfscript)
I might also add the restriction the task cannot be something that either language can accomplish in 0 bytes
 
That'd be ideal, yeah
 
@Mego One other problem is "write a challenge/task" is incredibly broad. Would you encourage restricting that?
(pick an OEIS? A Decision-problem?)
@DJMcMayhem V is an amazing langauge for this task since it's a "golfing language", but it's incredibly easy to find tasks it's shit at
Another example of a cheap answer: CMC: print the following text: Try It Online!
 
That's as cheesy as it gets, I guess?
How does python print that? Just type help?
 
help()
 
a way to fight against cheap answers would be to require the esolang and practical code lengths to at most differ by x bytes (whether and how x depends on the lengths is another question)
 
6:33 PM
That's trivial to bypass
 
I don't know if that would entirely fix it though. This doesn't technically work in python, but if there was a way to get help as a string, you could do help()[:50] or whatever to make sure that the golf answer isn't too long.
Maybe removing string based challenges would fix it
 
Yeah, I think "print this string" challenges in general would heavily favour some languages specifically
 
"digit-interleave two numbers" might still be a viable answer
 
Anonymous
@DJMcMayhem Yeah, that also needs to be better specified. Otherwise you'd get a ton of challenges about specific help text (like your example) and easter eggs (challenge: open a web browser to xkcd.com/353)
 
@JohnDvorak Hmm. Maybe make the distinction between and or ?
 
6:37 PM
ASCII art is KC
 
and/or :P
 
Please remind me why the tag isn't "constant output"
 
also why not make it like a regular where you must have a valid answer that makes the golflang the shorter one? (or even the other way around - an answer initially has a shorter golflang answer and the job of robbers is to create a shorter practical lang answer)
 
+1 for cops and robbers
 
+2
 
6:42 PM
The first way might work. The second way wouldn't (it's too easy to make a task that golfing languages beat all practical languages in)
 
Although I do think that'd be a nightmare to do the second way
 
@dzaima In that case, my V/brain-flak answer is perfect! lol
 
Also if you want to make it a serious question, you have to classify which languages count as golfing, which ... I wouldn't attempt, if you catch my drift.
 
@dzaima One thing about this way is that it's not too different from "Post an answer to any task that you know you can golf further". Just with the added restriction of putting a second language in for some reason?
Maybe it would be better if the two languages didn't have to be golfing or non-golfing. Just any two languages you like
 
@DJMcMayhem ..yeah, phrased that way the other language is pretty much pointless
 
6:54 PM
Fortunately, I have a better idea for a CnR that's been bouncing around in my head recently. I'll write it up sometime soon
 
7:22 PM
0
A: Sandbox for Proposed Challenges

DJMcMayhemTitle to be determined cops-and-robbers sequence As a cop, you must pick any sequence from the OEIS, and write a program p that prints the first integer from that sequence. You must also find some string s. If you insert s somewhere into p, this program must print the second integer from the se...

 
Speak of the devil
 
7:34 PM
if I have n floating point numbers, there are roughly n^2 pairwise distances between them
is it possible to output them in order without using n^2 space?
 
Are you asking if it's possible or how? Cause I suspect it is possible ;)
 
@DJMcMayhem well.. both :) I mean how do we know it's possible ? :)
because I can't do it!
 
I assume you just want absolute distances?
And do you care about runtime?
I can think of a way to do it in O(n^3)
 
It should be possible to do it O(n^2 log n) time and O(n) space, too
 
@JohnDvorak that would be very cool
but how?!
@DJMcMayhem O(n^2 log n) time would be great
 
7:45 PM
Hint: O(n) applications of a O(n)-sized min-heap
Actually, I'm not sure you can maintain a rolling window of n lowest values in just O(log n) time
 
@JohnDvorak hm... so sort the numbers first. Then for each number find the closest number to it and add it to the min heap... then what?
oh actually I see how to do it
so we have added the closest point for each point. We pop from the min heap. Say this came from point x. We now add the next closest for that point
and continue
 
My idea was to enumerate all pairs for each value output. But that's O(n^4).
 
I think the method I just gave is O(n^2 log n) time and O(n) space
 
That would work. Nice algorithm.
You can do it O(1) space if you don't mind O(n^4) time
 
I think you can do O(1) and O(n^3)
 
7:52 PM
Hm?
 
I'm writing something up
 
0
Q: Find the closest three-digit hex colour

wrymugIn CSS, colours can be specified by a "hex triplet" - a three byte (six digit) hexadecimal number where each byte represents the red, green, or blue components of the colour. For instance, #FF0000 is completely red, and is equivalent to rgb(255, 0, 0). Colours can also be represented by the shor...

 
@DJMcMayhem cool
ok next question... is there any reason to believe it can't be done in O(n^2) time?
 
Nevermind, my idea is actually O(n^4)
This was a lot harder to code than I thought it would be: Try it online!
Oh yeah, that also assumes that the numbers are sorted. Which is a drop in the bucket when you're talking about O(n^4)
 
8:16 PM
I guess you will need O(n) space to sort them
 
There are triangular(n-1) pairwise distances in a list of n:
 
8:41 PM
@EriktheOutgolfer can't stick around byt I don;t think your answer works. Note the bullet point in the OP which explicitly states "The input is sorted by characters, not by bytes."
 
you mean my reply?
 
nope, your code
 
my code handles the UTF-8 chars correctly though?
let's see...
 
...I understand the bullet points to mean "take the bytes of your code and read them as characters given by the encoding employed, use those characters to define the sort order, while I/O is then in those characters"
 
in my case that's all of UTF-8
 
8:44 PM
which is what I think, e.g. Adám would be thinking when implementing and scoring his APL answer
 
I'm not really defending all other answers to be valid... :D
 
So by my understanding this does not appear to be correct
Of course I might be wrong!
 
code is >>¹¹//B_Aạ§<< i here are the chars not in my code, while “®³nnÞṾṾ©©VVV” are all in my code
 
@EriktheOutgolfer Ah you have used UTF-8 AS your encoding of the bytes?
 
exactly, that's why my answer scores 26 and not 13
fun fact: I initially posted it because I was happy I outgolfed both yours and Nick's answers :D
 
8:49 PM
OK. If one passes the UTF-8 chars you get by encoding bytes as a string using Jelly's code-page into mine it works. So are you really questioning whether that is a valid encoding?
 
you mean decoding from JELLY to UTF-8 and then putting it as an argument?
 
Yeah, if my understanding is correct you may well have done so
 
well... technically, chars like are also accepted in my case
 
yeah bytes -> UTF-8 using the code page (which is how the code is displayed)
gotta go catch a train - I'll see any replies in an hour or so...
 
@JonathanAllan (for when you see this) if you have to convert from JELLY to UTF-8 before putting the argument as the program's input while the program is encoded in JELLY, then, unfortunately, I'm pretty sure that's not what the challenge specification's 8th bullet point means, instead, the argument should use the same encoding as the program
 
8:58 PM
@LuisMendo you probably need to think a little bit about how you orient yourself (i.e. what "left" or "right" means). Anyway, it just reminded me of this:)
 
9:41 PM
@flawr Haha, totally! I would be good to have a challenge with a 3D walk
 
@LuisMendo Input could be a 3d matrix
 
steps subtly inside the realm of tensors
 
@Mr.Xcoder ?
 
10:00 PM
Well... 3D matrices are order-3 tensors. Feel free to completely ignore that message :))
 
@Mr.Xcoder you could also interpret it as a 3x3 matrix:)
But then there is also this confusing thing that what you can also say a rank 3 tensor, but you can also talk about a rank 3 matrix, but these are two completely unrelated concepts:)
 
10:55 PM
@EriktheOutgolfer the program is bytes encoded as some UTF-8 chars which accepts such chars as input. Which is exactly how I interpret that bullet point (especially since another bullet point says the input is to be sorted by the chars rather than the bytes).
 
11:30 PM
at last, I've remembered a potential challenge
it's to sort UTF-8 bytes in order
so you start by sorting the characters in order
but then you sort the UTF-8 continuation bytes, but without making invalid UTF-8 sequences
 
11:47 PM
0
A: Sandbox for Proposed Challenges

MarkWrite an obscenity filter that is not obscene Write a program that removes all instances of George Carlin's "seven dirty words" from an input text. We want to be thorough, so be sure your program can eliminate these words even if they're written using a different capitalization, or are embedded...

 

« first day (3072 days earlier)      last day (1772 days later) »