« first day (362 days earlier)      last day (4577 days later) » 

2:26 AM
Dennis Ritchie, creator of C, has passed away http://bit.ly/MME6y http://bit.ly/p7FJA3
:(
 
2:45 AM
hello
 
2:59 AM
oh i feel unwell, lots of dying the last few days
 
@AlfPSteinbach Yeah, dark time for us, computer scientist :(
 
3:31 AM
First steve jobs, now dennis ritchie.
 
user457812
3:45 AM
Man, that's two people gone just recently that had an unusually large effect on my life despite never knowing 'em. Probably soon to be three.
 
I sure hope Bjarne isn't next.
 
@IntermediateHacker IMO, the two are not even close to comparable. Dennis Ritchie is orders of magnitude greater loss than Steve Jobs. He was not only brilliant and thoughtful, but a true gentleman as well.
 
@JerryCoffin I wasn't comparing. I use C every day, while I use the Mac like once a year.
But I wonder why ppl are totally ignoring Dennis Ritchie's Death...
I sure hope Dennis Ritchie's death isn't incremented... Bjarne should watch out.
 
4:02 AM
@IntermediateHacker I don't think there's a lot of actual ignoring going on, but it is much lower key -- well befitting his lower-key, more private personality.
 
 
2 hours later…
5:54 AM
@AlfPSteinbach She does composition and plays the keyboard during live concerts. I've never seen her sing.
 
6:14 AM
Discussions of e.g. Haskell, Python, Java, Smalltalk, Prolog and exam woes
who in the world discussed Prolog?
and I thought anyone discussing java would be shot here.
 
@IntermediateHacker @DeadMG discussed Prolog for a while -- specifically, until his class using it was over.
 
yeah...cause any mention after that just doesn't make sense. :)
 
@JerryCoffin They teach Prolog at university? What course did he take?
 
@IntermediateHacker We don't shoot anybody here (though tar and feathers definitely can't be ruled out). In any case, discussing the many shortcomings of Java is quite a popular pass-time.
 
@JerryCoffin discussing the many shortcomings of Java . One of my favourite hobbies. :D
 
6:18 AM
@IntermediateHacker I don't know the title, but a logic programming course, if I'm not mistaken. As far as teaching it, that seems to be open to more question. They required him to learn it, but appear to have fallen somewhat short of the ideal when it came to actually teaching it.
 
Im keeping quiet.
Better to remain silent and be thought a fool than to speak out and remove all doubt ~Mark Twain
 
7:52 AM
Morning
 
 
1 hour later…
9:04 AM
@IntermediateHacker So you like to spread doubt?
Speak up, man! Stop making your foolishness apparent! Get real.
;)
 
