« first day (1468 days earlier)      last day (3393 days later) » 

8:00 PM
holy crap
nested :?
 
yes
 
that is mental :D
 
[[1][4][9]]::mq gives [[1][2][3]] ?
 
[[1.0] [2.0] [3.0]] in my java shell
 
[[1 2 3 4][5 6 7 8][9 1]]::+ gives [10 26 10] ?
@aditsu yeah that ...
 
8:04 PM
@Optimizer yes
 
that is pretty powerful
 
well the ::+ was already possible via 1fb but now its for all operators :)
 
can I do ff{} now? :)
 
I bet APL is gonna run around to the corner , crying.
 
haven't changed f yet, give me a few minutes :)
 
8:06 PM
:D
:z works ?
 
write a test
 
[-1 -2 -3]:z gives [1 2 3]
 
yes it does
 
and the zipping part too ?
 
I think so
 
8:09 PM
[[[ 1 2 ][3 4]]]:z -> [[[1 3][2 4]]]
 
indeed
 
how do you handle ambiguities like :, now?
 
it does what the element is ?
for numbers, array, for array, numbers
 
so the main change is I have a parseOp method, which is recursive for : and f
 
@Optimizer but it has to decide between map and fold
 
8:11 PM
comma is currently implemented as Op1, so it treats it as unary
 
@MartinBüttner how do you fold on comma ?
 
but that's no different from the current implementation
 
@Optimizer ["abc"{...}{...}]:, would filter the string consecutively by the two different blocks
but I guess it makes sense to limit folding to binary operators where both operands are the same type
 
you can still do {,}* for those rare cases :p
 
8:13 PM
@MartinBüttner that is a very specially made array :P
 
of course it is :D
 
if you ever need to do so IRL, you should probably stop writing code :P
 
is there any binary operator with same-type operands which also has a unary meaning? (on another type, I guess)
 
ok I implemented f, anything you wanna test?
 
[[1 2][3 4]]5ff+
 
8:17 PM
it says [[6 7] [8 9]]
 
omg imma die
take that pyth with your no separators at all
 
hm, the ticket also has a comment about special cases for :o and :p (the operators, not smileys!)
 
to do what?
 
to not leave an empty array
 
8:22 PM
oh k
 
well, :o is the same as o
only p would be useful
 
I wouldn't bother
does :; work, btw?
(not that it's really useful... there's 0*)
 
no it doesn't
 
how come?
isn't that also just an Op1?
 
it's about the operator classes, ";" is just Op, not Op1
I guess I could make it Op1
but should I?
 
8:26 PM
why not?
I'd consider an Op1
 
Op is simpler.. but not a big difference
 
likewise \ is an Op2 and @ is an Op3
 
@MartinBüttner erm.. I'd rather not get into that :p
 
if \ was an Op2, you could rotate the entire stack with ]:\
 
well, you have m< and m>
 
8:28 PM
]1m<~ :/
 
1 char longer, and lets you rotate by different amounts
 
my point is... I really don't see any disadvantage to having these work... and you never know when it might come in handy
@aditsu 2 chars longer
 
you still need a ~
 
no
fold doesn't leave an array on the stack
 
o_O hmm
 
8:30 PM
I've actually used fold for non-folding operations a couple of times in the past
like getting the differences of an array is shortest with fold
 
how?
 
[1 2 3 -1 32]{_@-\}*;]
 
interesting
anyway, I guess I can make @ an Op2
 
ummm, that's Op3, right?
\ is Op2
 
sorry, \
 
8:34 PM
that would be great :)
 
and I don't have a practical use of Op3
I already made _ an Op1
 
oh, that's neat
@aditsu oh btw, is Ticket 3 coming?
 
I'm not sure it's a good idea, need to think about it some more
 
in any case I'd like if you could do something with the bottom of the stack other than crashing
like implicit "" could be useful
not GolfScript style, that there's actually a "" on the bottom of the stack
but if an operator tries to access more operands than are present, fill them up with ""
 
8:50 PM
that makes it hard to debug
 
