« first day (1601 days earlier)      last day (3240 days later) » 
00:00 - 15:0015:00 - 00:00

12:14 AM
0
Q: Ninjas and Monkeys and Bears, Oh My!

Calvin's HobbiesThis challenge is NinjaBearMonkey's prize for winning my Block Building Bot Flocks! challenge with the Black Knight submission. Congratulations NinjaBearMonkey! The challenge here is fairly simple, but has a variety of possible approaches. The story goes that in the world of Isometric Illusions,...

 
12:59 AM
@Doorknob You need to golf your NBM down some. It just isn't right having my Java submission tie your Ruby one ;)
 
heh, I noticed that :)
Don't know why I didn't think to make it a loop.
 
Yea, if you can't beat Java at string manipulation... you might be C#.
 
There. Less than 50% of the original :P
 
Much better :)
Is the reverse necessary?
 
Oh, didn't even notice the "they can come in any order" part.
 
1:13 AM
K, well I'm glad I could assist you in properly beating me at golf :D
 
lol
I knew something was wrong if Ruby was as long as Java... ;)
 
I didn't look at your code much at first, but when I did I thought there must be some obscure reason you weren't looping.
 
There is, actually. It's because I'm an idiot :P
 
I said obscure :P
 
Darn onebox.
 
1:18 AM
You could just add a prefix to prevent oneboxing instead of deleting.
 
 
2 hours later…
2:58 AM
0
A: Sandbox for Proposed Challenges

Nathan MerrillConsider an intersection as follows: Cars will drive up any of the above Input lanes, and will exit out of any of the 3 other Output lanes. The goal is to take the list of cars, their arrival time, and their destination, and to return the times they will exit the intersection. We will measur...

 
quiet chat
 
3:37 AM
The bounty expires on my golf question in 19 hours (plus 24 hours grace?) and my python answer is the only answer:
14
Q: Worst Case Manhattan Exclusion

trichoplaxImagine a W by H grid of squares that wraps toroidally. Items are placed onto the grid as follows. The first item can be placed on any square, but subsequent items must not be within a Manhattan distance R of any previous item (also known as a Von Neumann neighbourhood of range R). Carefully cho...

Anyone who can beat 270 bytes in any language will get the bounty...
 
 
3 hours later…
6:48 AM
@trichoplax You can actually take off a few bytes off yours because r=range;s=W*H and return ...+1 -> return-~...
And I think M,G can be lambdas
 
@Sp3000 I'm trying to decipher that - I'm not used to golfing... :)
 
Which part?
 
I take it the before and after ellipses refer to the same thing?
 
I was just being lazy :P The exact change is return-~M(G([1]*(W*H),0,0))
 
Just looked up the tilde operator so I understand that now - interesting thank you :)
 
6:54 AM
I'm trying your challenge atm and it's having fun choking on the last few test cases
 
The very last test case should make the most brute force approach impossible in any language, but the moderately brute force approach I used should be fine in anything approaching the speed of python
 
I think my problem is that I've got basically the same algorithm as you, except the place-the-first-one-at-(0,0)
 
I'm looking at my golfed code and I don't seem to use the s=W*H - I've defined it and then not used it. And using it would waste a byte so I think I'll just delete it...
@Sp3000 Ah yes - that will cause you problems on the last case - it will take I guess 256 times as long?
 
... I placed the first one at (0,0) and it made everything a heck load faster D:
5 seconds now, 256 times as long would have been over 20 minutes...
 
What language are you using?
 
7:00 AM
Python
 
I'm guessing C could get away with not placing the first one at a fixed position then
 
Let's see if I can also get away with being inefficient with the search...
 
But still couldn't use the pure brute force approach of not checking whether a placement is valid before trying it
 
(looks like I can get away without worrying about the order of placement)
 
I'm interested to see your approach. I'm not sure what you mean by the order of placement
 
7:08 AM
Well you could do your search by placing at (a, b), then at (c, d)
Or your search could place at (c, d) then at (a, b)
You end up at the same state, but the deeper you go the more paths you took to reach the same state, so you check the same state a lot more times than you need to (factorial)
(which is why something like (1, 20, 0) would take forever with mine)
 
Ah I see - permutations of the same N items in the same places
That's a bigger speed up than fixing the first at (0, 0) then - so maybe you could avoid fixing and still finish in time
 
