« first day (1983 days earlier)      last day (1050 days later) » 

8:04 AM
@DrGreenEggsandIronMan We're usually discussing about people who are bitterly complaining ^^. Have a good night !
@zʏᴀʙiɴ101 Hi @zʏᴀʙiɴ101 :)
hi all
hi part of all
@zʏᴀʙiɴ101 HI ZYABIN
@zʏᴀʙiɴ101 You should listen to your mom XD
@thepiercingarrow I shouldn't >_>
8:17 AM
@zʏᴀʙiɴ101 Why not?
@zʏᴀʙiɴ101 Please listen to your mom so you don't get in trouble.
I would be very grateful if people could comment on meta.codegolf.stackexchange.com/a/9488/9206 please
is the output description OK? Is the question clear?
hi @Optimizer
@Lembik I'm gonna read that
@Katenkyo Thanks!
8:23 AM
@Lembik I think I understand the task, but find the definitions hard to parse
I'll think if there's a better way to present them
@xnor oh.. tell me which ones in particular and I will try to clarify
@xnor ok thanks
it is much simpler than it used to be :)
requiring all runs to be output with both the endpoint indices and the run seems needlessly complicated
i'd suggest one or the other
@thepiercingarrow The previous time, mom just shut down my own PC because it's too late to play it.
@xnor OK. You think just outputting the indices will be OK? It's not as nice to look at or as easy to check
i don't see why not to allow 0 indexing
8:25 AM
I just wanted to make it easy to verfiy
@Lembik yes, i think that would be fine
There are not much problem from that.
@xnor I could change it all to 0-indexing including the examples.. would you prefer that?
i think allowing 0-indexing or 1-indexing in the code would be best, so that people can use what their language does, and the examples can be whichever one you prefer
ok doing that
I quite like having the indexes and the actual substring outputted.... Do you actually hate that?
otherwise I will leave it
but if people hate it I will change it
8:28 AM
i don't like it, but it's your challenge
@xnor true but I fear unpopularity :)
why do you like having both?
@Lembik In the list defining a run, you could split the second dot in :
- Runs never overlap except for their border
- A Run is always maximal, `w[i,j]` isn't a run if there exist a run `w[i-x,j+y]` with `x` or `y` greater than `0`
@Katenkyo i like that
@Lembik I think outputting both is fine, but it may be cumbersome for languages like retina
It really depends of what you want to do, in the end, you have to do a challenge that you would enjoy to do
8:29 AM
@Katenkyo I gave in and changed it to intervals only
i'm interested in recursive strategies for these types of questions that don't index characters, which i find elegant, so I'd actually prefer substrings only
but i can see how that feels like it doesn't "find" the runs
@xnor but that's really unclear as substrings will be repeated and you won't know which is which
@Katenkyo I didn't understand "split the second dot"
How about just "A run is maximal if it is not fully contained within any larger run"?
@xnor that sounds good but it does mean you have to understand inclusion of intervals rather than strings
so it's not 100% complete as a description
hmm, i see
well, if you're having the intervals be output, it would be natural to phrase everything in terms of intervals
8:33 AM
@Lembik As I read it, the second element of your list covers both the things I listed, Was suggesting to split it in 2 elements, making it easier to read.
and say that "An interval is X if the substring has properties Y"
@Katenkyo got you
might you consider having just the number of runs be outputs?
it would free up code to represent runs as it wishes, which I find nice
and it's what the paper's result is about
@xnor I would prefer not for this challenge. I have a follow up in mind which is fastest-code. That would just output the number of runs
@xnor but for this challenge I think it's interesting to actually output the runs
interesting and not 100% trivial :)
which is my main aim at ppcg
updated again
are you happy with the output format?
I have made it as loose as possible
I am tempted to post soon
yup, i'm happy with it
8:37 AM
per(w) <= |w|/2
that takes a bit to process
my intuition is "it has two full cycles"
maybe the idea of period and runs would be easier to digest by saying, there's a string that you try to extend cyclically, you do so as far as you can, and it requires at least two full repetitions
that is the definition of periodic more
but you make a good point
i know mathematically, periodicity is that there's a p with f(x+p)=f(x) for all x, but I think for strings, people think of it more as concatenating a chunk
8:40 AM
right but we need to be able to handle ababa
where ab is the minimal period
Q: Compute the runs of a string

