« first day (328 days earlier)      last day (4617 days later) » 

5:00 PM
rep wars and star wars
 
Hmm.
What is this grace period thing?
 
Als
oh we also do have Sex-Wars especially, with @cat and @xeo around.
 
Is it just a stupid way of saying, "Instead of 7 days, there are actually 8. The last one is named funny."?
 
Als
@RMartinhoFernandes: It means you have 24hrs(after bounty period ends) to decide which answers best answers your question after which the highest voted answer created after the bounty started with at least 2 upvotes will be awarded half the bounty amount.
 
Yes, but what is the difference between those extra 24hrs and the normal bounty period?
 
Als
5:07 PM
@RMartinhoFernandes: I guess in simple words, yes it is that
 
Hmm, that's annoying.
I was like, "yay, I'm going to get a bounty!" (it expired earlier today) and then "wait what? grace what?"
Look, a three-star programmer!
0
Q: Pointers to Pointers to Pointers (Error: Expression must have classtype)

J_XlinI'm having some trouble with multi-layer pointers. Basically I'm reading point locations from a file and using them to map out polylines. I'm trying to create a dynamically allocated data structure that will change depending on the information contained in the file. Each file is structured like...

 
hi
why do some people consider i++ wrong in a for loop, while ++i should be correct?
 
With overloaded operator++ the second avoids a copy.
 
0
A: Opening c++ program by double clicking associated file. How do I get the file name?

Alf P. SteinbachIn plain C++ you can use the arguments of main: #include <iostream> int main( int argc, char* argv[] ) { using namespace std; cout << argc << " arguments:" << endl; for( int i = 0; i < argc; ++i ) { cout << "[" << argv[i] << ...

 
It's not so much about correctness but about using the closest thing to your requirements.
 
5:21 PM
@LucDanton aol
 
@RMartinhoFernandes That's it? I thought it would be related to when i is read and when increased. But you can also overload ++i, can you?
 
Yes. But ++i doesn't require copies. It can just return a reference to the incremented object.
 
@AlfPSteinbach Something is going over my head here :)
 
i++ requires a copy because you need to return a value different from the incremented object.
 
@LucDanton oh
 
5:24 PM
You too what?
 
@LucDanton i 2 agree with using the closest thing to the requirements. i++ is most often asking for more than required.
 
@RMartinhoFernandes thx
@RMartinhoFernandes But if it is not overloaded, let's say it's used on a simple int it doesn't matter at all if one uses i++ or ++i
wondering if the generated code differs
 
@Nils it is about habit of generally using only what's required, not more
 
@Nils Not if it's just an integer.
 
Als
5:33 PM
@Nils: There is no performance difference, if for int
but for overloaded versions, ++i is more faster
 
ah the C++ faq.. should have checked that embarassed
 
@Nils Not at all. I didn't know the difference either, but now I do. I just thought that the entry in the C++ FAQ might be worth linking as additional input.
 
Apple discontinued shark :(
 
Apple better discontinued itself.
Nevermind. ;)
 
I have poor x86 asm knowledge but it seems that in a simple loop the same code is generated no matter if i++ or ++i are used, tested with clang
 
Als
5:48 PM
@Nils: Is i an integer?
 
yes
 
Als
@Nils: Then yes the code generated will be the same.
 
why do you know?
I mean without trying it out.
 
Als
@Nils: Because integer is a POD
If you try overloading, ++i and i++ where i is a custom class object, you would know that i++ needs to return by value and hence an overhead.
 
yes
but a = b++ or a = ++b are not the same
so I still wonder why exactly it generates the same code
 
5:56 PM
@Nils it doesn't generate same code in your example. with a good compiler it generates same code when all that's used is the side effect of incrementing.
 
@Als POD-ness is a property of class types (in the broad sense that includes unions).
 
@AlfPSteinbach Well I mean used in a for loop like codepad.org/HMTrqHnE
 
@LucDanton not just class types
Class types can be POD classes, but POD classes, scalar types and a few others are collectively POD types
 
I'm dead tired, maybe I'll just play a bit of Deus Ex
 
