« first day (1454 days earlier)      last day (3372 days later) » 

vzn
12:23 AM
0
Q: recording highlights of codegolf site history

vznthis site is not very old and yet, speaking as mostly an "outsider," clearly has a colorful/ unusual history. it is not a typical site for stackexchange and has many unique aspects, such as demographics like a very dedicated user base, young, and very eager to learn, etc. my suggestion is that s...

 
12:36 AM
1
Q: recording highlights of codegolf site history

vznthis site is not very old and yet, speaking as mostly an "outsider," clearly has a colorful/ unusual history. it is not a typical site for stackexchange and has many unique aspects, such as demographics like a very dedicated user base, young, and very eager to learn, etc. my suggestion is that s...

 
 
8 hours later…
8:15 AM
Is the next Fortnightly Challenge decided purely based on most votes? Or is there discussion of which one is most ready?
 
8:51 AM
@trichoplax the idea is to base it purely on votes. I don't think there is any concept of "ready" for the themes suggested there.
 
So it looks like Data Structures unless there happen to be any last minute votes. When is the cut off?
 
there's no hard cutoff, but the date for picking it is tomorrow
hm, I wonder why people are opposed to that meta question. an answer from one of the downvoters would be nice
@trichoplax re your comment, I guess it depends on what you consider young :P
 
@MartinBüttner yes lol. I upvoted though - it would be a great post to have, especially for people joining the site. It can give an insight into why there are questions from years ago that would no longer be accepted.
 
data structures!
 
@Lembik It's in the lead by 3 votes at the moment...
 
9:05 AM
@trichoplax codegolf.se is so grown up these days :)
soon you will require a PhD certificate to log in :)
 
lol
 
I have to say.. choosing the right data structure problem is non trivial
dimacs11.cs.princeton.edu/competition.html is not to do with data structures but looks like the direction part of codegolf is going in
 
At least with a fortnight we have more time for throwing around several different ideas in the chat room before deciding
 
@Lembik I'm sure that's why Sp3000 submitted it for the fortnightly challenge instead of just going ahead and posting it himself ;)
 
not number 11 specifically.. just the general model
dimacs competitions + kaggle :)
if I give you a list of file names, can anyone think of a neat way to check that the files in the current directory are a subset of those?
I mean clearly I could write a python script that made a set of the file names of interest and just looked up each one in the directory in that set
but I meant something more compressed and neat :)
 
9:14 AM
Compressed in terms of expressing it in code, or in terms of what it does in the background?
 
in terms of expressing it in code
I have a weakness for obscure bash tricks, for example :)
 
is it a one liner in python?
 
oh.. umm
I don't know if that can be done
 
I'm not that familiar with file system manipulation
Maybe you should post it as a question :)
Just posting in the sandbox might give you a very short solution that would show that it isn't suitable as a main site question - but then you'd have your answer anyway...
 
good idea :)
 
grc
9:39 AM
@Lembik something like set(file_names) >= set(os.listdir('.')) ?
 
9:56 AM
@grc oh that's surprising!
talk about overloading :)
does os.listdir list directories too?
 
10:15 AM
maybe I should have asked a simpler question for my first fastest-algorithm question ...
 
grc
@Lembik yeah - use os.walk if you need to separate files from directories
 
@grc interesting! Python has everything
 
grc
import antigravity
 
yes I know about that :)
 
grc
:P
 
 
1 hour later…
11:39 AM
@MartinBüttner Basically, that is the reason :P Also I was hoping someone would know some more interesting structures
Suffix tree's about the only cool thing I know
 
12:31 PM
I've done some rudimentary analysis of the keep your distance challenge
It seems like if (a+b+c+d)^2-4(a^2+b^2+c^2+d^2)<0 we'll find a local score minimum at (a+b+c+d)/4 and so either 1 or 99 was the winning choice
 
@so
@Sp3000 I know data structures if that helps
 
otherwise, we'll find a local maximum at (a+b+c+d)/4 and two local minima at sqrt((a+b+c+d)^2-4(a^2+b^2+c^2+d^2)) distance on both sides of it
 
That's what the chat is for :D everyone can throw in ideas
 
