« first day (1463 days earlier)      last day (3379 days later) » 
00:00 - 19:0019:00 - 00:00

12:29 AM
Regarding the elevator challenge, how will the submissions work, exactly?
Are they going to be functions that are called each time an elevator needs a new destination?
 
12:45 AM
I might go with the init-update model.
 
@trichoplax finally used up my last question on the CG proposal, if you're interested: area51.stackexchange.com/proposals/74985/computer-graphics/…
 
@MartinBüttner Will have a look now. I see you followed AL too :)
 
yeah, but I haven't really done anything with it prior to Lab Rat Race so I won't be able to come up with proposed questions for that
 
An extra follower is encouraging either way
It was just me for a long time...
Nice question on CG by the way
The growth seems fairly steady so hopefully we'll see another private beta within the next month or two
 
thanks. it's been asked on SO I think, and there are a couple of other posts around the internet, but I find all of it very unsatisfactory. most answers are either "well, project your plane noise onto the sphere and deal with the artifacts" or "cut your sphere out of 3D noise", which is both quite suboptimal
(and I'm generally interested in data on the sphere since that's what I've been working on for the past couple of years in our cosmology department)
@trichoplax well, we need to go through commitment first
 
12:59 AM
@MartinBüttner I'm interested in spherical distribution myself (with no background or expertise) for attempts at ray tracing
There was a question last time round about distributing points evenly over a sphere
 
I think healpix sampling is an equal-area sampling
oh yeah, the "EA" in "HEALPix" stands for "equal area"
 
Okay, I'm working on an elevator challenge controller, and I'm trying to figure out how the submissions will interact with the world.
 
take inspiration from elevator saga? I think an event-based challenge would be a novelty around here
 
In the online game, the user sets up a bunch of listeners for specific events.
And I don't know the best way to implement that sort of stuff in Java.
 
1:22 AM
Well, I don't have any clue how to do that..... My solution: each elevator or floor object will have several values which will be modified any time an event occurs, so floor.buttonPushed will give what button was just pushed (if any).
 
@MartinBüttner I like the second (third?) one on this page (Marsaglia 1972). It seems to work well even for evenly spread (not random) points.
 
healpix isn't random either
 
The one on that page is intended for random uniform distribution but seems to work well either way
 
and afaik it's actually an equal-area pixelisation for any number of samples (so it doesn't just tend to a uniform distribution as you increase the samples)
 
nice
 
1:40 AM
but you can really overthink this stuff. for circular zero (that game prototype, remember?) I needed to generate samples on the circle to monte carlo the score. so I thought I was really clever and did it in polar coordinates, with a non-uniform distribution in r to ensure a uniform distribution r dθ dr ...
well turns out, you're half an order of magnitude faster if you just generate samples on the square and discard those that lie outside the circle
so to generate uniform (random) samples on the sphere, I would maybe just generate samples on the cube, discard those outside the unit ball and then project them onto the sphere.
 
1:58 AM
Projection is a nice touch to get the full use of the interior. Would you discard the centre too?
 
just in case, although I doubt you'd ever actually get the centre if you're sampling floats
 
I wouldn't have guessed that circular zero used monte carlo for area. Not that I can think of a way of intersecting multiple arbitrary circles - it just hadn't occurred to me
 
a possible refinement would be to sample and discard on a square of theta/phi
 
I don't follow
Spherical polar coordinates?
 
it's about sampling the surface of a sphere, right?
 
2:04 AM
yup
 
right, spherical coords
seems more sensible to generate 2 coordinates for a 2d space
ok it would not be directly a square on two angle dimensions
 
The problem with uniformly distributed theta and phi is that the resulting points are not uniformly distributed over the sphere
 
one of them would have to be scaled down
and the other interval discarded
 
@trichoplax yeah, I found this paper for intersecting 3 circles and gave up on it :D ... but I had the k-d tree already implemented, so testing whether a given point was coloured or not was pretty trivial (and not too expensive either)... so I decided to just monte carlo that, especially since I could run quite a lot of samples between when the mouse is released and when the wall has been completed (by doing only a bit each frame)
@feersum that's what I described above for the circle. in that case it turned out to be a lot more expensive than just sampling on a square and discarding.
I'm not sure how it would be if you need to project samples from the ball back onto the sphere though, since that is probably not exactly cheap either
 