3.9:9 in N3225 :)
 
6:04 PM
ouh wondering where my C++ std doc is..
 
user181351
someone get std::thread working on mingw plox
 
@tm1rbrt and on MSVC, please, while we're at it
 
@jalf thx for the hint, will check it later
 
The STL iterators' operator++ is overloaded, right? So ++it is faster than it++, right?
 
@robert yes, they're overloaded, and it might be faster
it depends on how well the compiler is able to optimize them
 
Als
6:10 PM
hmm back
@jalf: most likely faster you mean to say i reckon.
 
@Als I'd expect to see zero difference for most std containers
so might be faster, and almost certainly not slower.
 
Als
@LucDanton: Am int is an POD too, as @jalf, already pointed out.
@jalf: Why just might be?
 
@Als because in most cases, I'd expect it++ to be optimized to be equivalent with ++it
 
Als
Can the compiler optimize iter++?
 
why not?
 
6:13 PM
In a traditional for loop? Yes.
 
Als
@jalf: I am not sure...
 
the definition is visible, after all, so in common cases (such as a for loop, where the return value isn't used at all), it should be pretty easy to optimize out
 
Als
@jalf: Perhaps, one needs to see the generated assembly to say conclusively.
 
@Als I didn't say it will be optimized out. Just that it can be, and that I'd expect it in most cases. Nothing conclusive :)
 
Als
I distinctly remember reading in a Josutils book, that iter++ would be slower.
 
6:16 PM
So far I always used the post-increment operator, both for primitive types as well as iterators. I guess I'll have to change my habits. :)
 
it'll never be faster, so you might as well assume that it'll be slower, and prefer pre-increment where possible :)
wow, my spelling
 
you need not comment on typos you already fixed :P
 
Of course you need! I'm not the one who makes the rules here!
 
@RMartinhoFernandes except when you are overruled
 
Hey, no comment on typos I already fixed.
 
6:19 PM
also please don't you start on a pretend-ego-trip too. It's bad enough with @DeadMG
 
Als
@jalf: Yes, to argue whether faster or not would be pedantic, i would agree to One should just use preincrement in loops
 
@jalf Oh don't worry, I was just trying to make a joke there.
Apparently I failed miserably.
 
Als
Bots and jokes are mutually exclusive IMHO
 
I think I get lots of lols around here.
 
btw, another reason why it might not be faster is just today's superscalar OOO CPUs. They're pretty good at hiding costs. Post-increment might mean an extra memory write, but there's no dependency on it, so it might actually be free even if the compiler doesn't optimize it
 
Als
6:22 PM
probably, you were a bot pre-programmed with funny one liners.
 
@Als Shh, don't tell anyone.
 
Als
@jalf: I see..Can't comment on that, No ideas about that. I will take your word on that :)
@RMartinhoFernandes: eh, pre-programmed for that too :P
 
@Als well, it's a guess. It might not be 100% accurate
haha, trying to look something up in my CPU architecture book. In the index, there's an entry for "x86 - flawed instruction set architecture of,"
 
Als
@jalf: :) Rather I will just stick to using pre-increment in loops. Those heavy books wear me down..
 
6:30 PM
Pf, this book isn't heavy, it's super interesting :)
 
Als
Thanks I am going to mark that in my ToDo list.
Actually currently I have like 2-3 other books on my hands..
 
Als
@jalf: geez would have been so much better to read them earlier...but hmm i am a self taught programmer, without any background, so i can't say i should've started early
 
this LOOKS GOOD, it's chicken with cashew nuts. but in the recipe they're drowning it all in asian fish sauce. ugh.
 
Als
@AlfPSteinbach: Do you actually eat whatever you post in pics here?
 
6:33 PM
yes, of course
 
mm, looks good
 
Als
I see, that explains the round face :) :P
You eat a lot perhaps, i saw the lamb and stuff a while ago
 
well it's a lot of hard work. i have to sprint to grocery store to buy ingredients, then cook, eat and wash up before posting next pic. not sure if i can keep this up.
 
Als
@AlfPSteinbach: You do all of that and yet you are here all the time! gosh
Do you work from home?
 
