« first day (1676 days earlier)      last day (3169 days later) » 

12:01 AM
36
Q: Reverse indentation

Doorknob I've heard that your code can run faster if you indent it in reverse, so that the compiler can process it like a tree design pattern from the very top of the "branches" down. This helps because gravity will speed up the time it takes for your code to be compiled, and the data structure efficien...

 
Oh man, those first two paragraphs
 
How on Earth have I not seen that before??
 
12:26 AM
My first wisdom tooth is starting to show :)
 
@AlexA. Indenting with spaces is always bad, no matter how many.
3
 
@Dennis Heresy!
 
Tabulators!
 
@TheNumberOne Aw! Better get it torn out of your face ASAP!
@Dennis I feel like the usual ಠ_ಠ face does not suffice here.
2
 
@AlexA. Why? I've had all four for years.
 
12:34 AM
@Dennis Idk. They took mine away.
 
I have a strict policy with doctors. If it doesn't bother me, they don't get to touch it.
3
 
@Dennis ewwww...
 
Haha I thought you were saying ew about Dennis getting touched, but no, it's about spaces vs. tabs.
 
12:53 AM
translate ko: door handle
(from English) 문 손잡이
@Doorknob ^
 
@AlexA. that is indeed the literal translation of "door handle" :P
 
I don't know who starred Dennis' pro-tab blasphemy, but to you I have only this to say: ಠ_ಠ
 
I did it, and I'd do it again. Tabs for life.
 
31 mins ago, by Doorknob
@Dennis Heresy!
 
Yes, I saw that. You're still wrong.
 
1:04 AM
Hooray for tabs.
 
@Maltysen Incorrect.
 
There's just not a single advantage for spaces. Really.
 
Spaces will crush your puny tabs into oblivion.
@Geobits So what's the advantage of tabs?
 
Indentation is exactly what tabs are for.
 
No, that's what spaces are for. :P
 
1:05 AM
The whole reason the tab key exists is to indent and line things up.
Space is an inferior hack.
 
Nope, that's what the space key is for. Tabs are inferior hacks.
 
Pro tip: you can make spaces with your tab key !!!
 
yeah tabs are variable width to line things up
 
@feersum This is the correct answer
 
what do u guys think about about a hard tab <-> spaces conversion challenge. Easy, except you can't change strings.
 
1:06 AM
Why on earth would I want my tab key to make spaces, though? I keep hearing this argument, and it makes no sense.
 
That already exists (IIRC).
 
54 secs ago, by feersum
Pro tip: you can make spaces with your tab key !!!
 
@Geobits Because spaces are better, but hitting space four times in a row is a pain.
 
Except spaces aren't better, so the argument is invalid.
I can make the q key insert spaces, too, but that would be dumb.
 
The tab key's existence predates programming. With the advent of programming, everyone on Earth except Geobits, Dennis, and Maltysen realized that tabs are useless crap when it comes to code, so spaces were adopted. The tab key exists mostly for historical purposes and for tab completion.
 
1:09 AM
@AlexA. they are the best way to format ascii tables
 
@Maltysen False
Also tab-delimited files shouldn't exist. EVER.
 
@AlexA. When you say "people realized..", what you mean is "a group of people started a space cult", right?
 
Clearly, we should code in CJam all the time so we only ever need single spaces
2
 
@AlexA. you want to write the exact same code that tab completion does to format a table?
 
@Maltysen I'm not sure what you mean. In any sensible environment, you can set the tab key to output spaces. That's what I do whenever I need to make a table in ASCII. If it's hard tabs in a table or space key only, I'm space keying it all the way.
 
1:12 AM
no I meant as output from a program.
 
@Geobits I didn't say "people."
 
Well at least you're finding a good use for your mod powers :P
 
@Maltysen Then I don't understand what you mean.
 
Oh my god Alex you have a diamond! CONGRATULATIONS!
 
Thanks!! :D
It came as a surprise.
 
1:13 AM
84
Q: Tabs versus spaces—what is the proper indentation character for everything, in every situation, ever?

kiamlalunoThe coding standards for the code hosted in drupal.org suggest to use two spaces to indent the code; other sites suggest to use tabs to indent the code. What is the proper indentation character for everything, and in every situation? Please explain the answer you give.

 
I'm so incredibly happy to see you and Dennis with the new mod positions. I couldn't have asked for a better outcome.
 