LembikConsider the following definitions taken from The number of runs in a string by W. Rytter. Note that word, string and substring are all roughly synonyms. A run in a string is a nonextendable (with the same minimal period) periodic segment in a string. A period p of a word w is any p...

yes, you'd have to think of cycling through the letters rather than concatenating the full string
I am sure you are right that some people will be confused
sadly :(
as defined, i think the empty string is always a run?
8:42 AM
i mean any empty interval
it's not an interval
by definition?
I should fix that
but I am just checking.. is w[1,1] a run? It shouldn't be
indeed, it isn't, its period is 1, which would require it have length 2
good point
so I just need to define j>=i
I always like to guess how long until the first answer :)
43 minutes?
8:48 AM
@Lembik How is aabaabaa periodic but aabaa not?
I say both are not periodic
@LeakyNun aab aab aa the minimal period is 3 < 8
@LeakyNun aabaa, the minimal period is 3 > 5/2
where is the source supporting your definition?
@LeakyNun you mean a definition of the minimal period of a string?
or the definition of a periodic word?
you know, saying that aabaabaa is periodic and aabaa is not
@LeakyNun I just proved it to you using the definitions in the question!
just compute per(aabaa)=3 and per(aabaabaa) =3
@xnor I am looking forward to the fastest-code version of the question :)
8:54 AM
@Lembik I know, you defined them that way, but I'm asking is that common in the world
@LeakyNun The definitions are from the paper I link to. I think they are standard
@Lembik alright
@LeakyNun usually, things said to be periodic are infinite sequences of functions, so it just means there is a finite period, and there's no ambiguity
@xnor alright
8:55 AM
for finite objects, you need to somehow restrict the period, else everything is periodic with period bigger than its length -- i don't how how widespread the half-length restriction is
@xnor it's standard in the world of combinatorial pattern matching (stringology) at least
@xnor otherwise all strings are periodic
longest common substring question still going strong with zero answers i see
@MitchSchwartz yes :)
this undergraduate exercise is beyond the wit of the internet it seems :)
and i had such faith in the internet
me too!
9:15 AM
@zʏᴀʙiɴ101 Exactly. You can't stay up too late playing. You have to go to bed, then you can play tomorrow :)
@thepiercingarrow Or just don't sleep at all and you'll be able to play until your death
Without wasting hours for this stupid things that's called sleep
oh no.. I have entered into the "full program versus function only" debate :(
@Lembik Function submissions are no harder to test. If you wish, you can ask people who submit functions to include a full program using that function for testing.
@Mego you are right that if they also include a full program that is just as easy
@Mego I am generally inspired by tex.se which has a really nice culture of wanting to be as helpful as possible to people who know nothing
It's not an unreasonable request - I often do it. A lot of people who submit functions will also include a full program for testing.
9:25 AM
all answers are supposed to be complete latex documents for example
@Mego but I don't really get the objection to complete program answers. I mean you can't compare Java and Jelly in any case
TeX.SE is a very different site. To name one major difference, they ask questions and get answers, where we pose challenges and get solutions.
@Mego yes that is different. I think the idea that answers should be as widely accessible as possible is still good though
@Lembik To me, it's not about comparing different langauges - it's about not having to type public class A{public static void main(String[]a){...}} for every solution. That's pure boilerplate - it doesn't add anything to the actual solution.
Let me be more precise, I don't mind what anyone else does :) I would just like my questions to ask for complete programs
variety is the spice of life and all that
Also, with some languages, the approaches with functions can be far more interesting than full-program solutions
9:28 AM
@Mego If you are providing a full program as well then you still have to to type all that stuff
@Mego ah.. now why is that? "approaches with functions can be far more interesting than full-program solutions"
@Mego And functions allow for some language to take an array as input :)
@Lembik That's arbitrarily overriding the defaults. A large portion of the community has decided that doing that is not good.
@Mego it's not arbitrary! It's my preference
@Lembik It still is arbitrary ^^
Personal preference is about as arbitrary as it can get
9:30 AM
or are we not supposed to have different sorts of questions
ok so this may be part of the PPCG culture I don't know about
@Lembik you can, but it's frowned upon because people like to be free of how they will codegolf a solution
when in rome
@Lembik Consider a challenge for determining if a string is a palindrome. The Python full-program solution would be s=input();print s==s[::-1]. A function submission might be f=lambda s:s==s[-1]and f(s[1:-1])
@Katenkyo hmm.. but I am also going to ask them to produce a full program in any case!
@MitchSchwartz :)
@Lembik Yes, but their function solution may be shorter
For instance, if I have to take an array as input in lua
9:32 AM
@Katenkyo yes it may well be. I am not sure how relevant that is unless we are comparing across languages
@Lembik Restricting solutions to full programs because you don't want to test function submissions isn't "different sorts of questions" - it's imposing a restriction for a poor reason.
@Mego it's not because I don't want to. It's because I think it makes the answers more interesting to the wider community
function f(a) end is all I need as a boilerplate, for a full program, it would be loadstring("a=".. ...)()
and hence makes PPCG a more attractive place
from another perspective, full programs are a natural default choice and allowing functions seems strange
9:33 AM
You know what makes solutions interesting? Not needing boring, static boilerplate that distracts from the actual solution.
thanks :)
@Lembik It's relevant if you want to find the optimal solution in ONE language
by disallowing functions, you may disallow the optimal codegolf for this problem
@Mego I disagree. a)That is from the point of view of the answerer and b) if I am asking for a full program as well that doesn't make any differenec
@Katenkyo That's an interesting argument but I don't agree with it. There are optimal full programs and optimal functions. They are both optimal
@Mego I like this example
@MitchSchwartz Why is that? You're ask to provide a piece of code that for x output y, it's the definition of a function ^^
How about finding the maximum element in an array? For Python 3, the full program would be: s=eval(input());print(max(s)). That's 4 function calls, of which 3 are only for getting input, processing it into a usable format, and outputting the result. As a function, it'd be max - the core of the solution.
9:35 AM
@Lembik And there's a third category, optimal <lang> ^^
@Mego I tend not to ask question which have such short answers
some languages don't have functions
@MitchSchwartz But a program with input and output is a function
@Katenkyo optimal <lang> is underspecified :)
Also, note that disallowing function technically disallow Lua to be used
9:36 AM
@Lembik Like I said before, I think a compromise that is agreeable to all parties would be to allow function submissions, but request that those submissions be accompanied by a full program to illustrate how to use the submission and make testing easier.
As even a full program in Lua is only a function
@Mego This sounds like a nice compromise.
this internet thing is pretty great, isn't it
@MitchSchwartz ? :)
9:37 AM
The difference between a function submission and a full program submission is that the program submission is standalone - it can be interpreted/compiled without needing any additional code. A function needs to be called, and possibly captured (in the case of unnamed lambda expressions), and possibly be wrapped in boilerplate code.
apparently people feel passionately about this issue
@MitchSchwartz yes.. and there is some groupthink here too :)
What do you mean?
@Mego most people here seem to agree with you but when I talk to people in the "real world" they don't all agree
Did I miss some juicy drama?
9:40 AM
@Lembik What do you mean by the "real world"?
please cite your source for your definition of real world
@Mego not in a chat room :)
@Fatalize yes!
but it's all resolved now
If you were to meet any of us in real life (as opposed to an internet chatroom), I suspect we would continue to hold the same opinions.
that seems a fair point
We would even beat you with a tire iron, we're savages like that
9:42 AM
we don't hold opinions here. we only acknowledge true facts
in any case.. I was wrong. 60 minutes and no answer
@Fatalize Hey now, don't go making broad assumptions like that. Some of us prefer less-crude weapons.
@MitchSchwartz :)
clearly because people are scared of writing full programs :)
@Lembik That might not be because of that, but simply because there's less people right now, and it might be hard to come with a good solution
Yes, public static void main keeps me up at night. I check under the bed to make sure it's not lurking there.
9:44 AM
@Katenkyo I was only joking!
@Fatalize I would prefer to beat someone using frogs. People are scared of frogs.
so... how long should I leave this question before I post the fastest-code version? I assume they should be done sequentially.
Q: Groups of repeating items