I don't really like to rely on exceptions for debugging purposes :P
you've got ed for that
I could imagine so many use cases if the bottom of the stack was implicit "" ... especially for all these source-layout challenges :D
but just think about it... you could have g and h loops terminate by emptying the stack
how sick would that be?
if you're building strings with + in a loop, you wouldn't have to provide an explicit L to start from... you could just get going
 
anyway, I'm just trying to finish ticket 2 for now and commit the code
 
kk, no rush ;)
actually, I'll make that a feature request as an alternative to ticket 3
@aditsu Are you taking suggestions for the "unused" variables?
 
eval'd input ?
 
no variable is really unused
 
9:00 PM
we really don't need 5 ""s and three 0s ;)
@Optimizer nah, I'm not a big fan of that
 
@MartinBüttner its handy in a way that you can reuse it
 
@MartinBüttner well, what do you have in mind?
 
for a start, 100 and/or 256. they seem to be the most common numbers beyond 20 I have to use in my code, and they always annoy me. :D
 
think about it a bit.. a variable when used, gets evaled (or even non evaled) input can be reused and save a lot of bytes in duping it
 
@lembik yes I noticed the 5th comment vote so I'll definitely be adding visualization now. I'm considering filling a folder with an image for each arrangement but that would be bad if they choose a large n. Maybe I'll display the number of arrangements first and then say "Are you sure you want to create this many separate image files?"
 
9:02 PM
@Optimizer eval'd would be weird, if the input doesn't eval to a single value
 
it just contains all the values
 
(or if the input contains code that doesn't terminate)
 
that would be eww even in current situation
 
in the current situation you wouldn't write a program where that could happen
if you added that as an interpreter feature, you literally couldn't take input that is code that doesn't halt
 
the variable can be lazy initializing
I dont see why this needs convincing ..
so many places we try to use ea just because we want to reuse the input
 
9:06 PM
ea doesn't evaluate straight away either. but lazy initialisation is a good idea (although it would be quite a special case then...)
 
even a non eval-ing input variable would be so handy
 
but eval'd is just a killer
 
9:36 PM
finally, pushed the code and closed ticket 2 :) feel free to pull from hg, build and test
 
nice
is the online tester updated yet or will that have to wait until the next release?
 
next release
 
@trichoplax my problem is that as there was only one answer, I am not sure it is worth posting my follow up questions
I thought it was a nice problem!
 
@Lembik it really is!
 
9:49 PM
@MartinBüttner thank you! Do you think I should just leave it a week or two
and see if people pick it up?
the associated article has some very smart ideas people might be able to use
I mean the one that solves the problem without worrying about the collisions during rotations
 
that one of the problem restrictions isn't relevant until large N is a bit non-nice to me
I could re-post my answer from here and get the highest score
ok, it would have to be modified not to connect the end
 
@feersum how would you know which values it is correct up to?
@feersum we don't know the smallest n for which collisions during rotations make a difference
 
it would be your problem :P
 
at least not yet
that's not the sort of thing we want to see here! :)
actually I asked on math.se if someone could prove the smallest n for which it makes a difference. I can see it does for n = 25
but maybe less as well
I could have asked on puzzling.se .. I would have got a lot of answers immediately
then when they proved wrong or unsupported a lot of close votes on the grounds the question was impossible :)
(sorry puzzling.se, you only have yourself to blame)
 
n=23 is over 2 billion for the easier version, so it is probably impossible to calculate enough of them to even reach the restriction in 1 minute
 
9:56 PM
@feersum I am not sure.. did you look at americanscientist.org/issues/pub/how-to-avoid-yourself ?
 
no
 
computers weren't very fast in 1972
I imagine one minute on my computer was more computing power than they had in a lifetime on one of their computers
 
if you actually wanted to consider rotations, you would have to use a much less efficient and more complicated method
 
@feersum you mean to worry about collisions during rotations?
do you mean my problem is much harder than their's?
 
naturally
 
10:00 PM
ok.. well I can't say :)
as I don't even know what the more sophisticated methods of A. J. Guttmann were yet
 
it has all the restrictions of the other problem plus some kind of pathfinding
 
It's not clear to me that you actually have to count each shape in turn
it seems you can get a lot in one go potentially
some sort of divide and conquer I have in mind
 
