« first day (2321 days earlier)      last day (915 days later) » 

7:00 AM
@Fatalize One could argue that that's two APL+2, while . is a single keystroke ;-)
@Fatalize Yeah, that's what people say, so we keep it on life-support.
@Fatalize It must be pretty good indeed when people like it despite its awful looks. Don't judge a tutorial by its cover, I guess.
"a variable name cannot be longer than 76 characters. (Big restriction, right?)"
When you come from Java… :p
@Fatalize That might have been the case on the ancient system it was written for, but Dyalog allows very long names.
@Fatalize I just created a variable with a 100 million character name in Dyalog APL.
Well in that case the tutorial is indeed ancient
@Fatalize Told ya' ;-)
@Fatalize What's the max var name length in Java?
apparently 65535
The thing is that in Java you often have ridiculously verbose names
7:12 AM
@Fatalize The how do you store hi-res videos in your variable names? :-)
Not sure that's a very good use of variable names :p
In Pyth, the maximum length of a variable name is 1.
@Fatalize Meh, arbitrary restrictions. I think C only goes up to 256 or so. Poor German programmers.
@isaacg hi!
7:14 AM
I rarely see you around
@isaacg In I, it is "0" – I doesn't have variables. Only functions.
Now that I think of it, Brachylog also has unlimited variable name length
@Adám what is I?
@Fatalize how?
@Adám did you create it?
7:16 AM
@LeakyNun Well for example: tio.run/…
Any string of uppercase letters is a variable
@isaacg As for a real world practical language, I think old TI-BASIC also only has 1 char vars.
@Fatalize is it really necessary to have so many As in your example...
Well no
@LeakyNun No, my colleague did.
The point is just that earlier in Brachylog, you had only 26 variables per rule
Now you have an infinite amount
(Which is pretty much always useless but just in case)
7:18 AM
but you can only put those long variables in the argument, right?
Well yes
For example you can call the argument OUTPUT
@Fatalize In Dyalog APL, _⍙çⒸ is a valid variable name.
@Fatalize In I, any string whatsoever can be a name because names are always quoted.
hi all
hi @LeakyNun
7:33 AM
@Lembik hi
@LeakyNun Looks like my challenge is proving tricky! I was hoping there would be some combinatorial insight
still time :)
@Lembik fastest-code is not that popular
@LeakyNun Oh that's a shame. Is it code-golf or nothing?
I think what I would like is team problem solving
so that we can ask harder questions and people can help each other
maybe we are quite close to that on ppcg in effect
I found a reddit programming challenge page too but I don't know if it's any good
has anyone tried it?
7:37 AM
@Lembik link?
@Lembik I have looked at it before. Can't make heads and tails of it.
@Adám how come?
don't they just pose programming challenges?
@Adám I am just starting to look at it too
which is confused about it?
@Lembik The whole thing looks so messy. Kinda like Reddit… Oh.
ah ok.. but the real question is are the answerers any good!
if they have smart people, I forgive all :)
2 hours later…
@Fatalize 16 now
@Fatalize I don't like the fact that is called "matrix"
things for square were already taken
Let's say ṁ is called "Matrix (the square kind)" :p
@Fatalize but you can still name it as "square matrix"
brachylog_matrix('integer':L, M, M) :-
    length(M, L),
    maplist(length_(L), M).