Not really - with your test cases the most I'd get is 4! = 24
The (0, 0) gives a much better speedup here (and is a lot shorter to implement in terms of bytes too)
 
Ah I see
 
Posted - somehow I think the distance calculation is the longest part :P
 
It does make me think I could have made test cases with bigger N though if I'd known about that speed up
 
7:19 AM
I think it'd cost about 20-30 bytes for mine - via the ugly method of converting states to sorted tuples and back
 
If I've understood correctly, could you define B before L?
 
... yes actually, nice catch :P
Not doing the lambdas? It'd make your code a one-liner :P
 
Nice to be able to return the favour :)
Yes I need to learn about lambdas now...
A one liner by nesting them?
 
Basically def f(x):return blah --> f=lambda x:blah
Any function that can immediately return is shorter as a lambda... is the general rule of thumb
 
So as long as it doesn't have more than one return statement?
That's good to know...
 
7:27 AM
Well as long as you can get away with not assigning things, e.g. if you had
def f(x):
 if x==1:return 2
 return 5
You could still do f=lambda x:[5,2][x==1] (or in this case, f=lambda x:5-3*(x==1))
 
neat :)
I'm going to give it a go
 
Also, you don't need the brackets for [1]*(W*H) :)
 
Hi everyone !
 
Hello!
 
@PeterTaylor nice, are you going to link that from your answer?
feel free to add the OEIS contributions to the meta post.
I'm still waiting for my last one to be accepted... it's been sitting for a week since the last proposed changes.
 
7:37 AM
@MartinBüttner Diamond tiling?
 
no, skew binary (the xkcd page numbering challenge)
 
gonna look at it, don't remember what it was about
 
How "great" is the improve?
(saw it yes, I was reading :))
 
Skew binary was fun - still not sure why I got so many upvotes though
 
7:43 AM
well, the OEIS article doesn't currently contain any information about the actual maths of the sequence. it's just listed as the pages in xkcd with the "only the least significant nonzero digit can be 2" rule.
so I've changed the definition to skew binary and added the first 10k terms
you should be able to see the proposal here: oeis.org/draft/A169683
 
(was looking at them) Really nice, going from 41 to 10k terms is impressive ! It's pretty awesome !
 
nah, with the logarithmic algorithm, anyone could have done a million or so, but 10k seems to be the standard on OEIS (if possible)
 
@MartinBüttner Looks like nobody was interested in it, but it is still awesome to see PPCG contributing to OEIS
 
@trichoplax Is STDIN input like 16,16,8 okay?
 
@Sp3000 sure
7
Q: Defaults for reading several pieces of input

DennisWhen reading several pieces of input as command-line arguments, it is common practice to read each piece as a different argument. The command-line arguments now provide an array of the input pieces. Should submissions that use different input formats also be allowed to read an array of input pie...

 
7:54 AM
Didn't realise there was a question for that :P
 
It's quite new...
 
(you can put the lambdas on one line btw)
 
The 2 lambdas can just be semicolon separated?
 
You can put everything on one line semicolon separated, yeah
 
You mentioned making it a one liner, but I don't think I can take it that far since the nested lambdas require the scope of the enclosing function
and I need to be able to define them and call them elsewhere
 
8:08 AM
Yeah, I realised after :P
Unless you took input from STDIN I guess, but that's a bit longer in Python 3
It'd save in Python 2 though
nvm it's just as long as putting it all on one line :P
 
It does go on one line - just leaving the outer function as a function :)
 
Yeah that
 
0
A: Sandbox for Proposed Challenges

Beta Decay5138008 code-golf In schools across the world, children type a number into their LCD calculator, turn it upside down and erupt into laughter after creating the word 'Boobies'. Of course, this is the most popular word, but there are many other words which can be produced. Using, an English lang...

 
@Katenkyo I'm interested in your strategy that needs more than 16 colours. How many more...?
 
it would be at least nbturn/10, so leave it x)
I found other way to turn around
using 4 colors for my road, I can : tell the directions (to the queen, or further), mark embranchments, and see if someone is already in this embranchement.
 
8:22 AM
@trichoplax Still up for more golfs?
 