Tabs are not originally meant for indentation, they are meant for tabulation, and do a dreadful job at it... — Timwi Sep 2 '10 at 19:15
@BrainSteel :) Me too. I'm so grateful to have been selected and I'm honored to mod alongside some super legit people.
 
I press the "tab" key and my IDE prints 4 spaces. So where does that leave me?
 
@BrainSteel The good side.
 
@BrainSteel That means you're correct.
:P
 
1:16 AM
What IDE do you use?
 
Oh boy! I've always wanted to be correct!
 
What's an IDE?
 
XCode on Mac, Code::Blocks everywhere else. Trying to get into Emacs. Occasionally nano.
 
@Doorknob Isn't Dennis Extra-special.
 
I feel like I've regressed, since I'm starting to prefer compiling from the command line...
 
1:18 AM
@BrainSteel Regressed? That's the exact opposite. :P
 
@BrainSteel I like XCode a lot but I'm beginning to find that it does too much for me. Like I haven't learned how to link anything.
It's a menu in XCode. I have not the slightest idea how to do it from the command line.
 
XCode hides everything. I am not a fan of that. Makefiles show everything.
 
Makefiles require tabs and are hence the devil's work.
But they're a necessity.
 
That's true. It's a bit disappointing.
 
Makefiles are awesome and amazing, except that they have to use tabs. But Vim conveniently handles that for me.
 
1:19 AM
Makefiles only require tabs because they're made for programmers and programmers prefer tabs.
 
[citation-needed]
 
Makefiles are the citation(s).
 
The first time I wrote a makefile in Vim I was expecting to have to go in and change all my tab settings. But nope!
 
Though, to be fair, I have to commend XCode for having a really nice debugging environment. That has become the #1 reason I use it.
 
Same
I've been enjoying "developing" (my pathetic, know-nothing version of development) in XCode since it tells me why I suck, then I take the code outside of XCode and test some more.
 
1:22 AM
Yeah, I agree. XCode is very good for a lot of things, and it has handy instruments for telling you just how bad your code really is. There's just so much of it.
 
Yes.
And it only wants you to use C, C++, Objective-C, or Swift.
 
And it fights you if you want to build GUIs in pure C.
 
You can build GUIs in pure C?
Using Qt, or is that C++ only?
Oh, does XCode want you to use Cocoa bindings or whatever?
 
I use SDL 2.0, which takes care of the little bit of required Objective-C, so it's not "pure" C. Linking it got a little funky. But in the end, every line of code I write is C, which pleases me greatly.
I always felt like the more crowded my IDE was, the more crowded my brain was. I've had great success writing code in Wordpad, just because it's so... blank.
 
@BrainSteel yeah i know what you mean, eclipse feels like I should be so productive, but notepad++ usually makes me more efficient
 
1:28 AM
@BrainSteel Then you should try Vim :D
 
@Doorknob That is very much an option for me! I've played with it a little, but haven't gotten comfortable with it yet. Do you have any general-manual-type references for an introduction and useful features?
 
Doorknob is a vim pro.
 
@BrainSteel Have you run through vimtutor repeatedly until you've gotten completely comfortable with everything in it?
 
I haven't even heard of that (I'm very much a novice with Vim)
 
@BrainSteel Actually, @PhiNotPi wrote the whole backend for his language, Element, using Notepad. I find that amazing.
 
1:31 AM
What OS are you on? I think it's installed by default on most Linux distros.
 
OS X
 
Dude knows what's up
 
Try just typing vimtutor into your terminal.
 
Can confirm, wrote it in Notepad.
 
1:32 AM
You're a wizard, Phi.
@Doorknob Works for me.
 
@Doorknob Huh. Looks like I've got a weekend project.
 
\o/
 
@PhiNotPi I can understand the urge to do that :D
Thanks everybody!
 
I helped in no way but I will still say you're welcome.
 
You helped in all the ways!
By the way, I have another question. My mom really likes procedurally-generated fractal-y art, and wanted to know if I could do something neat with it to hang on a wall or something. Anybody know any good references for the math behind it and such?
 
1:36 AM
@BrainSteel I can help if you correct your English. :P
 
Errr... 'Murica.
 
Excellent. Now that you ask...
 
Depends which fractal, I guess
 
Hahaha, do I get any more fancy points for that?
 
