« first day (400 days earlier)      last day (4546 days later) » 

12:10 AM
Hi.
 
sbi
12:27 AM
@keithlayne I drink cold beer nowadays, and prefer to not only when I'm in Germany. :-/ I used to not to drink cold beer ten years ago, but I'm a convert now.
 
Belgians frown upon the idea of drinking warm beer.
 
sbi
Have a look at this one, everybody:
8
Q: Canonical answers for repeated questions

JBernardoI know this question I'm proposing has some variants, but none had an answer that could solve the problem. Some others like this one: Here and Here There are these questions (from newcomers who can never reach the search bar or the automatic results after typing the title) that appear from time ...

There's others struggling with our FAQ idea.
 
1:00 AM
@sbi Not bad. Though I find the preventive question interceptor a far more pressing need.
 
1:37 AM
@StackedCrooked that's an interesting question about sudo...in most cases it probably doesn't matter either way, it will work.
@StackedCrooked Unless you don't want the second command to have sudo privileges, that is.
@sbi Good for you, I can handle good beer at any reasonable temperature, but cold is the way to go. I think I'll go for one right now.
 
2:01 AM
Wow guys, I have not been active on SO for very long but I've already been drowned in bad questions. Unfortunately, they're also where I've made most of my rep. It's a little shameful. The answers that I gave that took some work were two of the first three. Neither got any votes, and one got accepted.
I have answered questions before from people with higher rep than me that were simple google searches or figuring out how to do something like change program settings. This is sad. I don't know how you guys deal with it. If I were a mod I would delete mercilessly. I'm sure some probably do.
I would never ask a question on SO unless it was really out of my reach given the resources I have. And the resources of anyone who has access to SO to ask a question are considerable. I mean they have access to the internet, right? Lame.
Oh yeah, all that was about your crappy question prevention strategies.
I'll shut up now...where's my beer?
 
@StackedCrooked that is outstanding. Are they any good? Don't think I've ever had any of those.
 
2:17 AM
They're good for sure. Haven't tried them all though.
 
3:12 AM
hi
 
Wow, I got all soapboxy there and then actually read the discussions some of you had about the FAQ and I was very much moved by @jalf's arguments. And my respect for @sbi grows constantly; he's got parenting skillz, drinks his beer cold, and seems to be quite an effective voice for the dedicated C++ contingent on SO. I love beer.
 
 
4 hours later…
sbi
7:28 AM
@KerrekSB Yes, that's a good one. Note that this is already implemented to some extend: You see a bunch of suggested related questions when you attempt to close a question as a dupe. I don't know whether those are picked from the question's tags, title, or content, though.
@keithlayne I love how you value the beer idiosyncrasy over parenting and C++. :)
 
 
1 hour later…
8:36 AM
hi All
can anyone tell me which the tool or any other way to analyze the large C++ code ?
i have large C++ code and i want some pictorial representation of the code ? some class diagram or other that give clear idea about the source code
 
use doxygen
 
@NeelPatel The best tool is your brain. When I've had to analyze so called complex code (an euphemism for spaghetti), I have found that paper and pencil were indispensable tools. It also helps to discuss the thing with someone else, or lacking someone else to discuss it with, trying to explain it as an essay or something, which essentially is to discuss it with an imaginary reader.
 
but there comes a point where the project becomes so large that it's unfeasible to do it by hand... that's when doxygen comes into play...
 
@JosephH there comes a point where the project becomes so large that it's unfeasible to use doxygen... that's when paper and pencil comes into play...
actually a project needs not be very large for that point to be reached
the diagrams etc. produced by tools such as doxygen can still contribute of course
 
9:31 AM
good morning
 
morning
how is you?
 
I'm feeling a little less raeg and a lot more genius today
 
oh cool
I have a cold
 
probably because I didn't open my day with something sweet and not enough sleep
 
9:34 AM
colds suck
 
lol
yep they suck
 
balls
not just any balls, they suck leopard balls
 
9:47 AM
hahah
so what's your plan for today?
 
wel
there's the IGN Premier League airing, so I could watch that
or I could do some codes until MLG is airing
choices choices
 
hmmmm
 
10:13 AM
ok, the IGN Proleague is terribly, terribly laggy
codes it is
 
