« first day (1100 days earlier)      last day (3841 days later) » 

2:00 PM
-2
Q: How to generate an object in C++?

Hassan KansoI'm thinking in that thing in the first time I wrote a code,that how we can create an object (from a class) with a button and take a full control on it, like in the game engine when we click "add object" then we can change his x,y,z value ,give him a name and add subObject to it (full control).my...

 
    create a new box;  //the new box has been born :D
    give him a name ;  //and we give him a name !
This is worse ;D
 
@BartoszKP Well. The same goes if you precede the speaking with the summary slide
 
I was bored:
 
gesamtprice?
 
2:13 PM
Mehrwert Steuer? Some german words can be pretty
 
today's price? sale price? price after tax?
 
total (gesamt: together)
 
You're doing him a disservice by showing how to do C++ like it's 1997. — Etienne de Martel 1 min ago
 
ok
 
€336.01 is what I would have to pay. It includes €53.65 tax.
 
2:15 PM
Just noticed he linked to cplusplus.com's tutorial.
 
quick, vote to delete.
 
Quick, give me 5k so I can vote to delete
 
@MohammadAliBaydoun You are gonna need more for answers.
 
2:35 PM
0
Q: Function pointer argument list in a class

RobertEagleI have a class called A which looks like this: class A { protected: typedef bool(*fp)(); public: virtual void back(fp succesor,fp valid,fp solutie,fp show); // this function is defined in the .cpp }; and a class B derived from A which looks like this: class B : public A { public: ...

Whenever I see questions about function pointers, I just tell people to use std::function.
How bad could the speed difference be anyway?
 
surprisingly bad answer by KerrekSB.
I thought he was a Good Guy™?
 
Xeo
@DeadMG Huh, I think he's also invoking UB
 
@Xeo Not in the sample code, but it would be pretty trivial to change it so that it was.
 
Xeo
@DeadMG He's invoking a PTMF with the wrong type
 
legal if it's a base type.
 
Xeo
2:44 PM
Why would it be? The base even has virtual functions. The data members may all be jumbled up
 
@erenon I'm not sure I know what you mean. I challenge you to come up with correct code for managing the memory allocations in your sample class. (See my own answer, for contrast) — sehe 15 secs ago
Someone believes that manual memory management in a tree data structure can be "trivial"
 
Xeo
I think what you mean is that for struct X{ void f(); }; struct Y : X{}; , &Y::foo is void (X::*)()
 
@sehe Dear God your solution is beautiful
 
Xeo
@RobertEagle: please be aware that this solution invokes undefined behavior. In order to be able to come up with other options, it is abssolutely necessary to know what I have aasked you in the other thread. — n.m. 20 secs ago
haha
 
@MohammadAliBaydoun Is it. I think variants are extremely versatile/useful. However, I didn't actually read very closely into the OP's question (octrees might be something else entirely?)
 
user1804599
2:49 PM
Yay.
 
user1804599
I have my xkcd shirt.
 
You're officially cool now. You're free to go.
 
@sehe I think he's doing binary space partitioning for 3D models
He's trying to achieve something like this
Where each cube has 8 child cubes
 
@MohammadAliBaydoun Yeah, I'm vaguely aware of this area. So I don't have a clue whether my idea suits his area (though, with proper allocators, it could be made to, no doubt)
 
He just has to define what part of the cube each child index represents :P
 
2:55 PM
@sehe Think there is some misunderstanding here, but I'm not sure if it's worth to continue on this topic :) If you do blackout style - then the focus is clear - either the audience listens to you, and there is no slide, or you show a slide and help them read it, as a summary of what you've just said. If you don't do blackout's then you somehow combine these two, aiming to gain attention on important points, and keeping slides not crowded
@not-rightfold Cool! I've recently got my "programming motherfucker" shirt :D
 
user1804599
“Do you speak programming?” :V
 
@BartoszKP I got that. I'm not so sure that looking at 'mental cues' from a local slide view was somehow worse than looking at the same slide the audience is seeing
 
@sehe Good point. But in the second scenario you've already said the important things with the audience being focused on you, and there is no need for such attention when the slide is on. In the first scenario, if you know how to do it well it's OK. But I saw many terrible presentations when people just tend to forget about the audience, and just look at their laptop all the time : )
@not-rightfold yea I know : D
 
user1804599
That makes no sense.
 