The Fractal Geometry of Nature by none other than Benoit B. Mandelbrot.
1977
 
1:37 AM
I've been looking at recursive formulas, hopping from point to point. I was wondering if there's some objective measure that usually leads to what we call interesting. If there is, then I can hook it into my GP framework, and boom. My computer is an artist.
 
Or you could crib something from codegolf.stackexchange.com/questions/35569/….
 
@AlexA. I'll look at it!
 
I can mail you my copy. :P
 
Snail mail or email? ;P
@feersum A lot of those are a tad simplistic for her taste. Still, a great starting point!
 
@BrainSteel Hah, I only have a print version and I don't want to scan over 450 pages.
 
1:40 AM
Don' worry 'bout it. My university library likely has a copy :D
 
I dunno about objective measure, but it sounds like you could chuck random L-systems on and hope for the best :D
 
> This result suggests endless paradoxical stories. Sober readers are urged to forge ahead.
 
@BrainSteel For actually nice-looking stuff, you should implement the fractal flame algorithm.
3
I used to play with it at some point.
 
Holy crap, do that ^
 
Well, I was thinking that a recursive-fractal-generating-formula would be interesting if a) it had a large, but finite period, b) its second derivative is unpredictable (or something along these lines)
@Zgarb WHOA, THANK YOU.
 
1:42 AM
I'd star the link but phone
 
@Sp3000 Myself and 2 others did it for you
 
I think that caused it to get more stars than it would have if only Sp had starred it, lol
 
XD thanks?
 
Sp is a mastermind.
 
1:43 AM
He's actually a 3000-node computer.
 
Does that make his brain steel-based?
 
He's actually my chatbot
 
Apophysis is the program I used, but perhaps you'll want to implement the algorithm yourself. There's a learning curve either way.
 
Enter DoorHandle
 
@Zgarb I'm really interested in trying some more complicated graphical things programmatically, so I'll probably implement it myself. Thanks for the link though!
 
1:45 AM
I assume you'll do it all in C?
 
Naturally ;D
 
I don't know why I put a question mark on that sentence come to think of it. :P
 
I only use two languages regularly, and one of them is BF. No way am I doing fractals in BF. Yet...
 
Challenge: BF fractals. Make BF code fractallable, with each iteration printing something progressively more awesome
 
Write BF code that outputs its own source code as the next generation of a fractal. Repeat.
 
1:50 AM
Isn't that just a quine?
 
Fractal-Quine might actually be cool.
 
I don't think I fully understand the concept.
 
I don't think I do either. I think I'm spouting a bit of nonsense.
 
The generations of code must be describable with a certain class of string-rewriting rules?
 
Is it possible to write a program that's a quine up to a given Levenshtein distance? Like if you write a program that takes an integer as input, you output source code with the same length but with a Levenshtein distance according to the input from the original? (With the caveat that the output must be runnable with no errors/warnings)
 
1:55 AM
of course
 
You could just do a normal quine that outputs extra comments or something
 
I foresee code like "<slightly_modified_quine> my_constant = 1;" which then outputs "<slightly_modified_quine> my_constant = 1000..0000;" to change levenshtein distance.
 
@Sp3000 Same length as original
 
Hmmm... Then what do you do for inputs greater than your code length?
 
Modulo or undefined, I suppose.
 
1:57 AM
Would the output have to do something specific?
 
runnable with no errors is a pretty trivial requirement
 
Lemme try that again - replacing the first n characters with, say, # for comments
 
If you rule out comments... I think this is actually pretty interesting, and would have lots of varying strategy with different languages.
 
@BrainSteel If you can think of a good way to phrase it, you should sandbox it.
 
Rule out <blah> never makes it interesting
 
2:00 AM
If you rule out comments, you could probably do something similar with strings
 
there is always something equally simple, like a long variable name, an arbitrary numeric constant etc
 
I'll have to think about it. I unfortunately have a great deal of homework and not a great deal of time to get it done. I'll have to talk to you lovely folks later :D
 
@BrainSteel OKAY BYE <3
 
@Maltysen may we reorder a and b?
for example output this for 4, 3:
             #####
      ####   #####
###   ####   #####
###   ####   #####
### + #### = #####
 
Do you mean rescale?
 
2:11 AM
err
no
that should've been 4, 3
not 8, 6
 