I'm having a bizarre issue that I think is a g++ bug.
I'm getting a crash inside a 'for (auto &something: container)' loop when the previous statement shows that container.size() == 0 and begin() == end().
And I'm compiling at -O0
So, in theory, no statements in that loop should ever be executed for this container.
And, of course, the crash is because the object being used isn't valid.
 
what's the container
 
::std::unordered_set
Err... unordered_map
 
chuckle
 
11:13 AM
Not a g++ bug. The trouble with recursive data structures is you can't easily tell for which object a method is being invoked. And method X results in the unordered_map that's in a different object to be modified. Unfortunately, that object is in the middle of handling a call to it's own method X. In fact, it's in the middle of the loop that's having the issue.
 
I need help with my all-in-one container elements printer , here is my code: ideone.com/YjH6L
just last 3 lines of error are real error
 
Should be: PrintCont::printCont(cont,PrintCont::PrintTraits<T>::ContType{});
You confused yourself with your own naming. :-)
@MrAnubis I answered your question in the previous couple of messages.
 
11:29 AM
@Omnifarious but why did you use {} ?
() works which constructs the object
@Omnifarious anyways thanks for help , i need to use some good naming style though :)
 
@MrAnubis {} also works. And I prefer it. Using () is ambiguous because it's also used for function calls and function declarations. {} used in that context can only be an initializer.
 
honey will get you rid of any cold
 
@Omnifarious c++11 feature? i had used the typename prefix though to disambiguate
 
@MrAnubis Yes, just like your for loops. Can't remember what the official name for those are.
 
@Omnifarious but it is new in c++11 ?
 
11:38 AM
@MrAnubis Yes, just like your for loops. :-)
 
@Omnifarious thanks again :)
@JohannesSchaublitb you suffering from cold?
 
@MrAnubis did last week, but with honey it went away quickly
 
@JohannesSchaublitb say thanks to good bacteria in your honey :)
 
The concept of talking to bacteria is amusing.
 
11:43 AM
btw just taking honey in cold always works?
 
no
if it were that simple, nobody would ever catch it
 
@DeadMG i mean if you're suffering from cold already , does honey always helps?
@Omnifarious you call that empty initializer ? , that braces doesn't seems to work in my compiler , getting error , i am on gcc 4.6.1 though
 
@MrAnubis Yes, but I don't know what the for loop construct is called.
 
@Omnifarious range based for loops?
 
@MrAnubis std::vector<int> v; for (int &i : v) {}
 
11:54 AM
@awoodland aah , thanks
 
@MrAnubis Ahh, I guess that is what they're called. That name just doesn't ever come to mind when I see them.
Container for loops or something seems a better name.
 
sbi
@AlfPSteinbach That sent me on a trip across youtube, watching Roger perform all the old songs. The trip ended at iTunes where I spent a tenner on a best-of-ST (they didn't have BiA). Thanks!
 
A lot of people though seem to think they're one of the not-so-good features added to C++11, and I'm still wondering why.
 
because
they were totally unnecessary
a little re-tweaking of the Standard library, and possibly polymorphic lambdas, and the whole problem would have been instantly solved
new language features are bad
what's next, language-integrated select statements?
 
i.e. use for_each for everything?
That makes sense. I was trying to decide which syntax made more sense.
 
12:30 PM
folks
 
1:06 PM
@DeadMG already done in C#. though it used to be in C also. don't recall what that was called.
 
yeah, and they had LINQ instead and it was totally redundant
 
sbi
1:25 PM
@AlfPSteinbach Interesting, they have BiA. So what is Groveshark? Why can I play music there? How do they get payed and how do they pay the artists? What would having an account there give me?
 
If I mention someone who's not in the lounge right now, in my message, will he be notified ?
 
yes i think
 
maybe I should just restrict to ASCII identifiers
until I get some proper Unicode support
 
@keith.layne : So, you pretended to be a dumbass.
 
user784668
2:34 PM
Damn it.
 
user784668
I've misread "getter" as "glottal".
 
what's glottal when it's at home?
 
user784668
The glottis is defined as the combination of the vocal folds (vocal cords) and the space in between the folds (the rima glottidis). Function As the vocal folds vibrate, the resulting vibration produces a "buzzing" quality to the speech, called voice or voicing or pronunciation. Sound production involving only the glottis is called glottal. English has a voiceless glottal fricative spelled "h". In many accents of English the glottal stop (made by pressing the folds together) is used as a variant allophone of the phoneme (and in some dialects, occasionally of and ); in some languages, ...
 
ok
 
2:53 PM
@Fanael Happens every time.
 
user784668
@StackedCrooked really?
 
Morning.
It's still Sunday. That's nice.
 
user784668
3:29 PM
Anyone around?
 
3:42 PM
Nope.
 
3:59 PM
maybe
 
17
Q: What language should an 11-year old start with to learn game programming?

emsrI have a 11-year old son who wants to do game programming. I've started him on C++ (C++11) and he's learned iostreams, looping, functions, logic and flow control. I'm using the standard library and no memory management at all. But I would like to ask: What language would you suggest for a pre-...

Youngest C++ programmer ever? :)
 
