« first day (983 days earlier)      last day (4191 days later) » 

15:00
@DeadMG I'm not gonna star that.
It's too obvious.
Copy(fun) {
    return ForEach(function(val)[fun := std.move(fun)] { fun(val); });
}
/headdesk
@DeadMG Copy that fun
@DeadMG Were you not a moron, you would have noticed that you are a complete moron a long time ago.
copyable fun
hmmm
time to delete that file
@R.MartinhoFernandes The irony is staggering, yes.
15:00
@R.MartinhoFernandes Is that an oxymoron?
Xeo
Xeo
@DeadMG wat
damn I'm hungry
@not-TonyTheLion No, just a regular carbon-based moron. Oxygen-based morons are special.
5
@R.MartinhoFernandes You've been waiting to use that pun, weren't you?
15:02
@Xeo Yeah. You may notice, of course, that Copy(f) is identical to ForEach(f).
@Telkitty猫咪咪 :cripes: don't quote PHP troll crap here tia
@R.MartinhoFernandes It's all very well using a system scheduler for something like that until you actually try to use a system scheduler, for instance, you may want to flush internal data and close the files before the copy to prevent slicing, so you need notification from the scheduler.
@R.MartinhoFernandes haahahahahahahahahaahahahah
I broke my optional. It appears not default-constructible.
@not-TonyTheLion That would be funny if the manifold on Anne's car was not cracked. I gotta get it welded up :((
15:05
> When I was a kid I asked my uncle: "Why did Freddie Mercury die?". With a serious face he answered: "For being with too many men". After that I thought that being with too many men in a room would kill you, so whenever there were more than 5 guys in the room with me, I would always leave.
lol
Testosterone overdose.
@Griwes Won't confirm nor deny.
..also front offside wheel bearing is grumbling. The soddin' bearing is a complete hub sub-assembly with an ABS sensor, so £80 :((
WOAH
Google implemented payment sandbox.
@MartinJames I'm probably going to end up paying upwards to £150 to get some paint damage fixed on my car. Damn stones
Xeo
Xeo
15:08
@CatPlusPlus What?
@R.MartinhoFernandes The ones that you drive over and sometimes end up hitting parts of your car and sometimes damage the paintwork of your car as a consequence
@MartinJames ABS is really neat, until you have to fix it.
@not-TonyTheLion No fun. I don't suffer much from stone chips, I collect nails in tyres instead.
@not-TonyTheLion Meh, paint is not a functional part anyway.
@Xeo For their mobile in-app purchase system. Few months ago the only option was to test with real cards.
15:09
@CatPlusPlus lol
Xeo
Xeo
@CatPlusPlus ooh, nice?
@MartinJames oh, I guess each has their own sufferings
@CatPlusPlus How fucking ridiculous is that?
Xeo
Xeo
Or rather, finally?
WTF
How the fuck did they test it?
15:09
They even had "ignore transactions made by testers when you check the billing" or something like that in recommendations.
@R.MartinhoFernandes this is true, but I'd like to keep my car for quite a while, and keep it in good condition, potential for rust build up should be avoided
so I'm willing to spend money to keep it maintained.
@R.MartinhoFernandes It's simple, you just have to reverse the transactions after testing :laugh:
@not-TonyTheLion Get some duct tape on it :P
@CatPlusPlus facepalm.
15:10
@R.MartinhoFernandes Last wheel bearing I changed cost £2.75 from a trade shop - it was a bog-standard tapered roller used in industry everywhere. Now I had to buy this big chunk of machinery/electronics instead.
@CatPlusPlus This industry never stops embarrassing me.
Ell
Ell
gah. Why do all three of my usb to microsub fail!? :'(
Does anyone know of a brand which I can buy with assured quality?
which brand did you have before?
sure
you can buy Puppy™ brand
it's only £1,000 or thereabouts
Ell
Ell
15:13
Sure
I'm sure your parents won't notice if you use their credit card
Ell
Ell
Oh wait. I only have £250 to spend :/
I'll mail it to you in the post sometime
Ell
Ell
@Aboutblank asus
@MartinJames I changed a bunch of bearings before, but I don't think I ever saw one with the ABS electronics attached, actually.
15:14
what even is ABS
@DeadMG gold plated cables of course
@Ell There are brands?
@DeadMG Anti-lock braking system.
s/ea/a/
Ell
Ell
@R.MartinhoFernandes I don't even know, I just need one which doesn't keep falling out or has reliable connection
15:14
breaking is to smash something; braking is to slow down.
It's a rather ubiquitous car brake system that prevents wheels from blocking when you hit the pedal (i.e. you brake a bit less, but can still steer while doing so).
@R.MartinhoFernandes 'Fiat'. The car industry byword for reliability... (not).
ITT Puppy is clueless when it comes to cars.
Fiat ... you can never be sure whether it is 'Fit' or 'Fat'
15:16
FYI @DeadMG cars have 4 wheels :P
@Telkitty猫咪咪 Its a mix
@not-TonyTheLion Not all of them.
Fittingly fat.
Ell
Ell
I'm glad I got comfortable with debuggers
they are so useful
15:19
It's also some kind of plastic that is used to hurt feet everywhere.
Lego are made of ABS.
hmmmm
my website design sucks
Xeo
Xeo
haha
15:20
oh well
Hehe. OK, plastic.
lol
I don't think I stepped on much Lego in my time.
I was quite the Lego fan when I was young.
@not-TonyTheLion Don't start now:)
Lego is the awesomes.
@not-TonyTheLion It can still happen. Just walk into the den of a child playing with them.
Ell
Ell
15:21
I was a K'nex fan
K'nex was cool too.
@R.MartinhoFernandes True. Luckily I don't have kids in my vicinity
@not-TonyTheLion There is Lego film out, or in production.
Ell
Ell
I won county young engineer when I was a wee kiddy. I was meant to go onto the next level but shcool wouldn't let me :'(
Talking about kids, someone told me I'd be a good father.
K'nex was actually awesome.
15:22
@not-TonyTheLion Would laughing be appropriate?
Ell
Ell
okay scratch what I said about debugger, my ruby debugger just exited when it encountered an exception :£
@R.MartinhoFernandes Erm... Not sure.
My reaction was: meh
@Ell fail
@not-TonyTheLion if it was from an intelligent hot chick I suggest you to propose to her immediately!
@R.MartinhoFernandes I gotta admit, I laughed.
15:24
Oh I see how it is.
You guys think I would suck as a father?
I can just imagine it now
table flip Enough internet for today.
@not-TonyTheLion No, not at all! I was just wondering if thinking so would be appropriate.
baby: "I'm hungry, scream and cry for food!" Tony: "Duuuude, that cat image is so funny! Must browse moar reddit!"
3
That really wasn't as funny as I had imagined.
@R.MartinhoFernandes oh
@DeadMG Now that's crossing many lines I'd never cross.
15:26
yeah
optional_base();
optional_base(none_t = none);
// spot the error
its optional
@R.MartinhoFernandes Ambiguous overload. Both constructors are valid for optional().
Xeo
Xeo
@R.MartinhoFernandes haha
@DeadMG Dunno... it got two stars.
15:30
@MartinJames Not that, but the edit of the thing you linked to
0
Q: How to determine how much time has passed without a timer?

user2462027I'm trying to make a program that rotates and draws a bitmap 360 degrees over exactly 10 seconds , but I've found that the method I'm using to do this is not instant or even close, so my function will not execute within the expected time. To compensate for this I decided to determine how much tim...

wait, wut?
lol
he wants the time by magic
std::magic(time);
USB really needs to stop labeling everything Type-A or Type-B
USA and USB
10
Obama has both
0
Q: Multiplying character arrays like an array of integers

Matt2234What I am thinking about doing is combining character arrays. Lets say I have two arrays. char A[3] = {'a', 'e', 'i'}; char B[3] = {'c', 'f', 's'}; Id want to perform an operation such that A * B = AB A loop such as for(int i =0;A.[length]<3;i++) { A[i] = A[i] * B[i]; } work for int...

@not-TonyTheLion United States of Bullshit?
15:33
@R.MartinhoFernandes Could be
Someone has answered it!
Hmm
what is the effect of fork() on C++ resources?
@MartinJames and failed
@MartinJames And crashed and burned.
@not-TonyTheLion Yeah - I noticed :)
15:35
are constructors on all objects called again or not? Coliru disagrees with my own system
@KonradRudolph What?
fork knows no objects.
It copies the address space.
> A.[length]
LOL
fork creates a new process being the child of the current one
so the whole thing starts over
fork it
@R.MartinhoFernandes That’s what I thought … but on Coliru the child process apparently runs object constructors again
@not-TonyTheLion No, it does not. It continues exactly where you are.
15:36
@KonradRudolph It's a system library call, with all that that entails.
@KonradRudolph Can I see the program?
@R.MartinhoFernandes hmmm. I didn't know that.
Note the second “Setting up important resource”!
… which is actually even in the ’rong order!
on my own computer the constructor is only called once, as I’d expect
@KonradRudolph My guess is the optimiser messing up with yeh and moving the initialisation after the fork.
15:38
hmm … okay, legit
… although it happens even with -O0
Hmm, yeah, just noticed.
@R.MartinhoFernandes IDK if optimizers will treat fork as a special case- because that's certainly not legal for some arbitrary function with unknown body.
Either way I don’t think using fork() in C++ code is a sane idea
@KonradRudolph I don't think it'll be a problem (at least, any more than in C).
C programs have invariants too, even if they don't explicitly have constructors.
considering that the address spaces are identical, I don't see how an object which was valid in the parent could not be valid in the child (unless you're in an area which is bad for both C and C++, someshit to do with mutexes?)
@DeadMG Well the code I posted clearly demonstrates that it is a problem. In C with explicit resource management you can at least work around this issue, with RAII you cannot
15:41
@KonradRudolph What issue? Your code doesn't demonstrate any issue.
user142019
Boo.
@DeadMG Erm, it double-deletes an object
Something's definitely wrong here.
@KonradRudolph It does not?
It deletes two objects.
@KonradRudolph There are two valid objects. Being deleted twice is what should happen.
15:42
@DeadMG Erm, yes, it does. It calls the ctor twice.
@R.MartinhoFernandes It does, it calls the destructor in the child before constructing an object in the child
wait, let’s annotate these bitches
@KonradRudolph How do you know that?
well I’m inferring from the order of execution but if that’s screwed up I could be wrong
but no matter because on my computer it definitely double-deletes
wait, stop
it doesn’t double-delete
also
preferably a sample without global variables because I tend to have exceptionally little sympathy for global-dependent code
user142019
> It doesn't work on my machine!
15:43
what I mean is that it runs a destructor on identical (but not the same) objects twice, which may be dangerous if the destructor attempts to handle the same non-memory resource
user1182183
hey guys which open source copyright notice is the best if I want someone to be able to make closed source application but if the program uses my code the programmer MUST give me credit?
@DeadMG The global was to make sure it was initialised before main as required.
'on my computer it definitely double-deletes
wait, stop
it doesn’t double-delete' Make you mind up!
@GamErix Ask a lawyer.
user1182183
-,-'
15:44
@KonradRudolph Btw using std::cerr for that kind of examples might be less confusing.
user1182183
It's not a contract, it's a license ;>
@KonradRudolph Isn't it the job of the OS to handle some reference-counting dealie for OS objects that are duplicated in a fork()?
but also, again, I don't see how this is any different to fork() in C.
@KonradRudolph fds get duped, for example.
@DeadMG Yeah, TBH, fork() has always been a bit 'off' to me.
@R.MartinhoFernandes Yes, but they are an explicit special case!
15:45
Other resources you have to deal explicitly with in C as well.
So I see no issue.
in which case, I would accept that "fork() is a dumb idea", not that "fork() in C++ is dumb (and therefore implicitly there is some language in which it is not dumb exists)"
(You just need to set up the right ownership policy)
Threads are also an explicit special case.
user142019
Indent your code. This isn't the C# room.
15:45
Coliru bitch.
@KonradRudolph Urgh.
I wouldn't expect you of all people to dump a wall of code here.
user142019
Shall I go to Lelystad instead of to school.
@KonradRudolph Is exactly the intended and correct output. Since all resources are duped, then they need to be destructed in both parent and child.
15:47
@DeadMG It is a different output than just before
@DeadMG If they do not, it's easy to deal with in C. Is the point I think.
Yep, correct.
Totally correct.
Your test case sucks.
@EtiennedeMartel …
@R.MartinhoFernandes Why?
@LucDanton That would be a completely different argument to what I understood previously (and also, would require a completely different sample to show)
15:48
@KonradRudolph The child prints "I'm a parent" (which is likely to have completely thrown you off before and generated all your apparent confusion).
ah true :p
7 mins ago, by Konrad Rudolph
@DeadMG Well the code I posted clearly demonstrates that it is a problem. In C with explicit resource management you can at least work around this issue, with RAII you cannot
'can work around' indeed.
@R.MartinhoFernandes Maybe running the sample gives different results on each run, but for me, the same process that constructed the resource the first time also gives "I'm a parent", which to me suggests otherwise.
@LucDanton Granted, you can. But I’m assuming that there are classes in libraries out there which are not explicitly programmed to do so, and you cannot solve this without modifying those
I'm not swayed either way by the example and argument because I have no idea how often those resources arise in practice and because I'm eating a delicious sandwich.
15:50
@KonradRudolph This is absolutely no different to calling a C type's pseudo-destructor function.
@KonradRudolph No I meant in C.
frankly, for fork(), if it can't make a "perfect" copy, then I don't see any justification for using it- it's always gonna be unsafe.
@DeadMG But since in C you call them manually anyway, you can just opt not to do so, in the child process
I'm now totally confused by the whole issue. The OS does not know about copy ctors, so how can it dupe the objects?
@DeadMG You mean in my code? Yes, I fixed it.
15:51
Oh fork off :)
@KonradRudolph So simply wrap them in a struct that can tell you whether or not to do it. This is no different to any other "Move explicit logic into destructors" job.
user142019
struct resource resource;
acquire_resource(&resource);
if (fork() == 0) {
    /* child stuff */
} else {
    release_resource(&resource);
}
user142019
This is what he means by that it's easier to deal with in C.
@MartinJames The whole program is 'copied', so to speak.
I.e. it's not piece by piece.
@MartinJames It copies the address space. memcpy, so to speak.
user142019
15:52
(Ignoring fork() returning -1 for brevity.)
@R.MartinhoFernandes No, I checked your latest link. The same process constructs the resource as says "I'm a parent".
@DeadMG unique_ptr + release as the first op in the child, I guess.
@DeadMG Which is expected.
@R.MartinhoFernandes Right, but how does that mean that the child prints "I'm a parent"? It would seem to clearly indicate to me that the parent prints "I'm a parent".
@R.MartinhoFernandes I understand the COW thing, but the more I think about fork(), the less I understand how it coudl work safely at all.
@DeadMG In Konrad's code, which is not the same as I posted, it did. I swapped the messages around in the ifs.
15:53
oh right.
@MartinJames // deeper magic
@MartinJames It works fine if your objects are completely "contained" inside your program.
My head hurts. Is it beer o'clock yet?
it's food-o-clock for me in a minute
user142019
It's current hour o'clock.
15:56
In that case, both your objects and whatever resource they hold get copied.
But if the objects have some part, say, across the network, you will have two objects holding the same resource, because fork won't fork the remote resource.
Ok, food first. Maybe a cheese sandwich, (oh yes, I have no bananas), with a beer. Might distract me from the thought of sticking a fork into my head.
user142019
dirtwich
MB vs MiB going on in std-proposals.
user142019
Sounds fun.

« first day (983 days earlier)      last day (4191 days later) »