actually today i haven't even had a real dinner. just heated some pasta-with-tomatoes. that's all.
 
6:36 PM
tinyurl.com/3bm44n8 Possibly NSFW.
 
Als
What is that?
rather why that?
uhm...Is that someone like naked or is it my eyes?
 
That's Google Street View.
 
Als
I got that, You didn't answer my question
I am wondering if i am the only one who sees a naked chick in that
mind games eh bot!
 
@Als yes
 
Als
6:41 PM
Yes what?
 
what should i do when OP posts a comment to the answer, like here,
0
A: Opening c++ program by double clicking associated file. How do I get the file name?

Alf P. SteinbachIn plain C++ you can use the arguments of main: #include <iostream> int main( int argc, char* argv[] ) { using namespace std; cout << argc << " arguments:" << endl; for( int i = 0; i < argc; ++i ) { cout << "[" << argv[i] << ...

where the comment indicates he (or she) has completely misunderstood what he (or she) has done, or what I have written, and I don't know exactly what is misunderstood?
 
Pretend it didn't happen.
 
like, the second API function I mention doesn't have a non-Unicode version, it's only wchar_t based (at least as far as I can remember)
 
Als
@AlfPSteinbach: From what i have seen for some period of time is, You are a bit cursed or unlucky, most of the times OP accept your answers but even they themselves don't upvote them.
While other answers on same q get lot of votes.
I find it confusing, that trend
 
@Als i haven't noticed. but it doesn't matter, i already have enough rep for basic SO functionality.
 
Als
6:48 PM
@AlfPSteinbach: Two of your most recent answers.
0
A: Opening c++ program by double clicking associated file. How do I get the file name?

Alf P. SteinbachIn plain C++ you can use the arguments of main: #include <iostream> int main( int argc, char* argv[] ) { using namespace std; cout << argc << " arguments:" << endl; for( int i = 0; i < argc; ++i ) { cout << "[" << argv[i] << ...

0
A: Initialisation and assignment

Alf P. SteinbachOh my. Initialization and assignment. Well, that's confusion for sure! To initialize is to make ready for use. And when we're talking about a variable, that means giving the variable a first, useful value. And one way to do that is by using an assignment. So it's pretty subtle: assignment is on...

Oh you might see +1 on both on both of them because I am going to upvote them now.
 
well thanks
 
Als
My pleasure.
Does A self confessed C++ and OOPS enthusiast look too cheeky to be on resume?
 
What's the S on OOPS?
Seems like "oops!"
 
Als
ah okay, OOP's
or rather
OOPs
You are not answering my question...
 
If it were me, I wouldn't put it like that. But then, if it were me, I wouldn't give much weight to my advice.
But I still don't understand the "s". Object Oriented Programming is singular.
 
Als
@RMartinhoFernandes: Anyways, thanks for the answer which was a No-Answer.
 
@RMartinhoFernandes Object Oriented Programming System. Have you no imagination?
 
@JerryCoffin Er, look closely at my avatar. What do you think? ;)
 
Als
41 mins ago, by Als
probably, you were a bot pre-programmed with funny one liners.
 
7:07 PM
@RMartinhoFernandes I've looked, but I still have no clue -- nothing new there though (me being clueless, I mean...)
 
sbi
@JerryCoffin Didn't you ever read Asimov? Remember R Daneel Olivaw?
What's the "R" for in his name?
 
mind=blown
 
@sbi I've read Asimov, but not in something like 30 years. No, I don't remember the name (about the only names I remember from him at all are one or two from the Foundation series).
 
R. Daneel is the character that appears in more Asimov books.
 
sbi
@JerryCoffin lmgtfy
 
7:16 PM
A name of a constructor is actually a function or a type or both?
 
sbi
@RMartinhoFernandes In the Foundation series he only appears in the last book(s).
 
Though Susan Calvin appears in more stories.
 
