« first day (1698 days earlier)      last day (3264 days later) » 

9:00 PM
> It is not unusual to write a function that takes a container as argument and at a later time, the need to change the allocator type arises. This forces the user to change every site where the allocator type appears which can end up being many functions.
 
I've never ran into that scenario btw
 
Do C++11 polymorphic allocators help with that?
 
?
 
user1804599
polymoronic allocators
 
I heard C++11 introduced a new model for allocators, but I never understood allocators very much so I'm wondering whether they're meant to solve that kind of problem
 
user1804599
9:01 PM
I'm a Go/Python/Haskell programmer and the only allocator I need is the GC.
 
user1804599
I win.
 
@rightfold you GC-spoiled kid
 
user1804599
Tracing GC master race.
 
@AndyProwl C++ adds scoped_allocator
 
user1804599
Tracing GC or GTFO.
 
9:01 PM
@Rapptz they could let the user pass allocator_arg on construction.
 
@MarcoA. he's GC spoiled only in the same way as I would be parser-generator spoiled
 
@sehe what if I'm node.js spoiled?
would that be good?
 
@Rapptz Ah wait what I was talking about is not C++11
 
9:03 PM
> Containers hide everything

Sometimes, having a C style API with a raw view is beneficial.
 
std::vector::data
 
user1804599
@MarcoA. Node.js combines all the conveniences of callbacks with the efficiencies of JavaScript.
 
@Rapptz okay. Next example? (not string please)
 
9:03 PM
@sehe I don't have it., someone linked it on IRC
 
user1804599
@sehe she
 
@AndyProwl yeah probably
 
@MarcoA. Wrong link?
 
@sehe std::array!
 
9:05 PM
@AndyProwl no I'm just drunk
 
Anything that is actually mandated to be contiguous but only the sequential containers have that.
 
Marco...
What r u doin?
Marco...
Stahp.
 
Getting a raw view of the internals of every container seems like it's bound to expose too much and breaks invariants.
 
@MarcoA. lol, that song is so.. and that singer is so... well, nevermind
 
@nabijaczleweli you're not actually drunk until you write my name as Macro
 
9:07 PM
> fun fun fun looking forward to the weekend
 
@rightfold Okay. Just to be clear. I'm assuming you're just trolling because you make no effort to clearly ask for anything here. I'll grant you a lot of wishes and I don't care which direction you lean, but you need to be more specific for me to take your hints seriously.
@Rapptz Gosh.
 
@MarcoA. Good I passed the test. Would be surprising if I hadn't, since I'm not legally allowed to consume alcohol...
 
@AndyProwl fun fun fun fun
 
user1804599
I'm not asking.
 
anyway time to play video games
 
user1804599
9:07 PM
I'm merely pointing out you use the wrong pronoun.
 
@MarcoA. At least the message is clear
 
it's almost as annoying as a mosquito bite
but the bite is one-shot, this stuff has multiple choruses
 
It would be hard for me to listen to it unless drunk
actually I'd love a beer but I only have shitty beer atm
but no good beer till Sunday I guess - Uncon being in London doesn't help either
 
I don't like Rebecca
 
9:12 PM
wtf
thanks youtube for these video suggestions: youtube.com/watch?v=MP3X9F-ykRY
very much related to the C++ videos I saw last week
 
**Unit Testing**
I can't think of a less effective way to write test code. For every actual line of code, write 10x in tests. And if you change the code at all, throw away half, and modify the other half.
**Pair Programming**
I hope whoever came up with the idea of billing the client twice for the same work got a hefty bonus.
**Dependency Injection**
Not only do we write unit tests, but now we refactor code to make it easier to write more of them, at the expense of readability.
**Refactoring**
Let's get paid to write the same thing over and over.
 
top kek
 
0/10 either an idiot or a low effort troll and what's the difference really
 
@CatPlusPlus The point is that you can't tell the difference between a true idiot and a troll.
 
The point is that it doesn't matter
 
9:15 PM
@fredoverflow it's less fun when you have those as colleagues
 
hey guys - quick question from a newb-to-c++ developer:

if I have a method:
void MyClass::foo() { ... }

