« first day (1593 days earlier)      last day (3233 days later) » 

12:15 AM
You guys remember the time that I posted that my Minecraft base looks like a [insert term here] and the message got flagged and deleted and I got suspended from chat? Well it's time I showed you that I wasn't being offensive.
 
The image appears somewhat voxelated
 
Very blocky.
 
voxelate - to represent something as pixels
Your comment appears voxelated
This is not the definition I am looking for
 
@Rainbolt The image doesn't look in any way offensive. I'm guessing the offense was purely down to your skillful choice of words ;)
 
I said it looks like a d*** and b***s
Because it does
 
12:19 AM
Well, you built it...
 
yes I remember, but it isn't obvious enough in the image to be flagged (at least I don't think so)
 
Well yea the image won't be flagged
I'm just defending my comment that was flagged
 
lol I don't know the exact circumstances of it being flagged but I'm guessing it wasn't flagged for being untrue...
 
Seriously? Someone is now flagging my censored comments
And the "Because it does"
How on earth is "Because is does" offensive or rude?
 
There are language police around? We'd all better be extra-careful then, to refer to a certain esolang as B---nfuck.
 
12:21 AM
@Rainbolt They flagged both??
 
I wish I couldn't see flags on my own messages
Yea, they flagged both. And both were denied.
 
lol
 
I hope you feel good cowering behind your anonymity, whoever you are.
 
I like the perspective with the clouds - gives a great sense of scale
 
Yea that tree is huge. Who wouldn't look at that and think "Home."?
 
12:23 AM
You could hollow it out and have a town in there. How far inside is it accessible?
 
The entire tree is hollowed, but only the first two floors are currently occupied
Now that I have discovered elevators I may stop expanding outward and start expanding upward
 
You could have doorways near the top onto little wooden balconies
 
I think Calvin is about to suck me in to his vanilla server, so this project will have to be put on hold
 
@flawr I just fixed a one character bug for Dijkstra. I could make a new leader-board for you.
 
Although the image looks impressive, I have no way of relating that to effort input, as I know nothing about Minecraft
 
12:27 AM
Well 90% of the picture was auto generated terrain
10% (the stuff inside the tree, the farm, and the cow pen) is me
 
So you can't grow trees that big? Did you have to chop down a lot of other trees to build that one?
 
1:11 AM
0
Q: Pointers, pointers, pointers!

fridgefishIntroduction In the error outputs of some languages such as Java, a pointer is shown to give the programmer an idea of exactly where the error went wrong. Take this example on Ideone: Main.java:12: error: ';' expected Invalid Java! ^ Notice the caret shows where the inva...

 
 
3 hours later…
3:56 AM
I have a Python puzzle: Given a list l of single-digit numbers, replace every instance of a number a by the number b, while keeping the other elements the same.
so a=2,b=3,l=[1, 2, 3, 1, 2, 3] results in l=[1, 3, 3, 1, 3, 3]
Python version up to you
this is code-golf
 
there is a way shorter than [(x,b)[x==a]for x in l] ?
 
yup
for reference, that's 23
25 for l=[(x,b)[x==a]for x in l], actually
 
testing backticks: l
while 1:l[l.index(a)]=b 23
 
that doesn't terminate
 
it does, with an error
 
4:09 AM
Does that technically complete the task despite staying in an infinite loop??
 
ah
i'll say that isn't allowed, though I had a shorter answer in mind anyway
 
ohhh...
 
while a in l fixes it, but is longer
 
4:26 AM
There's no shorter way to do str.replace, is there? :/
 
4:37 AM
While there are python golfers in:
Python-self-answering a golf question: good or bad?
 
i usually wait a while befoere self-answering
or do you mean as a non-golfed reference implementation?
 
Why not? Just wait a bit to give others more time, since you've thought about it for longer
 
@xnor Sounds reasonable. I have a non-golfed reference answer in the question, but I wanted to see what could be done with python because I've set a 5 minute time limit for the test cases
(the example answer in the question is in JavaScript)
I have an answer in python that works for the test cases (it turns out a straight translation from JS was enough) so I'll post it after there's been time for other python golfers to post
A few days maybe?
A week?
 
