« first day (2388 days earlier)      last day (2752 days later) » 

20:00
posted on August 13, 2017 by flawr

Given a list of at least three distinct positive integers, output a permutation of that list that isn't sorted in ascending or decending order. Examples 1,2,3 -> 2,1,3 or 3,1,2 1,2,3,3 -> 2,1,3,3 or 3,1,2,3 or 1,3,2,3 etc..

uh what
@FLAWR YOU BROKE OUR BOT D:D:D:
@HyperNeutrino or the bot updated >:)
@HyperNeutrino WHAT?
@NewMainPosts Wutwutwut
20:04
@flawr ARE WE SQL PROGRAMMERS OR SOMETHING
@StepHen Did it actually?
also all 3 of my answers on that challenge do the same thing: sort, then shift right by one :P
@Pavel I dunno but it looks like it
YES PROBABLY MY NAME IS Robert') DROP TABLE Students; --
20:05
wait... does this mean we're getting redesign soon, by any chance?
2
maybe :D :D :D
Seemingly no related recent posts.
yeah, it was announced that we'll get it in about 6-8 weeks decades!
5
@flawr Sweet! Just what I always wanted...
20:06
@flawr same thing
Ask about this phenomenon on Meta PPCG. NMP will post about it, so we can see if that was just a one time thing, and someone might know something.
but... then I won't have all of the site privileges... which means I'll have another rep target to reach... which means I'll still be addicted to PPCG D: oh wait that's true anyway ._____.
We're not SQL programmers here, that language shouldn't have gotten a bunch of SEQUELS!
ಠ_ಠ just remembered back in the good terrible days when you made a pun for every letter of the alphabet.
the exact text sent differs from the usual thing that NMP gives. Not sure why trough
20:08
I think the nbsps break it
@dzaima oh, huh, and then it didn't onebox
Well, that was only two self-contained posts. The terrible portions were when I consistently spammed puns to the point where I got kicked.
it did though
@Zacharý yeah true :P
Yep.
Hey, does anyone know an APL idiom for splitting a string at a character, like .split?
That's a good challenge idea
20:12
@programmer5000 Why though? They have those b<number>.txt files, scraping is probably easier to be honest.
@HyperNeutrino I wonder what happened:/
me too :(
Question: when should I stop adding answer to notsort?
@HyperNeutrino when "at least three distinct numbers" is removed from OP
@HyperNeutrino When you run out of languages you are good at.
20:15
so never?
@Zacharý that may take some time :P
I mean it's pretty easy; sort, rotate.
@HyperNeutrino do it in a language without lists
or arrays
oh good at
@StepHen I could try to try it in BF...
too painful though
I'd do it in Ceres but that has neither sort nor rotate
neither does PostL...
I need to stop making golfing languages that are missing builtins D:
s/that are missing builtins//
:(
that's true tho :P
how do you reorder github wiki pages
@totallyhuman blowing raspberries <- Is that some kind of idiom?
20:23
@Zacharý searching
@flawr see his profile :P
it says "blows raspberries" :P
not sure if that's just a joke or if it means something
@totallyhuman ^ reveal the mistery plz
vague idea for a CnR: cops post a snippet of code in language X that meets a certain criteria, and can be broken by inserting N consecutive bytes of code at position P. The robber's challenge is to find some N consecutive bytes that breaks as many cops solutions as possible
Try that challenge in Fortress implementation ... >_<
Really, programming in the implementation of Fortress is nearly impossible. >_<
However, I can explain what blows raspberries means
It means sticking out your tongue and blowing to make a pbththththth sound
So this?
@HyperNeutrino wait why the ping :P
@flawr Exactly
Is an allophone a phoneme?
20:48
@wizzwizz4 I don't think so.
@Zacharý Good. My strong, unsubstantiated belief in Wikipedia has not been knocked down.
/wæt/
@flawr Hey, this is a random question, but what is your native language?
@DJMcMayhem swiss german
@MDXF segfaults; why else? :P
20:50
(not french)
TIL that Wikipedians natively process language like this:
DS G1S NARR IP-go go PROG tree-DEF.G4 chop-IMPV
"He went to chop the trees."
@dzaima That is a lot of weird features :P
@HyperNeutrino Lol that's what I expected
@HyperNeutrino eexactly :p
20:52
I didn't know about half of those, but since its syntax is less strict, it's quite golfy
print('''hi''') ughh.
like this for loop! for i=0i<10;;print(i++)
Proton doesn't have triple quotes btw...
@HyperNeutrino yeah, found that out the fun way
I know.
20:53
And it doesn't print hi nor 'hi', but <space>hi<space> (I think)
yes
because it's equivalent to print('' 'hi' '') which is print('', 'hi', '')
if4<7print("4 < 7") fails to run
that's because you need a space between if and 4 ಠ_ಠ
@HyperNeutrino why
@HyperNeutrino Please make it so that for0=i10>i;;print(i++) works!
20:56
@wizzwizz4 I could make it so that if the left side of assignment is not an identifier it does it backwards...
will do. brb
@dzaima because identifiers can have numbers in them ಠ_ಠ
0
A: Sandbox for Proposed Challenges

SanchisesAll your base 97 are belong to us code-challengebase-conversion Golfing languages are often at a very unfair advantage. When inspecting the individual bytes of those program, it immediately becomes clear why: they use all 8 bits to the byte, by using code pages that have 256 characters! There m...

Gahh
Why are no challenges easy anymore?
I can't answer most challenges RIP
@trichoplax Racking up the trash invitations. :-)
Because all the easy challenges are taken, and the ones that aren't get spammed with answers by HyperNeutrino.
20:58
@2EZ4RTZ Look at my most recent ones!
@flawr pls yes
@2EZ4RTZ I have some easy ones if you're looking...
@Zacharý Please hyphenate that.
At present it looks like people are spamming HyperNeutrino.
@trichoplax Si
@wizzwizz4 er what ._.
20:59
@wizzwizz4 I move to the private Trash room so hopefully there shouldn't be any invitations (let me know if any non-mods do see invitations).
none seen from me
Great. Especially as lots of messages end up moved when there was nothing wrong with them, they just no longer make sense out of the context of other moved messages
yup :)
@wizzwizz4 Assignment now autoreverts if the left side is not assignable
@HyperNeutrino Please allow a=0=b.
I'm being awkward, but golfing is worth it.
@wizzwizz4 done
(it works already :D)
that becomes a = (0 = b) which is assign the value of (assign 0 to b) to a
21:02
One could just do a=b=0, how would a=0=b help?
^
if anything it's less golfy because of the trailing space required
another thing: should I make identifiers not be able to match (keyword)\d+?
(like for0 would be tokenized into for, 0)
Yeah, for0 => for, 0
ok, will see if I can do that easily
Useful for golf, and safer for production.
May I ask the golfing experts here for opinions? I'm trying to establish some default I/Os for black-box functions. I started a draft here. Any opinions? @trichoplax @wizzwizz4 ?
21:06
@HyperNeutrino I'd say do that for keywords not identifiers because numbers at the end of variables are useful
@dzaima that's what I meant: an identifier can't be a keyword with numbers tacked onto the end
@flawr Is the second section meant to be the same as the first?
@flawr Ironically, pinging me delayed my response, as it made the reply arrow move down a line at the very moment I tried to click on it
No, that should be a separate entry to vote on
@trichoplax hehe, that was obviously intentional :)
Perfect timing :P
21:09
gtg for a bit, I'll ping you when I get the for0 working
@HyperNeutrino Would it work at the other end of a keyword too, so that ffor would be interpreted as f for?
(I know that particular example is not syntactical)
Just looked it up and it turns out "syntactical" is a real word.
@flawr I'm not sure the goal yet
@trichoplax I don't understand what you mean
@flawr That's what I was trying to say...
@flawr black box functions? I'm not sure I understand waht that is.
*what
The idea is that you can give functions as an input to a program
But where the program can just apply the function to arguments and observe the output, but no the inner workings. (hence black-box)
21:18
so this is an IO default for functions?
I don't see the point of specifying "black box"
@flawr I'm with you on that. What aspect are you looking for opinions on? I'm not sure what is meant by "default I/Os"
yes right
@trichoplax the meta thread about default I/Os, let me find the link
Ah I see - there's context...
Anonymous
@ConorO'Brien It's there because the idea is to be able to write challenges where input is given as a function where the only allowed interaction is by calling it and observing the outputs for the given inputs. It's a black box because you're not allowed to see the code.
ohh
that's kinda neat
21:21
Sorry, I expected you get that I mean this meta thing on the default IO methods
I've always wanted to write a challenge that involved functional input, but I thought everyone was pushy about having "open challenges that didn't depend on language specific features"
I think this would open up a whole lot of new kinds of challenges, but I think it needs to be clear how those black-box functions can be specified
So you're going to add an answer for black box functions, to define what that term means for inputs and outputs in challenges?
I didn't realise this related to the meta question - makes sense now.
I'm so used to questions in TNB being about language design that a question about meta posts threw me...
Well these are suggestions on how these black-box functions could be accepted as input in some languages.
Here I used the examples of languages that do have the classical functions
But this obviously needs other answers for other kinds of languages
which dialect of TI basic are you talking about? ti-83,84's basics don't have functions
21:24
Do you think it might be worth first defining what a black-box function is in a separate meta post?
That would be nice, so each answer can link to that
@ConorO'Brien the voyage-200 one (I don't actually know what version)
that's a nice calculator
But thanks for letting me know, I was not aware of that!
Maybe an answer here:
25
Q: Standard definitions of terms within specifications