If you just want your path to have a direction, you can colour it abcabcabc, or you can leave a parallel path to the left hand side and then keep it on your right hand side on the return journey (requires only one colour that way)
@Katenkyo Being able to tell whether someone is already in a branch sounds interesting
@Sp3000 Other questions or reducing this one?
 
Still this one :)
 
@trichoplax I might have some issues with my embranchment using that, I wouldn't be able to cross it
 
@Sp3000 Then yes - it's interesting :)
 
@trichoplax I don't know, it can makes me lost a lot of time
 
8:24 AM
@Katenkyo It's great to see strategies I hadn't even thought of - makes me think the competition should be interesting.
 
(Try golfing your distance formula - you shouldn't need abs, because Python modulo should do what you want (always nonnegative). You can get about 20 bytes from that)
 
More ant in the same embranchment says I'll have a more exhaustive search through an area faster, but could be a waste of time if it was already looked for
@trichoplax That's why KotH are fun :)
 
@Katenkyo Indeed :)
 
I think I would need 9/10 colors in total
 
@Katenkyo I'm almost certain it won't be less than 16, although I may increase it
 
8:28 AM
@trichoplax If it is increased, it could become very interesting to simply do a clock on 3 cells, incremented by the queen
You could prevent your queen to produce workers when there's few turns left easily
 
Interesting. Although you couldn't start the clock immediately as you need to move around to find food first. Unless you could keep a moving clock in your path colours just until you create the first worker.
 
@trichoplax would cost too much turns, losing up to 20/50 turns isn't that important, as I would, personnaly, stop produce for the last 20/10% turn
And as colors have sense, you should walk your way back to reset the timer and fill it with a no-op/already-explored color
 
@Sp3000 Just tested the abs removal - I didn't realise the python % was so helpful. That's 12 bytes already. Now I'm wondering if there's a better way to write the min contents
 
:)
 
@Katenkyo That's a difference with more colours. If you have enough colours to use some purely for counting then you can leave them afterwards because they don't mean anything else. But if you only have 16 colours you probably need to use the counting colours for navigation later so yes you'd have to tidy them up...
I remember seeing a way of writing min in terms of abs but I don't think it helps
 
8:36 AM
@trichoplax here comes the hard coice : if you want to use exclusive-timer-color, your clock will be bigger, and it will be harder to set it up and work around with it.
 
@Sp3000 Got it... I can move the %H outside the min()
 
0
A: Sandbox for Proposed Challenges

ZgarbPlay a Perfect Game of 4x4 Hex code-golf board-game graphs Background Hex is a two-player abstract strategy game played on a K×K rhombus of hexagonal tiles. Two opposite sides of the rhombus are colored white, and the other two black, and the two players, black and white, take turns in placing...

 
Wait... er... you can?
 
@Katenkyo good point - and it makes you more vulnerable to interference from enemies. With a large number of colours you could have room for more than one clock to error check each other
@Sp3000 You were thinking of another way?
 
Probably - my mods are inside the min
 
8:39 AM
@trichoplax you would need clock-dedicated ants to keep two or more clock synchonized, so I don't think it is worth it
 
@Sp3000 min gives nearest to -infinity, not nearest to zero, right?
Now I'm not so sure it would work
No it wouldn't :(
 
Yeah I don't think it would, hence my confusion
 
@Sp3000 I see it now - since % works helpfully, I don't need to keep things positive, so I don't need to add on H or W - another 8 bytes bringing it up to the 20 bytes you predicted
 
:) yay
 
Thank you :)
 
8:45 AM
Oops I just golfed yours down to beat mine
 
There was 30 difference and you've only given me 20 - or have you just spotted something else?
 
Three hints: 1) You can loop over r(W*H) in M, 2) Replace the if/else in G 3) Move the +1 in M inside to save a byte
Sorry for this, but I'm having fun :)
 
You'll need to golf yours too now... Your bounty is still safe unless someone other than me answers though
 
Ahaha maybe - it'd be more fun if others did answer though
 
I like how it's valid syntax to write lambda a=lambda b=lambda c=0:1:2:3, not that it's relevant
 
8:54 AM
Is that just poorly defined grammar or does it actually do something?
 
nested default arguments
 
Ah, that makes sense
 
@Sp3000 You mean the -1 and +1 will cancel to 0 to save 1 byte?
 