sbi
@MrAnubis I don't think so. Although for all practical purposes it makes no difference, I think a ctor is a function identified by the class' name, or something like this.
But I'm not good in C++ standard legaleeze.
> Daneel is the most commonly appearing Asimov character.
Says Wikipedia.
And it's the last three books he appears in. Wow, I had forgotten that.
(And for me it's only like 3 years ago, @Jerry.)
 
@sbi he started in the detective stories
the detective stories are in turn connected to Asimov's idea of radioactive Earth
which in turn is connected to silly short-story about time travel (to the future)
 
sbi
BTW, @Alf, the two songs you linked to on youtube are blocked to me. ("Unfortunately, this UMG-music-content is not available in Germany because GEMA has not granted the respective music publishing rights.")
 
7:21 PM
and to the pre-empire conflict stories
 
@sbi : look at this line please (the use of typename ) :
S(): X<T>::Base(typename X<T>::Base(0)) {}
 
sbi
@MrAnubis What is X<T>::Base?
 
@sbi oh, you're not missing much. that music was designed as parody but got immensely popular with fourteen year olds. :-)
 
sbi
@AlfPSteinbach See, I was afraid that wasn't music I'd enjoy. The title of the second one already gave it away, really.
 
but anyway, re the pre-empire novels, that in turn connects to Asimov's "currents of space" (which he later took to be carbon) and "analyzing nothing"
and i always confuse the latter story with Ursula K. Le Guin's "Left hand of Darkness"
 
7:23 PM
@sbi Yup -- I read never read an entire Robot-series book (tried once or twice, but always had better things to do). I read the original Foundation trilogy, but none of the others. In short, I'm not at all sure I've ever read anything that would have included that particular character.
 
which I wish I could find again, I remember it as a moving story
 
@sbi : S is class derived from X<T>::base
 
sbi
@MrAnubis I see. Then that syntax even seems to make sense. What's with that line?
 
@MrAnubis §12.1/1: "Constructors do not have names."
 
in above case if base (constructor) is simple function than there is no need to place typename , and if constructor name is type then we need to place typename
@JerryCoffin can you please tell me that line in simple words?
OMG templates in c++ is most confusing and hard part(
 
7:29 PM
@MrAnubis it is a formality, but it means that there is no way to refer to a constructor, other than calling it.
 
@MrAnubis They are confusing -- but there are parts of the overloading/name lookup rules that I think are actually even worse.
 
you're right , how did you monsieurs learn c++ sometimes i wonder
 
@MrAnubis that's like asking how porcupines manage to have sex. with great care.
 
@MrAnubis "Slowly" and "painfully" are a couple of the descriptive terms that virtually leap to mind... :-)
 
// Mr. Anubis <- demo
struct Huh
{
    template< class Type >
    Huh() {}
};

int main()
{
    //Huh     o;
    //Huh     o   = Huh::Huh<int>();
}
In this code, since there's no way to refer to the constructor, there's no way to specify the template argument. Hence it cannot be called. That's a bit absurd, and I can't say I really understand why it should be this way.
 
sbi
7:35 PM
@MrAnubis I started to learn C++ in the mid-90ies. I'm still at it today, and C++11 has just thrown me back about a decade. :)
 
programmers life is really persistent about learning
@AlfPSteinbach : thankyou sir , you confused me more
 
@MrAnubis what?
 
that code
 
folks, i am wondering if this person,
is the same as this person:
 
no they are different i think
 
sbi
7:42 PM
@MrAnubis Still confused, but on a higher level.
 
i'm just wondering. she added me on google+, but suddenly all her messages disappeared from my stream. but she's still there. and now there's link to facebook, with the image on top.
what with my earlier confusion over Als here, I feel like, well, confused
 
hi
 
Perhaps a bit of levels adjustment would help:
I'd say probably the same...
 
I say you can't say.
 
7:55 PM
looks the same to me
 
okay, thanks all, i now think it's same person. although the first one looks smaller and different figure from the second one. i guess real then.
how many science fiction authors have got the Nobel prize in literature?
 
sbi
@AlfPSteinbach Maybe that's Miss? :)
@AlfPSteinbach From a quick glance, none.
 
okay, i'll answer my own question. for the real Nobel prize, that's to my knowledge only one, namely Doris Lessing.
For the IgNobel prize, L. Ron Hubbard, the guy who started the Church of Scientology.
 
you know what pisses me off?
how you can't go back and re-watch programmes produced for the BBC, which is state-funded
 
BBC live broadcasts work fine for me, but any of the old stuff is "can't be viewed in your country". Some of it is on YouTube though. Happily.
 
8:04 PM
well I get it, if you're not in the UK
 
but if you are in the UK, then principally, I paid for this, so why can't I have it?
 
doesn't work?
 
nope
 
Hey
do you know why you have to add your own includes AFTER including C standard libraries?
ex:

file.h:

void my_function(int a);

file.c:

#include <stdio.h>
#include "file.h"

void my_function(int a)
{
...
}

WORKS.. but

file.c
#include "file.h"
#include <stdio.h>
doesnt work
 
Als
8:09 PM
ohla
 
@ManofOneWay You did it wrong, there's no reason at all.
 
@ManofOneWay Then your own header fails to include all that it needs.
 
@AlfPSteinbach but it doesnt need anything
it's only a declaration of a function that has an int argument
no need for standard C libraries
 
Als
Can someone tell me what is wrong with this answer.
4
A: sizeof() applied to structure and variable

AlsBoth will and should indeed return the same value. From MSDN: The sizeof Operator The sizeof operator gives the amount of storage, in bytes, required to store an object of the type of the operand. This operator allows you to avoid specifying machine-dependent data sizes in your programs. siz...

 
I get something like, error: redefinition of function my_function
@DeadMG What do you mean?
 
8:12 PM
@ManofOneWay it helps to be more concrete than that "like"
 
@ManofOneWay Well, there's absolutely no reason why it shouldn't work and it often works for me. The only reason it wouldn't work is because you did it wrong.
 
@DeadMG so it's not some stupid C standard?
notice that this is in C and not cpp
 
nope, not at all
 
hm strange
 
and if you're in C and not C++, then why are you here? gtfo, this isn't the C room
 
8:14 PM
I had a student today that did exactly this, and when he switched places of includes it worked
 
@ManOfOne: it's like, maybe rice pudding tastes very wrong, even though it's like some other pudding in some ways. it's like, it's just pudding. there is no reason the rice pudding should taste wrong -- until you reveal that you had lots of salt in it.
 
good evening everyone ;)
 