DoorknobQuite often I find that I am repeating myself when creating a challenge. For example, usually I have to retype the definition of "random" in all of my posts, or I have to specify the same thing about how reasonable input and output can be provided in every challenge. This post is meant to be a c...

(for linking to from the other meta answers about black box functions)
21:27
yeah, np! the voyage 200 uses the 68k variant of TI basic if memory serves me well
@trichoplax Ah that is great
So would you agree with the definition of black-box functions that I gave in this draft?
Or would you change something?
How much should a black box function be proof against work arounds? Should it be down to the function to be tamper proof, or down to the answerer to not cheat?
hey gamers
what's everyone talking about
@trichoplax I'd say we should trust the answerers not to cheat
I think so too, since in JS it's too easy to access the internals of a function with stringification
@ckjbgames standard input for functions whose inner workings shouldn't be accessed
21:30
In the extreme case you could provide a controller so the answerer's code never sees the function itself, but it seems like most of the time it would be nicer to have challenges where the challenge author doesn't need to run everything.
@flawr Sounds good to me
And I mean if some challenge requires anything more specific, it could still specify that in the challenge
@wizzwizz4 for0=i10>i;;print(i++) now should work
(not yet on TIO)
nvm it doesn't ._.
are you trying to recreate perl
21:32
lol
@trichoplax I don't want that; then you couldn't name a variable deforest :(
@HyperNeutrino yes there's lots of variables it would exclude. Depends if golfiness is a priority...
Hey there
0
Q: New Tag Proposal: fastest-compiling

ckjbgamesSo, I have a question that I want to create that involves creating the fastest-compiling version of a programming puzzle. Like fastest-code, submissions will have to be scored on a standardized machine or a specified virtual machine. This tag would work for compiled languages only, since you can'...

@trichoplax it isn't :3
It's my new tag idea :)
META META META. YOU'RE A WONDERFUL CONVERSATIONAL COMPANION
21:37
olol
hey look bot is unborked
Should've just waited for New Meta Posts lol
@HyperNeutrino I'm struggling to see an alternative reason for going to the trouble of making for0 possible :P
it was not troublesome
I just had to replace \W with [^A-Za-z_]
@HyperNeutrino if golfiness it's a priority you shouldn't turn people's heads, what if someone wants to name a variable fort?
or am I confused
That is still possible.
21:38
@trichoplax I added the Black-Box-Functions definition!
you just can't name an identifier a keyword followed by (a) number(s)
Any more feature requests? :P
@flawr Did you want to include the bit about being able to pass a black box function as an argument/input, or will that be saved for the other meta answer?
@trichoplax No that will go into the default IO question
@trichoplax for the second part, is there another name for functions in languages where you can "process" functions like e.g. integers or strings?
First class?
@trichoplax are these called first class functions?
21:47
In computer science, a programming language is said to have first-class functions if it treats functions as first-class citizens. Specifically, this means the language supports passing functions as arguments to other functions, returning them as the values from other functions, and assigning them to variables or storing them in data structures. Some programming language theorists require support for anonymous functions (function literals) as well. In languages with first-class functions, the names of functions do not have any special status; they are treated like ordinary variables with a function...
Ok yes that makes sense! So I'm gonna add those to the default IO now
I added the definition of black box functions, as well as the first two suggestions (first second). Please vote on what you agree or do not agree with.
3
And feel free to add other suggestions for languages or classes of languages that have not been covered yet.
@Mego @trichoplax see above^
@flawr +1 each, but just to be pedantic: Does "holds for" mean "holds only for" in this context? That is, can a language which supports first class functions still assume a function is predefined under a given name, or can that only be assumed where there is no other option?
are dicts injective or surjective
ah ok apparently surjective
21:59
@HyperNeutrino neither, generally
oh really?
Are you asking whether they can support keys without values, or values without keys?
@trichoplax it is non exclusive, I should probably mention that
Explicit is good on meta
well just since each key must map to exactly one value I'm wondering if that's injective or surjective
22:01
In languages where it's one and only one, I suppose you could call it bijective
what's the difference between a list and a tuple? like I mean other than the brackets, what's the difference in functionality
@trichoplax well I mean {'a': 1, 'b': 1} works so it wouldn't be bijective
In python a tuple is immutable, which comes with efficiency
(and safety)
In a more theoretical sense, a tuple is usually understood as an element of the cartesian product of some sets
@HyperNeutrino I get it now. Thanks. So yes they are surjective but not injective.
So in order for two tuples to have any relation, they need to be elements of the same product
22:04
ah ok
oh ok, thanks. that makes sense
In mathematics, injections, surjections and bijections are classes of functions distinguished by the manner in which arguments (input expressions from the domain) and images (output expressions from the codomain) are related or mapped to each other. A function maps elements from its domain to elements in its codomain. Given a function f : X → Y {\displaystyle f:\;X\to Y} The function is injective (one-to-one) if every element of the codomain is mapped to by at most one element of the domain. An injective function...
Had to remind myself which one is which...
I don't quite agree on that, injectiveness and surjectiveness usually depend a lot on the codomain
wikipedia is my (only) friend :D
@flawr that's true :I I guess by defining the domain as the keyset and the codomain(/range) as the valueset
@HyperNeutrino this is basically just the definition of a function
@HyperNeutrino exactly
22:06
well no, a relation. functions can't have duplicate results (iirc) (???)
take e.g. f(x) = x^2 and f(-1) = 1, f(1) = 1
oh
anyway gtg for a bit o/
So a function can be surjective or not, but all functions are injective?
a function maps each key (of the domain) to exactly one value of the codomain.
@trichoplax Injective means that no two key have the same value
and surjective means that for each value there is also a key
So a function can be injective or not, but all functions are surjective?
Oh. So neither are true
I think I finally get it...
22:08
a surjective function "covers" the whole codomain, while an injective function is something "reversable"
But every function can have its codomain restricted in order to make it surjective?
right!
Yay! I got something!
in order for a function to be invertible, it needs to be injective
since the inverse only has to be defined on the image (i.e. all values the function assumes) of the function
This is showing up how many years it has been since I first learnt this...
22:12
Hey, what do you think is a good minimum size for a flag in a flag challenge?
Well it took me also quite a few years from the first time I heard about it to when I actually got it :)
Hi!
0
A: Sandbox for Proposed Challenges

