« first day (684 days earlier)      last day (4264 days later) » 

2:00 PM
Oh yeah I was going to implement MapReduce.
 
@KonradRudolph regardless, as I clarified in my answer, I don't support always using braces, but using them sensibly. For example, your answer with the throws is a good one where I wouldn't use braces. I was merely pointing out the benefits (what the question was about)
 
Today's topic: we rant on C++'s shitty compilation model. Go!
Hello by the way.
 
@Takarakaka Dude, I make twice that. You're sooo ahead of me.
 
Oh, there was another twenty-timer here?
twenty-timer, noun: someone that makes twenty times your salary.
 
2:06 PM
Anyhow, seems my comment wasn't well received.
0
Q: Can I use IronPython for testing pure C++ Lib/DLL code, Written in visual C++

Eldad CohenHow to test C++ Lib/DLL code i IronPython , Is it for .NET ? are there any alternative for IronPython? Thanks

@R.MartinhoFernandes The dude was like"Oh yea, I'm the chief of net stuff at my company, I get paid 1000$ a month, mmmkkkaaayyy. I'm sooo coool."
 
struct {
public:
    void foo() restrict;
};
Is that standard?
 
public is redundant
 
restrict is in C99 (and so it wouldn't make sense in a member function), not in C++.
 
Hmm then it seems to be a language extension from clang or something.
@Drise Whoops. :)
 
2:09 PM
also, you don't have any name for your struct
 
Anonymous structs are allowed.
 
Are they?
 
Highly useless, though, when not directly constructed.
 
I was about to say, how on earth could that be useful
 
2:10 PM
@Drise I only know they are allowed, and I have used them. I don’t know all the details though.
There may be some weird things, like with everything in C++.
 
I use them for singleton (not the GoF singleton, fuck the GoF) token values, and for spewing out types when debugging TMP code.
 
@Drise unions and functors are two things I could think of.
struct {
  void operator()() { /* do something */ }
} foo;
foo();
 
struct {}_ = expr; causes GCC to spew an error with the type of expr.
 
What is a union?
 
union {
    struct { double x, y; };
    struct { double u, v; };
};
// probably *bad*
 
2:12 PM
A nasty thing.
@daknøk Nah, that one is actually fine. There are no aliasing issues.
 
Oh. :P
I used it in some 3D things in C++11.
 
So...
 
And you're explicitly allowed to inspect a common start subsequence.
 
union Point which you can use for both textures and objects.
 
It's like a namespace?
 
2:12 PM
No.
 
All members of a union are at the same memory address.
 
...
 
It is similar to boost::variant but less safe.
 
so no matter if I use x or y, I overwrite the same double?
 
2:14 PM
No.
 
union {
    double a;
    int b;
} foo;

foo.a = 42.0;
std::cout << foo.b; // UB
foo.b = 20;
std::cout << foo.b; // prints 20
@Drise no. &x == &u && &y == &v
 
That'sssss..... the stupidest thing I've ever heard
 
C++11 is more relaxed when it comes to unions than C++03.
@Drise It can be useful.
I wouldn’t use it too much, though.
In computer science, a union is a value that may have any of several representations or formats; or a data structure that consists of a variable which may hold such a value. Some programming languages support special data types, called (somewhat confusingly) union types, to describe such values and variables. In other words, a union type definition will specify which of a number of permitted primitive types may be stored in its instances, e.g. "float or long integer". Contrast with a record, which could be defined to contain a float and an integer; whereas, in a union, there is only one v...
> In C and C++, untagged unions are expressed nearly exactly like structures (structs), except that each data member begins at the same location in memory.
 
untagged...
?
so union {};?
 
2:18 PM
In computer science, a tagged union, also called a variant, variant record, discriminated union, disjoint union, or sum type, is a data structure used to hold a value that could take on several different, but fixed types. Only one of the types can be in use at any one time, and a tag field explicitly indicates which one is in use. It can be thought of as a type which has several "cases," each of which should be handled correctly when that type is manipulated. Like ordinary unions, tagged unions can save storage by overlapping storage areas for each type, since only one is in use at a time....
 
Untagged means that there's no tag to discern which of the members is in use.
 
^ that
 
o...k...
 
Union does not keep track of the type of value it stores.
 
Still seems completely useless and against strong typing.
 
2:19 PM
It is useful when you have not very much memory available. :P
1k!
 
@daknøk Wut?
@Drise It's not.
Some languages use tagged unions as their most common data type.
 