makes sense for a circle, since a circle is 2D as well as a square
but projecting 3D onto 2D might end up being more wastecful, is the idea
 
2:19 AM
yeah, that could be true... someone should try it...
 
make it a code golf and see which one is shorter, lol
 
lol
if I'm not mistaken, sampling uniformly in theta will require computing an arccos... that could be expensive
anyway, it's way too late to think about this kind of stuff
 
Sleep beckons
 
something like
t = rand() * pi; p = rand()
if ( p > cos(t) ) continue;
p = p*2*pi / cos(t)
 
I can't follow that right now
 
2:27 AM
Maybe we need a challenge to distribute points uniformly over an arbitrary implicit surface
 
what do you mean implicit?
 
as opposed to parametric
 
specified how?
 
So like x^2 + y^2 + z^2 = r^2
rather than using parameters over set ranges
 
sounds really hard
 
2:29 AM
That equation took so long to type this tired...
yeah I have no idea how to do it
I just realised that a sphere is only easy because projection from the ball to the sphere is always directly away from the centre. With any other implicit surface this isn't the case, so it made me wonder how on earth you'd distribute points evenly
 
what kind of terms would you be allowing in the equation?
 
i'm sure polynomial terms are hard enough :D
 
I guess you'd have to keep it to low integer powers...
Even for quadratic I can't see a way of doing it for anything but a sphere
I guess a cylinder can be done
 
anything quadratic should be only a scaled sphere, no?
 
well it could be an ellipsoid or a cylinder or a paraboloid or a parabola
 
2:33 AM
I was thinking only finite area would be allowed
 
that would make sense
ellipsoid then
which is sort of like a scaled sphere, yes
although I'm sure even that's hard when the ellipsoid isn't axis-aligned
 
So that should be possible using the awkward way (non-uniform distributions)
 
then it's mostly about diagonalizing the matrix
 
okay, you guys figure out 3rd order polynomials... I'm going to bed... :P
 
I can barely type - I need to sleep too!
 
2:36 AM
lol gn
 
good night :)
 
 
6 hours later…
8:53 AM
Could I get someone to add this question to the sandbox list?
GCD with strings
[tag:code-golf] [tag:restricted-source]
0
A: Sandbox for Proposed Challenges

impinballGCD with strings code-golf restricted-source Objective: Find GCD of two numbers, passed as strings. Rules: It must be a function with two arguments. Both arguments are strings. The return value must be a string as well, representing a positive number. The strings may be assumed to be positi...

 
0
A: Sandbox for Proposed Challenges

impinballGCD with strings code-golf restricted-source Objective: Find GCD of two numbers, passed as strings. Rules: It must be a function with two arguments. Both arguments are strings. The return value must be a string as well, representing a positive number. The strings may be assumed to be positi...

 
9:46 AM
@impinball Done.
 
 
1 hour later…
11:09 AM
meh... I just thought I had the best code golf idea... sort the digits of a number using only arithmetic... but then I (re)discovered this challenge from several months ago with the really broken scoring system: codegolf.stackexchange.com/q/25003/8478
but a handful of submissions ignored the weird bonuses and penalties and actually just golfed it without arrays and strings... those aren't competitive in that challenge at all, but I'm afraid that makes my idea a duplicate :/
@Peter opinions? ^
 
12:07 PM
@aditsu can you fix the representation issue of an empty array ?
it causes issues with other users saying that its not an array
 
@Optimizer then it's going to cause issues with the representation of an empty string
 
why .. ?
its not like internally there is no difference
 
well it can only be presented as one of them, right?
 
no
 
there is no difference internally
 
12:18 PM
Lp gives [] , ""p gives ""
 
what?
that must be new
 
I am saying after the fix.
:|
 
actually no
just tried it
 
ofc.
 
Lp gives ""
 
12:19 PM
DUDE
care to read ? :)
 
I thought by "after the fix" you meant "after his most recent fix"
 
no, he did not fix anything related to this.
 
but as far as I know there is no difference internally
strings are just arrays, distinguished by the fact that they contain characters. so an empty string and empty array can't be distinguished
 
anyways, soo . I am pretty sure there is a bug somewhere. If you have 3 characters on stack and you do ed it shows a string
 
well the stack is also just an array
 
12:20 PM
which is completely wrong
 
so if it only contains characters it's treated like a string
 
let it be an array. I am talking about the representation
 
sort of makes sese
 