shooqieChallenge description Given a list / array of items, display all groups of consecutive repeating items. Input / output description Your input is a list / array of items (you can assume all of them are of the same type). Sample outputs: [4, 4, 2, 2, 9, 9] -> [[4, 4], [2, 2], [9, 9]] [1, 1, 1, ...

@Lembik wait for at least some days
Personally, re:functions vs full programs, I don't mind either way. It just means the techniques are sometimes different (eg a Tips for golfing in Python for anagol would be very different)
9:50 AM
@Katenkyo will do
@Sp3000 good point
i think "Also, with some languages, the approaches with functions can be far more interesting than full-program solutions" is a persuasive argument, and the talk about defaults and stuff is kinda just an appeal to authority, or something
Having said that though, I think some people pull the "community defaults" card too fast
I think for sum of two integers there was a comment about taking the integers from different input sources, and the OP saying no
@MitchSchwartz in language poorly typed and were you have to prefix your variables with var or the like, a function means you already have a variable declared, and can be used as you like
Personally, I think it this case it's not unreasonable to require both nums from the same source
(Just as an example)
@Sp3000 I'm pretty sure the consensus is that input and output must each use exactly one method
9:54 AM
I am not sure why there has to be one view on this question. I mean I would support the questioner just saying what they want and people voting up and down as they chose.
Lemme see if I can find it (on mobile, will be slow)
A: Default for Code Golf: Input/Output methods

lirtosiastPrograms may combine two or more input methods For example, if the inputs are a string and an int, a function that takes a string as an argument and an int from STDIN would be valid. The input format must still be consistent for a given program.

^^ They pulled that one
@Lembik I think the problem here is that these tips are things to avoid in general but can be okay in the appropriate situations, but people are treating them as hard rules to go by :/
@Sp3000 Ah, another good point
@El'endiaStarman Great, it took me way longer to find this=)
@HelkaHomba thank you very much
@Sp3000 They are okay in the appropriate situations, but those appropriate situations are few and far between. The only example I can think of right now where not allowing function submissions in code golf makes sense is with quine challenges.
@Mego For someone so generous with NAA flags, I'm surprised you didn't delete your answer while fixing it. ;)
10:03 AM
not an answer
@MartinEnder I've actually been trying to delete it for the past few minutes. There's a storm here, and my internet connection keeps going in and out. :P
I think there are different communities here at PPCG which is fine and good. I think it would be much worse if we tried to limit to one of them
@Mego oh okay, nevermind :D
10:04 AM
there are those who really really like 12 byte MATL answers and would like all questions to allow those :)
@Mego With regard to functions being okay by default, I'm fine with that. I was thinking more other defaults that we have, which toe the line a bit closer
and there are those with no interest at all in questions like that
both are fine and should be allowed to flourish :) !
That, combined with the fact that, half the time, the SE JS code doesn't load for some reason, makes that delete button difficult to click.
@MartinEnder I know I used to be a bit too cavalier with NAA flags, and I made an effort to be more careful about flag usage. Is there still a problem, or are you just poking fun?
Is there some people from UK there? Would love to have some news from them after the Brexit, heard things are going south
You'd probably have better luck finding a discussion in a Politics.SE room
10:08 AM
or from Euroxit too
They're holding a referendum to rename themselves "Not-so-united Kingdom" next week
The Untied Kingdom
@Mego I don't want a discussion, just wanted toa point of view, I'm interested, but debating politic really isn't my thing.
@Katenkyo definitely South
@Mego the latter. the ones I've seen were generally justified, but I sometimes like to wait a day or so to give the author a chance to self-delete.
10:10 AM
@KazWolfe I am in the UK currently
But for real, why do they still call it Kingdom and not Queendom?
@flawr like mankind I suppose
Is there an in-browser unit test framework that supports Chai?
Same reason we don't call people Womanagers
@Lembik (fail ping) Ouch, sad to hear that
10:10 AM
It'd make sense, it'd just sound weird the first few times
@Katenkyo The UK has stabbed itself in the leg. It will most likely survive but it seems like a stupid thing to do
@Sp3000 Or womanpage
@Lembik And how do the population react? Heard there were more and more apparent racism since the referendum.
err.. some of these examples of "man" aren't great :)
@Lembik As an American, I can safely say that you will probably end up alright. We like to stab ourselves in the leg a lot.
10:13 AM
@Katenkyo when politicians say racist things then racists feel more comfortable speaking up in public.. so yes
@MartinEnder Ok, just checking :) I thought it was just poking fun, but it never hurts to be sure
@Mego right.. it's all very Trumpian in the UK
at first i read that as wuh-MAN-uh-Gers, but then i tried WUH-muh-nuh-Gers and i think that has a better flow
manager doesn't come from the word "man"! :)
@Lembik Not from a politician, from my father who was in England not long ago, saw some shops tagged with Get out and other things
10:14 AM
@Katenkyo all very sad :(
manager probably comes from the latin manus, meaning hand
just saying :)
next you'll tell me that baritone doesn't come from the word bear
u sure it doesn't come from mana?
@Lembik I know, but I couldn't think of a legitimate example fast enough that'd make it really awkward to pronounce (re:Mitch's comment) :P
@MitchSchwartz bar meaning a place to drink
@Lembik Oh jeez don't remind me about November. For once, I'm glad we're not in the global spotlight for buffoonery, though I wish it wasn't you guys either.
10:16 AM
@Sp3000 :)
@Mego the politics are strangely similar. A very rich guy claiming to represent the true wishes of uneducated poor people
@Mego Would you like my condolences now or do you want to wait til november?
@Lembik We had the same thing in France, Hollande is pretty much that, but he's not as extremist as Trump
@Katenkyo Go ahead and make them now, but hang on to them until November. You may want to add on some more things as the elections get even more ridiculous, and I'd prefer to receive them all at once.
@Mego Condolences and best wishes for the upcoming ^^
ALso, I may know some people in Canada or Europe if you want to move :)
the stress pattern in WUH-muh-nuh-Gers would be like marionette, which seems like a pretty rare stress pattern offhand
10:20 AM
I'm not sure that Europe is doing any better right now
Happy U.S. Independence Day!
@Mego Well, I guess you're true. We're killing ourself, but much more slowly
Instead of shooting in our leg, we're slowly using a knife to cut small parts around it.
@LegionMammal978 Thanks, we'll look forward to celebrating it with Scotland.
@LegionMammal978 When did the US leave the EU?
actually, it wouldn't be like marionette, hm
10:22 AM
@flawr In the year 153-76i AD
Sadly, this discussion is interesting, but I have to move my ass if I want to eat something. See you later guys.
@Katenkyo Happy ass moving.
"militancy" seems closer but still not quite right
i guess it's the way most people would say "jack in the box"
Mitch, just bust out a stress dictionary :P
10:41 AM
"physicalist", seems like there should be lots of words that fit that but i wasn't able to come up with one until i looked at a list of isms, oh well
11:08 AM
Q: Output the happy primes