A day or two should be fine I think. By a week people might have forgotten already
 
Great. Thanks for the advice :)
 
4:51 AM
@xnor Just checking, a, b are ints, right?
 
yup
 
single digit ones?
 
@trichoplax yes
 
"Single digit" is awfully suspicious it makes me think xnor's got some string shenanigans planned, but replace is expensive...
 
I tried my best to make printing a caret and some space interesting
lambda*p:'%s\n%*s'%(p+('^',))
 
4:57 AM
wow that's actually python...
 
Wow I didn't know %*s was a thing
 
what does it do?
 
>>> "%*s"%(3,"^")
'  ^'
Hm...
 
%5s prints in a field of minimum width 5
%*s makes the width another argument
 
whoa
 
5:02 AM
C stuff
 
Deep magic from before the dawn of python
 
you can also make it left align with a -
 
any way to get the ^ outside?
as ... +'^'?
 
Then 1 would need to be subtracted from the width which really defeats the purpose
 
ah right
 
5:04 AM
f=lambda*p:'%s\n%*s'%(*p,'^')
Works in Python 3.5
Now I need to update that tip, I didn't think tuples worked before for some reason
Funnily enough, lambda s,n:s+'\n%*s'%(n,'^') fits in between, at 28 bytes
 
5:30 AM
@feersum ^^ ?
 
nice work
 
5:48 AM
Does any of you know how many times I can edit an answer before it gets converted to community wiki? I thought I had seen a Meta post about this, but I can't find it...
 
40
A: Can we disable automatic community wiki conversion for answer edits?

Grace NoteWe have disabled all forms of community wiki automatic conversions, not just for answers but for questions as well. The feature was never really about encouraging substantive edits as much as it was about prevent abuse. And in fact it punished people who made not just substantive edits, but lots ...

 
Neat, thanks. I'm currently at revision 26 and I started to get worried.
 
6:07 AM
@MartinBüttner I'm thinking Marbelous could use a variable synchronizer, &?, which would sync based on the value of the marble on it.
so dropping 07 onto &? would sync up with other &7s
a bunch of existing code could be simplified with this. pretty much anywhere that there's a conditional leading to two different synchronizers.
 
7:02 AM
Hi everyone !
 
7:13 AM
@grc lol ninja'd, I was about to comment that :P
Nice work though
 
grc
:P I'm not sure if I should have posted it as an answer though
 
Why not? Nobody else uses %c
 
grc
idk.. it's more of an improvement on other solutions
 
7:25 AM
awesome answer at codegolf.stackexchange.com/questions/51436/… ... in case anyone wants to see an awesome answer :)
hi @Sp3000
 
Hello
 
Does anyone here is used to checkstyle?
 
7:56 AM
@TheNumberOne Feel free to do so! I usually did 100 games which now took me 20min.
just updated the animation
 
8:14 AM
Hi
 
@CoolGuy hi
 
lol Why is the chat showing my old profile picture?
Ok. Now it shows my current profile pic. :-)
 
can we upload animated gifs as profile picture?=)
 
@xnor I'm trying this puzzle, but nothing seems to work. Care to give a hint?
 
8:29 AM
ok
the single digits are a red herring for people who me to do a stringingifying trick. especially @Sp3000
this works for basically any type of element
the idea is not mine; I saw it in a golf elsewhere
 
Alright, I'll keep at it.
 
@TheNumberOne updated scores.
 
grc
8:58 AM
@xnor does it work in both versions?
 
nope
do you want me to say which one?
 
grc
not yet
it might give it away
 
actually, let me qualify that to say that the code I was thinking of doesn't work in both versions
it perhaps could be ported
it's clearly better to use one version
 
grc
does it involve a dictionary?
 
map({a:b}.get,L,L) ^^ nice idea, grc
 
9:10 AM
:-)
 