no it does not. I want ed to print my stack exactly as is
I have three characters, I want 3 characters
not a string
 
but it does :P ... you just have to accept that, in CJam, an array containing characters is by definition a string
(and that the stack is just another array)
 
12:22 PM
no
not in this case at least
 
well I could really care less about ed
 
there is no array on stack
just plain 3 characters, which I can use @ too
 
I didn't say there is an array on your stack
your stack itself is an array
still, I don't see how it matters... you'll never use ed in an actual submission, and you know what's going on.
 
forget about what the stack is . ed prints the content of the stack, which is 3 characters, not a string
I am saying the bug is same
 
Lp -> "" is not a bug. it's a feature.
 
12:26 PM
^ typical developer excuse
"its not a bug, its a feature"
 
it's literally a deliberate design decision
 
^ this too
 
you should get on with your CJam-fork then
 
and its not really hard to differentiate array from strings.
my interpreter is having strings and array as different types only
and I dont see where it will be lesser useful than right now.
 
 
1 hour later…
1:31 PM
Should I edit down AND delete my old posts in sandbox? Why to do both?
 
@randomra because high-rep users still see the deleted answers among all the others and need to scroll past them.
and having the link to the posted challenge is also quite useful.
 
got it, thx
 
1:49 PM
@Optimizer lol, see my revision history
 
:D
well, I certainly did golf it though
while u were not sure :P
 
nice trick with ArrayList ArrayList # ... didn't know that was possible
 
its not array list array list #
I think you are thinking too much "All strings are arrays"
its simply "foobar".indexOf("foo")
 
it is most definitely ArrayList ArrayList #. try it with arrays, it does exactly the same thing.
and yes, that's what it does effectively for strings
 
so whats new in that ? pretty sure that you must have also used it before
 
1:53 PM
nope
I didn't know this was possible
 
so what was # for ?
(as per you)
 
I only used it for finding characters or array elements (or using it with a block). not substrings or subarrays.
 
I see.
i have used it a lot of times for subarrays
something like [ 1 23 3 1 2 3 4 1 2 3 1 2][1 2]#
 
@Optimizer Slight rule-bending with swapping input order :P
 
I should probably experiment more CJam operators... I wonder how many other "undocumented" parameter combinations exist
 
1:56 PM
@randomra oh, it doesnt matter, i can reswap it too
@MartinBüttner .there is nothing like "documented" parameter combinations
 
true... well for most of the operators it's obvious. but then sometimes he's got some more obscure combinations as well
like % for splitting
 
yeah.
that was a surprise
but it was not because of undocumented parameter combinations :)
 
I wish there was x or so to stop execution of the program (without printing anything)
 
2:14 PM
hi @MartinBüttner
if anyone is interested
 
I'm not sure I'll have the time for it
the collisions are pretty tricky when you consider that you can fold more than just a straight end of the snake
 
@MartinBüttner that's a shame.. might have time if the bounty doesn't get awarded afterwards?
I am not against offering another bounty at a later date if that helps
 
I don't really know... can't make any promises
 
@MartinBüttner there is a more or less straightforward naive algorithm I think
it's just not very fast
you can basically look at all pairs when doing a rotaton
and check if any of them give a collision
 
2:41 PM
@Optimizer I will look into it; it's not trivial, Martin explained the current situation very well
the easiest short-term fix is to present empty strings as []
(if preferred)
I could treat arrays and strings as distinct types, but then I need to define when and how do they convert to each other
and perhaps modify some predefined variables.. more compatibility breaking :p
 
yeah, it would be a big change if the architecture is not like that now
compatibility breaking is fine
people can still download and use the older jars
 
yeah I also think so.. maybe I can do it in version 0.7
 
sure
 
there's already a "ticket" filed at sourceforge.net/p/cjam/tickets/14
 
cool
 
2:52 PM
I also noticed the discussion about "undocumented" parameters :p I think I should start to document the operators in depth
although the ones mentioned above don't seem that surprising to me (assuming some golfscript knowledge)
 
yeah, me too
but the % was surprise
that it splits on runs
 
gs does that too
"Split array around another array, like /, but remove empty results."
 
@Lembik I think the trickier thing will be the actual enumeration and avoiding duplicates. you can rule out reflections by requiring that the snake starts to the right and first bends left, and that there are never more right than left turns. as for rotations I think you need a representation of the snake from its own point of view (in terms of turns) and be able to reverse that representation.
@aditsu "assuming some golfscript knowledge" :P
I also didn't expect ~ to be able to eval characters
and there's just no way to figure out what j does without reading the code ;)
 