user784668
11-year old shouldn't be let anywhere near programming.
 
why not?
it's not like they'll explode the world by writing shitty spaghetti code
I've been programming since 3 years old
 
@Fanael 11-year old is plenty old to do programming. i did electronics when I was 11. i would have done programming if I had any access to any computers
 
user784668
There are already too many no-lifes in the world, nobody needs yet another one.
 
4:05 PM
wtf are you talking about?
 
nerds, probably
 
i think i'll have some coffee and chocolate ice cream. re-reading reynold's "house of suns".
 
user784668
@FredOverflow yup, exactly.
 
the world needs more nerds, not less
the non-nerds are doing a despicably bad job of running things
 
user784668
4:10 PM
If you say so...
 
also, just as it would be cruel to chop of the legs of a child who wants to run, it's cruel to chop off the brain of a child who wants to learn
or thereabouts
 
I've started way before 11.
 
^ when u'r strange no1 remembers u'r name...
 
Hi everyone. Anyone knows why pastebin.com/nJZGLScj would SegFault when i try to assign to part of a bitfield?
 
U'r using uninitialized pointer H
I think the main thing wrong with that code is the naming of things
it has names with initial underscore. that
 
4:22 PM
Oh, such a tiny mistake, seriously? Thought i got over that... trying again
 
is bad. and it has single letter names. that's bad.
and it has ALL UPPERCASE names. that's really bad.
 
user784668
There's no uppercase letter immediately after the underscore, so it's okay.</language_lawyer>
 
@Fanael no, it's not okay. names beginning with underscore are reserved in the global namespace. it's easy to get conflict if you don't abstain from using them.
 
Just couldn't get a better name for those variables
 
user784668
Are they in the global namespace?
 
4:25 PM
And initializing the pointer made things work nicely
 
@Drknezz oh, just convert to lowercase and avoid using lowercase single ell as name
u're welcome
:-)
 
Now i can keep coding that messy Huffman coder
Thank you :)
 
Instead of the hack byte struct, consider using a std::bitset<8> (or even more generally a std::bitset<CHAR_BIT>)
 
Will research on it
I am pretty new to C++... im used to get everything i need spoonfed from the BCL
I also now confirmed Linux is bigendian according to my experiment
 
How many main() can a C program have ?
 
user784668
4:29 PM
@Drknezz the OS has usually little to do with endianess.
 
@Failed_Noob One.
 
and how many can a C++ program have ?
 
Failed_Noob: AFAIK only one: int main(int,char**) XOR int main() XOR void main()
 
Thank You
 
4:31 PM
Fanael: Or maybe fwrite decided big endian style was best
 
void main is invalid
 
Damn you @Cat.
 
Third overload is int main(int, char**, char**)
Environment being the last argument.
 
user784668
@CatPlusPlus a conforming implementation can accept invalid code, it's then called extension :P
 
@CatPlusPlus No, that's an implementation defined one.
 
4:32 PM
Though it might also be C.
 
@Fanael No, not all invalid code.
 
@Fanael only if it emits a warning (for code that requires a diagnostic)
 
@CatPlusPlus Why is void main() invalid? Couldn't the compiler just infer "0 main()"?
3
 
Because standard says so. Geez.
> It shall have a return type of type int, but otherwise its type is implementation-defined.
 
I always use void main(){}
 
user784668
4:34 PM
int main() is invalid, too. Even children know that main is of type IO a!
 
> All implementations shall allow both of the following definitions of main:
int main() { /* ... */ }
and
int main(int argc, char* argv[]) { /* ... */ }
 