it could be doable, but seems like too much effort for PPCG
 
or maybe something cleverer
@feersum maybe... :) I mean some of the answers here are awesome and need a lot of brain power
@feersum someone might want to spend an evening working on something
people go to a lot of effort for no reward
see math.stackexchange.com/questions/562694/… as one of thousands of examples
I don't see why people would go to less effort on PPCG than they might on any other .SE site
@feersum unless you just mean programmers are lazy :)
 
it could happen but there are lots of other questions too
 
10:07 PM
sure but there are always lots of other questions!
that's true everywhere
the question is, are they more interesting to everyone :)
 
@Lembik what is your question? i can't sem to find it
 
10
Q: The number of reachable snake orientations

LembikThis challenge is not about the game Snake. Imagine a 2d snake formed by drawing a horizontal line of length n. At integer points along its body, this snake can rotate its body by 90 degree. If we define the front of the snake to be on the far left to start with, the rotation will move the back...

In this case I feel a good answer would get a new oeis entry :)
something to be proud of
@randomra I have two questions going.. the other one is about counting kmers
the second question may be about to be cracked by FUZxxl and the magic of suffix arrays ...
 
ah, I thought you had some new hard problem
 
@randomra well it is about one week old and hard :)
@randomra do you mean my challenges are too easy? :)
 
I like these and think about them although usually you only see an upvote...
 
10:15 PM
thanks!
 
The day when a Lembik problem takes 10 minutes to solve is the day when PPCG graduates
 
hey golfers
 
Hi!
 
@MartinBüttner a.) Sorry, nope. b.) 531 results... O_o
Perhaps I'll write a small script to un-CW all the [tips] questions and answers, because 531 is a bit much
 
@Doorknob huh, is there no way to un-CW all question with all its answers?
 
10:21 PM
@Lembik if collision would only count at turning start&end positiions do you think that would be oeis.org/A037245?
your example undoable shape can be made in that case
 
16
Q: Allow "Remove Wiki" on a question to cascade down to answers

BeofettWe recently had a question appear on the "Hot Network Questions" list, and it attracted a lot of attention to our site. We are very grateful for the views, and the influx of new users (many of whom appear interested in sticking around, which is just fantastic for a beta site that needs more part...

 
meh :/
 
Hey @Doorknob... educate me ... ;-)
I have judged this question on Code Review as off-topic both on CR and PPCG. Still, I thought I may be wrong, and sometimes things can be 'adjusted' to make it work. Thoughts?
 
@rolfl if he actually wants to cut it down to minimum byte size it would be on topic as a question, but if he just wants a short-but-readable version, it's not. however, even in the former case, I'd probably CV as duplicate on our standard quine challenge, because I'm sure it has the shortest known JS quine.
 
There is such a thing as a short-but-readable quine ? ;-)
actually, the longer it gets, the less readable it is.
I think you're right, and it's too ambiguous.
 
10:34 PM
there are short and readable quines, but it depends on the language :)
 
Do we have a decision problem quine challenge?
That is, determine whether the input is your source code or not
 
@rolfl It seems like you've been rule lawyering the guy a bit though with this comment ;)
 
I read about this recently and it seems like a much better problem than standard quine, since it disallows degenerate answers
 
unless "Questions about code whose functionality depends on the source itself are off-topic" is CR policy ;)
@feersum yes
 
10:40 PM
Yeah, it is rule-lawyering... I know that.
I wasn't trying to make it subtle ;-)
A quine is a particularly hard thing to review, because you cannot suggest any valid changes without changing the output.
and if people on Code Review want to play code games, they should do it somewhere else. Not that we can't have fun... though. We like competitions. Just ask PCG.
 
would it be possible to produce a quine that would still work with a single character deletion anywhere in the code?
 
QQ ? :)
 
degenerate echo quines work, for starters
like PHP without <?, etc.
or do you mean the original unmodified source?
 
the person writing the code doesn't get to decide which character is removed
basically, a quine that is still a quine with any 1 character removed
 
That would be unlikely.
 
10:45 PM
then my above comment is still valid
 
@aditsu not itself a quine though
 
example feersum?
 