Yup :)
 
9:15 AM
@Sp3000 I've changed the if...else to read (0,g[a+W*b])[min((x-a)%W,(a-x)%W)+min((y-b)%H,(b-y)%H)>R], so that's 2 out of 3
 
Actually, you can go one better with and :)
btw I think to golf mine down I'll have to switch to recursive too, hmmm
 
recursive but still with sets?
 
Yeah, not sure if that's any better than yours, but the idea will be a lot closer
 
-2
Q: How to check robot.txt file

user41655My website name is http://www.scdlpune.com and I want to know how can check text file and what is correct way of file?

 
g[a+W*b]*(min((x-a)%W,(a-x)%W)+min((y-b)%H,(b-y)%H)>R)
@Sp3000 like that?
 
9:22 AM
... Awkwardly I didn't think of that for some reason. Even better!
 
I got it from the and - took me a while to realise how I could use and, and then I realised since there's a zero anyway I could use *
 
Nice :)
 
Thanks :)
 
9:34 AM
@Dennis I can't believe there's no way to get [3 2 1] in less than 5 bytes... D:
I've found three or four different ways in 5 bytes now, and a couple in 6, but I can't seem to do 4 :/
...
 
You can petition to make 4 a variable :P
 
yeah, that would work
 
 
1 hour later…
10:39 AM
hi @feersum
and all :)
 
hello
 
@feersum I am very impressed by how simple you are making my problem look :)
I too tried to solve it for j=2 but got immediately stuck at the lack of independence
 
I'm just making an extension of the random walk idea
 
brilliant
if you don't mind, can I ask if you have an academic background in combinatorics?
 
No. Combinatorics problems are nice because anyone can count, not much training required
 
10:42 AM
True :)
@feersum out of interest.. how far do you think your approach can be extended (given enough time and effort)?
 
@MartinBüttner looks like Computer Graphics has only a month to live :(
 
It would be possible to make a formula generator for arbitrary j
 
wow!
 
But the number of summation loops goes with 2^j
 
@trichoplax :(
 
10:52 AM
@feersum I think that is really interesting nonetheless
 
I've changed my approach and added votes to near-10s
Still needs 19 more upvotes though, on 5 questions
 
It would be funny to make a Mathjax generator and make a giant image for j=6 or something
 
@trichoplax I wish I could help but my votes are all on score-10 questions, and I'm not going to retract my downvotes for the sake of getting to commitment phase.
 
@feersum I would be more than happy to help with that!
 
@MartinBüttner Do you mean your current upvotes are on questions at exactly 10, leaving no benefit to moving them?
 
10:54 AM
yes
 
All we have left is hope then...
With bounties, when it says "ending in 12 hours", is that 12 hours until the start of the 24 hour grace period?
 
thanks :)
 
don't people normally say grace at the start?
(sorry... :) )
 
11:03 AM
@trichoplax btw I just realised you can save another byte if you make the base case or[1] instead of or[0] (which I'm also doing now)
 
Golf seems to be like one of those sliding tile puzzles. You reverse something to save a byte, then change it back to how it was before to save another byte. Weird.
 
:)
I feel golfing competitions need to have some way to reward the use of different languages
 
What do you mean?
 
otherwise they are all in cjam, pyth or something in unicode
@Sp3000 wouldn't it be nice to see golf'ed code in C, Haskell, your favourite practically useful language?
 
Yeah I guess. Kinda of why I like sticking with Python for most
 
11:06 AM
great :)
 
Unfortunately there'll always be a language which does best. Take out the golfing languages, it'd probably be the APL family. Take them out, then it's probably Perl...
I guess it's just useful to have some sort of mental filter where you go "Okay, I'm going to compare against these languages"
3
 
I suppose the score could be the number of bytes plus the language rank at tiobe.com/index.php/content/paperinfo/tpci/index.html
it's not so obvious who wins now
 
For most challenges, I'd say C/Python for shorter ones and Perl/JS for the longer ones
You'd be disappointing a lot of Haskell programmers though :P
 
haha these language rankings
they say COBOL is +0.5%
and that's apparently a relative increase of over 50%
their data must be mostly noise
 
11:23 AM
They have a wonderfully objective method based on search results, modified by hand tweaked confidence factors
 