but someone told me "int main (void) {}" is the proper way to write it
 
so int main() { } is not allowed
 
Qt developers? pls have a look at this stackoverflow.com/questions/8202429/…
:(
 
4:34 PM
because it misses the /* ... */
 
(void) is C-ism.
 
@FailedNoob As @CatPlusPlus stated, (void) is something inherited from C, C didn't allow for parameter-less functions, so you needed to declare them as accepting just void.... AFAIK
 
If it didn't allow for parameter-less functions, (void) wouldn't buy anything.
It just defaults to varargs.
 
user784668
@Drknezz C allows for argument-less functions, that's just the syntax. void f() does something else in C: basically, it's void f(...) in C++.
 
4:38 PM
@Drknezz okay , what does AFAIK mean ?
 
@CatPlusPlus what defaults to varargs when?
@Fanael that's pure wrong
 
@Fanael Oh, didn't know that... seems i have to re-read a bit on C
 
@Failed_Noob AFAIK, "AFAIK" means "As far as I know".
 
don't believe him
 
@FailedNoob As Far As I Know
 
user784668
4:39 PM
@JohannesSchaublitb wrong?
 
some stuff has changed since the early versions of C
 
Thank you
 
It's an AK with FAI inserted in the middle.
 
I believe that C99 takes a much more C++ approach to functions and declarations
 
void f(...) is not valid in C and even if it was it would be completely different
 
4:39 PM
and removed implicit-int, for example
 
user784668
@JohannesSchaublitb of course it's not!
 
user784668
I didn't say it is.
 
no you said it is "basically" that
but since it is completely different, it's not so
 
user784668
@JohannesSchaublitb please quote then. I haven't written that void f(...) is valid C anywhere, I've written it's the C++ equivalent of C's void f().
 
> An identifier list declares only the identifiers of the parameters of the function. An empty list in a function declarator that is part of a definition of that function specifies that the function has no parameters. The empty list in a function declarator that is not part of a definition of that function specifies that no information about the number or types of the parameters is supplied.
From the C11 draft. §6.7.6.3p14
 
4:41 PM
@Fanael no that's not true
 
room topic changed to Lounge<C++>: Sunday evening language lawyer quarrels. [c++] [c++11] [c++-faq]
 
void f() in C is by no means equivalent in meaning to void f(...) in C++
 
user784668
@JohannesSchaublitb okay, I'd be glad to hear what's the difference. Because I don't really know.
 
cpx
so int main() { } is not allowed but int main() { return 0; } is allowed?
 
4:43 PM
@cpx In C++, both are fine.
 
void f() { } int main() { f(0); }
undefined behavior in C ^
 
cpx
hm but it miss /* ... */
 
The return of main may be safely omitted.
 
@cpx The compiler would infer the return 0;
 
void f(...) { } int main() { f(0); f(0, 0); }
completely valid in C++ ^
 
cpx
4:44 PM
@Drknezz yes
 
void f(); only accepts a certain set of argument types. only those that are compatible with its parameters in its definition. but void f(...) is a variadic function, and it can cope with any type and any number of arguments.
 
0 main()? What the fuck is that?
 
user784668
@JohannesSchaublitb Ah, okay. Thanks. But I think I'll forget that soon anyway ;)
 
In C, void f(); gives no information about the parameters, while C++ void f(...); means "everything goes".
 
@MrAnubis Cpt America was indeed a decent movie!
 
4:47 PM
Who cares about C.
 
So that means C can behave like Haskel? @RMartinhoFernandes
 
user784668
@RMartinhoFernandes everything? Nah, nah, you're wrong here :P
 
Als
Folks, A quickie
 
@Drknezz What does that mean?
@Als Where's the girl?
 
void f(); int main() { f((long)0); } void f(int n) { }
 
4:48 PM
Haskell certainly can be compiled to C.
 
UB too in C
 
What is 0 main()?
 
@LewsTherin Nothing of consequence.
 
@LewsTherin hmm.... yes it is then
 
@Fanael no good. so you will remain not knowing C
 
Als
4:49 PM
@RMartinhoFernandes: Tony bit you? :P
 
@RMartinhoFernandes Sure... :O
 
user784668
@JohannesSchaublitb no good?
 
Als
static_pointer_cast and dynamic_pointer_cast for shared_ptr are exactly similar as static_cast and dynamic_castfor naked pointers or there's anything more to them?
 
@MrAnubis Lol, why you are you agreeing with me. It's OK if you don't think so :)
 