@sbi I saw that :(
 
room topic changed to Lounge<C++>: RIP dmr (1941 — 2011) [c++] [c++11] [c++-faq]
 
do we really have to be another Twitter feed again?
 
sbi
@DeadMG The fact that silly news services (or what some believe to be silly news services) also provide the great news, does not in any way diminish those news.
 
It's not like the tagline has been very serious in the past 24 hours.
 
9:31 AM
I'm not saying that it's not important news
all I'm saying is that it's already being trumpeted all over the Interwebs and it seems a bit redundant to add it here
 
sbi
9:51 AM
@DeadMG Without Dennis Ritchie this whole room would not exist and who knows what we all would be doing today. (That is a lot more than I can say about last week's other famous dead one.) It is still Ok for me to hear that you don't care enough to make this worth a mentioning mainly because it's not like I expect you to suddenly become the reflecting, pondering person you never were.
 
Didn't say it shouldn't be the tagline because I don't care. I said that it shouldn't be the tagline because it's just repeating what pretty much everyone already knows.
 
Duplication leads to bugs.
 
sbi
People do not say "RIP" because they want to spread the news, @Dead, but because they want to honor the dead.
(And I am somewhat baffled that I have to explain that to you, out all of us here. With that name one would think you'd know about such issues.)
 
saying RIP to honour the dead does not require posting it as the tagline, it would merely require speaking it, or even just thinking it
 
sbi
10:07 AM
@DeadMG I give up on you. You are being deliberately obtuse.
 
didn't you give up on me a significant time ago?
 
sbi
@DeadMG I have many kids, so I am used to fight such uphill battles all the time. It's hard to shed that habit.
 
 
1 hour later…
11:27 AM
one of these days I really should look up the word 'obtuse'
 
@jalf I just did :D
I means 'unintelligent'.
Or tactless.
 
ah
 
You can double-click a word to mark it and then right-click on it and select: "Search Google for <word>". (Google Chrome)
 
ah, looks like the same works in firefox
 
Since I discovered that I've used it very much.
 
sbi
11:44 AM
@StackedCrooked According to leo's German translation, "tactless" is not a valid translation.
I had flagged this yesterday, asking whether a mod could remove the four close votes it had, lest someone steps in and throws the final one, because I (and others, according to the comments) considered them wrong. Until I left last night none of the mods did that (I suppose I lost flag weight for that), and today the question was indeed closed. Sigh.
I now voted to reopen. Please consider doing the same, it's a shame it got closed, especially after @StackedCrooked changed it.
 
@sbi: Voted to reopen. It's indeed a good question.
 
sbi
@BjörnPollex Thanks. If you think so, then please also consider upvoting my latest comment, so that passers-by with enough rep see the reasons for the reopen votes and can join.
 
@sbi: You are such a diplomat!
 
sbi
11:59 AM
@BjörnPollex You mean for the way I was expressing myself in that comment?
 
@sbi: Indeed - untouchable :)
 
sbi
@BjörnPollex I am just so sick of those ignorant passersby who earned 98% or their rep in some other popular tag coming by us and voting on subjects they have no business with and no idea of. The guy who threw the last close-vote on that question has a whooping 9 answers in the C++ tag amassing a score of 34 and decides against the comments of two high-rep users in the tag (2k+ and 5k+ scores) which, between them, got 15 upvotes for their comments.
2
This whole close-voting system is so seriously in need of an major overhaul.
 
@sbi "Annoyingly insensitive or slow to understand." From this is concluded that two meanings could be unintelligent and tactless. The word 'tactless' itself never appeared in the definitions though.
 
sbi
@StackedCrooked Ah, Ok. I can see how you got to the conclusion, but it doesn't fit my feeling for how the word is used. ICBWT, I am a non-native. too, after all.
0
A: No Dennis Ritchie quote on Stack Overflow? Why?

sbiNote the current tagline for the C++ room: RIP dmr (1941 — 2011)

 
12:21 PM
LOL I just found a singleton in our codebase with copy constructor and assignment operator defined.
 
@sbi What would happen if I just upvote every answer you have written? Will some script detect that and revert it?
 
Today I found a class that was basically a POD except it had a user-defined constructor that called memset to zero everything out.
 
sbi
@ManofOneWay Yep. Voting sprees are detected by an algorithm and undone over night.
 
@ManofOneWay: All hail the emperor!
 
12:24 PM
@BjörnPollex Unfortunately I'm not the real one
 
sbi
@BjörnPollex Actually, that doesn't sound all that bad. Or am I missing something?
@ManofOneWay You might be interested in this. Be warned, though, it's a lot to read.
 
@sbi: You are probably missing the reference to the Starcraft II player SlayerS_Boxer here. Google him, he's really famous.
 
sbi
@BjörnPollex Thanks, but I'm too lazy to google. Or, to make it sound more nicely: I have work to do and cannot google obscure references thrown at me.
 
@BjörnPollex I don't see the link with memset on a POD.
 
@sbi What if I upvote 10 of your answers every day
That might work
 
12:27 PM
@StackedCrooked: PODs are zero-initialized if not initialized explicitly, so the constructor did exactly the same thing the compiler would have done anyway.
 
sbi
@ManofOneWay Or it might not. The inner machinations of the vote fraud detecting algorithm have never been revealed, so I don't know.
 
Let's try!
+100 every day
 
sbi
@BjörnPollex Is that new in C++11? Because C++98 definitely didn't do it.
@ManofOneWay Please don't. If for no other reasons (like: it's wrong), this would fit very badly with me currently leaning far out of the window on meta regarding serial voting fraud.
 
Allright then
I won't
 
sbi
Phew. Thanks.
 
12:30 PM
=)
 