so in that case 1, 999 or (a+b+c+d)/4 has the highest score
 
(so yes, it does help)
 
12:35 PM
@Sp3000 van Emde Boas trees would be a cool and quite advanced challenge
where we have to time inserts, deletes and predecessor queries... somehow
 
@overactor What's a,b,c,d?
 
@Sp3000 The four numbers that were picked in a round
 
Oh, starting with a simpler case?
 
@Sp3000 the main problems would be a) how to specify the input b) how to time the results
@Sp3000 another alternative is not to define the data structure but rather to define the abstract data type
@Sp3000 this has very nice advantages and also maybe some disadvantages :)
the competition could be about space and time if we could agree on ways of measuring them
 
Space is probably going to be more of an issue
 
12:40 PM
@Sp3000 as in more difficult to measure?
 
Time at least is okay for most languages if you use a common system (or three)
 
@Sp3000 I think it's easy enough to measure the total RAM used by a process
but this of course is bad for some languages
 
Yeah, like I'm not sure whether some languages might implicitly use more memory
 
@Sp3000 or we could say the whole thing has to be represented in an array of integers in some range
and just count the length of that array
this makes coding it slightly more tricky
I suppose almost all languages have an array of integers
 
Most I think do, or something array-like at least
 
12:58 PM
what do you think of the abstract data type versus data structure question?
 
Hmm I'm not sure I know what the difference is, unfortunately
 
oh well let me tell you :)
 
sits down and listens
 
"An abstract data type is defined only by the operations that may be performed on it and by mathematical pre-conditions and constraints on the effects (and possibly cost) of those operations. "
so in an abstract data type you don't say HOW anything will be done
just what operations have to be supported
for example, insert(x), delete(x), find next biggest number bigger than x
in a data structure you say how this should be done
so an abstract data type challenge would let the programmer choose how to solve the problem
 
Oh, I see
 
1:01 PM
that is which data structure to use
 
So like for heaps you don't say "So this is how we fix the heap after an insert..."
 
a binary heap is a data structure. A priority queue is an abstract data type
priority queues support various operations (insert, remove minimum, read minimum i think)
you could implement that in a number of ways, one efficient way is a binary heap
 
Ah, that makes sense
 
great :)
 
Abstract data type sounds more fun if you put it that way, since you need to think about the implementation
 
1:04 PM
yes!
the problem we will have is choosing test cases that force people to have interesting solutions
the risk is that our test cases are really fast with some dumb solution
they ideally need to be in a sandbox for people to play with
 
Fortnightly sounds like it was a great idea now
Hmm the square root thing on keep your distance makes things pretty skewed...
It's not just in the middle of the largest gap - in fact, it seems very far from it usually
 
1:31 PM
@Sp3000 It's usually either 1 or 999
 
Damn :/
 
the case where you said it's 556, it's actually 1
999 is also better than 556
 
Is it not 200?
 
the worst possible choice there is 547.5 I Think
@Sp3000 I meant the one that already includes the 200
 
It's (556-1)**.5 + (556-200)**.5 + (990-556)**.5 + (999-556)**.5, right? Or have I misunderstood the scoring still?
 
1:37 PM
I think I'm being silly
I was squaring the distances for some reason
And then taking the square root of everything
 
Well that's a bit hard to fault, Euclidean's common :)
 
(a-b)^2 was so set in mind mind in association with distance
 
 
2 hours later…
3:19 PM
One of my coworkers told me that a Visual Studio extension existed that could recursively reload all dependencies for a given project. Now he has no recollection that he ever told me that. Does anyone here know what extension he might have been talking about?
 
...there's a Community edit that literally does nothing
it doesn't seem like a ping because its on a relatively recent question with lots of answers (Lab Rat Race)
 
@NathanMerrill "literally does nothing"? It adds syntax highlighting, like the edit summary says.
 
It's an anonymous edit
 
the text is the same
why would that change the highlighting?
I thought stackexchange used markdown
or some version of it
 
@NathanMerrill Have you even bothered to check the Markdown source diff?
 
4:04 PM
oh, I thought that automatically showed
thanks :P
 
