« first day (2303 days earlier)      last day (2523 days later) » 

6:01 AM
@DestructibleLemon The link is very obviously looking towards the word 'challenge'
 
no he is quite obviously looking down
 
And you used the word pls, obviously your grammar is not flawless.
 
pls is a variation of please
 
it's a shortening, not a variation
 
Abbreviations do not imply illiteracy.
 
6:02 AM
thank you
 
@ATaco wat witchcraft
 
It's rather simple.
 
how?
 
It just Pops the top of the stack, (Which default contains nothing), Increments 0 by one, and pushes 0 to the stack.
Numbers aren't literals, they're functions that just nicely push their assigned number.
 
I'm perfectly fine with restarting my computer for a windows update but I get irrationally pissed off when a video driver update makes my screen flicker.
 
6:07 AM
where do people get the idea that this is a site for doing your programming homework for you?
 
Ok I get justifiably angry when my screen stops turning on entirely for a few minutes... dammit.
 
> stops turning on
 
A better way to phrase that is "my computer monitor isn't showing anything send help"
 
> Turn it off and on again
 
That might ruin the video driver
I'm hoping to have at least one Windows isntallation attempt with a stable video driver
 
6:09 AM
> Turn it off and on again quickly
Perhaps it's a hardware issue.
 
It's Windows, is that even possible?
 
It has happened to me before.
Didn't last
@ATaco Likely, this was the fist computer I ever built.
goddammit
it was a monitor issue
the cable came out by accident
story of my life
 
@numbermaniac well yeah? it's possible in a VM running under Linux
 
FUCK
VIDEO_TDR_FAILURE
Also since when did the BSOD become green
 
@Phoenix never
you broke your monitor cable again probably
 
6:13 AM
No the coloring was just fine until the crash and it's fine now
 
lol @ASCII-only that's cheating
 
delete it before NewMainPosts posts it pl0x
 
@LeakyNun delete what? The python only question or something else?
 
yes
 
Why did the AMD installer download an out-of-date driver ;-;
 
6:16 AM
It could be a valid question, but it's personalized.
 
-4
Q: Python Only - Repeated number input with quit option

JeremyPython only! Write a program that repeatedly reads in numbers from the user. Your program should be capable of storing all numbers (ints/floats) entered and should stop looping and print the list when the user enters "q", "Q", or "quit". I have already written a 6-line solution below but I want...

 
Ooh, shite, I need to install the massive blob that is vs
 
I swear I've learnt more python from this site than any other site.
 
@LeakyNun your solution in the comments needs to escape the quotes in the list
 
6:19 AM
@numbermaniac done
 
@LeakyNun I've learnt more Python from Charcoal than from any other language :P
 
👍
 
12 hours ago, by Dennis
@Mego Threaten sandbox skippers with horrible violence. The vast majority of flags concern comments on these challenges.
 
I'm a Sandbox skipper out of pure stubberness.
It's not that I don't like the sandbox, Infact I recommend everyone use it. But I myself refuse to.
 
That's a bit hypocritical, don't you think?
 
6:24 AM
I never said it wasn't. It's irrational, Hypocritical, and potentially harmful to my glorious rep.
 
@ATaco And your physical safety after Dennis' announcement
 
All of my challenges start out as CMCs, which does a pretty good job of dupe-checking. I'm pretty good at doing the write-up for a challenge, so I only sandbox when I'm unsure about test cases.
 
And yet, I will not stop doing it.
 
list=[1]
while list[-1] not in ["q","Q","quit"]:list+=[input()]
print([float(x) for x in list[1:-1]])
in all seriousness, I can do it in 3 lines
can anyone do it in less lines?
 
@LeakyNun Use Python 2 to avoid cast
 
6:27 AM
@ASCII-only it's still 3 lines
 
use semi-colons?
 
@LeakyNun maybe (list[-1] or (list=[1])[-1])) to get rid of the first line?
 