4:50 PM
@RMartinhoFernandes In Haskell you can declare a function with only just the paramater names, if you try to do something you cant with the type of a variable, the interpreter just spits out an error and halts execution
 
Dammit.
 
@Drknezz Difference being that you always provide information about the parameters.
 
@Drknezz instead of (A xor B xor C) you want (!!A + !!B +!!C) == 1
 
Als
*Awaits an enlightening answer
 
user784668
@JohannesSchaublitb did you got the reference wrong?
 
4:50 PM
@Drknezz You can't define functions in Haskell without saying what the parameters are.
1 min ago, by Cat Plus Plus
Yes.
 
@LewsTherin I meant that in void main() the compiler can just infer int main() returning 0
 
Als
@Fanael, If @JohannesSchaublitb gets something wrong, you better we assured he is playing some trick.
 
@Fanael not sure where I used references
 
void main is still invalid.
 
@RMartinhoFernandes I need to recheck my Haskell knowledge then
 
4:52 PM
It didn't change in the last 30 minutes.
 
user784668
@JohannesSchaublitb I mean, did you referenced the wrong message?
 
namespace my { void main() { } }
valid ^
@Fanael dunno. i don't care abut message references
i just type the @
 
@Drknezz 0 is still an int value. Why should it infer that?
 
and whatever it chooses. i rely on context
 
@Drknezz Even if you say f x = 2 * x, without giving the types, you're giving information: there's one parameter, and you can do * on it.
 
Als
4:53 PM
fuck my Q got ignored...
 
@CatPlusPlus I dont see why your main function could just behave so it does not return an error code
 
2 mins ago, by R. Martinho Fernandes
1 min ago, by Cat Plus Plus
Yes.
@Als It was answered twice!
Thrice now.
 
@JohannesSchaublitb i think it was implicit that he was talking about main main functions, otherwise it would just be annoying word games and people don't drop by here to be annoying do they no they don't
 
@Drknezz Because standard says main returns an int, so void main is invalid.
 
lol @Alf
@AlfPSteinbach i didn't mean to direct it to him
i meant to just make an observation
 
4:54 PM
@JohannesSchaublitb you want to keep your job or want to get thrown by your boss?
 
Fact: many compilers will happily accept invalid code. Fact: that doesn't make it any more valid.
 
@RMartinhoFernandes That's what i am talking about: If the interpreter detects you are trying to do something like RandomClass* int it would halt
@CatPlusPlus I think you are just being a "GrammarNazi" now
 
@Drknezz What's that a reply to?
 
I fail to see the connection between Haskell's type system and C varargs functions.
 
user784668
@RMartinhoFernandes Fact: the code is compiled by an existing implementation, not by the standard. Hence, another fact: poor programmers don't care and think it's okay.
 
Als
4:55 PM
@RMartinhoFernandes: You mean Yes it is identical or Yes theres more to it?
 
@RMartinhoFernandes Don't know how to quote so: "
@Drknezz Even if you say f x = 2 * x, without giving the types, you're giving information: there's one parameter, and you can do * on it."
 
@Als Oh, the former, then.
Sorry, if that was ambiguous. It was @Cat's answer anyway :)
 
You could just check the documentation three times while trying to decipher that "yes".
 
hmmmmmmmmmmmmm
 
4:57 PM
@Als There's an added bonus though.
 
It won't blow up.
 
user784668
What's the standardese for the type of linkage that inline functions and template instantiations have?
 
@Fanael they can be external or internal linkage
just like other functions
it's not the linkage that allows multiple definition of the same entity
in standardese at least
 
user784668
@JohannesSchaublitb that's what I meant to ask for, really.
 
@Als If you static_cast a pointer up the hierarchy, and then delete it, bad things happen if there's no virtual destructor. If you upcast a shared_ptr with static_pointer_cast, you don't run into trouble because it will use the original deleter. Not sure if that's worth counting on.
 
4:59 PM
the linkage just is required to be external for multiple definitions of the same function across multiple translation units
 

« first day (400 days earlier)      last day (4546 days later) »