It does automatically show
<!-- language-all: lang-java -->
 
I have to click on "side by side Markdown"
I thought that it showed the markdown when initially looking at the edit
 
@NathanMerrill It does for me.
 
ah ok
 
Maybe it remembers your last choice and shows that?
 
4:25 PM
I created a 107 byte solution for the new rubiks cube challenge, but realized it was not completely correct :(
 
 
1 hour later…
5:52 PM
Markdown question: how do I write C# (and nothing else) into a level-3 header?
 
Use html instead of Markdown ;) <h3>C#</h3>
 
oh yeah, I keep forgetting that works
 
6:51 PM
:/ I wanted to do some crazy ODE solving for the 100-snippet, but the double pendulum equations are just way too long.
 
 
2 hours later…
8:23 PM
0
A: Sandbox for Proposed Challenges

ScimonsterCalculate cellphone key presses as quickly as possible from a cellphone keyboard! Here's a nice challenge: Calculate cell-phone keypresses. It has you calculate the amount of keypresses it takes to produce a set of characters on a cellphone keyboard. That challenge was ordinary code-golf. This ...

 
8:33 PM
another phone keyboard challenge? wtf...
 
@feersum I commented something to that effect. I don't mind having further phone keyboard challenges, but at least the actual challenge should be novel.
 
8:50 PM
well I got an answer... with an hilarious score :)
(100^100)*100 !
(not factorial)
 
this is pretty cool: play.elevatorsaga.com
 
9:48 PM
Is it better to delete/fix/undelete or just fix in place if you realize you really screwed up a code golf, assuming you are working on it now and it won't take very long?
 
you golfed something :o
 
I royally screwed up something for sure
 
@Rainbolt if I know I can fix it within a minute or two, I'll just fix it. if it takes longer than that, I'll delete/undelete
I'm sure you can shorten that a lot if you expect the input as a list and do .sum() instead of .count('1')
 
Ok, with that I will delete and reopen later
Seems as though I have a lot of work to do
 
"delete and reopen" makes feel about as uneasy as "[foobar)"
 
9:53 PM
 
delete and undelete?
 
nice, I just added a clearer explanation to my answer and got a downvote for it :D
dem cjam haters
 
How to dismiss annoying mismatched tags: store it in a string
string myString = @"<div>Q: How do you annoy a web developer?</span>";
If ReSharper doesn't care then I don't care
 
@? Is that... Objective-C?
 
@MartinBüttner linky?
 
9:58 PM
@Rainbolt same question
 
@Doorknob @MartinBüttner The @ symbol in C# means verbatim string literal.
 
I know
by "same question", I meant "my answer on the same question"
 
Oh... haha that was confusing
 
(in response to your request for a link)
 
You can look at Programming Puzzles & Code Gold for inspiration. — dmckee Mar 21 '11 at 1:30
Code gold!
3
 
10:02 PM
@Doorknob Are you stalking dmckee or are you Googling how to improve your game?
 
Could someone edit my Sandbox post into the directory?
 
@Rainbolt No, I found it via this meta post. :P
 
@ArtOfCode done
@ArtOfCode what's with the language restriction?
oh, just saw the sandbox notes
 
@MartinBüttner Congrats on 100
 
10:06 PM
@Sp3000 thanks :)
I've been trying to come up with a good corresponding snippet, but the nice ideas I had are too long
 
Ahaha k :)
 
0
A: Sandbox for Proposed Challenges

ArtOfCodeTransposing for C# (not the language) code-golf c# java python In this challenge, your job is to transpose a series of notes which you will be given so that the resulting sequence contains as many C# notes as possible. Input You may write a function or program which accepts one argument: an a...

 
@ArtOfCode I don't think the time restriction is really necessary at all. Something like "must run within 10 seconds on a reasonable desktop PC" seems absolutely sufficient.
you should definitely include more background about the challenge though. don't assume people know what "transposing" means. and I'd prefer if the list of frequencies was included in the challenge.
 
Oh neat. Python array slicing handles out of bounds. So I can do this:
list = [1,2,3,4] # a list with four elements
slice = list[3:7] # a slice from the fourth to the eighth element
 