ckjbgamesFastest Compiling Quine compiler quine fastest-compiling Your task is to create a program which outputs itself without "cheating": a quine. However, you will not be scored on its bytecount or how many upvotes it gets. You will be scored on how quickly the compiler can compile it. Rules Of c...

pls no downvote
And I now only know it because it is my bread and butter right now.
@ckjbgames If you don't want feedback you probably shouldn't post in the sandbox
@trichoplax yes
i just hope for some constructive criticism instead of just downvotes without any feedback
it's fine if you downvote :)
22:14
@ckjbgames you said you measure real time
Even the downvotes are useful (and often well intentioned), as they prompt other readers to wonder what needs improving and explain it
@flawr as in, the op line given by the time command
so you don't count the cycles, but actually measure the time?
@flawr should i do that
what command should i use
Well I'm not familiar with linux, so I cannot help with that
22:16
This probably means that you'll get a zillion entries that compile in one millisecond.
It might also depend on the compiler you're using.
really, it's scored by the amount of time it takes to compile
@Hosch250 That's an excellent point. This scoring method will probably only be meaningful for tasks which force a large amount of time to compile
Compile optimization battle - TO THE DEATH!
And the fastest will probably be the simplest version too.
22:17
Yeah I agree, you should probably use another kind of challenge for that. Also quines have been done to death.
Because compilers are highly optimized for those simple, and common, constructs.
@Hosch250 should've made it a more complex problem
help me out goyes
gosh darnit i can't type today :v
This proposed challenge is comparable to judging "Hello, World!" as . It will be almost impossible to measure the difference.
@trichoplax that's the problem
send me a more complex task and i'll change it to that
I'm not completely against the scoring method, but I don't think this is the challenge to test it with
22:18
how about fibonacci?
This could be a great challenge, but that ^
@ConorO'Brien good idea
Also a fast compilation.
so assembly language for the win?
I'd still use something a lot more complex.
22:19
Fibo only takes a long time to run.
@trichoplax Anyway, I need to go now, thanks a lot for your suggestions and all your help!
Fibonacci quine?
like of course I won't use a triply compiled language such as Jelly
maybe something on par with pe23?
Like, fastest compiler to compile itself.
22:20
@flawr Thanks for explaining things too :)
Roslyn wouldn't win.
I'm changing it to a Fibonacci Sequence problem
Unless you counted it as two languages.
That will have some fun optimizations 8)
-1
A: Sandbox for Proposed Challenges