@MartinBüttner or reading your explanations
 
user23013's actually
 
3:06 PM
not Dennis ?
 
still, I read urs only :P
 
well, that's not the ones that were discussed before :p
 
5
A: Mixed Base Conversion

user23013CJam, 45 q~_,@m>0@{@(:T+@T*@+}/\;La{\)_@+@@md@@j@+}jp; Finally I found a good use of j. But this is slower than the program below. How it works Long ArrayList Block j executes the block which takes an integer as the parameter, and Long j will call this block recursively in the block. It will...

 
I should also post a couple of examples for j
 
3:07 PM
@aditsu yeah even for those... I wouldn't expect people to know golfscript
 
for now, here's a memoized "n-th fibonacci number": 2,{(_j(j+}j
 
Can we also start giving feature requests ? :P
 
(I have it sitting in a file)
 
I want an increment unary operator
and decrement.
 
like ) and ( ?
 
3:09 PM
like them but updating the variable
 
@Optimizer I thought that's what tickets are for :P
 
@MartinBüttner silly Martin, tickets are for kids
 
yeah those tickets are for both bug reports and feature requests
 
or was that trix ? trix is for kids ?
 
ooh that reminds me, I should add the milestone
 
3:11 PM
you should also move stuff to github :P
 
no I shouldn't :D
 
yes you should
 
its so much better and easier
 
it's much worse and harder :p
 
this sounds like a constructive argument
 
3:12 PM
sourceforgenet is 10% of the time down
it makes u wait 5 seconds before downloads
its evil.
 
well, I admit it's not perfect, but I haven't found something better
 
Github
for geesus' sake
 
and yes I know github is popular, it's just not a match for me
 
how old are you ? :P
 
mid-30s, why?
 
3:15 PM
generation gap could have been one of the reasons ..
 
first problem with github is the first 3 letters
 
its a smaller problem than the first 11 letters of the other option
 
anyway, you're welcome to mirror it on github if you'd like to
it's free software :)
 
mirroring on github doesnt really server any benefits
 
@aditsu git is amazing. trust me, if you ever find the time to spend a week or two using it properly, you'll never want to go back to SVN or whatever you're currently using.
 
3:20 PM
CVS
?
please dont say CVS
 
guys you're being offensive
I'm using hg
 
I guess that's alright
(I've never used it, but I haven't really heard bad things about it)
 
it's somewhat like git, except it makes sense and usually does what I expect
they're comparable in terms of features
 
first comment? :)
 
3:23 PM
:P
 
mercurial does not have branches
its all about folders
at least not real branches.
 
what are you smoking? yes it does
 
@aditsu so you are saying it has "real" "soft" branches ?
not different directory paths
 
not sure what you mean by "soft", but yes it has
it's not svn
I have 2 branches in cjam
 
hmm, I wonder why mozilla does not use it then ..
 
3:28 PM
you mean like hg.mozilla.org ?
 
yeah
 
well, check it, it's being used :)
 
name a branch
 
in cjam? I have default and gwt
 
in mozilla
 
3:29 PM
I don't know, I haven't looked at their code
 
they dont use branches
 
or are you saying they don't use branches?
ah
I thought you said they don't use hg
no idea then, I'd expect them to have some branches
 
mozilla is my only experience with hg
 
those are all separate folder paths
 
3:32 PM
no, they're branches
 
oh these
noone really uses them
no
see the dates
 
there are some more recent branches at hg.mozilla.org/chatzilla/branches (different project)
anyway, whether or not they use branches, I don't know much about their practices and how they decided to manage their codebase and why
better ask a mozilla person :)
 
heh
 
oh I just noticed.. in my memoization example, the chat ate a backslash
 
@aditsu yeah, I figured ;)
 
3:43 PM
2,{(_j\(j+}j
better :)
 
you could just wrap it in backticks
 
like this? 2,{(_j\(j+}j
 
I'd used that here, completely ignoring the fact, that a non-memoised fibonacci implementation is equally short
should have used 2, probably
hm, doesn't make a difference
 
I just looked at codegolf.stackexchange.com/questions/37905/… - the latest version doesn't "expand and fill the internal array" anymore
it uses a map now
so you figured out how to use j by reading my uncommented java code? that's awesome :)
 
well, I tried, and couldn't quite piece it together. but apparently user23013 did.
 
3:48 PM
you could have asked :)
 
u were not here :)
 
I'm not that hard to find, plus I have an answer about cjam somewhere, you can comment on it
 
well it's impossible to ping you if you haven't been in chat for 2 weeks or so ;) ... but yeah, the CJam answer would have been an option
 