I think it'd be good if you mentioned that the frequencies are related by a ratio of 2^1/12 btw
 
10:10 PM
Must.... refrain... from posting tip kdjfhSALDf
 
@Rainbolt That only outputs [4] for me. :(
 
Otherwise the frequencies look somewhat random
And that A4 being 440 is the base point
 
@Doorknob That's the point. It doesn't give you an array out of bounds.
It just slices what it can, and ignores the fact that you suck at counting.
 
Oh, I was expecting [4, 1, 2, 3, 4].
 
You were expecting the end of the array to wrap back around to the front of the array?
 
10:17 PM
@MartinBüttner I'm working on that elevator site
 
it's pretty fun, isn't it?
 
but I don't know javascript well enough
all it does is sit there and freeze
I think I caused an infinite loop (as not even people appear)
but, yes. It is fun
do you see the bug?
{
    init: function(elevators, floors) {

        for (var i = 0; i < elevators.length; i++){
            elevator = elevators[i];
            elevator.destination = i;
            elevator.dest = [];
            for (var j = 0; j < floors.length; j++){
                elevator.dest[j] = false;
            }
            elevator.on("floor_button_pressed", function(floorNum) {
                elevator.dest[floorNum] = true;
            });
            elevator.on("idle", function() {
                max_distance = 0;
I've checked all the braces, and they are right
I've verified that it gets past the initial for loop
which means that it is freezing on an event
but it seems that no event ever gets called
 
have you checked the console?
if no people appear there's usually an error
this isn't going to work though, because in all those functions elevator will ultimately have the last value you gave it in init.
I did something like this to make all elevators work the same:
elevators.forEach(function(elevator) {
    elevator.on('idle', function() {
        // do something with `elevator`
    }
}
this way, each elevator is actually in its own closure
 
closures XP
 
Is that like Windows XP, only written in JS?
 
10:33 PM
@MartinBüttner I suppose you have seen alexnisnevich.github.io/untrusted ?
 
heh, looks fun
 
I'm having an awful lot of trouble getting the index of the max in Python
max returns the maximum value rather than the maximum index
enumerate looks like it returns both a value and an index, but I can't figure out the syntax for calling max on it
I've managed this much:
def a(b,c):
    for d,e in enumerate(b):
         print d,sum(b[d:d+c])
It prints a list of the indexes and their sums, but I only want to print the one with the highest sum
 
@Rainbolt maxsum = max(map(sum, b))
Use index if you need the index, too
 
You can do what feersum did, which is use the key parameter of max
Alternatively, you can sort the (index, sum) pairs and take the last one
(Although for that to work they'd need to be (sum, index) pairs)
 
Ah, feersum beat me to the punch
At least I learned how to do it :)
 
10:48 PM
:) Learning! plays a fanfare
 
Thanks for that. Now in my head Dora the Explorer keeps exclaiming "Learning!" followed by fanfare.
I am not excited about this weather :(
Is there a way to onebox chat messages and also include a caption? Instead of double posting?
 
@Rainbolt No. Well, you can post an image with hover text, but that doesn't really count.
... err, whoops, maybe not. Forgot the syntax. But something like that.
 
@Doorknob Can you edit? I am taking a screenshot for a feature request on meta and I want to make it purty.
I am not excited about this :(
I am not excited about this weather :(
Thanks
 
11:05 PM
@MartinBüttner I'm running into buggy situations with that game
where I will start the game, and none (or just one of my elevators move)
but if I restart the game, everything runs just fine
 
hm, no clue
 
Do you need the http:// ?
 
Apparently
 
ignore me lol
you corrected it as I pressed enter
In Firefox when I copy the address bar (that doesn't show http://) it includes the http:// in the clipboard so when I paste the whole address shows up
 
11:22 PM
:( trying to run the Keep your distance controller but I don't know how to Java - has anyone else tried?
 
And I subtly complained about the cold rainy weather
Quick! Fill up the chat with smart things so that we look good!
 
11:48 PM
I updated my JRE and JDK but my IDE's still not recognising the funny -> arrows
 

« first day (1454 days earlier)      last day (3372 days later) »