@sbi: According to 8.5.5 of the 2003 standard, default-initialization for PODs is zero-initialization.
 
@BjörnPollex I mean that I don't understand how it is related to Starcraft.
 
sbi
@ManofOneWay Anyway, if you wanted to try this only for scientific interest: I am pretty sure that, should you cast ten upvotes on unrelated answers of the same user within, say, 5mins, without voting for other users in between, the algorithm would pick this up. Start slacking some of these parameters and I wouldn't be so sure anymore. (I am pretty sure, though, that some of them can be slacked somewhat.)
 
The name ManOfOneWay was the initial name Boxer gave himself when he started to play Starcraft II
 
@BjörnPollex I thought the members were zeroed-out when using value initialization. E.g. POD() (with the braces).
 
sbi
12:33 PM
@BjörnPollex Are you saying that in
struct X {
  int i;
};
X x;
x.i is zeroed?
 
@StackedCrooked: Yes they are.
@sbi: That is how I read the standard.
 
@sbi I've always wondered, how do you make code another font-style?
 
X x; isn't value-initialized though.
 
sbi
@BjörnPollex I was under the impression that either X x = X(); or X::X() : i() {} would be needed to zero X..i.
@ManofOneWay Read the newbie hints.
 
@sbi X x {}; will value-initialize the POD.
 
12:35 PM
How do you interpret this:
 
sbi
@LucDanton Yeah, but that is C++11.
 
To default-initialize an object of type T means:
— if T is a non-POD class type (clause 9), the default constructor for T is called (and the initialization is
ill-formed if T has no accessible default constructor);
— if T is an array type, each element is default-initialized;
— otherwise, the object is zero-initialized.
The last point applies for PODs, doesn't it?
 
@sbi Try X x = X(); and new X(); (as opposed to X x; and new X;) then.
 
sbi
1 min ago, by sbi
@BjörnPollex I was under the impression that either X x = X(); or X::X() : i() {} would be needed to zero X..i.
 
12:37 PM
It's a shame that X x(); won't compile.
 
@sbi Right, but putting a default constructor doesn't enable value initialization.
 
sbi
@LucDanton It does. In
struct X {
  int i;
  X() : i() {}
};
X x;
x.i will be 0.
 
@sbi But that's default construction.
 
code !
 
sbi
@LucDanton I'm confused. How does using "default construction" differ from "putting a default constructor"?

Test room

Let's have fun in here
 
12:39 PM
@LucDanton He's using value initialization on i.
 
@StackedCrooked That's one way to see it, yes.
 
sbi
Anyway, gotta work now. See you later.
 
struct X
{
    int i;
};

X x;
struct X x;
Will both work? First instance is a C++ struct and second one is a regular C struct variable.
 
Yes. Note that in C++ you can only have C++ structs.
 
in c++, both should work
 
12:49 PM
you cannot have normal C struct variables?
 
You can only have C++ code inside C++ code.
And there's nothing abnormal about struct in C++.
 
so struct X x; is invalid?
 
@ManofOneWay what he means is, in C++, every struct is a "c++ struct"
 
It's valid.
Consider not using that style however, as it can lead to obscure errors.
For instance: if you declare void foo(struct X x);
But if X is inside a namespace (e.g. ns::X) and you forgot about that then the declaration is still valid.
 