in my user info you can find some ways to contact me
and there's sourceforge, with forums and tickets
 
oh god, never make me click on that website again :D
 
3:51 PM
hahaha
 
oh. my. god. I did not get a noification about that
and failed to check it from time to time
 
@Doorknob The Sandbox has lost its tag. Could you please re-add it?
 
@ProgramFOX I've already flagged it (which probably gets some mod to do it more quickly than pinging one of them in chat)
 
4:14 PM
@ProgramFOX Fixed
 
thanks
 
@MartinBüttner I get chat ping notifications on my phone, but I only see flags when I check the site (and I don't check meta flags very often), so if you want me, a chat ping would be faster :)
 
haha, good to know
 
@MartinBüttner It's hard to tell what's competitive in that question - there appear to be open questions over the scoring of some of the better answers - but you probably already know that I'm of the view that being able to copy earlier answers with only minor changes makes it a duplicate whether or not the scoring system is strongly positively correlated.
 
@MartinBüttner I posted an answer at sourceforge.net/p/cjam/discussion/general/thread/39fd9617 (sorry to make you click on that website again :p)
 
4:18 PM
@aditsu oh, I didn't mean that website... I meant your homepage linked to in your profile :P
 
ooh, hmm, well, I guess that's worse, since I made that one
 
"it can work with multiple parameters" :O
 
I should update it sometime
 
if the types aren't integers, how do you initialise the values?
 
well... you don't
 
4:20 PM
oh okay
 
you can just put things in the block
 
also, isn't a in xn a f n j redundant if you can't use it anyway?
 
you can use it if x's are integers
 
I mean for n > 1
oh wait
can a be a nested array then?
 
yeah.. something like that :)
 
4:22 PM
that's rad
@PeterTaylor it's a shame that a bad question with a good problem can ruin the problem for the entire site ;)
@aditsu can we get file system support for CJam? ;) ... just a simple "content""file"write and "file"read ... can even be on an e_ command
 
@MartinBüttner It's also a shame that so many people can't tell a bad question from a good one.
 
but some challenges require it, and it's always annoying to be left out ;)
 
@MartinBüttner yeah I'm thinking about reassigning the standard in/out, not sure about binary mode
 
oh that's a good idea
does ed and errors go to STDERR?
@PeterTaylor yeah :/
 
currently they go to stdout
I could change that, or make them ignore the reassignment
the issue with stderr is it doesn't get separated well in eclipse
it's like 2 threads competing to write to the console
and on the web.. I guess I would need a separate area for it
well, on the web you couldn't use files anyway :p
unless I implement a whole environment
 
4:46 PM
@aditsu obviously...
(although it would be nice... :D)
 
 
1 hour later…
5:48 PM
@MartinBüttner would you mind adding any interesting ideas maybe as comments?
 
I don't really have anything substantial, and as long as I don't try how well it works it's all just wild guesses
(which I don't think belong in comments)
@Dominik had already started on a visualisation, so maybe he would be in a better position to develop that into a full submission :P
 
@MartinBüttner ok
 
6:20 PM
@Optimizer I feel like learning J for the scrambled keys challenge just to beat both CJam and Pyth :P
 
are you sure you can win ?
 
J can decompose a permutation into cycles in 2 characters, and I'm sure it doesn't need 23 to find the cycles' lengths and their LCM ;)
 
but you have to make sure that you count only the relevant cycles
their might be a cycle that is completely not coming into picture
for the given name
 
ah, true... hopefully J can filter by intersection in 2 characters as well :P
 
dreams! I say!
 
6:24 PM
eh.... as good a reason as any to finally learn J :P
 
pretty sure APL answer is going to win
 
J has beaten APL before... but more importantly, I am not going to learn APL :P
 
6:42 PM
okay, maybe I will not beat Pyth...
 
lol
oh wait. I put the input in wrong order
 
00:00 - 19:0019:00 - 00:00

« first day (1463 days earlier)      last day (3379 days later) »