and he only had simple function definitions in his header that required no standard libraries
 
Als
hmm...no answers.
 
he probably left a semicolon off or something
 
8:15 PM
@DeadMG No we checked that
 
well, unless you actually show a meaningful example, then I can't possibly psychically debug it
 
@ManofOneWay probably a name conflict on the name of "my_function" that you do not reveal. keeping the error cause secret. that's very silly
 
all I can tell you is that the include order is meaningless
 
okey, then something else must have been wrong
 
Als
hmm
 
8:27 PM
Evil macro definitions?
 
@robert could that be a problem?
 
8:45 PM
Rather unlikely, if it's a redefinition error. If there are evil macro definitions you should get syntax errors instead.
Missing include guards maybe, so that a header file got included twice?
 
9:05 PM
@AlfPSteinbach the first person looks much sexier than the second person pic anyway
 
@JohannesSchaublitb uh, i humbly disagree
 
lol
second one looks like she just woke up
 
9:33 PM
there is not much difference 0o
 
int this line :
 template <typename T>
class z: base<T>
{
}
name what do you say to : base<T> ?
standard says anything?
 
@MrAnubis Sorry, I don't understand your question.
 
base<T> how would you say it?
 
You mean how you pronounce it?
 
yes
 
9:37 PM
I say "base of t", or "base t".
 
@RMartinhoFernandes can you say me any good book on templates , i am being over killed by them
 
I recommend C++ Templates: The Complete Guide. I bought it recently, and it's a good one.
633
Q: The Definitive C++ Book Guide and List

grepsedawkProvide QUALITY books and an approximate skill level. Add a short blurb/description about each book that you have personally read/benefited from. Feel free to debate quality, headings, etc. Books that meet the criteria will be added to the list. Books that have reviews by the Association of C an...

Also this.
 