user1804599
You can’t speak an activity.
 
3:00 PM
@not-rightfold which one have you got?
@not-rightfold yea I know : D
 
@not-rightfold good choice! : D
 
Hey!
I want to be cool too ;_;
 
I've just ate a whole box of cookies, I'm not feeling well ... :#
@MohammadAliBaydoun Invent some cool rule, rule of 0, 3 and 5 are taken, other numbers are waiting for you!
 
Rule of -1!
Or maybe I should invent a Buzzword
Generic Entity Component Composition Interaction System
 
3:10 PM
Buzzwords! That'll be great! Consider fuzzy roughness, or rough fuzziness. Fuzzy sets and rough sets are buzzwords since like 10 years ago!
 
user1804599
The rule of π.
 
:D Rule of n: for any natural number n, there existed, exists, will exist or could exist a "rule of x" with x = n
 
I have to write move constructors anyway. Fucking VS2012 :<
I'm upgrading to Windows 7 SP1 just so I can finally install VS2013
 
user1804599
It declares a const non-static member function on mystery that takes a mystery const& and returns a mystery&. — not-rightfold 53 secs ago
 
user1804599
It’s a mystery.
 
3:16 PM
:DD
 
sry taken :F
 
I don't even know Regex
Nor am I driven to
 
The linux one seems cooler
Someone declaring that he knows regex as it was some great achievement is like someone being proud of knowing how to use a shovel ;0
 
jerry has an badge. Now thats rare.
 
3:23 PM
@BartoszKP Well, I know how to use a spork!
 
@MohammadAliBaydoun lol, I want a spork!!!!!!!!!!!!!!!
 
user1804599
 
@Mysticial Could you please look at Why does gcc generate 15-20% faster code if I optimize for SIZE instead of speed? Based on your answer here, I believe you would be able to answer my question as well. Many thanks! — Ali 7 mins ago
^^ I'm popular
3
 
See @MohammadAliBaydoun ? That's being cool!
Robert Downey is cool: youtube.com/watch?v=jy2-B4Wl8WI ;00
 
@BartoszKP whoah
 
3:33 PM
@GamesBrainiac Yeah, at first I thought it was playback ;0
 
@BartoszKP I hear he does gungnam style too :P
 
@GamesBrainiac lol, youtube.com/watch?v=GrQ5hzqMPRQ , but not as cool as singing : )
 
3:50 PM
@Mysticial nice to hear your ram works. For me the timings with or without xmp-profile are nearly the same, so it works both ways.
 
@Darklighter Yeah. The SPD information itself wasn't really that useful. But I looked up the exact model I had and found out what timings I needed to run at 1866.
And they were, well... significantly higher than what the BIOS tried to do. :)
 
@Mysticial ^^
 
I don't particularly care too much about ram timings as long as they work. I try to write my code to be tolerant to high latency memory.
So in that respect, slower memory actually makes be write better code. :)
 
4:17 PM
user image
2
Read the bit under the photo.
 
4:33 PM
@EtiennedeMartel lol nice
 
user1804599
The global warming hype is hilarious.
 
ffs I have been taking an alternative route to work because the shortest one is interrupted by construction work. And now... my alternate route is also godfuckingdamn interrupted.
bye
just came here to say that I'm going away
 
user1804599
How about going to your old workplace?
 
4:50 PM
I really dislike Upworthy and their baiting.
Their videos are all like "Click this for something that'll blow your mind!"
It's like those "Lost weight with one simple trick" ads.
 
I don't actually go to that site, it was a link I saw on FB from a guy I went to Uni with.
Anyway, I thought his argument was interesting.
 
Also, isn't that like Pascal's Wager?
 
user1804599
If God exists, he’s a total asshole.
 
@not-rightfold Nah, he just doesn't give a shit about you :P
 
user1804599
Hence ~.
 
5:00 PM
@not-rightfold Why should he give a damn? :P
 
@EtiennedeMartel Sounds similar yes, but applied to global warming
 
user1804599
Just stop farting and we’ll be fine.
 
Apparently we can count to 17.
 
5:23 PM
I could buy a new server with that much money.
 
I could buy a whole nation with those money. Oh wait...
 
I could buy all the mexican food I want with that money.
 
5:39 PM
You'd run out of things to buy before you'd run out of money
2
 