Matt SInput: n Output: A list of length n, with each element being the nth happy prime. Starting with any positive integer, replace the number by the sum of the squares of its digits, and repeat the process until the number either equals 1, or it loops endlessly in a cycle which does not include 1. A...

@flawr Thanks, the twerk was good !
2 hours and no answer! :)
11:31 AM
i had a crazy idea: what if we had a community norm to make trivial answers community wiki?
i mean, solutions that are basically a built-in and whoever posts first gets it
that way, they still get posted, but there's no rep incentive to rush to post them yourself
@xnor Main problem I see is people arguing about what they consider trivial or not
Since some people seem to think it's perfectly ok e.g. to use any non-empty string as a truthy value, I'd say people will probably argue similarly ridiculous things about the trivialness of answers
I think that'd be a great idea in theory, but yeah arguing about what's trivial
11:47 AM
i guess we can start with "literally just a built-in"
(advocacy and nominally are two others, but i like how womanagers would just be all schwas, which really gives it that extra zing)
@xnor I'm for the idea in theory but just to play devil's advocate about how it might fail in practice: what if it's a builtin of some really obscure language which just happens to perfectly do the job but you're sure nobody else would have known about it (and not because the language was yours or something)
@Sp3000 eh, i'm fine with no rep for that
it could be honor system maybe, like "hey i don't think i deserve points for this but it might as well be posted all the same" idk
like not specifically disallowed, but something that would catch on cause people just feel that way about it
I'd be fine with none too, but I think some might not
Honour would be interesting
11:55 AM
people have been pretty reasonable about things like not posting an answer when someone already posted basically the same answer, so these types of subjective things could possibly work without rules based on "feel" and "honor"
i guess it comes down to people already thinking that getting rep from built-in answers is somewhat dishonorable, which i do but other don't
12:08 PM
How about we make the reward you get for a solution proportional to the number of people who upvote it? Then the community can decide which solutions should get rep.
we can make the number of upvotes proportional to the number of times people click the up arrow, too
that would be pretty sweet
Excellent :)
@trichoplax the issue is that the how good I want to mark an answer and how much rep I want to award the answerer are not the same
@xnor That's an interesting concept. I can't think of a circumstance where I'd want to separate those two. What I am I missing?
12:11 PM
@trichoplax if one person makes an awesome golfing language that has just the right feature to answer the question, and another person answer with it because they see the question first
Ah I see
another example is when someone posts a poor golf and others suggest great improvement that are incorporated
I now feel I should donate most of my rep from python solutions to Guido
@xnor I'd love to see a way to share rep.
i would happily give Guido a share if he appeared on the site
@Fatalize you are among many, many people in the same boat
I don't know if rep sharing has any chance of happening, but I think it would be welcome and well used if it did.
I dug out an older challenge:
Q: Keep your golfing in your code, not in inputs and outputs