and I need to pass it as a pointer to another method:
void MyOtherClass::bar(void func()) { ... }

how would I do so from another method on MyClass?
void MyClass::baz() { myOtherClassObj->bar(--here--); }
 
You're more likely to get an answer on:
 
yeah I suppose youre right @mysticial
I just figured it was probably a simple question that I can't seem to make heads or tails of so I'd try here first haha
 
@RobertPetz Also, you probably don't want to do that.
 
@MarcoA. she does failed to be on time for recording
 
9:20 PM
@captaingiraffe I only have to do it as I'm passing it as a call back to be fired at a later point in time. I'm on Arduino so I don't have a concept of threading, and I can't block my main thread with a delay()
 
@RobertPetz You can't pass a method as a function, because those are not the same thing.
 
@RobertPetz Ok, carry on then.
 
25
Q: How can I pass a class member function as a callback?

oferI'm using an API that requires me to pass a function pointer as a callback. I'm trying to use this API from my class but I'm getting compilation errors. Here is what I did from my constructor: m_cRedundencyManager->Init(this->RedundencyManagerCallBack); This doesn't compile - I get the follo...

 
@fredoverflow thats a great link - thanks for that. I'm following some example code that isn't using a class member, so that explains why I'm having trouble haha
@fredoverflow perfect- that's exactly what I was looking for
thanks
 
@RobertPetz You're almost never the first person with a particular problem.
 
9:25 PM
indeed - I think my main issue is that I'm still wrapping my head around the terminology and differences between C# and C++, now knowing that a class member is treated differently than a function is why I wasn't understanding it haha
 
C# is callback heaven compared to C++.
 
indeed haha
 
You can bind methods to objects natively, can't you?
Like "here is a method, and here is an object, bind them together, and then pass it around as a function"?
 
well, in c# there's only 'methods' - but methods can be passed around as an anonymous function/action (action being a function that returns void)
 
If you have a class Account with a method void deposit(int amount), is that passed around as an Action<Int> or an Action<Account, Int>?
 
9:29 PM
that would be an Action<int>, if it returned 'String' it would be a Func<String, int>
 
And how do I get this action if I have an account x?
 
it doesn't carry any indication of the class that it spawns from when passed around, it's just an anonymous method reference at that point
 
But how do you say "Here is the account object you should act on later when the action is invoked with an int"?
Is it something simple like Action<int> lol = x.deposit;?
 
essentially
 
Is that the exact syntax?
 
user1804599
9:31 PM
BuildCraft is really nice.
 
user1804599
I wish it were there for 1.8.
 
user1804599
Might be there for 1.9 again.
 
From a quick google search here's a good example

public Func<float, float> QuadraticFunctionMake(float a, float b, float c) {
return x => a * x * x + b * x + c;
}
 
That's just a lambda. That's trivial.
 
lol, maybe I'm misunderstanding the question
one sec
 
9:34 PM
Adder add5 = new Adder(5);
AddDelegate d = new AddDelegate(add5.Add);
Okay so object.method seems to be indeed the syntax.
 
Account a = new Account();
Action<int> test = x => a.Deposit(x);
test(5);
 
Again, the second line is a lambda.
 
if Deposit returns a string:
Account a = new Account();
Func<String, int> test = x => a.Deposit(x);
String result = test(5);
 
Perhaps that's simply how it's done these days.
 
right, lambdas everywhere haha
there's other ways to do it, but I haven't done it any other way in a really long time
 
9:36 PM
is using file extensions like:
workorderno.measuring
workorderno.measured
ona windows box a bad idea?
 
Action<int> test = new Delegate(a.Deposit);   // I guess this is the old syntax
@JohanLarsson Can you confirm my C# delegate guesses?
 
I believe you're right
 
@fredoverflow maybe, what is the q?
 
"How do I bind a method to an object?"
 
shrug, i can't read high CS
 
9:38 PM
@fredoverflow there is no new delegate syntax (lambdas are lambdas)
 
Delegates predate lambdas by a long shot.
 
But I believe the use of method group (a.Deposit) is C# 3+
 
C# lambdas generate anonymous delegates behind the scenes.
 