no semi-colons
 
@KritixiLithos the guy in the comments asks not to
 
@Phoenix Doesn't work
 
6:27 AM
aww
 
@Phoenix this isn't C. you can't have assignments in statements
 
Assignment in Python is a statement
 
but one could abuse id... (it is a built-in function)
 
this is getting interesting
 
while type(id)!=list or id[-1] not in ["q","Q","quit"]: id = id+[input()] if type(id)==list else [1]
print([float(x) for x in id[1:-1]])
2 lines
 
6:32 AM
What is this id
 
just a built-in function
 
all those spaces that can be removed...
 
it is the shortest built-in function
 
But what does it do
 
@KritixiLithos we're counting lines
 
6:32 AM
f=lambda l=[]:(lambda s:(s in["q","Q","quit"]and l)or f(l+[s]))(raw_input())
print "\n".join(f())
oh wait it should be possible in one line with list comprehensions
 
what does id do inside a program like that?
 
Jun 30 '16 at 11:53, by Leaky Nun
Recursion without self-referencing: http://ideone.com/Cq9Qls
@numbermaniac it just acts as a variable
@ASCII-only my link should make a one-line solution possible
 
convenient
What's id supposed to be used for?
Other than golfing I can't think of any application.
 
id(object)

Return the “identity” of an object. This is an integer (or long integer) which is guaranteed to be unique and constant for this object during its lifetime. Two objects with non-overlapping lifetimes may have the same id() value.

CPython implementation detail: This is the address of the object in memory.
 
Ah
 
6:36 AM
1 line: [print("\n".join(map(str,f(f))))for f in[lambda f,l=[]:(lambda s:(s in["q","Q","quit"]and l)or f(f,l+[float(s)]))(input())]]
 
print "\n".join(((lambda r:r(r))(lambda r:(lambda l=[]:(lambda s:(s in["q","Q","quit"]and l)or r(r)(l+[s]))(raw_input()))))())
 
Oh, the fact that you used id here was arbitrary, you could have used any predefined function name?
 
@Phoenix yes
@ASCII-only my solution is only 2 bytes longer than yours
 
That makes sense.
 
6:38 AM
I don't even get it.
 
oh that's python 2
 
I just worked on the previous 2-line solution provided
 
it...works...somehow
 
@numbermaniac which one
 
Leaky's
 
6:39 AM
@numbermaniac it's from lambda calculus
Jun 30 '16 at 11:53, by Leaky Nun
Recursion without self-referencing: http://ideone.com/Cq9Qls
fac = (lambda r:r(r))(lambda r:(lambda n:(n*r(r)(n-1) if n else 1)))
 
BTW for my one-liner I use python list comprehension hacks to do fake assignment without =
@LeakyNun Y combinator?
 
Is it just me or did the teamspirit.js score indicator start using Times New Roman for some reason
 
@LeakyNun just checked and your solution accepts non-floats too
 
The parens aren't needed: [print("\n".join(map(str,f(f))))for f in[lambda f,l=[]:(lambda s: s in["q","Q","quit"]and l or f(f,l+[eval(s)]))(input())]]
 
@ASCII-only I suppose so. I don't really know.
Now Dennis is going to tell me not to answer off-topic questions in comments...
 
6:42 AM
He doesn't seem to be around
 
yesterday, by Dennis
@LeakyNun Please don't answer off-topic questions in the comment section.
 
[print("\n".join(map(str,f(f))))for f in[lambda f,l=[]:(lambda s:s in"q,Q,quit"and l or f(f,l+[eval(s)]))(input())]]
 
@ASCII-only I don't even get this.
 
@LeakyNun and or is pretty much equivalent to ... if ... else ... (you probably know this)
 
>> f=(r=>r(r))(r=>n=>n<2||n*r(r)(n-1))
<< function f</<()
>> f(4)
<< 24
@ASCII-only I know this
what does f</<() mean?
 