@orlp no. And finally someone who's gonna beat my reference solution.
 
@Maltysen what do you mean?
 
my reference program I used to generate test cases was 45 bytes long
and no one has beat that yet, even the Pyth one.
 
you're saying I'm going to beat it?
thou hast faith
 
@orlp probably. I spent all of 5 minutes writing it.
 
2:20 AM
ok gna start golfing now
hope I don't disappoint you senpai
 
haha
 
@Maltysen man, I really want a feature I have in Pyth5 in Pyth :(
 
is pythh5 ready for contributions yet?
like just writing all the macros
 
`yes
actually, I haven't implemented this yet
but I will
either on * or ^
*a) = *aa
 
good idea
 
2:24 AM
^a) = ^a2
not sure which I prefer yet
 
can we make ^a) = ^a3
 
they're functionally equivalent
 
if we use the former one for squaring
 
don't think cubed is that useful tbh
 
more useful than ^aa ;)
 
2:26 AM
but then you can do squares like *M[blabla
for example
 
was looking over the macros code, why are & and | in there?
 
@Maltysen lazy evaluation
 
yeah so shouldn't they be syntax
 
what do you mean?
@Maltysen by the way, pretty much all of the core language is implemented, the main thing that's missing is stuff like *F and _M
 
like it shouldn't be a function but instead {0} and {1}
 
2:29 AM
not taking contributions for that - I want to implement that myself
@Maltysen it is?
@Maltysen what line of what file are you looking at?
 
*facepalm*
was looking at the comments in env.py
 
yes, those are just to keep track of what goes where
and keeping everything in the right order
even if there is no associated function
 
but it might not be a bad idea to make & a lambda func
and do lazy eval ourselves
 
@Maltysen so you can simply ctrl+f "# <char> to jump to the right place
 
same with | and ?
 
2:31 AM
@Maltysen open pyth_lang/codegen.py@35
 
yeah I saw that, was suggesting making it a lambda instead of syntax
 
@Maltysen I don't see a reason to
especially not right now
it'll make the debug output harder to read, slower to execute, etc
 
oh wow, all the lambdas are no even lambdas anymore, cool
 
@Maltysen what do you mean
 
map, filter, etc.
 
2:33 AM
only map
 
oh
what are the init- thangs?
are they for z and Q?
 
some symbols have a different meaning when encountered the first time vs the second time
z an Q, yes
lambda as well
 
ah
I see L for the new way we use L
 
no, the main pain point I have right now
is that assignment doesn't really work with lambda functions
 
hmm?
 
2:36 AM
let's say I have m4a
that's [0, 1, 2, 3]
 
right
 
but if I were to do m4,=a1a, what would you expect the output to be?
and what would you expect the value of a to be at global scope, after the map lambda has ended?
 
0
Q: A calculator as a list of numbers and operators

TrebuchetteYour task is to take a list of arguments that are either integers or operators, and parse them like so: There is a current operator, which starts as +. Each time an operator is found, the current operator will change to it. The possible operators are: "+", "-", "*", "/", and "%", which correspo...

 
[[1,1],[1,1],[1,1],[1,1]]
 
and the global scope a?
 
2:38 AM
its original value
 
here's what actually happens
[[1, 0], [1, 1], [1, 2], [1, 3]] and a at global scope is 1
 
I see
 
a's default value is abc...
 
so shadowing is not working properly
maybe you should implement your own variable handling?
 
2:41 AM
yeah since assign_at sets the global not the local
 
@Maltysen well, here's the thing
in Python you can't programmatically edit locals() in any way from what I've figured out
 
ah so you should write your own variable handler
 
so the only option is to turn all variables into a dict
so e["a"]
 
and a lambda definer which takes care of shadowing
 
yes
but that will hurt performance like crazy
severaly hamper output readability
 
2:42 AM
I was thinking about that second one
that has already happened ;)
 
?
 
so how about making the debug output pseudocode
 
nah
real code or it's useless
pyth is the pseudocode
 
2:58 AM
@Maltysen help me with this golf
let's say I have a list of stuffs in Pyth
and I want to join the list with one string, repeated
but I want the output to be a list, not a string
e.g.: [1, 2, 3] -> [1, " ", 2, " ", 3]
 
interlace
.iKU4mkK
.iKU4mktK
 
hrm, I'm not gna get any savings then
 
Is this seriously shorter in Snowman? " "aJ
 
@Doorknob we have j, but it joins a list into a string
@Maltysen I think we should change interleave
oh wait
hrm, string is a sequence
 
In Snowman, there's no such thing as strings (they're just arrays of ASCII codes), so join operates on two arrays and outputs an array. :P
 
3:05 AM
wait
why isn't the second argument of .t by default a space...
@isaacg grrr
@Maltysen pretty bad golf: codegolf.stackexchange.com/a/55792/4162
 
well you beat me by ten, so upvote
 
3:23 AM
@Maltysen make that 13 :)
j_.ts.im*d]*d\#+Qs.aQm[kdk)"+="d
 
ah nice use of .t and then _
 
would be 31 characters if .t had it's proper default argument :(
@Maltysen I thought my tetris answer was pretty nifty as well
5
A: Possible Tetris sequences

orlpPyth, 16 15 bytes sm*F.{Mc+>Gdz7T Prints 0 for false, a positive integer for true.

can you figure out what it does?
 
yeah
it pads the sequence with G
and then chops into 7
and then checks uniquness for all of them
 
it was the smallest way I could find to 'offset' the sequence
since G doesn't clash with uniqueness
 
its pretty nice
 
3:29 AM
I can't run your calculator answer btw
 
offline?
 
y
you use Q
but the input is not something you can eval
5 8 25 * 9 6 2 - 104 / 4 7 + 6 % 14
 
oh I did like: 5, 8, 25, "*", 9, 6, 2, "-", 104, "/", 4, 7, "+", 6
should mention that in the answer
 
is that allowed?
 
it says list of args
 
3:31 AM
also your answer is incorrect
your % and / must be like C
in your answer it's like Python
 
I get % but is / different?
 
they're directly related
the behavior of one defines the other
regardless of how you choose to implement them
(a/b)*b + a%b must hold
 
ohh
 
so if a%b has some value, a/b must follow suit
 
I'll ask the OP
 
3:34 AM
what's there to ask?
he said it should work as in C
 
3:44 AM
@orlp the OP is allowing you to use whatever your language does so I guess I'm alright
 
3:55 AM
0
Q: Implement arbitrary precision integer division

xiver77Define a function div(a, b) which will print out two decimal numbers to stdout. The first output is Q and the second output is R where b * Q + R = a. The format of the output is unspecified but the two numbers should be distinguishable. The only datatype you can use is 8-bit integer of range fro...

 
@Maltysen are you ready to have your mind blown
replace }\'`H with t*H0
 
whoa
that's smart
 
I CANT FORMAT THIS SHIT
 
that's dynamic
 
there
 
4:02 AM
actually it might not work because of K
 
@Maltysen K?
 
autoassign
your method requires switching the ternary around and that makes K assign at the wrong time
 
@Optimizer K?
 
18 secs ago, by Alex A.
@Optimizer K?
k
 
4:07 AM
@orlp k!
 
@Maltysen ready to have your mind blown, again?
@Maltysen -`HH
 
same problem...?
its false on strings
ohhhhh nvm
i get it now
thats really cool
 
@Maltysen I'm known for being cool
and sexy
 
4:22 AM
1
Q: Are compiler-specific submissions allowed?

DJ McMayhemFor example, in a c++ submission, this is valid if you use g++ #include <iostream> main() { std::cout << "Hello world!"; } but in any other compiler, this would not compile because of the missing "int" keyword.

 
4:41 AM
@AlexA. Now that you are mod, you need to stop partaking in trolling and memes :P
or at least reduce
 
@Optimizer hypocrit
 
I am not a mod!
moreover, I am a Llama!
 
Llama is very similar to lame
 
but quite the opposite
 
A llama is a mall backwards
 
4:51 AM
Madam a llama a mall am adam
 
ah.. the non-sleepers :)
 
its broad sunlight out there
 
in hawaii? :)
or moscow?
 
@Lembik on my screensaver
 
4:58 AM
@Lembik wow what a terrible projection
that's just shameful
 
I no longer know what a circular shadow is
 
I'm actually trying to get my summer hw done since school starts day after tomorrow but. . . as it says on the room description
 
worse.. I don't think it is daylight in hawaii at the moment
you are clearly all in Moscow :)
 
@Lembik Sleep? It's 3!
 

« first day (1676 days earlier)      last day (3169 days later) »