user1804599
I would invest in antimatter creation and conservation research and make an antimatter bomb.
 
user1804599
Or I would invest in rotatable panels to cover the globe with, and then have people give me money and blowjobs if they want sunlight.
 
user1804599
I wonder what “biljoen” is in English.
 
user1804599
It’s not “billion;” that’s “miljard.”
 
5:49 PM
yeah
 
I would invest in Scott
 
There are two scales in English
 
NL: miljoen, miljard, triljoen, triljard
EN: million, billion, trillion, quadrillion
 
The long and short scales are two of several different large-number naming systems used throughout the world for integer powers of ten. The names are from the English translation of the French terms échelle longue and échelle courte. Many countries, including most in continental Europe, use the long scale whereas most English-speaking countries and Arabic-speaking countries use the short scale. In all such countries, the number names are translated into the local language, but retain a name similarity due to shared etymology. Some languages, particularly in East Asia and South Asia, have l...
 
We say milliard for billion in Arabic as well :o
Except I don't follow that system.
Also,
After 8 hours ;_;
I'm so happy right now
 
5:54 PM
Now click cancel.
 
user1804599
@StackedCrooked Je bent biljoen vergeten, dwaas.
 
lol
I'm dwaas.
 
mysical has been on SO for only 2 years.
dayyum.
 
user1804599
NL: Miljoen, miljard, biljoen, biljard, triljoen, triljard.
EN: Million, billion, trillion, quadrillion, quintillion, sextillion.
 
Quick question, is this a function pointer declaration: int (*px1)[4]
If not, why is this codepad.org/NfFwLyjD fucking up?
 
user1804599
5:58 PM
@LewsTherin It’s a pointer to an array of four ints.
 
@ScottW yeah, dogs don't need much sleep
 
@ScottW Penny for your thoughts? Whats keeping you up all night?
 
@LightnessRacesinOrbit It's shorter and faster than writing position = Vec2D(x, y); within the method. It's how I've been thought to call them at school. — Broxzier 1 min ago
^ Oh dear...
 
@not-rightfold Yeah that's what I thought. So why is the code fucking up ? It is printing an address after dereferencing
 
@MohammadAliBaydoun Haha loser. I can download 1.9GB in 4 minutes.
 
user1804599
6:00 PM
@LewsTherin well, you’re dereferencing a pointer to an array.
 
@LewsTherin What else did you expect %p to do?
Also, the address of the first element of an array has the same value as the address of the array itself...
 
@LightnessRacesinOrbit Because %d didn't work. I figured %p may work
 
So I don't see why any of this should be a surprise
@LewsTherin So, you're just wildly guessing and flailing about?
 
@LightnessRacesinOrbit I'm messing with it yes.
 
> Dogs need about 10 to 15 hours of sleep per day. They have a much higher metabolism than humans do and therefore need more sleep than we do. Most of the time dogs sleep very lightly and can come fully awake suddenly.
 
6:01 PM
I just press random butans until stuff happens
 
I won't say guessing exactly. More like experimenting.
@not-rightfold Sorry you are correct lol
Brainfart
 
@LightnessRacesinOrbit Hey man! :D Hows life?
 
@GamesBrainiac You're a very curious person
 
Also downvote for recommending tabs
 
@LightnessRacesinOrbit I'll take that as slightly cranky but hanging on.
 
6:04 PM
What completely unhealthy food shall I order today
 
@CatPlusPlus Cat food.
lol, that was so cliche.
 
@CatPlusPlus French fries with mayonnaise.
 
user1804599
 
@LightnessRacesinOrbit :<
 
I haggis tasty?
 
6:15 PM
@StackedCrooked After 10 Highland Park, yes.
 
whiskey?
 
No, whisky. It is generally accepted that Tennessee distilled spirit has the 'e'.
 
7:00 PM
What are you to do to break out of a double foreach?
 
user1804599
goto.
 
Why do you have a double foreach
 
user1804599
return.
 
And why do you need to break out of it
 
Just a hypothetical.
Or, a foreach at the bottom.
What is on top doesn't really matter.
 
7:02 PM
Hypothetical what
 
Wrap the inner for in a function and return when you want to stop
 
^
> What are you to do
What does that mean?
 
Or maybe restructure the conditions
It's impossible to give you a solution to a problem that doesn't even exist
 
user1804599
Just use goto jesus.
 
goto jesus;
 