6:45 AM
for ... in is used to bypass assignment
@LeakyNun What browser
 
there's too much functions there
you're messing with my brain
 
@LeakyNun Where
 
@ASCII-only firefox 53
@ASCII-only too many lambdas in your solution
 
@LeakyNun oh haha
 
what
how do you even lambda this
 
6:49 AM
lambda1 = lambda lambda1, list: lambda2(input())
lambda2 = lambda string: list if string in "q,Q,quit" else  lambda1(f,list + [eval(string)])
@LeakyNun ?
 
lambda this
 
this isn't reserved in python (neither is self), plus it's pseudocode
 
I know it's pseudocode
I mean, how do you even reference yourself
 
you can't
the print statement calls f(f)
 
Doesn't Python have an eval?
 
6:50 AM
@ATaco we're trying to avoid it
 
Why not just make it a one liner- Oh
 
we have eval and exec
and their difference is beyond me
 
@LeakyNun the difference is mostly exec doesn't return anything
 
eval evaluates stuff, exec executes stuff
Obviously
 
I see
 
6:52 AM
eval only takes a single expression, exec can take a block of code
 
Shorter: [print(n)for f in[lambda f,l=[]:(lambda s:s in"q,Q,quit"and l or f(f,l+[eval(s)]))(input())]for n in f(f)]
 
I haven't even understood the last one
now you're giving me another
I think I'm getting it now
the for f in [...] is quite clever
 
Oh okay, the only difference here is I'm doing a [a for_in1 for_in2], basically do a for each element in for_in2, which itself iterates over for_in1
 
I can read Python.
 
well I get confused with the weird order of nested for ... in though so I posted that just in case
 
6:56 AM
@Fatalize hi
 
Hello
 
@ASCII-only that's very clever.
 
CMC: one-liner in python to print the factorial of input
 
Is there a builtin name defined to 0 you can assign?
 
7:01 AM
I don't think so
 
@LeakyNun Same trick, 63 bytes: print[f(f,input())for f in[lambda f,n:n and n*f(f,n-1)or 1]][0]
 
I can't get mine to work
[print(f(f,n))for f,n in[lambda f,n:n<2 or n*f(f,n-1)],[input()]]
 
Same trick, 59 bytes: print[f(f,input())for f in[lambda f,n:n<2or n*f(f,n-1)]][0]
 
please debug mine
doesn't matter
 
@LeakyNun You need to zip the two lists for that
 
7:07 AM
can I not zip?
 
@LeakyNun Also int(input()) not input()
 
right
 
@LeakyNun 50 bytes: Try it online!
 
@DJMcMayhem you win
 
Wait I forgot eval hacks were allowed
 
7:09 AM
Actually, I'm not sure if a lambda counts, so here's a full program: 53 bytes Try it online!
 
@DJMcMayhem Why can't I see the output?
 
@KritixiLithos Ha! Whoops, I confused footer and input Try it online!
 
well, 48 bytes if semicolon is a thing: f=lambda f,n:n<2or n*f(f,n-1);print f(f,input())
 
@LeakyNun you don't need f as an argument if you do f=
 
@DJMcMayhem oh lol, that happens to me many times. Sometimes I am left wondering for some time why my code didn't work
 
7:10 AM
@ASCII-only right
"What good is import?" part 1425234187875
 
JavaScript (just for fun, I know you want a Python answer), 17 bytes : f=n=>n?n*f(n-1):1
 
@Arjun -1 this doesn't print anything
 
@LeakyNun Now you should do it in brain-flak
 
@DJMcMayhem no thx
 
7:13 AM
Haha, it shouldn't be that bad
 
@ASCII-only ?
 
@ASCII-only thx
 
@DJMcMayhem Isn't it on the wiki
@DJMcMayhem ({}<(())>){(({}<>)[()]<({<({}[()])><>({})<>}{}<><{}>)>)}{} from the wiki
 