FatalizeI am becoming more and more annoyed at the ever-increasing number of rules about what is deemed acceptable as inputs and outputs to programs Here is a compilation of such rules that I found: Interpretation of Truthy/Falsy Empty string as a truthy value Can numeric input/output be in unary? Sho...

These are the results of jpg lossy compression, when we repeatedly apply this transformation.
12:27 PM
last image looks better
I made a joking reference to "image burn" back when I answered that one - one image ending up permanently etched into the other due to the losses:
I think that challenge is a great example of a popularity contest asked well
1:08 PM
4 hours! :)
@trichoplax What the heck did you do here?=)
@MartinEnder Could you please explain to me?
@flawr majik, obviously
@MartinEnder I just saw this comment and I think you mentioned an important point, there are so many rules that are just in the form of a meta consensus. Do you have an idea how to tackle this? / Are you planning to post a meta-meta post in order to discuss it?
Something... interesting:
@MartinEnder So what if we have 10 helpful comments in a row? Wait, that can't happen in PPCG (or TNB, for that matter)
1:26 PM
Q: Find the nth digit of pi

Bassdrop CumberwubwubwubThere are already 30 challenges dedicated to pi but not a single one asks you to find the nth digit, so... Challenge For any integer in the range of 0 <= n <= 10000 display the nth digit of pi. Rules For this challenge, digits are every number after 3. Your program may be a function, or a fu...