@Drise No, it is still strongly types. Access the wrong member and UB!
No silly conversions happen.
You just get pregnant, or something else.
 
boost::variant is perfectly type-safe.
 
Built-in union is stupid and useless.
 
@daknøk not actually UB; it's equivalent to reading uninitialized memory
 
2:21 PM
@ecatmur What about non-POD members?
(Which are allowed in unions since C++11.)
 
@ecatmur It's an aliasing violation first and foremost. (Unless it isn't)
 
It is UB, AFAIR.
 
@daknøk well, in that case, obviously.
 
Also, reading uninitialized memory is UB, no?
 
I think it's implementation-defined.
oops, no, UB.
 
2:24 PM
Ideone y u no unrestricted unions.
Lets try clang…
 
@daknøk liveworkspace.org is more recent
 
@KonradRudolph assuming you do look at a stack trace. I've both forgotten to put braces when adding a line, and had to debug problems which occurred because someone forgot to do so. I just always add braces. Simpler and easier IMO
 
> error: call to implicitly-deleted default constructor of 'union <anonymous union at foo.cc:4:1>'
lolwut
C++ is confusing.
 
You can always write if(something) { whatever(); }. Has braces and uses less vertical space than if(something)\nwhatever();
@daknøk You didn't initialize the union.
 
I feel like I had not enough sleep.
 
2:28 PM
@daknøk Pleonasm detected.
 
@EtiennedeMartel Welcome to my world.
 
@R.MartinhoFernandes yeah, that's what I do. The downside to that is that when the debugger tells you that you're inside that line of code, it's not immediately clear if you're in the if statement's condition or body
 
union F {
    F() {
        new (&a) std::string();
    }

    std::string a;
    int b;
} foo;
 
@R.MartinhoFernandes You're a robot. Why do you need sleep?
 
foo.cc:11:3: error: attempt to use a deleted function
} foo;
  ^
foo.cc:4:7: note: function has been explicitly marked deleted here
union F {
      ^
1 error generated.
How is the ctor a deleted function?
 
2:29 PM
@jalf IME, the VS debugger highlights only the portion in the if body. At least with .NET.
 
What is this horror.
 
@R.MartinhoFernandes only with .NET, yes :)
 
@daknøk There is no ctor.
 
unless they improved it in VS11
 
2:30 PM
Oh.
 
Compilation finished with errors:
source.cpp: In function 'int main()':
source.cpp:11:7: error: use of deleted function 'F::~F()'
source.cpp:2:7: note: 'F::~F()' is implicitly deleted because the default definition would be ill-formed:
source.cpp:7:17: error: union member 'F::a' with non-trivial 'std::basic_string<_CharT, _Traits, _Alloc>::~basic_string() [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
source.cpp: In function 'void __static_initialization_and_destruction_0(int, int)':
 
Unions are not "normal" objects. They're just pieces of storage.
 
Onions are normal objects.
Plus, they are delicious.
 
You need to call constructors and destructors manually.
 
An object is a region of storage!
 
2:31 PM
A storage is where you put stuff!
 
Unions are a sure way to bring shame to your family.
 
@Cicada They're awful.
 
I love onions.
 
@Cicada How about unions of onions? Onion storage.
 
I'm a carnivore, so I know what I'm talking about.
 
2:32 PM
 
@R.MartinhoFernandes Robots can't understand shit about cooking.
 
@R.MartinhoFernandes We already established you have no sense of taste.
 
Don't tell that to Bender.
 
@EtiennedeMartel That's pretty badass IMO.
 
union F {
    F() {
        new (&a) std::string();
    }
    ~F() {
        typedef std::string s;
        a.~s();
    }

    std::string a;
    int b;
} foo;
 
2:32 PM
#define onion union
 
union onion { tasty; makesmewannacrywheneveripeelone; }
 
@Cicada Is this about cooking or eating?
 
@R.MartinhoFernandes YES
 