it's so short lol
CMC (language-specific): given positive integers x and y, create an x-by-y 2D array of anything
9:36 AM
@LeakyNun Definitely shorter than other built-ins…
9:50 AM
@LeakyNun APL, 2 bytes: ⍴⍨
@Adám you win
@LeakyNun What‽ No language has a 1-byte solution?
@Adám It's just an expression
@LeakyNun What do you mean by "language specific"? And why?
@LeakyNun APL, 1 byte:
@LeakyNun Now I win.
@LeakyNun This is one of those simple challenges where I think "Brachylog really sucks"
9:59 AM
@Fatalize Brachylog is domain specific. It is amazing at a very special set of tasks. I wouldn't want to code a webserver or a factory control system in Brachylog.
10:26 AM
Wow, Rod sure got lucky here codegolf.stackexchange.com/a/122746/44998
@Fatalize you're not even trying
(how would you say "you're not even trying" in French?)
10:56 AM
@Mayube 311 to 150? o_O
@EriktheOutgolfer to 77
150 to 77 and 65 to 46 too
11:14 AM
See how quickly you can get full marks ;D
No not BuzzFeed
@BetaDecay wow so tough
I was disappointed
@BetaDecay hardest test of my life
@BetaDecay 8/8 despite not knowing Python :-)
@BetaDecay Now let's try the same thing in APL.
11:28 AM
@LeakyNun Tu ne trying pas
I speak fluent French, in case you couldn't tell /s
I think trying = essayer
@Adám 0/8 immediately :D
What would you call a challenge where the goal is to output sourcecode that performs a given task?
there we go, now just give it like 3 weeks for NSP to catch up
11:36 AM
@Mayube NSP?
New Sandbox Posts
@Mayube Ugh, I should know.
A: Sandbox for Proposed Challenges

MayubeBuzzfeed's Ultimate Coder Challenge code-golf code-generation Buzzfeed recently published a coding test which the guys over in TNB have determined is the world's hardest coding test [citation-needed]. In the language of your choice, given no input, output 8 separate snippets of code in your lan...

@Sherlock9 I would love to, but I'm not able to host a server right now (or pay for hosting). If someone else wants to take care of hosting, they can be my guest :)
11:54 AM
hey is there a chat.se api?
A: Sandbox for Proposed Challenges

HankrecordsThe Travelling Merchant king-of-the-hill Economy is flourishing in the great Kingdom of Pipysigea [pee-pee-see-gee-ah], since the bandits have been driven away by the King's army. Especially, many people have decided to make trade their... trade, and have become merchants. You were one o...