Oh
Well I just wrote this by hand Try it online!
Cause I forgot about the wiki
 
I'm still writing one
 
7:16 AM
Written from my phone too!
 
can you guys not
 
I'm actually headed to bed now
I'll talk to you all tomorrow o/
 
@DJMcMayhem Good night! :)
 
nvm I give up
I got work to do
Aug 7 '15 at 18:38, by aditsu
abandon all work, ye who enter here
 
@betseg (just saw this message) oh yeah, Android Studio 3.0 got released \o/
 
7:56 AM
@DJMcMayhem bed?! I just got up!
 
timezones
 
antipodes are fun
 
8:15 AM
CMC: Output all of STDIN to STDOUT
 
That's basically a cat program
Carrot, 1 byte: #
 
That infact is a cat program, however, our Standards of IO don't specify STDIN
 
would something like lambda n:n be allowed then for python
 
Nope.
Has to be STDIN, has to be STDOUT
 
does input() count as STDIN?
 
8:26 AM
are trailing newlines allowed?
 
Yes.
@numbermaniac Does it encompass all of STDIN? Including Newlines?
 
Röda, 30 bytes: Try it online!
 
input() would take one line of input
so in that case i suppose not then
 
@Riker 4/10 pretty sure he would not pass the driving exam with this technique
 
BF, 5 bytes: ,[.,]
 
8:28 AM
 
@KritixiLithos good morning
its in beta
 
morning to you as well
Android Studio version 2 was much better than the first version. I can't wait to get the third version
 
CMC: given a,b,c, calculate b^2-4ac
 
purpose of both a and c?
 
trivial JS solution: f=(a,b,c)=>b*b-4*a*c
 
8:50 AM
probably mathematica has something like QuadraticDiscriminant or something
 
f(a,b,c)=b^2-4a c works pretty well in Math.JS link
 
nice
 
That did not massively change the solution.
@KritixiLithos You don't really need to name it.
 
@betseg Since you have done stuff with Android, do you know what would count as the bytes if someone were to post an Android App as a submission?
 
Also, can I take input as b a c..?
 
8:54 AM
@ATaco sure
you can even take it as b,[a,c]
 
what about [[[b],[[a],[[c]]]]]?
:P
 
sure
 
@KritixiLithos no idea. maybe styles.xml + all the classes' source codes' byte count?
 
RProgn2, 6 bytes. *\2^\- Input as bac
 
@KritixiLithos IMO everything
 
8:56 AM
@betseg yep there's a Mathematica built-in called Discriminant
 
@numbermaniac it's probably shorter to just do #2^2-4#1#3&
 
True
 
Does #^2-4##& work?
 
PolynomialLang, 7 bytes : b^2-4ac
 
@LeakyNun No IIRC, # is short for #1
 
8:57 AM
Plus Discriminant takes it as an expression rather than a list of a,b,c
 
can you call the same function for a cubic function with 4 arguments, or is it a different function, or does it even exist?
 
No
It's the same one
 
oh you mean Discriminant?
 
Yeah
@LeakyNun not quite because that would take 4abc rather than 4ac
 
I see
 
9:00 AM
Jelly, 5 Bytes. ²_⁴×⁵ Input as BAC
 
CMC (heavily inspired by this): a skyline of modulus, the heights for 15 are 15%1, 15%2, 15%3, ..., 15%15
@ATaco I don't think that works
 
Mathematica, 10 bytes: #^2-4#2#3& (from your solution earlier), input b,a,c
 
Seems to work.
 
@ATaco Doesn't work
 
Oh, I forgot the 4 part of it.
 
9:02 AM
@LeakyNun JavaScript : n=>new Array(n).fill(n).map((c,i)=>c+'%'+i)
 
9:26 AM
0
Q: Is this molecule polar?

Beta Decay Disclaimer It is bad practice to draw out your molecules in 2 dimensions because that is not how they are. I chose to do this in 2D because it is easier to explain. Note that the bond angles are wrong too: the angle in CH4 is 109.5°, not 90° as I said and the bond angle in NH4 is 107...