12:51 PM
Whereas void foo(X x); would be an error (so you can more easily fix it to void foo(ns::X x);.
 
@ManofOneWay: If X is a POD-type the memory-layout is guaranteed to be identical to that of C, meaning you can pass it into a C-library, and it will work just like it was called from C-code.
 
What is a POD-type?
And what exactly is the difference between
X x;
struct X x;
 
@ManofOneWay: A POD is an aggregate, and that is defined as: *An aggregate is an array or a class (clause 9) with no user-declared constructors (12.1), no private or protected
non-static data members (clause 11), no base classes (clause 10), and no virtual functions (10.3).*
 
The second also introduces a declaration of X.
That means that writing struct X x; is equivalent to struct X; X x;.
 
@BjörnPollex Ah okey!
@LucDanton Yes that makes sense
thanks
 
sbi
1:00 PM
18
Q: What are Aggregates and POD's and how/why are they special?

Armen TsirunyanThis FAQ is about Aggregates and POD's and covers the following material: What are Aggregates? What are POD's (Plain Old Data)? How are they related? How and why are they special? What changes for C++11?

 
I wrote an answer to that a while ago. Upvote it.
:)
 
I tried converting some of my types to aggregates since they didn't do much in terms of construction. I can't say I succeeded.
@RMartinhoFernandes Upboated. If I ever get around to making a new attempt at writing aggregates I'll need this.
 
Btw, see AndyT's comment in my answer.
 
sentences = re.findall(ur'([A-Z]*[^!?\.]*[\s]+%s[\s,]?[^?!\.]*[\s\.!?]+)' % random_word.name, content, flags=re.IGNORECASE | re.U)
 
I really don't know why "standard-layout classes must have all non-static data members with the same access control" is required.
 
1:09 PM
Lovely.
 
@CatPlusPlus Is that a regex followed by the format operator?
 
@RMartinhoFernandes For a given access control, members are ordered following from their order of declaration (inherited from C).
 
(Or whatever that thing is called)
 
@RMartinhoFernandes Yes.
 
However C++ decided to not specify how ordered the different accesses are relative to each other to give levy to compilers (quite usual when it comes to C and C++ Standards).
@CatPlusPlus Lovely indeed.
 
1:11 PM
Ah, thanks. I think I'll try to add those explanations for AndyT.
@CatPlusPlus Ugh.
 
So the side-effect is that access specifiers don't just affect access (duh), but also layout.
 
It's bad enough to use a regex that isn't a named constant.
But building one dynamically?
 
Meh, I do that all the time. I'm just wondering if splitting on a dot wouldn't be clearer.
 
There's no escaping there (though I have no idea if random_word.name is pre-sanitized).
 
Don't have to be.
 
1:15 PM
Because it's sanitized, or becomes the r prefix is magic?
 
sbi
Where again was the site that listed the achievements unlocked by different rep? I can't seem to find the link.
 
The word will never have special regex sequences in it.
Backslash is not a valid part of a word.
 
You can find a link by hovering over your name in the top bar and then clicking "privileges".
@CatPlusPlus Haha, Mardown wins.
\
:P
(I cheated.)
 
sbi
1:17 PM
@RMartinhoFernandes Yeah, thanks. I think this was once linked from the rep number on your profile page. But it isn't anymore. How did you find it?
 
1 min ago, by R. Martinho Fernandes
You can find a link by hovering over your name in the top bar and then clicking "privileges".
 
sbi
@RMartinhoFernandes Thanks. Blush. I missed that message of yours.
 
Oh, every new user has to click through this once to ask a question: stackoverflow.com/questions/how-to-ask
Doesn't seem to be producing enough of an effect.
 
I haven't used languages that provide in-class initialization much. How useful will that be for C++? I've used it once for now.
 
I'm halfway through defining AlphabetSingleton for my comp. sci. Java project.
Capital letters aren't supported "for security reasons."
Maybe I should implement the decorator pattern with punctuation.
 