@xnor Yay Vieta's theorem :D
@LeakyNun Oh okay thanks, that makes sense.
Does Jelly have mixed base conversion?
12:12 PM
@totallyhuman Nope
Chat is the neglected stepchild of SE
apply(|a, b...|: {
  if b == []
    return a
    recur a + b[0], b[1..]...
}, x)
Is this syntax alright?
Or does it look ugly
The second one :P
:( I need a better way of writing multiline lambdas
@Mego Do you have any suggestions for a multiline lambda in a whitespace-based language?
@Qwerp-Derp If it uses whitespace for indentation, why do you need curly braces at all?
12:15 PM
Also the arg list is ugly
apply(a, b...:
  if b == []
    return a
    recur a + b[0], b[1..]..
, x)
@Mego But in this case, I might need a way to specify where the lambda starts and ends
Because it's confusing in this sense
The lambda ends when you get back to the indentation level where it started
@HyperNeutrino You should ask that there.
@HyperNeutrino I think so
12:20 PM
I remember losing to Jelly once because of mixed-base conversion
A: Sandbox for Proposed Challenges

PhilippeThe problem As I sometimes build bots, I often came across real time image reading. The goal in this problem is to be able to identify a number given pixel representation with the minimal amount of tests. For that, you will have to generate a tree that can identify any number. Input A list of...

Do you think remaking the Implode a Box challenge except with Explode a Box would be a dupe?
@Adám You were not joking.
@Mego No I wasn't.
12:37 PM
I don't know what I was expecting, but that managed to exceed my expectations
The only way it could be worse is if it used hotdog theme
Is that using COMIC SANS??? D:
:( imgur blocked on school wifi
@Mego not quite hotdog.vim yet
12:44 PM
I tried
A: Index of a multidimensional array

DennisJelly, 7 6 bytes Ṇ;żḅ@/ Try it online! or verify all test cases. How it works Ṇ;żḅ@/ Main link. Arguments: D (list of dimensions), I (list of indices) Ṇ Yield 0, the logical NOT of D. ż Zip D with I. If D = [10, 10, 4, 62, 7] and I = [1, 2, 3, 4, 5], this yields ...

Oh okay, thanks!
@Mego Thank you, I'll update our CSS.
what have I done
1:06 PM
ugh python's being a dumb
@Mayube what happened
@HyperNeutrino python lambdas suck is what happened
rip :I
A: Sandbox for Proposed Challenges

FatalizeThis will eventually stop… Given an input string S, print S followed by a separator in the following way: Step 1: S has a 1/2 chance of being printed, and a 1/2 chance for the program to terminate. Step 2: S has a 2/3 chance of being printed, and a 1/3 chance for the program to terminate. Step...

1:30 PM
Q: Explode the Box

Hyper NeutrinoThis is very similar to this challenge, "Implode the Box". It was a pretty nice challenge and it didn't get many answers, so I'm going to post a similar challenge (strongly) instpired by it. ASCII Boxes look like this: ++ +---+ +------+ +---+ +---+ ++ | | | | ...

@Mayube They're not fantastic. I wish there was a way to omit the lambda keyword
@Mego I was trying to insert them into a dict, doesn't like that
which is a shame because a dict of anonymous functions is a great way to setup primitive functions in interpreters
@Mayube It should like that. I don't know if they can be used as keys, but they absolutely can be used as values
@Mego env[':'] = lambda env,x,y: env[x] = y threw an error
That's because you can't do assignments in lambdas
1:32 PM
well there's another thing that sucks about them then
env.__setitem__(x,y) should work
doesn't matter now I've already ported the entire thing over to node
remedial math question.,.. in the sequence 1/3, (1/3)(1-1/3), (1/3)(1-(1-(1/3))) etc. what is the nth term?
Python lambdas try to be pure functions
imo js' anonymous objects and functions are the best things about the language
1:34 PM
@Lembik Is that (1-1/3)/3 or 1/(3(1-1/3))?
good point.. fixed
is the third one supposed to be (1/3)(1-(1/3)(1-1/3)) instead?
argh :) yes
So (1/3)(1-(1/3))**n for n >= 0
Oh wait I misread parens
1:36 PM
@Mego not really... the third one in its current state is (1/3)(1/3)
so f(n+1) = (1/3)[1 - f(n)]
@LeakyNun yes
I just want to solve that
@Lembik that would make it (1/3)(1-(1/3)(1+1/3)) instead...
could you give me your original problem?
yes.. I split the first third off string of length 1 and then do the same for the remaining part and repeat
I just want to size of the nth part I split off
so I wrote it all wrong ...sorry
but that's the problem
1:39 PM
you should have given me the original problem instead
:) always true
the first term is 1/3, the second term is (1/3)(1 - (1/3)), and the third term is (1/3)(1 - (1/3))^2
5 mins ago, by Mego
So (1/3)(1-(1/3))**n for n >= 0
let me check the third term
Hey look I was right after all!
@MartinEnder I have yet another case of people ignoring historical meta rules
1:41 PM
it's (1/3)(1-(1/3))**(n-1), if you use 1-indexing
in Mego's answer, one begins with the 0-th term, which is 1/3
should I make another post, or should I wait for this master post to get posted?
so what are we saying the third term is exactly as a fraction?
@NathanMerrill Link?
@Lembik = (1/3)(2/3)^2 = 4/27
that does look right
thanks @LeakyNun and @Mego and sorry for being so confused
It used to have 10 upvotes, until it was started to get enforced, then people hated on it, and it gained a bunch of downvotes
so, I feel like I need to repost it
but it'd basically be the same question all over again
@Lembik it happens to everyone
@NathanMerrill Don't repost it. It's entirely possible that the people who are downvoting it simply missed it when it was originally posted, and are just now expressing their opinions.
1:45 PM
Perhaps, but I'd really like some discussion on the matter
like, people who are downvoting aren't commenting
its simply a matter of "I don't like that my submission needs more bytes, let me downvote this"
furthermore, its still the top-voted post, but I don't really want to go to a bunch of posts and say "This is invalid". That's the wrong place to put the fight
FWIW I support that answer. It follows logically from this very related consensus and this somewhat-related meta consensus.
@NathanMerrill You can't force people to discuss their opinions. That's probably a good thing.
Downvoting that answer without posting reasoning or an alternative answer doesn't solve or change anything really
It's still the highest-voted answer, and has a positive score, so it's the consensus
@LeakyNun so if you add those up it should come to 1
1:50 PM
@Lembik yes
it's a geometric progression
Right, and I understand I'd be perfectly OK to go and comment on all of the invalid submissions. But if nobody follows it, is that really the best way to move forward?
@LeakyNun It's also the PDF for a geometric distribution
@LeakyNun but it sums to 2/3
@NathanMerrill If people don't willingly delete or fix their invalid submissions, then mod flag them with a link to the meta post.
@Lembik Only if you exclude the initial 1/3 term
1:52 PM
@Lembik could you show how you computed 2/3?
sum (1/3)(2/3)^x x = 1..infinity = 2/3
You should be doing 0..infinity
ah yes... :_
Off-by-one errors get all of us :)
1:53 PM
Well, all but one of us
but in practice when splitting a real string it seems you only need to sum something log_{2/3} n terms ?
I mean when there are no fractional splits
Well how do you split a string whose length isn't a multiple of 3?
you have to round
But how do you round?
the nearest integer?
and stop if the string is length < 3 maybe
1:57 PM
So the remaining part would have length ceil(2*len(str)/3)
And there would be some value N where repeatedly applying that operation would result in a string with length less than 3
Let's call L the original string length. If L < 3, N = 0. If 3 <= L <= 5, N = 1 (because after applying one cut, the length would be in [0, 2]).
2:01 PM
hmm, so in js let's say I have an array a containing 2 elements, and I have a function f that takes either 1 or 2 arguments. I know I can get how many arguments it takes with f.length, but how can I then pass only the correct number of arguments from the array?
bah....I just realized that we have a problem with our current "function as a submission" definition. If I make a scripting language with 20 integer types, and each of them do something different with i->i+i, then I've effectively encoded 20 different operations in the same 1 byte.
If 6 <= L <= 14, N = 2 (because after applying one cut, the length would be in [3, 5])
Its the Java problem, but extended out to scripting languages
So N = floor(log_3(L))
like if f.length == 1, I want to call f(a[0]), but if it's 2, I want to instead call f(a[0], a[1])
2:03 PM
@NathanMerrill By scripting languages, I assume you mean dynamically-typed languages and duck-typed languages?
more importantly how could I do it for an arbitrary f.length?
@Mayube JS allows an arbitrary number of arguments to be passed to a function.
Use arguments to get them all
do I just not define any required args in the function definition then?
so function f(){}
instead of function f(arg){}
2:05 PM
Yep. Parameters don't mean much. They are just aliases for the elements of arguments
@Mego oh...log_3 ?
I wasn't expecting that
but it makes sense
I think it's log_3... I might be wrong
A: Sandbox for Proposed Challenges