@EtiennedeMartel :(
 
@Cicada You're doing Objective-C now?
 
2:33 PM
@ecatmur using std::string; a.~string();
 
Don't mention Objective-C.
 
@daknøk ahhh.
 
@CatPlusPlus Well, she said YES. Which is like true, but for Obj-C BOOL.
 
@EtiennedeMartel Subjective-C it is.
 
Onion-oriented programming.
 
2:33 PM
@EtiennedeMartel I KNOW OKAY DON'T MENTION IT.
 
@Cicada More like Suckjective-C, amirite?
 
@daknøk Layering at its best.
@EtiennedeMartel Is this an awkward proposal.
 
Layers.
 
@Cicada Eh?
 
2:34 PM
I so love derailing these conversations
 
@Drise When I see "Layers", I think about Photoshop. My past is catching up to me.
 
There's not much to derail though.
 
We're like a little train. Choo choo!
 
They eat lasagna in Java.
All the layerz.
Abstract lasagna, to be exact.
 
Lasagna are awesome! I should cook some. When I have time. Maybe.
Or at least get the recipe in GW2.
 
2:35 PM
My mom makes the best lasagna in the world. Well, maybe not. But it's damn tasty.
 
+10 toughness
+10% exp.
+onions
 
@Cicada I’ll come over instantly.
 
@Cicada +10 people repellent.
 
@EtiennedeMartel No, my mom does!
 
@daknøk You mastered the difficult art of FTL travel?
 
2:36 PM
No my dad does!
 
@EtiennedeMartel I will travel even to France if I get lasagna.
 
@daknøk That's so hardcore
 
Now we know your most terrible weakness: you love France.
 
inb4 meme
Almost had it
 
2:38 PM
class Triangle
{
public:
  int id;
  int nodeIDs[3];
  double aspectRatio;

  int idSurface;
};
Dear god, please just use a struct.
 
You can't name your class Triangle.
There's an Apple patent over that shape.
2
 
@R.MartinhoFernandes Everyone loves France. Except those who have the terrible misfortune to live in it.
 
Lol!
 
@Drise What is this? struct fascism?
 
@Drise The class Triangle should derive from AbstractShape and IDrawable. Your design sucks.
 
2:39 PM
and there is no AbstractSingletonFactory.
 
@daknøk Piss off, it's not my code.
 
@daknøk But dude! Polymorphic lambdas!
 
@EtiennedeMartel Are you sure you're not talking about Région parisienne?
 
polylambda morphine !
 
@LucDanton Isn't that the same thing?
 
2:40 PM
Triangle is a polygon!
 
Your mother is a polygon.
 
@EtiennedeMartel Only to people that live there.
 
@LucDanton I see.
 
@R.MartinhoFernandes At least she is in shape.
 
Even we hate them.
People hate France mostly because of the Parisian attitude (no, really)
 
2:41 PM
I hate writing Win32 stuff. I always feel like my code is yelling at me with all those uppercases.
 
template<typename Pt> using Triangle = std::tuple<Pt, Pt, Pt>;
 
I hate France because of the language and the food.
 
Uh, my posts arrived in the wrong order.
 
I have been there many times, and I must say that the food is as delicious as rat vomit.
 
@StackedCrooked That's a tripoint. Should be template<typename Angle> using Triangle = std::tuple<Angle, Angle, Angle>;.
 
2:41 PM
Rat vomit *is* delicious, clearly you have no taste whatsoever.
 
@daknøk Strange, I heard the opposite. Never been there though.
 
Who are these people that knowingly taste rat vomit.
 
They eat snails and frogs, what do you need to know more? :P
 
Your mamma's so fat, if her weight were represented by a long, it would have overflown.
 
At least we're not american.
2
 
2:42 PM
Your mamma's so long, if her weight were represented by a fat, it would have overflown.
 
Your mamma’s so fat that this joke isn’t even funny anymore.
 
Unless her weight were represented by kilograms, in which case no.
 
What do you want to represent it in otherwise?
 
Pounds? You deserve a bullet.
 
2:43 PM
Planets.
Jupiters.
 
Logarithmic scale.
 
@Cicada Ha. One thing's funny about American cuisine: there's always too much food on your plate.
 
@EtiennedeMartel There's no such thing as "too much meat".
 
@Cicada Your mamma's so fat, her weight on a logarithmic scale would still overflow
Which would be a very impressive figure, actually
 
2:44 PM
@EtiennedeMartel I know right! Some friends who visited the US told me that France's McDonald's "XL" menu is NY's "small" one.
 
@R.MartinhoFernandes Well, I could probably feed Africa with the leftovers from my lunches.
 
@Neil > implying that would be more than exponential
 
Almost 40% of the place I live voted for Geert Wilders.
 
@Cicada If you had to represent n where 10^n is the weight of your mamma, that too can overflow
 
That’s awesome.
 
2:45 PM
Who's that.
 
Maybe I don’t live in such a dumb place, after all.
 
Sounds dutch.
 
One of the few decent politicians.
 
"Geert" matches my "dutch word regexp".
 
2:46 PM
@daknøk lol, you do live in a dumb place.
 
Yeah, you’re right.
I should move to Norway.
 
No way.
 
The point is that you make the places dumb.
 
A country not in the EU.
Much better.
I hope NL leaves the EU.
 
Seriously, you just said "One of the few decent politicians."
There's so much fail in that sentence, I don't even know where to start.
 
2:48 PM
:5158815 Damn, someone was quick on the flagging.
 
Also, stop flagging jokes.
 
The EU is bad, the Netherlands are bad, and the Netherlands should feel bad.
The European Union! That says enough.
 
Damn Mericans! Blame it on them. :-)
 