I really hope people have tagged their challenges accordingly and this really isn't a dupe ^
1:39 PM
hi, happy fireworks, beer, sausages and illusion of freedom to all 'Mercans :)
fireworks are evil
they scare cats
So are vacuum cleaners
@EᴀsᴛᴇʀʟʏIʀᴋ Surprise for you: Windows (and DOS since 2.0) accepts both / and \ as filepath delimiters. The "backslash only" might have come around because the command-line parser treats / as a parameter delimiter that usually required \ to then be a filepath delimiter.
that formatting failed?
Needs more escaping
1:44 PM
I have to say, portal 2 has great music.
grumble grumble
If you can find some DOS 2.0 computer, you can compile and run a very old C program on it with / as the filepath delimiter, and it'll work just fine.
@flawr I wrote it up in the answer :)
@trichoplax Where was this second bonus specified??
Oh that was the pattern
1:49 PM
Yes - paragraphs 2 and 3 in the challenge
@EᴀsᴛᴇʀʟʏIʀᴋ I think one of my favorite little details in Portal 2 is how the music changes when you enter/exit Propulsion Gel
haven't hit that yet. :/
Where are you?
chapter 5
right now I'm on my way to take down the turret production
1:56 PM
how far is that?
Propulsion Gel is Chapter 7

« first day (1983 days earlier)      last day (1050 days later) »