0
Q: Is this number a factorial?

ArjunThe Task Given a natural number as input, your task is to output a truthy or falsey value based on whether the input is a factorial of any natural number. You can assume that the input number will always be in the range of numbers supported by your language. Input You'll be given a natural n...

 
1
Q: Incentives for answering old questions

Peter TaylorBackground A recent meta question seems to me to be asking the wrong question. However, there is some truth in the underlying issue raised: The majority of golfers browse the latest and featured questions. Or in the word's of ais523's answer: Newly posted challenges also have major adv...

 
@Arjun wait what is that even valid
 
@Arjun Can I take input as unary? Is it okay if my program crashes for false and does not crash for true?
 
9:47 AM
I got a 37-byte retina answer, but it does ∧ and is hence invalid
 
@ASCII-only ?
 
@KritixiLithos then make it convert from/to unary?
 
If the language supports only numbers in the range {0,1}, can I expect the input to always be 1? — eush77 4 mins ago
In what world would that be okay?
 
It's actually the bit about crashing that I have a problem with
 
@Arjun That isn't a valid answer to the CMC
 
10:04 AM
Is there a challenge when, given a number n, find the smallest factorial larger than n?
 
No, but it's basically the same as the current factorial challenge
 
@ASCII-only Why?
 
@Arjun Because it outputs nothing even close to the expected output?
 
@BetaDecay ? Link
 
:| I can't implement mathematica flatten
 
10:08 AM
@ASCII-only ? Really?
 
@Arjun ... do you really think you were supposed to output "15%1"
etc
 
Yeah!
Does it need to be 0, 1 etc?
 
No, the heights of the ASCII-art buildings are supposed to be 15%1, 15%2 etc
 
Ooh.
Main bhi na pagal hoon.
Going offline for a while.
 
5
Q: Is this number a factorial?

