|
qntm posted:then what's this? code:
|
# ? Jan 26, 2016 18:39 |
|
|
# ? May 25, 2024 02:45 |
|
Does C++ have a way to get string representations of enums yet?
|
# ? Jan 26, 2016 18:41 |
|
an inner function can be convenient because you can close over the locals declared above it in the containing function. this is useful in python because the lambda syntax is limited to one liners and linters will balk and tell you to use an inner function instead of a lambda
|
# ? Jan 26, 2016 19:07 |
|
I always thought of a lambda as just a special case of inner function which is why I'm puzzled to see people talking about them as if they're different things
|
# ? Jan 26, 2016 19:22 |
meatpotato posted:Does C++ have a way to get string representations of enums yet? Sure does! C++ code:
|
|
# ? Jan 26, 2016 19:43 |
|
qntm posted:I always thought of a lambda as just a special case of inner function which is why I'm puzzled to see people talking about them as if they're different things lambdas are just anonymous functions, so I guess it's more accurate to say it's the other way around? usually the only difference is that you have a more expression-like in-line syntax (like \x => ... or w/e) so it's more like every other variable declaration. that means you don't have to assign them to a name if you are just going to return them, but inner functions are mostly equivalent otherwise.
|
# ? Jan 26, 2016 19:48 |
|
VikingofRock posted:Sure does! C++ Here's my "improvement" but I don't know if this is horrible or good: C++ code:
Hunter2 Thompson fucked around with this message at 20:12 on Jan 26, 2016 |
# ? Jan 26, 2016 19:59 |
|
|
# ? Jan 26, 2016 20:21 |
|
qntm posted:then what's this? a gcc extension with wacky semantics that requires runtime code generation and inherently leaks memory (it's a closure that can be passed around as a normal function pointer, so it has to generate a trampoline which passed in the captured values).
|
# ? Jan 26, 2016 20:28 |
|
Plorkyeran posted:a gcc extension with wacky semantics that requires runtime code generation and inherently leaks memory (it's a closure that can be passed around as a normal function pointer, so it has to generate a trampoline which passed in the captured values). Jeffrey of YOSPOS fucked around with this message at 21:53 on Jan 26, 2016 |
# ? Jan 26, 2016 21:50 |
|
the trampoline is stored on the stack, so it should not leak memory but is only valid until the function returns i wondered how that would work with the nx flag, turns out gcc just disables it. if you have this anywhere in your program your stack doesn't get no-execute protection
|
# ? Jan 26, 2016 22:53 |
|
suffix posted:the trampoline is stored on the stack, so it should not leak memory but is only valid until the function returns brb, adding gcc extensions to debian server packages
|
# ? Jan 26, 2016 23:10 |
|
qntm posted:so what's the difference between that and what you were talking about? idk i guess just syntax so that your lambda/inner declaration cannot occur as a result of like void foo() { ... stuff ... // whoops hosed up a closing brace void bar() { more stuff... } } because there is probably at least one case where that has happened and been the most ludicrous runtime bug to solve
|
# ? Jan 26, 2016 23:59 |
|
languages that are not hosed up horrorshows give you cleaner ways of declaring this:code:
the only thing that is not flawless about this is that you have to manually specify Func<T> you can't just var away the whole thing
|
# ? Jan 27, 2016 00:02 |
|
All I'm seeing is an argument for whitespace sensitivity
|
# ? Jan 27, 2016 00:08 |
|
gonadic io posted:All I'm seeing is an argument for whitespace sensitivity or auto-formatting on commit, which i guess is essentially the same thing but less enforced
|
# ? Jan 27, 2016 01:07 |
|
autoformatters own because people can stop bitching about indentation and line breaks and whatever
|
# ? Jan 27, 2016 02:09 |
|
https://twitter.com/gavinjoyce/status/691773956144119808
|
# ? Jan 27, 2016 03:18 |
|
lmao. that's so loving javascript
|
# ? Jan 27, 2016 03:19 |
|
|
# ? Jan 27, 2016 03:34 |
|
|
# ? Jan 27, 2016 03:42 |
|
npm install verbose is loving terrifying
|
# ? Jan 27, 2016 03:49 |
|
uncurable mlady posted:npm is loving terrifying
|
# ? Jan 27, 2016 03:54 |
|
who exactly is it who thought "man, the way i just list all my dependencies in this file and maven+eclipse take care of it for me, even telling me when version numbers are wrong... imagine if we had that, but without any of the good parts, and in javascript!"
|
# ? Jan 27, 2016 04:06 |
|
p-langers
|
# ? Jan 27, 2016 04:29 |
|
0% chance anyone involved with npm had ever used maven
|
# ? Jan 27, 2016 06:23 |
|
Bloody posted:the only thing that is not flawless about this is that you have to manually specify Func<T> you can't just var away the whole thing One of my few good colleagues tells me that this is because the c# compiler can't determine if it should be a Func or an expression, so now we have a handy helper for it: code:
And then one for all the different number of parameters on the Func, and now we can use var with lambdas.
|
# ? Jan 27, 2016 07:14 |
|
MALE SHOEGAZE posted:react's api exposes like 6 functions. it's the definition of simple Just use backbone with underscore for templating
|
# ? Jan 27, 2016 10:06 |
|
This is pretty bad, but considering there is a toggle for the progress bar in the first place implies they already know there is a performance hit. What other reason would you have for allowing it to be turned off?
|
# ? Jan 27, 2016 10:14 |
|
don't defend npm it's unseemly
|
# ? Jan 27, 2016 10:33 |
|
Valeyard posted:This is pretty bad, but considering there is a toggle for the progress bar in the first place implies they already know there is a performance hit. What other reason would you have for allowing it to be turned off? (this is kinda common behaviour for cli tools though?)
|
# ? Jan 27, 2016 10:44 |
|
I thought the IO being non-blocking was the point
|
# ? Jan 27, 2016 10:46 |
|
|
# ? Jan 27, 2016 10:47 |
|
progress bar toggles and the like are for when you want to pipe the output to a file and don't want the control codes messing it up
|
# ? Jan 27, 2016 11:07 |
|
https://googleblog.blogspot.co.uk/2016/01/alphago-machine-learning-game-go.html?m=1 Looks like computers are now better at go too. The way they did it is cool too. Rip humans
|
# ? Jan 27, 2016 20:33 |
|
Literally all we're good for is loving. Ian m banks was right.
|
# ? Jan 27, 2016 20:34 |
|
The previous post should be considered forward dated to 2025
|
# ? Jan 27, 2016 20:34 |
|
avatar the color of a tv tuned to a dead channel
|
# ? Jan 27, 2016 21:06 |
|
pointsofdata posted:https://googleblog.blogspot.co.uk/2016/01/alphago-machine-learning-game-go.html?m=1 that looks way more promising and impressive than facebook's attempt
|
# ? Jan 27, 2016 21:37 |
|
|
# ? May 25, 2024 02:45 |
|
pointsofdata posted:https://googleblog.blogspot.co.uk/2016/01/alphago-machine-learning-game-go.html?m=1 https://storage.googleapis.com/deepmind-data/assets/papers/deepmind-mastering-go.pdf
|
# ? Jan 27, 2016 22:05 |