12:13 PM
looking for feedback on:
0
A: Sandbox for Proposed Challenges

Nathan Merrill4-Way Intersection Simulator Consider an intersection as follows: Cars will drive up any of the above Input lanes, and will exit out of any of the 3 other Output lanes. The goal is to take the list of cars, their arrival time, and their destination, and to return the times they will exit the...

 
12:52 PM
@Lembik anarchy golf does user ranking on a strictly per-language basis
 
Sh*t...
Was too tired (I'm near sleeping over my keyboard) and deleted (definitvely) 2 h of work...
 
they're aggregated for an overall score, but being beaten by another language never hurts your score
 
@PeterTaylor How come you didn't add a b-file to A066931?
 
Hello :)
 
1:09 PM
16
Q: Can and should we encourage more meticulous golfing?

xnorI find that much of the joy and art of code golf comes from the ridiculous tricks and optimizations needed to squeeze every character. Yet, I find myself losing motivation to do so because I feel like the site doesn't give enough incentive to try my absolute hardest. If I work hard to cut 2 char...

 
I still have an issue with the title of that post
"Can and should we improve our community?"
 
@Rainbolt You can't phrase it like that
It is a closed question, you only can answer yes
 
He really wants ideas on how to encourage more meticulous golfing.
So why doesn't he just ask for them?
Instead he vote whores with a title that is only answerable with "Yes."
 
maybe he doesn't know what he wants
 
So "How could we... ? " might be better
 
1:25 PM
Wait. Someone's using the title of a post to attract attention to it? Somebody call the cops. This is clearly unprecedented.
5
 
@Geobits The problem isn't attracting people, we were wondering about the subjectivity of a (serious) meta post
 
I'm not worried about the subjectivity of it. Meta is one giant subjective cesspool.
 
(I know this is sarcasm by the way)
 
Do you see a wink on the end of my previous message? ;)
 
@MitchSchwartz interesting!
@MartinBüttner thanks :)
 
1:37 PM
@Rainbolt was (speaking) to Geobits ^^
But yeah, meta is actually all about subjectivity over Point of View attempting to be objective
 
1:53 PM
@Rainbolt vote whore? Really? :)
 
I'm guilty of vote whoring too
 
don't you have to promise something to be a vote whore?
what was promised ?
 
If this was StackEgg time, the word whore would have got you both chat banned
 
@Optimizer what is StackEgg time?
@Optimizer would b****fuck too?
 
@Lembik not sure about that
 
1:58 PM
my criticism is purely linguistic! I think it's the wrong term
:)
 
nevermind, don't know how to count
 
it's funny I also thought I had too many stars.. it does look odd
 
It's because we want equilibrium
 
you guys are accustomed to adding only 1 star in f*ck
 
@Optimizer doesn't it depend how good it is?
 
2:00 PM
@Optimizer I usually call it BF
 
(is that tripadvisor reference too cryptic? :)
 
@Lembik well, 4 stars are too much for you.. so 1 should not be that bad :P
 
:)
 
So for 1 start, you're fucked, for 4 stars you're b****ed, right?
@MartinBüttner I don't know CJam at all, but I'm always amazed while reading the explanation, thank you for that !
 
I'm too accustomed to reading b**** as bitch for it to mean anything else. Sorry, but that's 'bitchfuck' and 'bitched' to me.
 
2:04 PM
@Katenkyo it's not that hard to learn and I find it really refreshing to code in a completely different paradigm every now and then :)
 
@Geobits how often do you read the word bitch a week??
 
I haven't kept an accurate count recently, but I'd estimate 924 times per week.
 
@Geobits I'm used to see b*** for bite (dick in french), which sounds great in b****fuck
@MartinBüttner I might give it a try if I have time to spend during summer
 
@Geobits I am fascinated :) You need a stop motion video of a week's reading
 
Dennis's thoughts: "Oh god, what did I walk in on?"
 
2:06 PM
I... don't even know how that would work. A stop motion of the words would just be words flashing by. A stop motion of me reading the words would be utterly boring.
 
@MartinBüttner he's not Peter
 
@Geobits I'd probably watch the latter.
 
Nice creepy voyeur vibe you've got going there.
 
@Optimizer Peter wouldn't think that. I think his thoughts would be closer to "ugh".
 