ArjunThe Task Given a natural number as input, your task is to output a truthy or falsey value based on whether the input is a factorial of any natural number. You can assume that the input number will always be in the range of numbers supported by your language (however the number of numbers support...

 
10:16 AM
@BetaDecay How would it be basically the same, though?
 
All you need to do is add a loop which increases from the inout
 
Good point
But shouldn't there be golfier ways to achieve to goal of my challenge?
 
Maybe, I don't understand maths enough
 
@Qwerp-Derp _=(n,f=1,l=2)=>n?_((n/l)|0,f*l,l+1):f
 
@Qwerp-Derp I agree. My own challenge was quite similar to the factorial-finding challenge, but I thought that there will be golfier ways to solve my challenge rather than simply adding a loop. Turns out I was right!
1
A: Is this number a factorial?

ArnauldJavaScript (ES6), 30 29 bytes Returns 0 or 1. f=(n,k=2)=>n>1?f(n/k,k+1):n&1 console.log(1, '-->',f(1)) // Truthy (0! or 1!) console.log(2, '-->',f(2)) // Truthy (2!) console.log(3, '-->',f(3)) // Falsey console.log(4, '-->',f(4)) // Falsey console.log(5, '-->',f(5)) //...

 
10:25 AM
@Qwerp-Derp _=(n,f=1,l=2)=>f>n?f:_(n,f*l,l+1)
 
10:36 AM
I can't figure out how to implement the fourth overload of Flatten, posting a challenge probably would help but i'm too lazy :(
 
11:06 AM
Also is it just me or is the documentation for StringTake contradictory
 
Mono 5.0 now ships with one of the few JITs with concurrent garbage collection: mono-project.com/news/2017/05/17/concurrent-gc-news
 
@ASCII-only nvm
 
0
A: Sandbox for Proposed Challenges

Qwerp-DerpDon't break the bridges! Introduction: You are a worker, who is in charge of managing a set of bridges, connecting a square grid of "nodes": N - N - N | | | N - N - N | | | N - N - N (the grid here is 3 by 3, but they can be larger). Each of the bridges has a set capacity from 1 to ...

 
Review ^ please?
 
11:33 AM
Someone voted to close the sandbox as "primarily opinion based" ಠ_ಠ
 
@ETHproductions tbh it kinda is opinion based
but I did not cast that vote
 
Okx
Problem is, close votes for the sandbox are entirely anonymous until it actually does get closed
 
@KritixiLithos True, but isn't almost every meta post?
 
... so let's close meta? :P
Apr 14 at 3:59, by Dennis
PSA: Mods can see who cast close votes, both pending and retracted. If you think your privileges are toys, I'll take them away from you.
 
Okx
11:37 AM
Oh, nice.
Oh and also @Dennis @MartinEnder the community removed from the sandbox, will need to add it back.
 
Random programming language idea: in a language with if (x) { ... } and while (x) { ... } constructs, a when (x) { ... } construct that's basically an event listener (as soon as x becomes truthy...)
 
But how would when (alert("blah")&&false){} work, is that essentially a while true loop?
A forked, While true loop, at that.
 
Hmm, perhaps
That's a pretty weird scenario tbh
 
Weird, but very easy to do.
 
@ETHproductions already exists minus the if and while
 
11:45 AM
@ATaco Why would that expression result in true?
 
@ETHproductions Someone suggested that in VSL, plus it's already been done in Zilch IIRC
 
@KritixiLithos It's not, but it needs to evaluate the expression to determine if it';s false.
 
@DestructibleLemon In which language?
 
@ETHproductions Hmm in what situation would that be useful?
 
can't remember
 
11:47 AM
@ASCII-only In a scenario like when (ready) { ... } and ready can become truthy at any moment
 
@ETHproductions It exists in Clojure
But I don't suppose that really counts
 
Functions could do a similar thing, I suppose
 
@DestructibleLemon Wow, a language entirely made of when expressions?
Interesting
 
I think there are others
 
11:49 AM
@ETHproductions in which order should events fire when multiple trigger at the same time?
 
reading order
 
If it's by the source code order, in which order should multiple events fire when registered by the same code?
 
either that or make it non-deterministic
 
11:50 AM
How would you register multiple events with the same code?
@ATaco Maybe it would be better to have when (<variable> becomes <value>) { ... }
 
Just order it began listening.
Hmm.
 
k = 0; (1..5).each{|i|when(k > i){...}}; k = 6
 
in code order?
when k>1, then >2, then >3 etc
obviously
 
Why?
 
because that's the order in which they were registered?
 
11:53 AM
Seems pretty intuitive to me
 
That may be the opposite of code order
 
Yes, scratch code order, the order in which they were registered is obviously the way to go
 
That's the way Javascript uses.
 
@JanDvorak is k never incremented?
 
@JanDvorak oh i meant code execution order
 
11:54 AM
(continuing from previous message) <value> would have to be evaluated exactly once so as to make e.g. infinite alert calls not possible
 
oh wait that does not matter
 
But, should events trigger synchronously / recursively or should they wait for the previous event to clear?
 
I'd say asynchronously, as with most event systems
 
I propose that multiple events that trigger at once should run in parallel in separate threads
 
There could be a queue of event calls, whenever one finishes the next one is started
@JanDvorak That's an option as well, I don't know much about multi-threading though
 
11:56 AM
a queue, or a stack?
I love micro-threads (fibers). Normal threads, less so.
 
Hmm. Not sure whether queue or stack would be better
 
Or perhaps don't run them in parallel, but still randomize the order
 
@JanDvorak Well the maximum number of parallel tasks running though is the number of virtual cores
@JanDvorak ... randomize? Why?
 
@ASCII-only for the evulz, of course
 
I am not a fan of implicitly randomizing order of execution, ever
 

« first day (2303 days earlier)      last day (2523 days later) »