That can be easily solved with the Befunge technique mixed with the 2D quine
 
ok, my PHP quine is "abc"
 
For example, most languages require whitespace somewhere....
 
10:45 PM
@rolfl you don't know the kind of languages we're using :D
 
@MartinBüttner does it actually do Q twice? I'm not sure it's clearly defined
 
I'm pretty sure it does
but I'm not an expert on HQ9+ either :P
 
you may be right
@rolfl whitespace is the easiest problem to solve
just double them :)
 
I knew I had heard it somewhere... I thought it was a PPCG challenge but no
 
10:53 PM
@aditsu it's not that trivial, because there might be whitespace that doesn't automatically get replicated exactly in the quine
(because you manually replicated it in a string)
 
ah
 
I like the issue on that github post - is it meant to quine the original or the one deleted
 
well, depends if it's a quine that really constructs itself rather than taking an easier approach :)
 
oh okay
so it's not what Nathan asked for
I'm still surprised this hasn't been asked yet
 
I was just asking - because when I said it was easy in Befunge I thought Nathan meant outputting the original program
 
10:57 PM
although it does seem impossible without reading your source code, because even if you manage to get the framework redundant, there's generally no way to notice if a character has gone missing outside the actual string construction
this reminds me... did anyone ever write a quine in marbelous?
doesn't look like it
 
Maybe if you had a language where 11 pushed two ones and deleting either outputted 1 automatically with no newline
 
well yeah, in CJam 1 and 11 are both quines
but I wouldn't count that
in /// everything not containing / is a quine
 
same deal as PHP
 
^^ that's the one I was thinking of
 
11:05 PM
that's a fault-tolerant way to point to my comment in befunge :)
 
11:19 PM
0
A: Sandbox for Proposed Challenges

Sam WestonMissile War Background So here's the situation, we are at war! The last line of defense between them and us is the two walls defining us: +.....................................................+ +.....................................................+ +..............................................

 
11:34 PM
@PeterTaylor re normal distribution: someone else also requested a ruling on how accurate the results have to be. I tried fixing that by stating that the chosen algorithm must by exact in theory (ignoring datatype and PRNG limitations) and that all arithmetic needs to make use of the full width. let me know if you think that has similar flaws as my phrasing for the shuffling challenge.
 
Does exact in theory mean that it needs to be able to output ridiculously large/ridiculously small numbers with nonzero probability?
(i.e. numbers probably outside the float range)
 
no, it means that given a perfectly uniform source (of reals, not floating point numbers or something), it should produce a perfect normal distribution as output
 
should it be able to put out irrational numbers? :P
 
the algorithm?
absolutely
the implementation doesn't need to though :P
 
@MartinBüttner No, I think it's ok. The fact that the question necessarily requires the use of non-integral numbers makes a significant difference to its natural interpretation.
 
11:41 PM
if a language had only a random integer generator then it would be impossible to use?
 
@feersum you could draw integers in 0...MAX_INT and rescale that into the required range
that's a good point though
I should specify the minimum range the uniform distribution should be taken over
how is that? (just edited)
 
or you could assume you have a function for generate numbers from 0 to 1 which does not count as part of the code
 
hm, interesting, but I'd rather see people work with what their language gives them
 
in other words, exclude languages w/o random float generator
 
@aditsu wow, that feature request was handled quickly :D
 
11:51 PM
well, it was simple and not controversial, so while I was at it... :)
 
thanks :)
hm, maybe I should include one instalment in the randomness series to actually write a PRNG?
for example, it looks like we never golfed a Mersenne Twister (although I can't tell how much fun that would be)
 
x << 23 | y >> 57 | x & ~9039236237LL ... doesn't seem that fun
 
Well there's been this
 
@Sp3000 huh, interesting... I think that's quite different though
 
Well if you're doing specifically Mersenne Twister, then yeah it is - just thought I'd point out something related :)
 
11:57 PM
yep, thanks
I mean, maybe there's a more interesting one out there
there's also still "generate points on a sphere uniformly" ;)
 
Can we ditch the north pole? :D
 
it has probability 0
 

« first day (1468 days earlier)      last day (3393 days later) »