« first day (1267 days earlier)      last day (3872 days later) » 

01:30
@Rainbolt You aren't Rusher any more!
I see a lot of people taking the input as and arguement and not part of the code. Can I do that too in PHP. For instance in a recent golf game the input was longer than some of the solutions offered. Can I, if I am answering in PHP, assume that the PHP was called as code.php?input='whatever'; as at the moment I am hardcoding a string? I hope that all makes sense and this is an appropriate place to ask about it - thankyou in advance...
@PaulDrewett Personally, I prefer seeing that than hardcoding the string. I think it's considered better practice on this site, but most people don't care that much.
Thank you underarou, that helps a lot.
No problem.
silently adds 'underarou' to the list of things I've been called on the internet
3
02:09
haha
 
2 hours later…
03:41
Multithreading: Check! Now all I have to do is add caching and my slime KotH will be ready!
04:08
0
A: Proposed Question Sandbox - Mark XIV

Super ChafouinNoah's Ark unit testing Write a program that accepts a string as input, and output "yes" if the string is an animal name, and "no" if it is not. The recognized animals are : dog, cat, horse, cow, rabbit, mouse, elephant, tiger, lion, zebra. The plurals should be recognized also : dogs, cats, ho...

 
3 hours later…
06:40
@Rainbolt You have an hour of grace period left. :O
07:09
@Doorknob Can your mod powers extend it by an hour?
I really need it :-/
I'm upset that I couldn't compile them all in time
@Rainbolt Umm, we can refund bounties, but I'm not sure about extending them. I'll check
If you refund it I will immediately award a new one for the same amount. You know I'm good for it.
And I'll award it tonight
250 rep
I'm very sure you would, but I'm not sure if that would increase the minimum bounty amount
Well, 300 is fine too
I'm more worried about the challenge than my rep
I earned nearly twice that much anyway
Never mind, I checked. It doesn't change.
Alright, if you can't compile them in time, I think I could refund it and you could start a new one of the same amount. (You'll have to wait another 24 hours to award it though.)
07:15
That's fine.
I appreciate the help. I was getting frantic lol
Reminds me of the late nights before homework was due. I forgot how bad that feeling is.
Ok, bounty refunded. :)
Thanks
No problem
Added another bounty back. Hurray!
Now if I can figure out how to compile c++ entries
I don't see a "download" button on the GNU page
I can run the g++ command but they are all failing
So it must be me... not them
What OS are you on?
07:22
Windows
Downloading visual studio express now
Try MinGW; that's what I used when I was on Windows and tried some simple C++ stuff
Oh noooo I have to log in to microsoft live
so lame
Ok, that should work too
Heh
I have mingw. So is the problem theirs then?
C:\Users\Rainbolt\Documents\NetBeansProjects\GoodVersusEvil>g++ -O3 -std=c++0x -o Bo
okkeeper Bookkeeper.cpp
c:/program files (x86)/haskell platform/2013.2.0.0/mingw/bin/../lib/gcc/mingw32/
4.5.2/../../../libmingw32.a(main.o):main.c:(.text+0xd2): undefined reference to
`WinMain@16'
My g++ command seems to be confused.
It thinks I want to compile with haskell
Umm. That's... interesting
Did you follow the steps here?
07:25
Yes, and after I was done I installed haskell
And that's when it blew up?
Well I think I got the haskell one to compile actually
Maybe if I just remove mingw and reinstall it
I think the problem is either you didn't include MinGW's g++ in your PATH, or it's being overridden by Haskell's g++
Yeah that might work too :P
I added mingw manually to my PATH
Which is how I got haskell to compile
but the mingw bin folder doesn't seem to have anything remotely related to c++
OH wow some things are just too easy
I randomly typed mingw-get install c++ and it worked
Who woulda thunk
07:31
Am I understanding correctly that mingw-get comes with absolutely nothing useful until you download it?
Is it like a supercompiler or something?
Haha, I'm not sure, but that appears to be the case
07:52
Haha! It did have a bug. He forgot an include. And I would never have fixed it without actually digging into the code.
Now have three c++ entries compiled :)
@Doorknob What are you doing up so late? Or is it late where you are?
Hmm I don't know what to do about this: codegolf.stackexchange.com/a/34400/18487
I don't feel comfortable downloading a compiler from sourceforge for code I can't even read lol
 
1 hour later…
09:17
My productivity is slowly dropping to nil
Oh hey @m.buettner
Did you just wake up?
@Rainbolt yes
good morning ;)
Good... whatever this is
4:30 AM
I can't do this... I may as well go to bed and pick it back up in the morning
Doorknob bought me an extension
I'm like staring at my cmd prompt typing silly things just to watch them echo
Good night morning!
Time for bed
See you later!
@Rainbolt Isn't he in Korea?
10:05
@Rainbolt I'm in Korea. It's currently 7:00 PM here.
Oh wait m.buettner already said that. :P
10:16
@PeterTaylor is there a simple way in GolfScript to perform a regex substitution on the top element of the stack?
Bizarrely, despite being a language designed for golfing, it has no native regex support
So you have to use Ruby string interpolation
so something like "#{gsub(/regex/,'subst'}"?
Looks plausible, I'd have to look up some Ruby docs to be sure
wait no, how do I specify the top stack element within the interpolation?
You have to do some complicating trickery with string concatenation. Or maybe cheat and rely on knowing the inner details of the interpreter
10:26
lol I've never done anything with GolfScript, so that knowledge doesn't exist ^^
I was just wondering whether I could quickly whip up a full GolfScript program based on this: codegolf.stackexchange.com/a/34759/8478 without actually having to learn GolfScript ^^
@m.buettner Could you use sed?
@Doorknob could I? if I knew sed, then maybe :D ...
@m.buettner It's basically a regex find/replace tool :P
yeah I'm aware of that
but what constitutes an actual sed "program"?
For example echo Potato | sed -e "s/ota/i/" would result in (I think) Pito
Yep, it does
10:32
right, that might work
So you could write a sed program of s/YOUR REGEX/THING TO REPLACE WITH/
yeah
sed doesn't have lookaheads
@m.buettner Hmm. You could try a simple perl thingy
If you're taking input from stdin (as opposed to working around a lack of stdin by pushing to the stack), you can skip the delayed parsing
10:37
echo Potato | perl -ne "s/ota/i/;print"
(also untested)
With regex.gs containing "#{$stack.pop.to_s.gsub(/c/,'x')}" I can run golfscript.rb regex.gs <<<abcd and get the expected output
@PeterTaylor Thanks. Unfortunately, that's longer than the ES 6 version (it is a full program though)
I think perl should be shorter
Optimised to "#{gpop.to_s.gsub(/c/,'x')}"
@Doorknob what's the n flag for?
@m.buettner To get input (-n assumes while (getLineOfInput()) { [YOUR CODE] } or something like that)
10:40
But yes, perl will be shorter
@Doorknob Ah that won't work. I need the entire input slurped into a single string.
@Doorknob, but -p would work equally well and save the ;print, wouldn't it?
11:18
-1
Q: Preliminary Assignment

ArjayA. Make a program that would count number divisible by specified divisor. It would also count a set of numbers where a number(s) with that set is divisible by specified divisor. Sample output is shown below: INPUT Enter Divisor : 3 Enter Number Set 1 : 1 2 3 4 5 Enter Number Set 2 ...

What do you think?
@PeterTaylor Thanks for your effort with the domino thing. If you can't find a neat a neat way to include the C- exception, I might just add it to the possible cases anyway.
@ɐɔıʇǝɥʇuʎs If rewritten along the lines of "Write a function which takes an integer (x) and an array of arrays of integers (A) and returns a two-element array whose first element is the number of elements of the flattened A which are divisible by x, and whose second element is the number of arrays in A which contain an element divisible by x" then (a) I'd want to know how duplicate elements are counted; (b) it's pretty darn trivial.
@m.buettner I'm wondering about explicitly naming - and | orthogonal elements and / and `\` diagonal elements and then describing interactions in those terms. But I think I need to think about it some more.
@m.buettner perl -p0 foo.pl should work for that.
I've just been grammar-checking Latin, and my brain is a bit frazzled.
@PeterTaylor Latin is quite regular right?
11:26
@PeterTaylor haha, nothing quite like Latin grammar :D
@ɐɔıʇǝɥʇuʎs it is, but at the same time they rely so much on their grammar that it carries a ridiculous amount of meaning... up to the point where the order of words becomes almost arbitrary because all the information and meaning is in the cases etc
they can form the equivalent of an entire relative sentence by putting a participle in a specific case... you really need to think about that grammar a bit differently than about the ones europeans are used to ^^
@Ventero cheers, I'll give that a try later
12:26
Just found another weird behavior in Python
x=[lambda x:x*(i+2) for i in range(5)]
assert x[0](2) != x[1](2) != x[2](2) != x[3](2) != x[4](2)
print("sanity!")
It never hits the sanity line, lol
Turns out, all the lambdas in x return x*6.
wtaf
@Trimsty That happens in JS too, and probably most languages that have some sort of lambda / function variable
@Doorknob It's a huge design flaw, i should not have persistence at all
It's basically equivalent to:
I just realized how important it was for me to put the backticks in there
i = 0
a = [None, None, None, None, None]
while i < 5:
    i = i + 1
    a[i] = lambda x:x*(i+2)
Very pseudocode-ish but you get the idea
12:34
yeah, but isn't i destroyed afterwards?
yeah, it is, just tested
so the lambdas should error...
Yes, because of the brackety-for-in-thingamajiggy (I just forgot the name for some reason), but the idea is the same
@Doorknob Look here;
List comprehension
That's it
>>> i = 5
>>> x = lambda: i
>>> del i
>>> x()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 1, in <lambda>
NameError: global name 'i' is not defined
>>>
>>> x = [lambda: i for i in range(5)]
>>> x[0]()
4
>>> i
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'i' is not defined
...i don't see how that's even remotely logical
>>> def get_the_thingies():
...   i = 10
...   thingies = [lambda: i, lambda: i+1, lambda: i+2]
...   return thingies
...
>>> get_the_thingies()[0]()
10
>>> i
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'i' is not defined
>>>
When you think about it it's basically the same
12:39
yeah, but how does the lambda access i?
Same as above ^
@Trimsty Through a closure.
In [31]: x=[lambda:i for i in range(5)]

In [32]: x[0].__closure__[0].cell_contents
Out[32]: 4
The lambda retains a read-only reference to the variable, even though you can't access it anymore outside the lambda.
...so then it checks every other element in the scope for an i closure and updates it on every loop iteration?
if a copy of i is made for each lambda, they shouldn't all be 4
>>> def very_similar_to_the_original_listcomp():
...   i = 0
...   a = []
...   while i < 5:
...     a[i] = lambda x: x * (i+2)
...     i = i + 1
...   return a
...
@Trimsty Not a copy, the keyword there was reference.
12:42
@Ventero so how does Python know not to destroy it?
It now has a non-linear stack
i should really write in lisp :P
Not too sure about the interna of the Python interpreter, but my guess is that it sees you're defining a lambda that's referencing a "free" variable, so it stores it in a closure.
@Ventero imo, if there's ever a need to check some actual language element to change semantics, something there is pretty badly thought of
but hey, I guess Python can't be perfect, lol
The perfect golfing language would generate some useful logic from a number in a reversible way, and take a number as input on base ascii.
@professorfish Why did you edit this 6-month-old answer just to add a comma?
I just called my Jot compressor perfect...
13:55
Going to sleep now; my slime KotH should be up almost as soon as I wake up (~UTC 0:00)
@Doorknob did you write anything about pseudorandom submissions?
(and people wanting their submission to be re-evaluated because they changed the seed)
maybe you should specify that anyone who uses a PRNG has to use their user-ID as the seed?
then they could still make changes by just generating a few extra numbers before starting their algorithm :-/
I really don't know how to prevent a back-and-forth between multiple players changing their seeds to beat the others
14:12
@PeterTaylor thanks, that looks really good now
I think the last bit could be a bit simpler by just saying "if any of these two rules are in conflict for a time step, the affected domino remains standing"
Ah actually that's pretty much what you said
In the side-by-side view it somehow seemed more complicated :D
 
2 hours later…
15:56
@m.buettner Am I missing some catch, or why are all the other answers to codegolf.stackexchange.com/questions/34758 incredibly long?
Don't you just have to check below the rock, diagonally below it and to its right for empty space and move it to the first one you find?
@Ventero basically yes
So the only difficulty is in the last step, when there's no space to move the rock. But since just terminating is allowed, I just let an exception terminate the program.
16:40
hehe, yeah that should work
 
2 hours later…
18:51
wakes up and comes straight back to PPCG
@m.buettner You probably want to change the #+ in your regexp to #*. Otherwise dropping the ball above an empty row doesn't work.
19:12
@Ventero Somehow I assumed there wouldn't be an empty row.
@Rainbolt Good evening!
@Ventero You're right though, one of his examples doesn't have # in the top row, so there's no guarantee that there will be any in the second one.
yay, two Nice Answers in a day :)
I've been on the piano for like, 3 hours now
6 bars of Fantaisie-Impromptu = doneeee
19:40
@Ventero are you going to beat my JS function? ;)
Don't think so, no.
If we wouldn't have to special case the last line, I could get it down to 52.
how is the last line special?
But I don't think I can get much more out of this. Maybe 1 or 2 characters.
"When the rock is already in the last line when running the program, you can choose to either terminate the program or output the unchanged input"
If I take out the check for the last line, it just continues moving the rock to the right.
oh okay
I guess I'm lucky there that the regex just doesn't match any more
I didn't look at your code, so I thought you might also just look for a pattern and change the input accordingly (in which case you just wouldn't find any of the patterns in the last line)
Nah, I'm pretty much following the steps I described above: Check the two characters below the rock for spaces, otherwise move to the right.
Mh, actually for input like ` o ` both our solutions fail. :P
19:46
right
of course ^^
but I don't think the rock not being adjacent to the hill is not part of the problem
But you might argue that this doesn't fall under "The hill only ever goes downwards"
although I think mine would still move the rock to the right
Oh well, I'll just leave it as it is.
I'm actually surprised I even got it down to 55 characters.
yeah that's pretty decent
I'm still wondering why all the other solutions are at ~200 characters ...
I guess the problem is that they all use Python, which has immutable strings.
19:57
@Rainbolt How is compiling going?
20:43
0
A: Proposed Question Sandbox - Mark XIV

githubphagocyteASCII: Art or Math(s)? (better title suggestions welcome) ascii-artpopularity-contest The contributors to some Stack Exchange sites request to be able to use MathJax for mathematical notation. Sometimes the answer is yes, sometimes the answer is no. For those sites that do not get to use MathJ...

20:56
@m.buettner Going well except for the Eigen entries. Everything I have tried has failed. I think I gave them due diligence... so I'm just going to exclude them
21:21
Does anyone have a link to a good explanation of what the lib, bin, src, etc folders are for in general? I know they are present in Java, and I remember Unix having bin folders for commands, and I have picked up tidbits of information here and there, but I want formal learning on the subject and can't seem to find it.
I can guess that lib is for library, but I don't know if I should distinguish between "jars that I call in my program" and "classes that I use in my program". And I don't know if the source code for these 80 entries really belongs in src or somewhere else, since they aren't really part of my Java source code
bin is the only folder I can find a lot of information on
21:51
@m.buettner My new verdict on this is "I don't really care." I'm only updating the leaderboard every few days or so, so it would take an eternity to do something like this, and if they just happen to find a seed that gives perfect strategy well then good for them.
@Rainbolt src = source code, bin = binary files, lib = library files, etc = etc
That's what they stand for at least
@Rainbolt what Doorknob said. But I'm not sure KotHs follow any conventional project structure which those conventions originate from. hence, you might just want to roll your own
I'd compile all .jar files into lib... only the executable belongs in bin...
I'd either put the submissions into a dedicated folder within src (which you might mirror within lib) or - which probably makes more sense, since not all submissions are in java - just make a separate top-level directory for submissions... each one is individually compiled into its own binary... and you just fish them out from there
:( no love for my Mastermind answer...
...but what do I expect, it's the weekend...
22:15
Hmm. Maybe I should wait until Monday afternoon to post my slime thingy
Any J wizards around?
@Doorknob definitely.... posting on the weekend is definitely not worth it
it won't get any real exposure but it'll still be pushed off the top of the front page by the odd edit or answer over the weekend
@PeterTaylor thanks for helping me with the domino spec
that should work now
any opinion on the forwarders? I guess the spec is complicated enough as it is.
(not that it's conceptually complicated, but the post will just get longer and longer)
o.O user page URLs can contain Unicode... (without URL encoding)... what on earth...
22:33
@Doorknob Thanks, but I definitely was able to Google what that stood for. I was more interested in their use. Seemed like a bad question to ask on SO, but maybe I can spin it right...
@Rainbolt Would probably be a better fit for Programmers
What on earth? They have a different site?!
@Rainbolt Apparently
I love this: Programmers Stack Exchange is not about coding tools, such as compilers, debuggers, and IDEs (ask on Stack Overflow instead)
The name of the site is a misnomer apparently
Choosing the best tool for the job is part of the Design phase. Programming SE says that design is on topic. But then they deny it shortly after
I'm going to go ahead and guess that the site has a complete overlap with other sites. Nothing in the Help Center is unique to their site. It shouldn't exist at all...
it's more like a meta SO... not in the sense that it's about SO but in the sense that it's about the meta-aspects of programming and software engineering (at least that's what I gather from the questions I've seen there)... it's a lot about best practices, general approaches, architectures, design...
22:39
Seems really opinionated
a lot of it probably is
Creating a site where people can vote on best practices seems like a wonderful way to start a fire
but then again I saw today that graphic design SE has a "critique" tag
Does Code Review acknowledge that they doesn't follow the SE format?
Do we?
22:40
We're split now
:P
Did you have to do anything for your new user name to show up in chat?
I had to wait three minutes or so
I didn't have to log out
But I did have to leave chat
I had another tab open so I could view it myself
That's why I instructed others to reload when it finally changed lol
Why am I unable to get this cjam submission to run
I downloaded cjam, I put the cjam jar in my lib folder, I put the submission itself in root, and I ran it with java lib\\cjam-0.6.1.jar Innocent.cjam
I tried leaving off the lib\\, just in case NetBeans already knows what lib is for. Still no luck
Hm hasn't changed yet... maybe it'll change over night... can't be bothered to wait now
Lol
Bedtime?
not quite
22:45
I'll probably see you early morning again
plus, my beer isn't empty yet ^^
I have a MTG tournament shortly, so I'll be taking a break from this
Err... I did remember to include -jar in my command that I mentioned above, but I can't edit it now
OMG I downloaded cjam 0.6.2 not cjam 0.6.1
I am so dumb sometimes
really
SUCH an obvious mistake
facepalm
Maybe it's more of an obvious mistake to me after having to get the right version of every compiler for the last 70 entries I have compiled.
Meh... the old version of the compiler doesn't work either. But at least I got actual errors that I can copy and paste for the author to review
@m.buettner Is there some way of making a Turing-complete process out of a suitably configured infinite chain of dominos, perhaps something like the billiard ball machine? But no, that would be getting too complex ;)
22:58
@PeterTaylor :D ... (gotta look up billiard ball machine)
ah I see, interesting
@PeterTaylor also yes it's definitely possible
in year 1 of my software engineering degree we had one hardware lecture that basically went through all layers from transistors through to a full multi-core PC architecture
and in the very last lecture the lecturer showed us a video where someone built all logical gates from dominoes
I think that would justify a separate challenge though without being a duplicate (even if they use the same ASCII art encoding)
(that wasn't the one he showed us, but it's the first I found)
(actually I need to watch this now... I'm curious what trickery you need to make a NOT gate turn a 0 into a 1)
23:17
I think he showed us this one youtube.com/watch?v=SudixyugiX4
Ok. mingw doesn't compile C#
It was too good to be true anyway
why do you need mingw to compile C#? o.O
It compiles Fortran, C, and C++
I thought it could also compile C#
you do have VS though, don't you?
Not on this machine
Well technically I do. I can remote desktop to a machine that does
I feel dirty. I'm going to delete nearly everything on my PC when this is all over
Better yet, I'll just system restore to three weeks ago
Time to go play MTG!
23:27
hf!
@PeterTaylor en.wikipedia.org/wiki/Domino_computer ... there it is ... you need a separate power source line to get a complete set
that would make an amazing code-challenge - a domino circuit generator that generates minimal circuits... and the submissions from the current challenge could be used as validators ^^
(in that case, adding forwarders would be nice though... otherwise, just finding a planar circuit layout will be horrible, I think)
especially when you need the power source
They rely on pushing more than one at a time. Maybe doable with your setup using diagonals. I'm off to bed now, anyway, g'night.
yes, you can do that with diagonals
good night!
the more difficult thing will be kicking dominoes out of the way or blocking the way
might be possible with going in opposing directions though

« first day (1267 days earlier)      last day (3872 days later) »