(that's insane btw, passing the same list twice)
 
grc
@Sp3000 wow I forgot you could do that... I was stuck with this: map({a:b}.get,l)
 
That is indeed insane.
 
grc
very nice
we should raid all the python tricks from that site
 
9:14 AM
there's associated tips pages, but it's familiar stuff, except for stuff with input that we have different conventions on
the post-mortems are a trove of ideas though
 
grc
I should probably leave that for when I don't have exams
 
I wonder why they choose set('%d'%5**18) rather than set(str(5**18))
 
for the L at the end in some versions
 
Even for str? I thought that was a repr thing
 
oh, you're right
 
9:19 AM
(aw damn they have `L`[2::5] already)
 
yes, though it seems they didn't know it as of the permutation challenge
that's where I expect we won the char
 
str(bytearray(L)) <-- Damn.
 
i should look at that; I have no idea how byte arrays work
 
I've noticed that sum(b"000") in Python 3 sums the ASCII values (so that example gives 3*48 = 144)
I'd never have thought of going the other way though, from ASCII values to chars
 
Here's a ridiculous one: list(open('/dev/fd/0'))
It actually works on my machine.
 
9:22 AM
D:
 
is there a way to get the ords out of the byte array?
@isaacg that's that file?
 
>>> list(map(int,b"xnor"))
[120, 110, 111, 114]
Like that?
 
@xnor It gets the input to the program I fed it into.
python read_input.py <<< 'abdads
> basda
> asdfasdf'
['abdads\n', 'basda\n', 'asdfasdf\n']
 
@Sp3000 well, i was hoping byte arrays gave a more dirrect approach
 
Oh, actually calling list works
>>> list(b"xnor")
[120, 110, 111, 114]
 
9:25 AM
i'm not getting that
in 2.7.2
just converting to a list of chars
what version are you using?
 
3.4
 
ok, works for me in 3.3
that's fascinating -- a new way to write lists of ints?
can you do it with non-printable chars?
list(b'\x01\x03\x06') works fine
 
I'm sure you could use the literal characters as well.
 
they are one byte, right?
 
Yeah
 
9:30 AM
wow, this seems broadly useful
@grc can you use it for hourglass?
it works as *a,=b'\x01\x03\x06' too
and for n in b'\x01\x03\x06':
 
Oh? Can you add/subtract?
 
subtract?
 
Little optimistic, but I was wondering how far you could treat it as an int
 
nah, it works completely as a list of numbers
concatenation, find, max
oops, find doesn't actually work
 
find is python 2
 
9:41 AM
index also fails
 
It's most similar to a tuple of ints
 
it has replace!
i'm getting more and more excited about this
it lets you do string operations, effectively, on a list of positive ints
wait, i spoke too soon
it has replace in its dir but "expects an object with a buffer interface"?
 
You need to replace a bytes object
 
ah, of course
 
b"abc".index(b"a") = 0
Likewise, index works
b"abc".replace(b"a", b"c") = b"cbc"
 
9:47 AM
btw now that xnor/grc's brought up dicts, here's a little side-puzzle: What's the shortest way of generating the dict {"a":"b","b":"c","c":"a"}?
(because every time I see dicts like those I feel like there's so much wastage)
 
dict(zip("abc","bca"))
I mispasted the first time.
 
Ah right :P
Yeah that what I've been using thus far, and I'm wondering if there's better... (dict(["ab","bc","ca"]) ties, unfortunately)
 
unfortunately, b'123' creates an immutable bytes object. if you want mutability, you need a lengthy bytearray(b'xyz')
 
Hmm I think the str(bytearray()) thing only works in Python 2
 
I still think the fact that
list(open('/dev/fd/0'))
Gives the inputs to the program is very weird.
 
9:57 AM
Ahaha, too bad it doesn't work on Windows - I can't test :(
 
It's very linux only.
Or unix only
 
@randomra Did you think CH's challenge looked familiar because of this?
 
the xkcd number system has a name:
The skew binary number system is a non-standard positional numeral system in which the nth digit has a value of and each digit has a value of 0, 1, or 2. Each number can be written uniquely in skew binary canonical form where there is only at most one instance of the digit 2, which must be the first non-zero least significant digit, as shown in following table: The advantage of skew binary is that each increment operation can be done with at most one carry operation. This exploits the fact that . Incrementing a skew binary number is done by setting the only two to a zero and incrementing the next...
 
for hourglass, here's what it looks like with bytes in Python 3:
t=int(input())+1
s=' '*t+'.'*60+' '*70
n=0
d=sum((1<t<56,2<t<48,3<t<36,4<t<22))
for i in b"\x00\x11\x0f\x0d\x09\x05\x01\x05\x09\x0d\x0f\x11\x00":print([s[n+i:n:-1],[s[180-n-i+d:][:i],'.'][5+d*3>i>0]][n>59].center(i).center(19,'#'));n+=i
 
How much better is it?
 
10:12 AM
it's 197, from 203, if I indeed understand that each escape char is one-byte
 
Hmm might be usable in seven-slash too if I can rework things to be in terms of digits instead of segments
Too bad you can't bitshift bytes though
 
10:50 AM
@Sparr @Geobits @Compass okay, with the definition of skew binary it's actually fairly simple to do it in O(log N).
 
11:03 AM
0
Q: Help me find the type of connection between the social network entities

JackSavvySparrowConsider a Social Graph which represents the friendship among the entities of the social world. The vertices are the entities and the edges are the friendship between the two entities. Given such a graph you have to analyze the graph and answer the query as to what is the type of connection betwe...

 
11:24 AM
0
A: Sandbox for Proposed Challenges

Cool GuyGenerate boxes Your task is to generate boxes using any one ASCII character with respect to the inputs given. Test Cases 1 1 --> ===== = = ===== 1 2 --> ========= = = = ========= 2 1 --> ===== = = ===== = =...

 
11:48 AM
@Sp3000 Right, thanks. I tried to find it there too but couldn't. I'm not going crazy after all. :)
 
12:29 PM
hi all, I've updated some CJam wiki pages - mainly added the new operators, started making individual operator pages (one so far) and cleaned up a couple of things
 
1:07 PM
hi all.. how long should I wait before I accept the shortest answer at codegolf.stackexchange.com/questions/51406/… ?
 
no less than a week from posting would be my suggestion
 
@Lembik , Your wish. I usually give at least 2 days.
 
Hi, I agree with Melon
 
42 days and 23 hours.
 
7 hours, 3 minutes, and 14 seconds
 
1:08 PM
I'm with Geobits on this one.
 
any more, and they could be using a super computer.
 
I think you should wait one second.
Whoops you missed it.
 
just wait until I am winning
3
 
Suppose I post an answer in the sandbox. Someone responds to it saying "You should add xxx". Should I edit the answer to include it or should I do that when I post it in the main site?
 
edit it, the idea of the Sandbox is to let you make changes before posting, and such, should represent what you intend to post so people can vote it up when they think it is ready (also means your final phrasing gets looked over, etc. before posting)
 
1:20 PM
It also lets others know that you're willing to actually add it in rather than ignore the feedback, possibly encouraging more feedback.
 
Alright. Editing my answer.....
 
If you disagree with adding xxx you should say so in comments, again with the point being that people know you're not just ignoring it.
 
@CoolGuy thanks
 
Does anyone object to not requiring the efficient algorithm for the xkcd-base challenge? (And just offering a bounty for it.)
I can think of 4 ways to solve the challenge. one is O(output), one is O(input), two are O(log(input)). the linear ones and at least one of the logarithmic ones could be the shortest in one language or another (maybe even the other logarithmic one as well)
since the faster ones aren't necessarily longer, I think I'd prefer keeping the variety by not prescribing a minimum efficiency
 
Makes sense
I'd only want to exclude a trivial brute force approach. If the most brute force approach is still not trivially short then it seems fine
 
1:31 PM
that's the O(output) one. but it seems hard to find a time limit that rules out O(output) but allows O(input) for all languages.
 
Personally, I don't like challenges with an O(f(n)) requirement, since I don't know how to calculate it.
Not all of us have studied CS...
 
That's the nice thing about a time limit - no one needs to think about complexity classes they just automatically can't do anything which is too slow
Even people who have studied CS may disagree on what the complexity is of an opaque bit of golfed code, but there's no arguing with a time limit
 
Unless you do most of your golfing on a slower-than-usual computer, then it sucks.
 
the problem is, I'd need quite a large N to separate the two linear algorithms since the factor between them grows rather slowly. so by the time I could reliably set a time limit between them, the computation will take quite a while in slower languages.
 
Also, you have to distinguish between the algorithm's complexity and the implementation's. Some operations are insanely expensive in some languages.
 
1:34 PM
surly the factor between them is constant if they are both linear?
 
@VisualMelon they are linear in different variables
 
For example, computing an array's length without destroying it is O(size of the array) is most stack-based languages.
 
Depending on what the algorithms you have in mind are, you could do something like "You may not calculate more than n/2 preceeding terms", although that might be a bit harder to enforce
 
What's the worst consequence of allowing all approaches for this particular question?
 
1:36 PM
that I misjudged the golfability of the interesting approaches
(and everyone uses the boring one)
 
So not world-destroying?
 
but I really doubt that. I don't think I could beat my (efficient) Mathematica implementation with the trivial one.
okay, that's settled then.
btw, this number system actually has some merit.
 
So even if the trivial approach wins, it will be in an unexpected way.
 
when incrementing a number, at most two (adjacent) digits will change... you'll never carry a change through the entire number. so with the right representation you can increment the number in O(1)
 
Interesting
Is there any advantage over Gray codes?
 
1:41 PM
@MartinBüttner So allow all. A language with regex support might use the brute-force approach, others probably won't.
Always nice to see a little variety in the answers.
@aditsu Making individual pages for each operator sounds like a lot of work. You could split the operator page in four (one-letter, infix, extended, math) and add a short example to each. Maybe with an individual page for j, with the answer you gave in the forum.
Thanks for that, btw.
 
@trichoplax not sure. slightly more intuitive way to recover N I guess.
 
Made me wonder about a challenge but Gray codes have been done...
 
@aditsu I agree with Dennis. I wouldn't want to have to click to a new page for each operator. not even j needs its own page - just a longer sectiion.
 
Ok I'll think about it
 
blagh
 
1:47 PM
I should probably propose some improvements to the OEIS page for that xkcd sequence... it doesn't mention anything about skew binary.
 
i blame randall for that
He should have cited his source Kappa
 
0
Q: xkcd-Style Page Numbering

Martin BüttnerRandall Munroe's book "xkcd, volume 0" uses a rather odd number system for the page numbers. The first few page numbers are 1, 2, 10, 11, 12, 20, 100, 101, 102, 110, 111, 112, 120, 200, 1000, 1001, ... This looks a bit like ternary, but notice that he skips from 20 straight to 100, from 120 to...

 
@Dennis @MartinBüttner I think I'd rather make several pages grouping operators by type, like arithmetic, stack manipulation, logical, etc... but I'm not sure if I can separate them nicely
 
that will be a problem due to overloading
 
^^
 
1:54 PM
unless you want to repeat the operators on different pages
I'm not sure I like that though :D
 
So... no time limit? Sounds fun :)
 
@Martin did you get to see my base?
 
I did
@Sp3000 yes, unless you want the bounty :P
 
ok
so i can do all the test cases but the breaker
 
I'm putting my money on at least one answer taking exponential time :D
 
1:57 PM
Can I get an alternate bounty for taking way too long?
 
wat
chrome doesn't do the
 
@Geobits Sure, if you find someone to offer it :P
 
=> ?! chrome doesn't use ECMA6?!
 
Oh quick question - leading zeroes?
 
@Compass nope
 
1:57 PM
stabs eyes out
 
@Sp3000 oh, good question
I'm gonna say no, because you don't need to handle 0 input.
 
@Compass It's really the only reason I have FF installed :/
 
Thought so, just checking :P
 
do i have to be able to do the last test case?
because RIP firefox
i can let it run overnight obviously
but i need to work on firefox tooo
 
your algorithm won't solve the last test case before the singularity
 
1:59 PM
@Compass You must be running out of eyes...
 

« first day (1593 days earlier)      last day (3233 days later) »