7:07 PM
No, understand what the fuck you're doing and how the stupid loop solves the issue
Where is my food dammit
 
Well then.
@Jefffrey I didn't make that phrase up :\
 
It's a valid phrase~
 
@Pawnguy7 Yes, you did.
 
I make up words, not phrases :D
 
It's probably just a handle.
 
user1804599
putStr $ "\x1B[0;" ++ intercalate ";" (map attr attrs) ++ "m"
 
user1804599
Haskell is really nice.
 
@Jefffrey Got to admit, that has bugged me a bit too. I think it is fairly light, though.
 
@Pawnguy7 Yeah, I was browsing the same file.
Those mutables worry me.
 
7:28 PM
I have no idea what mutable does :D
 
It's an hint to the compiler that says "Hei, this memory allocation can be modified by someone else other than this program".
 
No, it's not a hint
It allows you to modify these variables even in const-qualified objects
What you're thinking of is volatile
 
Oh. Right.
 
And even then it's not really about other programs modifying your memory, because you can't really do anything about that
Compiler hint in general is something that compiler can happily ignore
 
If you write int x; and you don't use it in the program, the compiler might ignore that variable and don't even allocate space for it. If you say volatile int x;, that variable is gonna be allocated even if not used by the program. (because maybe you want to write to it with something else, god only knows why).
Isn't that right? inb4 no.
 
user1804599
7:33 PM
No wtf.
 
user1804599
Here is an example of mutable:
 
mutable exists in a context where you cannot not allocate space for variables
 
Fuck, I meant volatile.
I should sleep more.
 
user1804599
class some_giant_immutable_object {
    public: int get_hash() const {
        if (!cached_hash) cached_hash = expensive_hash_calculation();
        return cached_hash;
    }
    private: mutable boost::optional<int> cached_hash;
};
 
You are bad for the mind.
 
user1804599
7:37 PM
Lack of masturbation is mad for the mind.
 
user1804599
Speaking of Converse, I need new shoes.
 
Alrighty then. Time to party. See you all in few hours.
 
@ScottW oh baby, I need some love
 
user1804599
@ScottW Heroin-needlely transmitted disease.
 
Finally fixed a pesky bug. I had to add one ampersand to fix it ;.;
 
<3
Something like that
because Belgium
 
Belgium is the best country.
 
It's not funny. :(
 
Belgium is All.
 
7:45 PM
Belgium is the new sex
 
Belgium is inside of All.
 
user1781434
hello world
 
Good job there
 
std::all(humans.begin(), humans.end(), hasBelgium) == true
 
std::belgium
 
7:48 PM
Can you inherit std::belgium?
 
Woop, gotta install a Service Pack
 
Is it copyable?
 
user1804599
class belgium : protected wallonia, public flanders { }
 
std::belgium is noncopyable, nonmovable and it cannot be inherited from
 
user1804599
Protected inheritance is silly.
 
7:49 PM
It's also a variadic template that only accepts std::belgium
std::belgium<std::belgium<std::belgium<std::belgium<...
 
user1804599
std::belgium is final, abstract and has no public members.
 
user1804599
std::belgium is a valid identifier in Haskell.
 
QlpoOTFBWSZTWfdcOBQAAHt7hMIQAUBAAX+AABBmRJ7AAACACCAAciEQwQwBM1MBKaIRNGgzU9Rt
TE5rfJ4YYKTAZjrM75p5HZMzA/tyNn23liYDWoziycVaxL1FimMJUdFpIfCYjW9z8Kxz9rCAlinZ
Z17nTigsREA2LuSKcKEh7rhwKA==
 
Ugh. Now I have to download some 400MB tool just so I can run this shitty updater.
 
user1804599
It is raining.
 
user1804599
7:55 PM
I love rain.
 
Free drinks!
 
user1804599
I hope it will be raining tomorrow morning.
 
@MohammadAliBaydoun The meta-updater?
 
user1804599
@sehe I can’t quite decode that.
 
user1804599
> BZh91AY&SY\8��{{@@�fD�� �r! 3S)4h3SmLNk|`f:y3r6}&ZZEc Qi!oss)g^N(,D@6.p!p(
 
user1804599
7:59 PM
It rains every day.
 
user1804599
It’s secretly a tropical rainforest.
 

« first day (1100 days earlier)      last day (3841 days later) »