oh god is close enough to ugh in this context
 
2:10 PM
just out of curiosity, does anyone in here have any experience with Unity?
 
Unity like the engine or Unity like the the desktop?
 
@Geobits Unity as in fraternity
 
@Geobits oh, there used to be a desktop environment... I totally forgot about that (that looked sick, if it's what I'm thinking of). I meant the engine though.
ah no
Unity is the new Ubuntu thing, right?
hm, now I wonder what the other one was called
 
Vanilla Ubuntu used GNOME 2 and then Unity.
If that's what you're talking about.
 
I looked into the engine a few years back, but I decided it was overkill for that project. Kept meaning to check it out again, but [insert procrastination excuse here].
 
2:15 PM
Heya
 
@MartinBüttner Crazy. I think I've tried at least 20 different approaches. Nothing seems to beat [ZYX].
 
@Geobits yeah, same (I first looked into it when prototyping Circular[0] and discarded the idea right away). I've got an idea for a new prototype though and I think it would work best on mobile... so before I start learning Android (and have to code Java), and then maybe later have to learn objective C to port it, I thought it's probably easiest if I use Unity and let it take care of some of the mobile-specific stuff.
 
@aditsu ^
I am not sure how many more reasons you need....
 
@Optimizer That's not the first time.
 
2:21 PM
@MartinBüttner My only experience with cross-mobile platforms is PhoneGap. I hate it with a passion, but I assume Unity can't be as bad.
 
@Optimizer no, that's just the camstudio project
 
@Geobits (hopefully) being able to port it more easily is just a bonus. just getting it on one mobile platform in the first place is my main motivation right now.
 
I am looking for a related problem to the knapsack problem... My english is not the best, and I have large difficulties finding it :p Say I have an amount of money and wallets of different sizes. I have as many wallets as I want. Now the question is how to get the storage in the wallets as close to the number of money. Eh best fit.
 
@MartinBüttner I haven't done a native iOS app, but I found Android surprisingly easy to pick up (it's where I learned Java in the first place).
 
@Optimizer even filezilla, which bundles stuff in the installer (from what I heard), is not listed as malicious
 
2:23 PM
Does this sound familiar, or I am I crazy?
 
@Geobits Java though
 
That's what I kept saying. My main experience before that was in the C-family. It wasn't so bad making the jump.
 
@Optimizer I've turned malware protection on to test. Cannot reproduce on Chromium.
 
@Dennis camstudio project gives me that same warning
in chrome
 
@Martin The main thing you'll have to learn for Android (assuming you know Java) is the app lifecycle. Writing things that can be interrupted often, at any time, is the biggest hurdle. I assume iOS is the same.
 
2:25 PM
I can reproduce on chromium, only for camstudio
 
@Optimizer Strange. I have Chrome at home (Chromium is a headache on Fedora). Will try it there.
 
(For those unaware, on that site, [mtg:Card Name] creates an automatic link to the Gatherer, a database of cards)
 
@Rainbolt wow...
 
2:50 PM
Too bad base convert doesn't work on chars, like '94b
 
@Geobits The main thing when I had to learn for Android was dealing with AndroidStudio...
 
@Sp3000 That would be nice, yes. But a substring operator (like Pyth has) would have been even more useful here.
 
@Katenkyo I don't like AS, so don't use it. The Eclipse plugins work fine, and since I use Eclipse anyway...
 
@Geobits I use eclipse too when deving java, but had to use AS for studies...
 
Oh, yea, for a class. That sucks.
 
2:57 PM
0
A: Sandbox for Proposed Challenges

Vioz-Palindrome Reversal-Addition The process of Reversal-Addition is where a number is added to it's reverse until the number created is a palindrome. For example, if we start with 68, the process would be: 68 + 86 => 154 + 451 => 605 + 506 => 1111 As you can see, this took 3 additions to get to a...

 
@Geobits System team of my campus didn't do its job, we spent the first 5h setting AS because of incompatibilities with their custom *nix environment/lack of libs/sdk etc
AS wasn't even downloaded...
And it was unstable -_-
 
Always nice when that happens. There's nothing I enjoy more than being sucked into dependency hell.
 
00:00 - 15:0015:00 - 00:00

« first day (1601 days earlier)      last day (3240 days later) »