sbi
1:22 PM
Please have a look at my comment to Jeff's answer to this question. This is the outcome of me combing meta because I was disgruntled about the close voting system. (Jeff's answer is all the way at the bottom, BTW.)
 
AlphabetSingleton? OMG, that sounds like something from TDWTF.
Gotta go. Bye.
 
@RMartinhoFernandes That's the idea!
 
1:38 PM
Oh, using aggregates restricts the use of std::is_constructible, doesn't it?
 
2:03 PM
Good time everyone !
 
2:22 PM
@LucDanton Er, why?
 
@RMartinhoFernandes std::is_constructible tests for T t(std::declval<Args>()...);
Given struct aggregate { int i; };, then is aggregate(42) valid?
 
> error: no matching function for call to 'aggregate::aggregate(int)'
 
Right, but std::is_constructible<aggregate>::value is true.
 
@RMartinhoFernandes For context, I was considering transforming certain types which use perfect-forwarding constructors to aggregates.
Not that I use std::is_constructible, but that just occured to me.
How sane is it to upgrade one's installation of Ubuntu rather than make a clean install?
 
2:28 PM
No idea.
A friend of mine had issues with Ubuntu updates once.
But he'd probably have the same issues if he did a clean install.
They broke some drivers or something.
 
Whoah, the Web is becoming weirder. Apparently there's an in-browser demo of Ubuntu.
 
An interactive mock-up of what Ubuntu looks like, really.
 
It's actually very useful, I can see how Unity has gotten worse.
 
2:31 PM
lol
 
What other desktop steals screen real-estate both from a bar on the side and a bar at the top?
(Come to think of it, that one Unity is copycatting.)
 
Oh, they stopped mimicking Windows and now are mimicking OS X.
I hadn't noticed that.
Change in management?
 
I don't really pay much attention to Canonical/the dev process.
Well let's check how Debian is doing these days.
 
You know what, I think I've been neglecting the tag.
I've learned a lot just by browsing the first page of questions.
 
Lurking or participating?
 
2:38 PM
Lurking.
 
Working on this crap is so painful.
 
Sounds like a tautology.
 
And I'm not really sure whether it's my fault, codebase's, Python's or Django's any more.
 
Without more info, I'd bet on one of the first two.
Nothing personal.
 
One thing I'm sure about is that I don't want to be a web developer.
5
 
2:45 PM
Goddammit Unity actually pissed me off too much to upgrade.
 
41
A: How to paste text into Vim command line

BenoitYes. Hit Ctrl-R then ". If you have literal control characters in what you have yanked, use Ctrl-R, Ctrl-O, ". Here is an explanation of what you can do with registers. What you can do with registers is extraordinary, and once you know how to use them you cannot live without them. Vim stores wh...

Needs more upvotes.
 
@RMartinhoFernandes Are you going to start a series of 'One useful Vim tip a day' or something?
 
I'm not planning to.
(And there's way more than one useful tip in that answer.)
 
hi
 
2:52 PM
yay, the sun is shining and I am at least somewhat warm
and double yay, I finally acquired a charger for my phone, so I can finally entertain myself in the evenings and get cracking with stuff'n'stuff
 
> Wow..that is quite a discussion...where is Bjarne Stroustrup...he could just answer once and save every one some time
 
What's stuff'n'stuff? Do I want to know?
 
Lol I don't even.
 
@CatPlusPlus Where's that?
 
well, it's stuff, and then some more stuff
I hope that clears up your question(s)
 
2:57 PM
Ok, that's fine.
 
1
Q: C++ - Namespace vs. Static Functions

Chris Aaker Possible Duplicate: Namespace + functions versus static methods on a class I want to group similar functions togther. I can do it one of two ways. To me they are just syntactical differences...in the end it does not matter. Is this view accurate? Namespace: namespace util { vo...

 

« first day (362 days earlier)      last day (4577 days later) »