« first day (1124 days earlier)      last day (4050 days later) » 

17:00
C++ is too complicated for me
JBL
JBL
@Pawnguy7 Remember, we talk about probably not reasonable people.
@Pawnguy7 I've seen it...
@Pawnguy7 These are really dumb people!
I still don't get why this threepenny thing runs as a web server
I've heard that name
17:01
if there was a wrapper with that Hs2Js thingy it could work
@CatPlusPlus it's RFP GUI that uses a web server and a local web browser
@JBL or this :)
float3x3 mat{
    { 3, 0, 0 },
    { 0, 5, 0 },
    { 1, 0, 7 }
};
which is rather strange, to say the least
If you want FRP that compiles to JS there's uh
I don't remember
17:02
Gonna be hard to google for that one.
JBL
JBL
uh.oh More likely.
uh stands for "User-interface Haskell"
oh so fay is using FRP?
This is not what I was looking for though
interesting
As far as getters/setters go, I think of it like this: you might change what happens someday. In the cases where that is never going to happen (setting the color of it, for example), then it is a matter of API consistency. Maybe this is why C# properties are useful though.
17:03
@Pawnguy7 That's wrong.
No, I think this was something else
That's not an advantage. It's the opposite.
It would've made more sense if constructors were explicit by default and you'd have to declare them implicit on your own, no?
@Pawnguy7 no.
17:04
77
A: Why use getters and setters?

R. Martinho FernandesA public field is not worse than a getter/setter pair that does nothing except returning the field and assigning to it. First, it's clear that (in most languages) there is no functional difference. Any difference must be in other factors, like maintainability or readability. An oft-mentioned adv...

