« first day (2560 days earlier)      last day (2580 days later) » 

18:00
P
:P
We've just been taught what a function is, what a graph of a function means, linear functions and order 1 functions, so not much.
Separately, I have studied derivatives (now studying all their rules), a tiny bit of integration, restrictions and properties of functions
The worst part in calculus is when they ask you to find the limits but without using L Hopitals
The worst part in calculus is when they ask you to approximate definite integrals using Riemann sums :p
Ah yes, going through that right now myself
@ETHproductions Oh god good luck!
18:04
So far it's really just been "and so we approximate like so, and when we take the limit as n->inf we end up with this integral"
I hope there's no quizzes where we actually have to calculate the approximate Riemann sum itself :P
I find integration quite hard compared to differentiation
^^^ Good lord, that would be so imprecise :P
Differentiation is waaaay easier
I really need a professor to get into integration properly, can't do it by myself. I guess I'll wait for 4 more years until the 12th grade :P
18:06
Yeah, chain rule >>> substitution rule
Agreed.
The method my prof used to find the antiderivate of sec(x) was so out-of-the-way I would have never found it
Although some mathematicians think differentiation is mechanical
@DJMcMayhem interestingly the differential of tan is slightly less undefined than tan is, since it only diverges to +Infinity whereas tan diverges to either +Infinity or -Infinity depending on which direction you approach the discontinuity
@ETHproductions Lol, I've just encountered that earlier
18:10
@Mr.Xcoder I agree, to differentiate you can just apply a certain set of rules. With the substitution rule you have to actively find a way to break up the function into smaller pieces
hmm, are there functions that don't have antiderivatives?
@Neil Huh. That's fascinating
CMC: What PPCG challenge has the most other challenges closed as a duplicate of it?
Oh misunderstood
Rickroll definitely
@ETHproductions There are some that don't have elementary antiderivatives.
(The only answer is amazing, not that I understand all of it)
wow, that'll be quite a read
there are 10 dupes of that challenge
Just 10 o.o
18:16
non-deleted anyway
@Mr.Xcoder the top comment on the answer is the best
> Raymond, I don't believe you've given enough detail.
And it's a community wiki! ಠ_ಠ
wow that's like 13.6 pages or something
18:29
CMC write a function that returns itself
@ConorO'Brien Python 2, 10 bytes
f=lambda:f
Dang
I had def f():global f;return f
I didn't think about lambdas lol
dang markdown you have disappointed me
18:32
@ConorO'Brien Haskell, 3 bytes: f=f
hehe
Anonymous
@totallyhuman Haskell (Lambdabot), 3 bytes: fix
Anonymous
Probably cheating :P
@ConorO'Brien JS (untested): f=()=>f
@Mr.Xcoder -1 byte: f=a=>f
@Mr.Xcoder f=_=>f
18:35
@NieDzejkob Is that allowed?
ninja'd 'cause lag >_>
@Mr.Xcoder javascript doesn't care about what arguments are passed
Ok then
Anonymous
In JS, arguments are more like suggestions
also that'd be valid anyways 'cause unused input is allowed
Solution: Don’t use JS.
18:36
@totallyhuman I don't think that counts, I believe that is an infinite loop
yes but it does return itself :P
it returns itself which returns itself which returns itself...
@ConorO'Brien Japt, 3 bytes: =@U
@ConorO'Brien APL (Dyalog Unicode), 1 byte +
@J.Sallé huh, then Haskell, 2 bytes: id
I think that would allow the 4-byte JS solution eval, or atob, btoa, etc.
or am I misunderstanding how that works?
Anonymous
18:41
@ETHproductions How does eval return itself?
no as eval() doesn't return eval
calling id in Haskell returns id? That's interesting
uh well
not quite
@ETHproductions Dyalog APL returns whatever function you type if it doesn't have arguments, as I see it at least. Probably @Adám can explain better.
@ConorO'Brien PowerShell, 7 bytes -- $a={$a}
18:43
@J.Sallé oh, I see the difference. Seems kinda cheaty though
it's the way functional languages work :P
@ConorO'Brien C, 11 bytes: x;f(){x=f;} Try it online!
@ETHproductions I assume it is kinda cheaty, I just answered because it was a CMC :p
Anonymous
@MDXF -1: f(x){x=f;}
:o
19:02
@Mego so long as calling fix with no arguments returns fix it should be fine
@MDXF well, if the function really returns itself, then f()() == f, but this is not the case, as your function returns a memory location
Anonymous
Technically calling any function with no args in Haskell returns itself :P
Anonymous
So ap would be shorter in Lambdabot Haskell :P
Or just id
the thing is, the function has to be called :P so afaict, since APL doesn't evaluate its functions when presented with no arguments, it does not count.
@Mego looking into it, functions in haskell can't be called without arguments, right?
In C would be char*f(){return f;}
In Apl one function that return itself would be {∇} but for me not compile...
Anonymous
19:10
@ConorO'Brien Sure they can. It's entirely possible to define nullary functions: a=1.
In Axiom f(x)==(...;f)
@Mego ok, they can be defined, how might you call one tho?
Anonymous
@ConorO'Brien Just like any other function?
I don't know haskell, but I'm interested in testing the fix solution. how might I verify it?
19:14
Totally unrelated, but dimensional analysis is a life-saver!
Anonymous
@ConorO'Brien I realized after I posted it that it doesn't work unless you call it with itself as an argument :P
Anonymous
Unless you look at it from the perspective of "every function returns itself with 0 arguments"
hm, this calls for another cmc
Anonymous
In which case there are shorter solutions, like id or 1
19:16
CMC: write a function that returns any other function that isn't itself
that looks good I think?
Anonymous
Well it depends on how you define "other function"
Anonymous
With f=id, f and id are functionally identical, but have different names
well, f() != f && f is a function
@ConorO'Brien Python, 15 bytes: lambda:lambda:1
Anonymous
@DJMcMayhem Why not just lambda:id?
19:21
Because I have a nasty golf habit where I implement the first thing I can think of and then post it without thinking of shorter alternatives
Anonymous
me too thanks
nonetheless the lamba lambda is kinda cool :>
Anonymous
Actually: ⌠`1⌡
Anonymous
(which is just lambda:lambda:1)
@Mego Technically you could even do something like str.find
I'm not sure what the shortest class.method combo is though
Anonymous
19:23
I should make Actually's parsing better so that can be written as ``1
lambda lambda red pajambda
19:41
@ConorO'Brien wrong
f()() is just not valid syntax
@ConorO'Brien Non-cheating APL (Dyalog Unicode), 9 bytes Try It Online!:
r←f x
r←f
It takes a dummy argument, actually runs, and actually returns itself (which can then be applied to some other (dummy) argument.
@RosLuP Dfns cannot return functions as a result.
I had to refer to this that I wrote when I was 13 (and put on GitHub years later) to write that
@ConorO'Brien Sorry, this is an example run.
Anonymous
@MDXF You didn't free that memory. Shame on you.
@ConorO'Brien APL (Dyalog Unicode), 9 bytes Try It Online! (non-cheating, takes dummy arg, returns plus)
19:47
@Mego You're referring to basics.c? No memory is allocated
...except for foo
Anonymous
Exactly
Fixed
Anonymous
@MDXF I think with enough parens in the right places (plus a cast), you can make f()() work, but I don't want to try right now
@Mego I'm pretty sure it's completely impossible but I'd love to see it if you do figure it out
@MDXF oh, right, I was thinking you couldn't cast functions for some reason
20:03
Anyone know why this happens?
@ConorO'Brien Pyt 5 bytes: 2⁶Đ⁺ṕ
@mudkip201 just curious, do you know about Cubically?
Anonymous
@MDXF Change line 47 to char *tmp = malloc(strlen(s) + strlen(lastbrace.since) + 1);
@MDXF haven't really looked into it
@mudkip201 just wondering because your first few dozen codepage values are the same as Cubically's
20:16
Huh. Strange
but completely coincidental
Interesting
(no accusations here I'm just legitimately interested)
@Mego ლ(ಠ益ಠ)ლ
@mudkip201 How many characters are in the Pyt code page?
currently 200
And almost none are ASCII? :P
intentionally
allows for comments
since there isn't a comment character
Anonymous
20:21
@MDXF Gotta remember that null terminator :P
@mudkip201 You could just not have comments.
@cairdcoinheringaahing Eh. Not changing it now :P
I quite like Jelly's way of having comments: ḷ“comment” It works because only takes the left value and ignores the string to its right :P
but then you can't include in your comments /s
@Mego hm how about this (if you immediately spot any problems, don't waste too much of your time)
20:24
@cairdcoinheringaahing So then what's the point of ?
Is there somewhere it's actually useful?
Getting the first value of a list, without modifying the list: ḷ/
:O
I have always wanted to do that
(with error instead of 0 on empty list :D)
Also, to get the last value, you can use ṛ/ and to make all values in a list equal to the first, you can use ḷ\
20:32
@cairdcoinheringaahing Comes from APL ⊣'comment'. Together with it allows you to insert comments inside expressions, e.g. 'two'⊢2*⊢'power'⊢'three'⊢3⊣'evaluate' gives 8.
Anonymous
@MDXF Use strncpy - orig may not have a null terminator
@DJMcMayhem In APL, on a matrix, ⊣/ is the leftmost column, ⊢/ the rightmost, ⊣⌿ the top row, ⊢⌿ the bottom row.`
Anonymous
Or explicitly add a null terminator to orig
@Mego Ahh, I was passing a string without a null terminator. That wasn't the problem tho
Anonymous
Also valgrind is your friend
Anonymous
20:35
The problem is that strcpy reads the src string up to a null terminator. If there isn't one, it keeps reading past the allocated memory.
@Adám uh, APL already has ⍝comment :P
@EriktheOutgolfer Yes, but it doesn't allow you to comment separated expressions or include comments inside trains or one-liner dfns: avg←('sum'⊢+/)('divided by'⊢÷)('count'⊢≢)
@Adám why would you want to do that >_>
of course you can do this in Python too
lambda x, y:'Addition' and x + y
Assuming that x + y != 0
20:41
@EriktheOutgolfer ¯\_(⍨)_/¯
@EriktheOutgolfer Nevermind, I forgot how and works
@EriktheOutgolfer What does that mean?
well, lambda x, y: is the "header" of an anonymous function (pretty much like Dyalog's {} but also specifying the arguments' names and other properties), in this case with two arguments x and y
'Addition' is simply the string Addition
and is the logical AND operator
@EriktheOutgolfer OK, I understood all of that, but how does and do ?
since it determines 'Addition' is truthy (non-empty for strings), it returns its right argument, x + y
@Adám ^ (it's a bit hacky)
20:44
@EriktheOutgolfer Yikes!
@Adám a and b returns b if a is truthy else a :/
@cairdcoinheringaahing Ugh.
For a language designed to encourage readability, Python is surprisingly easy to be hacky in
@Adám well, Python's logic isn't that "0 is falsy, 1 is truthy, don't dare bother me with other values" ;)
Ironically, it's only unreadable when it's intended to be written, rather than read. Most pieces of Python code are fairly easy to understand what they do, when not golfed :P
Anonymous
20:47
An advantage of a and b over the more-readable a if a else b is that b isn't evaluated if a is truthy
uh, it's not?
I don't think the latter unnecessarily evaluates b either
the advantage is that you only write a once :P
Hm, I'm quite content with APL's "1 is truthy, 0 is falsy, everything else is not Boolean".
and a (dis?)advantage is that and has a way higher precedence over if and if...else
Anonymous
@EriktheOutgolfer Oh right, I'm thinking of [a,b][cond]
yeah that does evaluate b indeed
20:50
I bet no-one can tell me what this does :P /s
Anonymous
At this point I've internalized the Python golfing strats and now get the reasonings confused :P
Anonymous
@cairdcoinheringaahing Big-Omega
Now JavaScript, that's a different story when it comes to random WTF's in it type system
@Mego are you sure that's 100% true? I discover new Python golfing strats now and then
20:51
groans Don't get Mego started on JavaScript
Anonymous
@EriktheOutgolfer "the Python golfing strats", not "all of the Python golfing strats"
[]+[]
Anonymous
Obviously I can't internalize what I haven't learned, so your pedantry is unnecessary :P
Anonymous
@Zacharý It's less of a system and more of an accident
We don't practise pedantry because it's necessary, but because it's fun
20:53
Javascript is just a faster version of Java
3
The less necessary, the more fun
Apparently Java autoconverts in some cases where not even Python would
Anonymous
@Poke eye twitches
@Poke (prepares for the flood of comments about that remarkably controversial message)
:)
20:54
JavaScript is Java if it were untyped and not OOP
Anonymous
Java is OOP, JavaScript is OOPS
15
JS is OOP now. Soon the two will converge
@Zacharý there are definitely some weird implicit casts but you're usually doing something silly if you encounter one
For a sec I thought OOPS was a paradigm ;P
@Poke string with integer
20:55
Can anyone help me with writing an interpreter for the esoteric lang i made up
I not too experienced with that xd
Anonymous
@Mr.Xcoder It is. It means "use something else" :P
@trichoplax never will JavaScript and Java merge
Hell no
@SnivyDroid flak.
@Zacharý you mean during concatenation? That's something I'd expect at least
20:56
That should be outlawed by the geneva convention
@Zacharý I knew someone would bite :P
@SnivyDroid Which language?
Combining a slow-compiling lang to a bloated lang would be a catastrophe
@Poke considering Python doesn't let you do that, I'd think not.
Java and JS are in an eternal state of war
20:56
@SnivyDroid Sure, I wouldn't mind
@Adám Its one I made up
@Adám do you think it'd be APL
Its a palindromic alphabetical language
@Mego Then JS and C++ (I know you’ll disagree about the latter) are definitely OOPS :P
I call it ALPHA
20:57
Introducing Java²Script
lord no
Anonymous
@Mr.Xcoder C++ is a planned mistake that could be good if there weren't a few dozen competing interests steering its development
Which do you hate more, @SnivyDroid
@Mego D will forever be the best c-style language
20:58
@SnivyDroid OK… Do you have a design doc?
I can make one
yeah i forgot to do that whoop
@Adám you sure? that would create uncontrollable forces which will instantly exterminate the human kind and our galaxy between the eternal, deadly war of the Javanese and the JavaScriptians
@cairdcoinheringaahing What fors that do?
Give me ten miniutes
@SnivyDroid What language is it (going to be) written in?
20:59
Javanese people might be offended :p
Preferrably python
@cairdcoinheringaahing Python
@Mr.Xcoder C++ is OOPSHITWHATAMIDOING
@cairdcoinheringaahing Try it online! is a bit shorter, and the output is the same. I'm not sure what the goal is though :P
thats the only language i know somewhat
20:59
Perfect for caird
@Mr.Xcoder Divisor sum of 10, 50, 120 and 54
@DJMcMayhem ಠ_ಠ
@DJMcMayhem I mentioned flak, right?

« first day (2560 days earlier)      last day (2580 days later) »