Keyu GanCount Numbers in Integer Partition code-golf Challenge and Example We can partition a positive integer into smaller (or equal) ones. For instance, for N=6, it can be divided into: 6 (1 integer occurs >= 1 times, 0 integer occurs >= 2 times) 5+1 (1, 0) 4+2 (2, 0) 4+1+1 (2, 1) 3+3 (1, 1) 3+2+1...

> Use a space before an opening parenthesis when functions, or indexing, like method (a);
The mono team has gone insane.
@mınxomaτ That's sadly a very common style for C/++
2:14 PM
I hardly ever see this in C
Thankfully PEP 8 allows ritual sacrifice of Python devs who style their code like that
good: method (a); array [10];
I don't include that space, even in if-statements like if(blah == blah) {}
@KritixiLithos Good. Resist the dark side.
It will bring you nothing but pain, mostly in the form of having your fingers swatted with a ruler, Catholic-style.
2:16 PM
Ruler still beats having to buy forgiveness for cold hard cash
I believe space after if and while is fine, but certainly not in function calls.
D: some of my older code has that space after ifs
Challenge: Given Python code, write equivalent code that contains no whitespace (therefore it must be a one-liner)
@mınxomaτ hey, have you been able to look into WSL supporting Suse and Fedora?
but at least I've changed now
2:18 PM
is it similar to how you were doing Arch?
@NathanMerrill Microsoft is making a fedora one
I usually put spaces after ifs
You can get it with a preview build of windows iirc
I also see this a lot: int f ( int x ) { foo(); }
In one line functions
2:24 PM
@Phoenix barfs uncontrollably
I'll be more active, I hope at least, in a few days
@PhiNotPi ...I thought that you had finished that. I checked the question though, and apparently I was dreaming or something
@NathanMerrill ;-; i know it's sad
maybe I was remembering the digital clock
2:28 PM
Has anyone else in here played the game Crossout? I think it'll be really cool to have a KOTH like that.
A: Sandbox for Proposed Challenges