@daknøk you do know the UK still uses Imperial
 
The European Onion would be pretty awesome, though. :)
@thecoshman I know, and the imperial system sucks, is confusing and not SI standard.
Not accepted by SI.
 
2:49 PM
@daknøk Shit, I was about to steal that joke from you (which you stole from @Cicada - it's like a human centipede of jokes).
 
@EtiennedeMartel Uh-oh.
@EtiennedeMartel Are you implying it's a shitty joke?
 
@EtiennedeMartel ew
 
@R.MartinhoFernandes Ba-dum-tish.
 
@EtiennedeMartel Not to mention that the Human Centipede is a Dutch movie.
FROM THE EU :<
 
@daknøk Really? You guys really are completely messed up.
 
2:50 PM
IFC Films | released = | runtime = 92 minutes | country = Netherlands | language = EnglishGermanJapanese | gross = $252,207 | italic title = force }} The Human Centipede (First Sequence) is a 2010 Dutch horror film written and directed by Tom Six. The film tells the story of a German doctor who kidnaps three tourists and joins them surgically, mouth to anus, forming a "human centipede". It stars Dieter Laser as the villain, Dr. Heiter, with Ashley C. Williams, Ashlynn Yennie, and Akihiro Kitamura as his victims. According to Six, the concept of the...
lol epic wikipedia onebox picture fail
 
@daknøk I initially considered watching that film, but after careful deliberation, I decided I wanted nothing to do with it.
 
@daknøk Fail why?
@Neil Try the sequel.
 
Wikipedia oneboxes are so full of fail.
> IFC Films | released = | runtime = 92 minutes | country = Netherlands | language = EnglishGermanJapanese | gross = $252,207 | italic title = force }}
Really?
 
huh, hit exactly 102k rep
 
@Neil it's actually not that bad, both in terms of quality and graphic content
 
2:51 PM
because an answer I'd downvoted got deleted by a moderator
 
it's more the idea that is gross
 
@thecoshman Try the sequel.
 
@jalf I’d give that moderator a cake.
 
@daknøk I saw that movie. It was pretty bad.
 
lolz
 
2:52 PM
@R.MartinhoFernandes they made that already?
 
Xeo
mornin'
 
Dutch movies suck.
Only New Kids is kinda funny.
If you are < 25.
@thecoshman Try the SQL.
 
@thecoshman It's a trilogy.
 
oh wait, sorry, it was already closed, he deleted it
 
@R.MartinhoFernandes I was only aware of the one being made so far
 
2:54 PM
@R.MartinhoFernandes It’s a tragedy.
 
And hell no, I'd be more inclined to give out cake when moderators refrain from deleting stuff
 
Undelete it!
 
it's my understanding that he basically conned every one into committing to it financially before they fully grasped what is was about
 
Hardcore Stack Exchange. Downvote = permaban.
 
@daknøk INSET "shit" INTO MOUTH
(it's been a very long time since I used sql)
 
2:56 PM
@jalf “simpler and easier IMO” – sure but as I’ve shown in my answer there’s a trade-off which most people just pretend doesn’t exist.
 
Is it possible to see who flagged stuff?
 
@Drise no
 
ok
 
@thecoshman Incorrect syntax near the keyword 'INTO'.:
 
well, with in the context of SO, no
@daknøk zero
 
2:57 PM
@daknøk Sounds like Minecraft SMP hardcore: death = ban
@thecoshman I meant chat
 
DELETE FROM Users WHERE ChatFlagCount > 0; -- fixed
 
@Drise chat is part of SO
 
@thecoshman fair enough
 
@Drise is it though; is it really?
 
@daknøk Why are people obsessed with replacing IF with every other word that makes sense?
 
2:59 PM
@Drise What?
 

« first day (684 days earlier)      last day (4264 days later) »