ckjbgamesFastest Compiling Fibonacci Sequence compiler fibonacci fastest-compiling Your task is to create a program which takes one numerical input and outputs all numbers in the Fibonacci sequence up to that point. However, you will not be scored on its bytecount or how many upvotes it gets. You will be...

And it should have a requirement on which features have to be supported.
22:21
Changed it up a bit
And someone downvoted without saying why
@trichoplax Anytime:)
could the person that downvoted explain why
Odds are because both of these tasks take a trivial amount of time to compile.
@Hosch250 I need a task that doesn't
help
Compiler that compiles itself?
22:25
@Hosch250 8)))))
BUSY IN HERE TODAY
With a minimum number of features.
Otherwise, someone will make an empty file and say it compiles itself.
@Hosch250 This isn't about a program that compiles itself. It is about how long it takes for a compiler to compile a given program.
a problem is that with pretty much any challenge is that the fastest compiling program will be one which is just a long string which then gets executed as a shell script or something else that's simple
@ckjbgames It may well be one of the several people who have been explaining in here...
22:28
@dzaima Interpreted languages aren't allowed.
@Hosch250 true
@trichoplax yes
maybe hyperneutrino
@ckjbgames True.
Meh, no need to be speculating on that. Just fix up the challenge and it will get upvoted.
@Hosch250 so, i need a relatively difficult task that would take a while to compile
@Hosch250 yup
@ckjbgames I'm not looking to guess who it is, just saying that they have already explained why...
@trichoplax yes
will someone help me think of a task that would take a while to compile already?
g++ is already slow sometimes, especially if you have to link a ton of crap
22:31
Hmm, this looks like it might have potential: codegolf.stackexchange.com/questions/3184/…
Maybe that on a larger board?
Maybe fastest program to compile a certain set of programs.
subset of C# or something, maybe?
22:49
@ckjbgames hi wat?
oh you mean the downvoter on the meta tag proposal?
yeah that was me. I just upvoted the comment placed there by Draco to say I agree and downvoted because I don't think the tag would benefit us that much
Hey, what would a good monadic case for ?
@Zacharý As in logical and?
maybe "all"?
Also LCM.
or reduction via "and"
22:56
That would only save one byte -_-.
oh for a golfing language
does your language have complex numbers?
Yeah, a transpiled-APL golfing language.
(So, it does have complex numbers)
you could go with "length/angle"
> two-element list of the length and angle (in radians) of the hypotenuse of a triangle with base and altitude equal to the real and imaginary parts input
Hm ... that might work, but I'm thinking along the lines of something to do with factors/prime factors/factorization/etc.

« first day (2388 days earlier)      last day (2752 days later) »