But delegates could do complete anonymous inline functions earlier right. Damn. I don't retain any historical info
 
Huh. It'd be interesting if I could use a PCI-E card on MXM.
 
9:39 PM
Also, implicit conversion of method group to delegate exists since C# 3
 
I wonder if their pinouts are compatible.
 
I thought delegates were typically used to define a method signature that you want to be used?

public delegate void Del(string message);

Del myDelegate = x.SomeMethodThatFollowsTheDelegateSignature;
 
why are votes on reddit posts always fluctuating?
 
@AndyProwl To ward off voting bots
 
it's as if there was a random delta added every time to the actual score
 
9:41 PM
Yeah, there is.
 
@AndyProwl votebot mafia
 
@RobertPetz Delegates are essentially function pointers, yes.
 
@AndyProwl Voting bots are shadowbanned so the vote count is randomized to prevent a watcher account to detect the shadowbanning
 
I've no idea what you guys are talking about
 
:)
 
9:42 PM
I feel like my father when I try to explain him computer stuff
what's shadowbanning?
 
Okay. What
 
Voting bots on reddit aren't blocked; instead they're told their votes are taken into account but they're not
 
The key difference is that a delegate to an instance method can also contain an object to use as the this parameter` (the reflection API even calls it the "first parameter")
 
@AndyProwl You're banned, but you don't know that, IIRC
 
@AndyProwl you don't let the bannee know
 
9:43 PM
@sehe Standard issue call for help from someone in a burnout.
 
Because of this some voting bots had a "friend" bot that would detect if the vote count would change or not; if it wouldn't then they'd knew they were shadowbanned and would create a new account
 
@EtiennedeMartel It's eev.ee
 
To prevent the watcher bots, they randomize the vote count
 
Is this really the first time Vlad has hit the repcap?
-11
Q: Recent achievments are not updated

Vlad from MoscowI found out today (and sometimes I saw this in other days) that my recent achievments are not updated. For example I answered two questions and they were up-voted three times in total. However nothing is shown if to press button recent achievments and of course the reputation was not even changed...

 
@sehe That's a pokémon and also someone I don't know about.
 
9:44 PM
@sehe I wish I could
 
He's quite famous. I believe
 
@Mr.kbok I'm starting to understand
 
She?
Wrote the "PHP: Fractal of bad design" article
Also has an ugly cat and posts photos of it on twitter
 
He. I'm p. sure
 
> Send me a F#ckFriends request so we can hook up

My usename is PamelaFromBehind
> My profile is here. TALK S00N
> S00N
 
9:46 PM
You're getting repetitive
 
Miserable attempt at leetspeech is miserable
 
@Columbo They know your weak spot
 
@sehe You're getting repepepetitititive
 
sexy leet speech
 
@Columbo Talk S0N would have been more appropriate
 
9:47 PM
... leech spit?
 
ew
 
@sehe p sure it's unclear :)
 
Oh. That way
 
@sehe They should be sending me "You want some mature, juicy template diagnostics? My username is bstroustrup. TALK S00N"
Then I'd consider clicking on it
 
Baby, let me click on it iiii-it, let me click on it, iiii-it
 
9:51 PM
@Columbo I wonder if I could photoshop that.
Or rather GIMP it.
 
I can only discern "Paradise by the meatloaf"
 
@Nooble Y NOT SP00F MA1L
@Columbo Wanna swap my appointment at 9:20 with the optometrist?
 
@sehe Sorry, I'm writing an exam around that time
But any other one I'd be willing to consider
(Given that it doesn't intervene with something I planned...)
 
Meh. So guarded
 
9:53 PM
@sehe In fact, I got something to do on every day of my life, so fuck your optometrist, and fuck him right
 
@Mysticial Well, you won't earn that much acting as a rep-whore. Just panic accepts, and some blind upvotes for answers on questions that more likely should be closed as OT.
 
Cuz my eyes are working stupendously well.
 
@Columbo Luckily you got the gender pronoun wrong.
Well. At least on paper
 
@sehe For real though, what do you mean?
It's a woman?
 
I have an appointment with the eye-doctor and it seems you might need one too
3 mins ago, by Columbo
I can only discern "Paradise by the meatloaf"
 
9:56 PM
@sehe I only see what I want to see, not my eyes fault
I want a... paradise by the meatloaf, I guess
 
I don't blame your eyes for not facing that horribul truth
 
@sehe What truth? I'm telling you, not only is Jesus our lord and savior, the meatloaf paradise is real and can be found! But you have to believe!
 
At least on paper??
 
@fredo did you get an answer? Ask Reed in C# if not, he knows all things.
 
Oh. It's your first appointment.
Man the sleuthing that discussing here requires
 
9:58 PM
@Mr.kbok That, and it's a large department. Replacements happen in case of absense/emergencies
 
@sehe Don't be surprised if I turn up at your doorstep to talk to you as a meatloaf's witness.
 
lol
23:59am. Quick, the standby butan
 
@πάνταῥεῖ Looks like it's not his first time, but it's the first time he's noticed it since the votes came in masse.
 
I'm at 33% CPU Usage.
 
Ell
10:19 PM
First exam tomorrow
Physics g485
 
hey guys! do you know how to delete all breakpoints in gdb
 
@Ell Good luck.
@ShivanshuGoyal Use delete.
 
Yeah, if you do "delete breakpoint <n>", then it deletes the nth breakpoint. But I guess there's no convenience command which deletes all breakpoints
 
Just delete.
No arguments.
 
Oh hahaha that did work! Never tried that command by itself :p
Thank you!
 
10:33 PM
No problem.
 
@Nooble Hi
Whoops didn't mean to ping
 
@VermillionAzure Hi.
 
Welp I think I can actually get started on my real job today
 
Which is?
 
I feel good having direction
Develop a single cell RNA sequencing data analysis workflow
Translation: take counts of data, normalize, transform, make pretty graphs, work with CSV files and R and maybe a web api
Why are problems reducing problems to smaller problems
 
10:41 PM
DDS by MS in Github: https://github.com/Microsoft/DirectXTex Whoa!
 
Oooh DDS. Isn't that that optimized-for-the-gpu texture format?
 
Ell
@Nooble thanks
Did you say it was the fury that'd cost $400 BTW?
 
@sehe This is almost garbage-level blogspam. Have you become a game developer?
 
@LucDanton I take offense to this :(
 
@Ell Sadly not. It's the R9-390X that costs $389.99.
Which is weird because the R9-290X cost $549.99 on launch.
 
10:47 PM
I took a pause from studying today
mainly because I only got 1 hr of sleep
and I really want a beer
 
I need a new avatar =/
 
@Borgleader You could be a koala like me.
 
I've yet to find an avatar to use for a long time :<
best I had lasted me some 3 months or so
man this is good
 
Ell
I wonder how much the fury will cost
 
10:51 PM
Hanlon's razor applied to Internet discussions: Never attribute to trolling that which is adequately explained by stupidity.
 
Xeo
Hot damn the UE4.8 release notes
that was long as fuck
 
In unrelated news, I hate my work keyboard.
 
silva and ursus are the best dark beers around here, yum
 
Xeo
In related news, your keyboard hates you.
 
silva is slightly sweet, ursus tastes like burnt wood
I like the latter the most
@Nooble what was that about amd?
 
10:53 PM
@EtiennedeMartel Or better yet, stop differentiating between the two
 
nvidia has the 980 Ti now
 
@CatPlusPlus Good point.
 
it's not cheap
but it's basically a Titan X for a lot cheaper
 
Reminds me of something that roughly went as: if you're ironically being an asshole, you probably are for real.
 
some 2 months after titan x
 
10:54 PM
I need that image with the guy pretending to be retarded stylised like ancient Greek thing
ONE THING ON INTERNET I CANT FIND
 
evening
 
> In a traditional furniture workshop, you would have a work table for the person who works with wood, another one for the one who works with metal pieces, and maybe a third one for the guy who mounts all the pieces together. In FreeCAD, the same concept applies.
then proceeds to show me a list of a billion work things
workbenches yea
 

« first day (1698 days earlier)      last day (3264 days later) »