@RMartinhoFernandes : would you say in this line class z: base<T> ( from above code) name base is dependent on T?
or whole name base<T> is dependent on parameter T ?
 
No, base is not dependent on T; base<T> is.
 
and only "base" doesn't even makes sense , right?
 
9:45 PM
base is a name. It's a name of a template.
But it doesn't make sense to use just base as a base class, because a base class must be a type, and base is a template.
 
omg , then what about base<T>
right
 
@MrAnubis That's a type.
 
last thing , will you marry me?
grins
awesome , thanks for quick help
 
@MrAnubis Are you a hot smart chick? I will if you are.
:)
 
lost another guy
:)
between are you in job or student?
if don't mind telling)
 
9:49 PM
Hmm, both.
 
cool:)
 
@RMartinhoFernandes Proof that men really are deeper than women. Men look for hot and smart -- women look for hot and rich (yes, I'm being sexist again -- oh well!)
 
evening all
 
9:58 PM
hi
what's up?
seems like we have a @CatPlusPlus imitator
Tom, San Francisco, CA
1.1k 5 18
 
@TonyTheTiger Imagine my amazement that within a minute of posting something with "sex" in it, Tony shows up!
 
@TonyTheTiger He's bigger.
 
@JerryCoffin oh lol, I swear that was entirely accidental
@RMartinhoFernandes same picture though... lol
 
I'm hoping to use this weekend to make severe progress with my BitTorrent client.
 
@TonyTheTiger Oh, yeah. I definitely believe that! :-)
 
10:04 PM
For now I'm working on an implementation completely devoid of synchronisation.
 
@JerryCoffin You're free to believe what you want really :)
@RMartinhoFernandes oh that sounds interesting, you're talking thread synchronization?
 
Yes. I'm going to see how it performs running everything in a single thread, so no synchronisation will be needed.
I can still get asynchronicity thanks to Boost.Asio.
Since this is mostly I/O bound (network and disk), I'm curious to see how well it performs.
 
true indeed, Asio is a nice library, have used it before.
should you init a double to 0 or 0.0?
or does it not matter?
 
0 is int, but it gets implicitly converted to double.
I wouldn't care.
 
oh ok
 
10:11 PM
It may make a difference passing parameters though.
Classic example: given template <typename T> max(T const&, T const&);, max(0, 1.4) does not compile.
 
oh I see
 
std::tuple or std::pair?
Ever used boost.intrusive?
 
10:36 PM
std::tuple is c++11, right? so i'ld prefer std::pair or boost's tuples until the new standard is well established
 
if it's only two, I'd use a pair
but if there's more, then tuple, obviously
 
Ah, I just remembered something.
What is the difference between void foo(const &T) and void foo(T const&), or has it the same semantics?
Once I read of a rule of thumb like "const always refers to the left-most thing next to it", so it might be more consistent to put the const& on the right side.
7
Q: Why do some people prefer "T const&" over "const T&"?

Michael Aaron SafyanSo, I realize that const T& and T const& are identical and both mean a reference to a const T. In both cases, the reference is also constant (references cannot be reassigned, unlike pointers). I've observed, in my somewhat limited experience, that most C++ programmers use const T&, bu...

 
foo(T const&) here T is const
 
11:00 PM
hi. for (int i = 9; i >= 0; i--) {
cout << "abcdefghij"[i];
} why does this compile?
 
Because it's valid?
Why wouldn't it?
 
operator [] on a literal is new to me
 
A string literal has type const char[N] where N is the number of characters + 1.
Does that help make it clearer?
 
yes. shouldn't it also work for initialier lists in c++11. e.g. for (int i = 9; i >= 0; i--) {
cout << {1,2,4}[i];
}
 
11:26 PM
@Ricky65 The problem here is that the compiler doesn't have a clue about what type is being initialized.
And std::initializer_list<T> has no indexing operator.
 
11:49 PM
lulz
 
ahahah :P
 
> I understand that by clicking "enter" below I agree to all of the above, even the stuff that contradicts itself.
 
lol
where did that come from?
 

« first day (328 days earlier)      last day (4617 days later) »