Ooops, sorry. Bad copy-paste.
@CatPlusPlus I think you could combine reactive banana with fay somehow
or at least its model
It saddens me that people think having the ability to change the interface without changing the interface is a thing to strive for.
I don't know how all the events stuff would align with simple callback model though
@R.MartinhoFernandes are you pasting a lot of shared_ptrs to bad new-people lately?
I am afraid it will be way more complicated
JBL
JBL
17:05
Well. Got to go, see you all.
where a simple pure function with State monad as a callback could do
Fuck's sake, can't find it
but maybe I'm wrong.
I don't remember the name
addWindowEvent :: String -> Fay () -> Fay ()
addWindowEvent = ffi "window.addEventListener(%1, %2)"
funny.
k, Im heading for a bus
17:06
You can use UHC to get real JS FFI
Xeo
Xeo
@BartekBanachewicz At least in AS, events are just callbacks. Think signal/slot
@BartekBanachewicz Make sure it's stopped before you hit it.
Oh, this elm-lang.org @BartekBanachewicz
@Pawnguy7 Code like some_object.setX(some_object.getX() + ther_object.get_width()); (instead of some_object.x += other_object.width;) on the off chance that someday you might want to compute x on the fly by computing the arc-tangent of the subtended angle (or whatever) is simply foolish.
when using std::function, should I pass it around as const reference?
Xeo
Xeo
17:08
Preferrably, don't pass around std::function :P
@R.MartinhoFernandes I dunno...I think being able to change the interface without changing the interface would be a pretty cool trick. :-)
@Xeo why not?
It's for storage.
@JerryCoffin do you think conditional statements should have braces, even if they only have one statement?
Lol poor jerry
17:10
but is it ok to pass it as const reference?
in situations when you want a callback, for example
@Pawnguy7 Yes
Xeo
Xeo
@Pawnguy7 "one statement" can be a lot of things
@Venemo Specific example?
It's silly design that they're optional
Something being deleted while you are reading it is a bit unsettling.
@Cat looks extremely interesting.
17:12
@Pawnguy7 Me? No. The unnecessary noise is somewhat problematic; the fact that somebody understands syntax so poorly is much worse.
@R.MartinhoFernandes How do you know these things? Are those just instances of the "design by contract" theory?
@JerryCoffin poor syntax understanding?
@Jefffrey I guess.
@Xeo let's say you write a method that does something asynchronously and you want it to call a function when it's done. for this I could use a function pointer but the trouble with function pointers is that you can't squeeze capturing lambdas in them
@Jefffrey Every API is a contract
17:15
Makes sense.
Don't most things handle this with...
@CatPlusPlus ...but only between ferengi
Xeo
Xeo
@Venemo Where does passing std::function come into play with that? What about template<class F> void do_stuff_async(F callback)?
Well, take WinAPI for example.
@Pawnguy7 Yes. Specifically, that the conditional simply controls a statement, and enclosing in braces is just a way to group a set of statements into something that's (syntactically) treated as a single statement.
17:15
If you pass the wrong parameters, nothing happens, and it tells you what you passed was incorrect.
Couldn't the same thing be done here?
@Xeo why not do_stuff_async(const std::function &callback)?
@Pawnguy7 If you put "it might throw an exception X if the data is wrong" from the very start
Because std::function is not that.
3 hours ago, by R. Martinho Fernandes
It's a type-erased container for monomorphic callables.
Otherwise adding error-checking is breaking change, too
@Venemo Do you pass a container with the number if you want to pass a number to functions?
17:17
Compatibility is not an easy thing
@R.MartinhoFernandes it's just a reference to the container, not the container itself
Oh fuck, it seem like I'm an asshole. Now I gotta go and shit all over the JS room:(
Xeo
Xeo
@Venemo Do you pass a reference to a container with a number, if you want to pass a reference to a number to functions?
@JerryCoffin that is the misunderstanding, or the correct thing that is misunderstood?
@CatPlusPlus Fair enough. The consistency still bugs me though.
Also.
@Xeo @R.MartinhoFernandes the trouble is that function pointers don't work with capturing lambdas
17:18
What if there is a situation where the input is still accepted, but something must be done with it?
@Venemo Who said anything about function pointers.
Maybe it has different internal representation.
Xeo
Xeo
3 mins ago, by Xeo
@Venemo Where does passing std::function come into play with that? What about template<class F> void do_stuff_async(F callback)?
templates are not going to cut it
The way to take arbitrary callables in C++ is with templates.
Xeo
Xeo
17:19
@Venemo Why?
Anything else is sub-par or under different constraints.
@Pawnguy7 Perhaps look at it from the other direction. Would it make sense to "be consistent" by simply enclosing every statement in braces? int f(int x, int y) { { int ret = x + y; } {return ret } }? Enclosing a single statement in braces makes just as much sense in this case as when controlled by a condition. For that matter, why stop at one? Why not {{{{{{{{{{{{{{{{{{{{{{x=1;}}}}}}}}}}}}}}}}}}}}}?
if you use templates like that, don't you have to put the function body into a header file?
@Venemo You usually do that, but no, it's not absolutely necessary.
btw, I see std::function as a sort of smart pointer for functions
17:22
@JerryCoffin I am tempted to put that last one one somewhere in my code. That being said, I am not certain these are the same things. In your function definition there, you are forced to have braces to define what is there: you can have multiple statements without adding more braces.
Whereas in a conditional, you cannot.
Xeo
Xeo
@Venemo Buy some better eyes.
@Venemo And you don't pass smart pointers around if you are interested in their pointees!
Please don't.
You pass smart pointers if you are interested in the smarting, not the pointing.
I see, but then, how do you do this without templates?
All other cases take Ts and you call f(*ptr).
@Venemo Hmm, std::function, then. :(
@Pawnguy7 Yes, a function is defined as having braces around the body. A conditional isn't.
17:26
As far as I know, the argument for it is fairly simple: you might add something later.
It has a bunch of drawbacks and the only benefit is that you get a binary API.
I personally do not do it as adding braces later is easy, and I find braceless easier to read, though.
@Pawnguy7 YAGNI
@R.MartinhoFernandes without templates, in a way that one can pass in a capturing lamba
@R.MartinhoFernandes what are the drawbacks?
@Jefffrey That sounds kind of funny coming from you :D
17:27
@Pawnguy7 Ikr :P
Anyway, if nothing else, I am rather fond of API consistency.
I don't want to use three types with getters/setters that are needed, and find an object where it is different. It is jarring.
@Venemo Lost optimisation opportunities, extra overhead, potential for compilation errors related to overloads or implicit conversions.
@Jefffrey how comes your master plan?
@R.MartinhoFernandes can you point me to some article about this?
@Pawnguy7 Consistency is great, as long as what's being represented is itself consistent. If it's not consistent, well: "A foolish consistency is the hobgoblin of small minds."
17:30
@Venemo I've been wanting to write one about it for a while, since I got tired to telling people on SO about it. There are a couple of answers that might help, sec.
@Pawnguy7 I didn't do much today.
It makes sense, really.
@Venemo This is one common problem that pops up stackoverflow.com/questions/11628765/…
I could have planned out this multiplayer thing in advanced.
I'm interested in how to do this correctly, but didn't find many alternatives
17:32
But for some reason I can never make myself plan ahead.
SFML has piss-poor networking support you can use
Ell
Ell
boost asio is nice imho
There Is No Nutrients In Our Food Anymore Or In Our Soil OR IN OUR WATER.
wtf -.-;
Ell
Ell
+ stackless coroutines thing is apparently nice :P
@Borgleader Oh god the titlecase.
17:34
@R.MartinhoFernandes nice! what is std::bind?
@BartekBanachewicz what is this related to?
@R.MartinhoFernandes found it on cppreference
@Venemo It's something that was quite useful when we didn't have lambdas. It does partial application among other tricks.
Ell
Ell
@R.MartinhoFernandes among other tricks? o.O
what are these other tricks?
Xeo
Xeo
I still find std::bind very useful for forwarding lambdas.
17:35
@Ell You can use it to reorder arguments, for example.
Xeo
Xeo
@Ell ignoring arguments, swapping argument positions
Ell
Ell
Ah right yeah
I thought of that as partial application still for some reason
Xeo
Xeo
I used std::bind in our server code for command-handling. All commands get handed the same arguments, but some choose to ignore certain arguments at binding-time (since the actual callback function doesn't have the corresponding parameters).
@Venemo Bind is almost (but not quite) completely unrelated. It's primarily a way of taking a Callable that takes some number of parameters, and producing another Callable with some of the parameters already bound. A typical example is if you want to add 2 to something, you can use bind(std::plus, _2, 2) to get that. The result is just a function object that calls std::plus, passing 2 in place of its second parameter.
Xeo
Xeo
@Ell Also, function composition with freely distributable arguments amongst the composed functions
17:38
@JerryCoffin You probably want bind(std::plus, _1, 2), though.
ah, so it's basically irrelevant to my question
f = bind(std::plus, _2, 2) needs to be called like f(dummy, number_to_add)
Xeo
Xeo
(thinking about it, std::bind really does a lot)
@R.MartinhoFernandes Both of you guys probably want std::plus<someT>(), though.
Else it won't compile at all :P
@Xeo namespace foo { namespace std { ::std::plus<int> plus{}; } } using namespace foo; I hate you for this
Hmm, I guess it could be ambiguous anyway. Fuck it. Assume I'm inside namespace foo.
Xeo
Xeo
17:43
lol
@Xeo It can also duplicate arguments!
@Xeo Yes, of course. I wasn't trying to make it syntactically correct, just giving the general notion of what it's supposed to do.
@Venemo Avoiding templates is silly
well, the template thing works, but it stops working if I don't want to put the function body in the header
template <typename Fun> auto join(Fun fun) { return std::bind(fun, _1, _1); }
17:44
You're using C++, this is the way to do it
Is OOP all about class invariants?
Xeo
Xeo
@R.MartinhoFernandes why "join"?
@Venemo It may be possible to get it to work otherwise, but for the most part, just live with the fact that it should go in a header.
I don't want to put the implementation details into a header
@Xeo Because it is the join operation of the (->) a monad.
17:45
Headers are an obsolete concept, and don't serve the purpose you want them to serve anyway
@Venemo Use an .ipp file and include it at the bottom of the .hpp file.
@Venemo "I do not want to do this slightly annoying thing that allows me to use one of the greatest tools in the language" gz
If you have any class in a header, you already leak implementation details
Xeo
Xeo
@R.MartinhoFernandes I still don't like that one.
Because I still don't fully get it.
If you're using C++ properly, most of your things will go into headers
17:46
@Xeo join f x = f x x. Simple.
@Venemo There are lots of reasons to not want to, and we all want modules added as soon as possible to get away from it. Until then, however, putting them in a header (or something else that gets included in a header) is the least of the available evils.
Xeo
Xeo
@R.MartinhoFernandes Sure, I get that part. I meant the monad itself.
@R.MartinhoFernandes Not (f x) x?
yes, but putting that code in the header will expose all the implementation details (such as the private class, etc)
Wait, that's the same
17:47
@CatPlusPlus Parentheses don't matter for curried stuff.
@Venemo That's how you write C++, sorry
Put private crap in detail namespace
heh
well, that's one way of doing it
user1804599
@Ell I often use it as std::bind(distribution, prng) to have a single function object.
Ell
Ell
@rightfold good idea :D
user1804599
Not sure if that’s partial application since all arguments are taken but yeah. :v
Ell
Ell
17:49
anyway I must go to some chemistry
@rightfold std::bind(distribution, std::ref(prng)), no?
user1804599
@R.MartinhoFernandes hmm right.
user1804599
Well, depends.
That site hosts practice exams for the Lebanese Baccalaureate D:
17:50
Oh well, nevermind.
user1804599
What if I want to return it?
I am assuming other things.
anyway, if I don't care about capturing lamdbas, function pointers will work fine, too
Xeo
Xeo
@Venemo That sucks as a callback system, though. Also, lambdas are not special.
@rightfold I tend to make my prngs static locals, so that's why I got in the habit of just refing them. Copying prngs is not only heavy, but something to be careful.
user1804599
17:51
@R.MartinhoFernandes I see.
user1804599
It depends on the situation, I’d say.
user1804599
Never thought of static locals. Thanks for the tip.
We have two places in our code that use a prng, and they make use of it all within the same function scope, and are unrelated, so we just make a static generator for each and call it a day.
@Xeo putting the whole implementation in a header sucks even more
Meh.
I'd say having a binary interface is what should require justification, but well.
17:55
yes, that also matters
how about providing an overload which accepts a function pointer and another overload that accepts an std::function?
Why not just the latter then?
FWIW, that would make it ambiguous if you pass a non-capturing lambda.
(Another example of the issues I alluded to)
true
I think I've never properly understood OOP
Wow.
17:57
@Jefffrey I'd say it's an important part of it.
anyway, I gotta leave now. see you later
In any case, at an ABI boundary I'd be weary std::function anyway.
yes, it's an ABI boundary
As much as I prefer C++, C is the language of ABIs.
17:59
So I'd just do the usual function pointer + void* dance.
@R.MartinhoFernandes I should brainwash everything I know and start over again. Any idea where from?
I desperately need some guidance ATM :(
@R.MartinhoFernandes how about one overload with a function pointer + void* and another with std::function?
@Jefffrey Sorry, all my knowledge was accumulated over time.
It's ok, I thought so. Thanks for the interest anyway :)
std::accumulate<Knowledge>(robot.getLife().begin(), robot.getLife().end())
3
18:02
:)
@Venemo I guess that providing the latter would merely be as a convenience over the former, but it feels like stopping halfway: I'd maximise convenience with a template for the latter :P
@Borgleader I don't understand why they need all the keys...
Its encrypted...
All of the emails are encrypted
18:06
It was my understanding of the article that this is a per-user basis.
I'm confused as to what confuses you
They are targetting one person, correct?
Is it why they need all the keys, or why they need key(s) in the first place?
Yes it seems that way, one key per person, now if you want to know why they wanted all of them, well look at the NSAs recent track record.
My question was why they needed all of the keys.
I don't know what basis you can use.
Terrorism
18:13
Well yes. For one key.
@Pawnguy7 The US federal government has made it pretty clear that they believe "but I want it!" is all the justification they need for anything.
The only other thing you really have is "give me everything, so nothing bad happens again."
But greater good arguments are... scary, to say the least.
They always seem good until they are applied to you.
What was that quote?
Something about perfect security.
Anyway.
It is basically like Hitler.
Only question is what Hitler stands for.
In this hypothetical.
Godwin's Law?
Never heard of that, but it is funny.
I have made comparisons with Hitler recently.
My point is, in any police state, somebody, or some group, is at the top.
You are subject to whatever their philosophy is.
Yet we argue that we should not push things on others.
I don't.
18:20
@Pawnguy7 Read through the US constitution and compare what it says to the current US Federal government. The very existence of roughly two thirds of the current federal government is pretty clearly contrary to the stated intent of the constitution, and is (sort of) allowed only by one loophole in the first sentence of article 8 that says: "The Congress shall have Power [...] provide for the [...] general Welfare of the United States;".
Oh. Some do, anyway.
pushing things on others is like doing any other thing- you do it if you need to and you don't if you don't need to.
But the need is determined by you.
well, preferably, it would be determined by the most objective process around.
that may not necessarily be saying much, of course
On that basis (and, essentially, it alone) they've basically gotten to the point that they feel free to ignore all the stated limitations of the Constitution, and treat whatever they want to do as being "for the general welfare of the United States", so it's allowed.
18:21
what I never understood is why lavabit's storage was vulnerable to key escrow in the first place
any half-decent system will never have access to user's encryption keys in the first place
@bamboon well yeah, that
how I would do it is store an RSA public key of the user in a database
@Pawnguy7 multiplayer?
if an unencrypted email comes in a new random number is generated to encrypt the message using AES, then the random number is encrypted using RSA and the pair is stored in the database, the random number is the deleted
Oh god
isJust : Maybe a -> Bool
no that's not how you...
user1804599
18:24
:
@Xeo @Cat @rightfold ^
user1804599
What? It’s fine. vOv
@rightfold elm
There's a lot of partial functions
They're useful sometimes, but generally you should not use them
head, tail, etc. are in the same boat
user1804599
isJust is not a partial function.
18:25
@DeadMG Humanity has a way of not being objective. Human nature, really. For example, your stance on perceived racism is rather militant. Such is the attitude of revolutions.
user1804599
fromJust is.
Oh, right
I read an interesting thing just yesterday, actually.
user1804599
:P
NEVERMIND THEN
18:26
Imagine we all take a test.
Let's say we all failed.
user1804599
Imagine we all take a test test test testicle.
Oftentimes, we think thoughts such as "the test was too hard" or "outside factors caused this". Somehow, it was not your fault.
But when we look at others who failed.
We often say it is their fault.
Yes?
@Pawnguy7 Everybody can only have their own perspectives.
My point is, by nature we are not that good at this objectivity thing.
@DeadMG So true.
@Pawnguy7 Also so true.
18:27
for me, the difference between, say, racism, and, I dunno, whether or not you like to stick your cock in your girlfriend's arse
@BartekBanachewicz Was somebody talking about multiplayer?
I wouldn't choose to do either of those things, but if your girlfriend doesn't mind, then it doesn't affect me in any way whatsoever.
but if you're a racist and you start talking about killing all the fucking niggers
then you make other people's lives worse.
The example in question was a joke.
yes,of course.
I'm merely pointing out where I personally draw the line.
Ell
Ell
Gosh. LaTeX is really not very good at being user friendly
18:30
Where is that, exactly?
user1804599
Hmm.
Evidently it does not include pretending to be a racist.
user1804599
Sinterklaas will come to the Netherlands on Saturday.
Ironic racism is about as funny as unironic one
@Pawnguy7 As far as I'm concerned, you can do whatever you want, as long as it doesn't negatively affect people who didn't volunteer for said negative effects.
3
18:32
@Pawnguy7 I doubt anybody's entirely objective, but some are certainly much more so than others.
user1804599
When will man learn that all races are equally inferior to robots!
@DeadMG Fair enough. But, again, negativity is determined by the person making the call.
Many people in the same situations would make different choices.
you can only act on the information you have, but you'd have to determine "negative" in terms of the views of the person being affected.
@JerryCoffin Probably. But oftentimes it is like influence: you do not realize you are doing it.
Just... my end point is.
I would rather not rely on one person's morales to determine such big things, in this hypothetical police state.
Everything's always terrible
user1804599
18:35
I have so many boners right now.
I am doing really bad at this getting things done thing :\
@Pawnguy7 the only reason, there, is that we don't like to picture ourself as idiots and if you failed a test for other reasons other than "other factors" you are likely to be considered an idiot, by... well, other idiots.
Not quite sure what you are saying here.
Also, not necessarily idiots. Maybe you just didn't study well.
I've been watching too much CollegeHumor lately
@MohammadAliBaydoun humor me
18:39
@Pawnguy7 I'm not funny :<
And neither are they ;___;
I thought you were going to be a comedian.
@Pawnguy7 in my experience most of those that say they didn't study for a test, as the reason they failed it, are those people that attend the library (and generally study) more often.
I put a joke in a code comment one time
So you can say my career as a comedian is getting pretty serious
@Jefffrey quite possible
@Pawnguy7 Most people clearly don't realize it, and don't think about it enough to even question whether what they want to believe is objectively accurate or not.
18:42
@Jefffrey but when you say you didn't study for a test because you're an idiot and didn't study...you're still an idiot? :D
While it is true that some people are better at putting this into practice then others.
I think we all have a few areas where we do not realize it.
@melak47 you said it yourself :P
11 mins ago, by Cat Plus Plus
Everything's always terrible
the message right after this one
I have no idea what to say :|
"How many?"
user1804599
At least 90.
18:47
11 mins ago, by rightfold
I have so many boners right now.
Do you have many boners because everything is always terrible?
user1804599
Yes.
user1804599
PHP is so exciting.
Fascinating.
user1804599
Criminals turn me up so much.
user1804599
The government makes me horny as fuck.
18:48
Whatever floats your boat
user1804599
#boat {
    float: left;
}
Xeo
Xeo
@BartekBanachewicz Eh, I don't see what's wrong with that.
It's just a convenience function
@CatPlusPlus yeah, that.
@Xeo I don't see >>= in the docs
also why the fuck would he swap :: and :
user1804599
18:52
: is hipsterer.
user1804599
Also nothing is more unrelated to isJust than >>= is.
@BartekBanachewicz what were you saying about multiplayer?
Xeo
Xeo
@BartekBanachewicz and how is that related?
@Xeo both offer a way to working with a value in the context
@rightfold yeah but the unnecessesary rewrites of Haskell code :/
Xeo
Xeo
No. isJust simply tells you which state the Maybe is in
18:59
which is rather useless when you have bind and lift, no?

« first day (1124 days earlier)      last day (4050 days later) »