PhiNotPiEpic Customizable Tank Battle (Work-In-Progress) This is an idea I have been working on in conjuction with users @Trimsty and @githubphagocyte in the chat room. It is inspired by the flash game "Bubble Tanks" by Armor Games. This will be a king-of-the-hill challenge. Main Idea The main idea...

^^ basically the game Crossout is one in which you build a vehicle, attach armor and weapons, and fight other vehicles in an arena.
The thing that makes it fun is that you have basically unlimited flexibility in how you design/build your vehicle.
Q: Can those squares form an imperfect square

Roman Gräf Given an array of length l of positive integer, determine if it's possible that if we turn all integers of the array into squares with the sidelength of this integer and arrange them that it is possible that they form an square with an integer sidelength the output can have anything as tru...

I wanna install C on my Windows 8.1, and I am an absolute newbie. Anybody wanna help me on installing that ?
@AlexKChen MinGW or Cygwin+GCC
2:43 PM
Q: Questions about compiling C on Windows and using getchar()

Alex K ChenI am an absolute newbie to programming (only know very basic Python), and I'm reading C from Kernighan and Ritchie. My two questions are: How do you start coding in C in Windows 8.1? I mean, basically, in Python, you just install it from the website, and start coding in IDLE, but I don't see a...

I have asked this question, so I am asking a few questions based on the responce I got:
@Mego I mainly want to use C for simulationing physics and mathematical stuff. Can I do it in the Visual Studio ?
Q: Arranging arbitrary rectangles to fill a space

Hyper NeutrinoCan these rectangles fill a rectangular space? Given a bunch of rectangles, you are asked whether or not they can be arranged to fill a rectangular space. Specs Given a bunch of arbitrary m x n rectangles; 0 <= m, n <= 1000, determine whether or not it is possible to arrange them so that they ...

Anybody ?
@ETHproductions Yep :P
@Mego While installing Visual studio for C, should I tick any of the stuff in "workloads" or "indivisual components" ?
@AlexKChen Sure. You might have some difficulties with the fact that Visual Studio doesn't fully support all of the newest C features, but it will work. I personally think that VS is overkill, and you'd be better suited with MinGW and an IDE like Code::Blocks or NetBeans.
2:48 PM
@Mego Okay, so to use MinGW, what should I do ? (Also, what is IDE ?)
@AlexKChen IDE means Integrated Development Environment. Basically it's a program that includes an editor and some tools that make development easier. To get MinGW, you can download it directly from the MinGW site, but it's much easier to just download and install an IDE that bundles MinGW (like Code::Blocks or NetBeans).
Then I can simply start to type C code ?
@MDXF Wow, that's insane
@ETHproductions Well, so am I, we already established that :c
2:58 PM
I think the most rep I would have ever earned in one day without the rep cap is 350
You must've had an answer go really viral or something

« first day (2321 days earlier)      last day (915 days later) »