« first day (103 days earlier)      last day (5071 days later) » 
00:00 - 21:0021:00 - 00:00

00:00
lol
sbi
sbi
@Maxpm See, that's the thing. Old people keep their bathrooms clean and have seen many a weather. :)
@sbi Haha.
man, even leaning forwards just now upset my stomach
Hm, I guess there is no point in lying about my age anymore. Apparently, I am 12 years old, and I drink Gin on a regular basis. (This is AA, right?)
D:
00:01
lol
sbi
sbi
@DeadMG Even though you're not trying to sleep?
indeed
well, I am dead tired, so you could argue that I am actually currently trying to sleep
sbi
sbi
@FredOverflow No, this is Anonymous C++ Programmers. How did you get addicted, pal?
@Runcible I was just making the origami model in your gravatar a few minutes ago. Go figure.
=)
Origami ninja stars are the best type of ninja stars
00:02
@sbi I can't remember, I don't even actually like Gin.
But it made me look like a 31-year old.
could it be allergies?
I recently bought a new duvet..
sbi
sbi
@Maxpm Sometimes, origami is much more rewarding than that other word starting with "or...". What's it? Or..., org..., orga... organization!
Yeah, that's what I was meaning!
@sbi Amen.
sbi
sbi
@FredOverflow I wish a few gin would me make look like 31. :)
LOL
Try bathing in it.
sbi
sbi
00:06
@DeadMG I dunno. I haven't heard of any allergies upseting your stomach. But then I'm not a doctor.
@FredOverflow Origami?? Or the duvet??
Could you be lactose-intolerant, perhaps?
only at night?
@sbi I don't know what a duvet is, let me look that up...
and no, I don't drink any milk
but I'm sure as hell going to go and ask a doctor
because I have exams starting in a week and can't operate on this sleep schedule
sbi
sbi
@Maxpm Living in a country with, what?, 60% plain indo-european origin (with around 3% or so of a chance of being lactose-intolerant, and thus a healthy dairy industry), and being 20 years old, don't you think he'd have found out by now?
00:10
@sbi Good point.
sbi
sbi
@FredOverflow I didn't know either. dict.leo.org/?lp=ende&search=duvet
@DeadMG Do you feel pressure in your stomach? Or how would you describe the pain?
more like something is crawling around
it's not strictly painful, but exceedingly uncomfortable
sbi
sbi
@DeadMG Urgh! What did you eat again? Was it dead? Really?
duration is too long to be food poisoning
it's been getting slowly worse for nearly a week
00:12
@DeadMG Could be acid reflux. Try eating something alkaline and see if the symptoms disappear.
But seeing a doc is probably the best idea.
Oh good, an excuse to eat batteries.
sbi
sbi
@DeadMG A week?
I was gonna say
I have no idea what foods are alkaline
sbi
sbi
Seems time you'd do somethign about it.
well it didn't start out a big deal
I just belched a little more than normal at night
didn't even notice
sbi
sbi
@DeadMG I think milk is, right?
@FredOverflow There's a website for everything...
Oh, cool! I can get my free "5-Days Alkaline Diet Newsletter!"
don't have anything more than slightly alkaline
00:15
@sbi Oh, I mixed up "duvet" with "bidet" :-)
A bidet is a low-mounted plumbing fixture or type of sink intended for washing the genitalia, inner buttocks, and anus. Originally a French word, in English bidet is (US) or (UK). History Bidet is a French word for pony (and in Old French, bider meant to trot). This etymology comes from the notion that one rides a bidet much like a pony is ridden. The bidet appears to have been an invention of French furniture makers in the late 17th century, although no exact date or inventor is known. Theories exist that its inventor is Christophe des Rosiers, furniture maker for the French Royal F...
sbi
sbi
@FredOverflow I didn't know these two could breed! What's the result?
@sbi No more being scared of #2 in the bed, of course!
There, that works better.
sbi
sbi
793
A: What is the best comment in source code you have ever encountered?

matthewsException up = new Exception("Something is really wrong."); throw up; //ha ha

Anyway, I really need to go to bed. And I need to do this now.
'night everybody!
lucky you can do
@sbi 'Night. (Better late than never.)
 
4 hours later…
04:40
@FredOverflow Nice article :-)
@PrasoonSaurav What is that?
Anyone up for a maths challenge? :)
Not really good with math :S
@PrasoonSaurav Is it like a sum of 1s?
05:12
sup
06:03
Hey guys
Hi..
06:23
Can any body tell me what are the equivalent of pipes() function in VC++, what headre file should i use etc?
07:14
@nightWatcher if you're trying to find posix's pipe(), then windows does provide some wrappers (e.g. _stat for stat), but I don't know about that one; windows has its own pipe api
 
1 hour later…
08:32
co and contra-variance....
it's boggle my mind somewhat so far
it's just replace-ability of derived types right?
"just" that, sure :)
just two of those things that are relatively simple, like the concept of a lambda/closure, yet pops up again and again with unexpected consequences
for example with closures, look how they're used in javascript to give "classic" style public, protected, and private attributes
yep, I guess that's the faith of difficult concepts... for experts to get annoyed with n00b questions on it....
 
1 hour later…
10:06
@PrasoonSaurav Thanks. I have just found and fixed an error in the article: determining the distance between two pointers p and q is done via q - p, not p - q :)
user379888
10:38
Hi
user379888
Can anyone help me out with biometics?
user379888
I am interested to make a project about biometrics
user379888
which could be applicable in general
user379888
The program should be based on C/c++
10:41
can anyone else watch the clip in http://cdsweb.cern.ch/record/1204845?
I can't download the movie and it doesn't start from the webpage either (it just says "Starting download")
I don't feel the need to download wget :) Could be some temporary issue.
none of the links you posted gives me anything.
it's not like I use wget often, but it's hard to beat the functionality of that type of tool when you need it :)
that is true
those are the three direct links it shows when I click "download now" or whatever
the first one is what I used, and wget handled it perfectly :P
10:45
@Default It works for me in Firefox, but not in Opera. Which browser do you use?
I have used it once: when my team lead at work changed our schedule so very often and you couldn't keep up with the changes. He always said "well, I changed that some weeks ago, you have to check it" - So I created a scheduled task with wget to download it and store them all on a daily basis. That's the only time I used it :)
@FredOverflow Chrome. I'll try ff
@FredOverflow worked in IE as well :) thanks
@fahad I think you have to be more specific
@fahad What do you mean by C/c++?
Why not Java/C# or Basic/Assembler or Pascal/Fortran or Eiffel/Modula?
Those languages are just as unrelated as are C and C++.
no, you cannot say C and C++ are unrelated
at least, not if you want to be taken seriously :)
@FredOverflow Not completely knowing what you mean (thus, this might not be true at all), but the distance between two points could also be determined by abs(p - q), right? then it wouldn't matter if it's q - p or p - q
@Default: he was talking about a typo in a SO post
10:55
ok
@FredNurk I say Java and C# are just as "related" as are C and C++.
I say you're very wrong
the C++ committee (and, to a much lesser extent, the C committee) have put a lot of effort into keeping as much compatibility as is feasible
I know of no such effort for Java and C#
if you want to say that "C/C++" isn't a useful term, then say that
I'll agree
"C/C++" isn't a useful term
2
but the languages are undoubtedly related
@FredNurk Historically, yes. Out of necessity. And my guess is, at least in the case of Java and C#, hadn't C# looked superficially like Java, it wouldn't have taken off.
user379888
10:59
@FredOverflow: I just know C/c++ know and I have to submit a project about C++ .I am choosing biometrics for it
@fahad "Knowing C++" is an extremely vague statement :)
@fahad Are you saying you know both C and C++, or are you saying you are programming in a mixture of both?
user379888
I am learning C++ : D
user379888
I have done C and currently doing C++ and my project should be based on C++.Even if it has a some part in C language,that wont create a problem
> There is no language called "C/C++". The phrase is usually used by people who don't have a clue about programming (e.g. HR personnel and poor managers). Alternatively, it's used by people who simple do not know C++ (and often not C either). When used by programmers, it typically indicates a "C++ is C with a few useful and a lot of useless complicated features added" attitude.
> Often, that is the point of view of people who like to write their own strings and hash tables with little knowledge of the standard library beyond printf and memcpy. There are people who stick to a restricted subset of C++ for perfectly good reasons, but they (as far as I have noticed) are not the people who say "C/C++".
(taken from Bjarne's FAQ.)
user379888
: )
user379888
11:03
C++ was first named,"C with classes" by Bjarne
user379888
Both of them have a lot of things similar so they blend in the best
@fahad Yes, and that was 32 years ago.
user379888
I need good ideas for my project : )
user379888
Can you please help me out?
@fahad Good C programmers tend to be poor C++ programmers, because almost none of the C idioms should be applied in C++. For example, arrays and pointers are central to C, and they are almost never used in modern C++, because they are too low-level and error-prone.
@fahad Help out how? Do you have a specific programming question?
user379888
11:06
@FredOverflow: I need help in choosing my project
Oh, so nothing C++ related? I cannot help then, sorry.
user379888
thats not C++?
there are some things that are legitimately both C and C++
like the preprocessor
"Help in choosing my project" is not C++, no. "What is the difference between the copy constructor and the assignment operator" is a C++ question I could help you with, for example.
@DeadMG One of Bjarne's goals in designing C++ was to make the preprocessor redundant :)
user379888
11:08
I just gave that answer in my test paper today :p
it's not completely redundant, though
and if I asked a question about it, I think it wouldn't be unreasonable to tag it with C too
@DeadMG Sadly, no. But if C++ ever gets modules, we can finally get rid of it :)
lol
modules won't change my need for __FILE__ and __LINE__
@DeadMG I would even expect C programmers to be more proficient with the preprocessor than C++ programmers...
user379888
@FredOverflow: We can use copy constructor only for the objects of same class?
11:11
@fahad The copy constructor is defined to look like X(const X&) or X(X&) (plus additional default arguments are allowed), see 12.8 §2. So by definition, yes.
of course, that doesn't mean that a constructor can't take other parameter combinations, just that doesn't make it the copy constructor
user379888
@FredOverflow Thanks
user379888
@DeadMG: thanks to you too : )
Now here is a great question: Does it make a difference if I make the copy constructor explicit or not? I don't even know the answer to that question myself :) @Johannes, are you there? :)
is that even legal?
11:14
dunno :)
user379888
Can a normal webcam be used to implement face recognition system?
Are you talking about minimal resolution?
Because the recognition itself will be done by the computer, not by the webcam.
user379888
I mean to take in the image of the person for comparing it to the prerecorded patterns can I use a webcam?
@FredOverflow and continually/on-going, out of more than necessity
@Default The difference between two pointers can be negative (in fact, we have the type ptrdiff_t to express the difference between two pointers), and that can be semantically useful. I see no use case for abs(p - q) if you really want to say q - p. Note that if q lies before p, the results will differ in sign.
@fahad What is the technically limiting factor here? Why does it work with other devices (what devices are those?). Is it resolution, framerate, "depth perception"...? I'm not an expert on face recognition.
11:29
@Default: the two concepts "difference" and "distance" are not exactly the same, they are related in exactly the same way that a vector (geometry, not std::vector) and its modulo. The "distance" will tell you how far apart they are, the difference will also tell you in what direction to walk.
1
A: Avoid Redundancy in Python

Frost.bakaVersion for args: class Foo: def __init__(self, *args): for index,arg in enumerate(args): setattr(self, 'arg%s'%index, arg) Foo(1,2,3) >>> Foo.arg0 1

11:42
@DavidRodríguezdribeas Ah, like "velocity" and "speed" :)
one a vector, the other a scalar
@DeadMG On a side note, C++ has "scalar types", but those are something completely different :)
@FredOverflow @David why would you need a difference between two pointers? I could maybe see a reason if you have a string and would need a substring (or similar for vector), but are there other uses?
T* middle = begin + (end - begin) / 2;
@Default You need that in quicksort if you don't want to degenerate to O(n²) for sorted inputs.
@Default nope, no other uses; manipulating slices of a sequence (including finding the length of a particular slice) is the only reason
but it is enough of a reason :)
11:49
hehe
Quiztime! What does the following program do?
int a = 47;
int b = 11;
std::cout << &b - &a << std::endl;
(No, it does not print 4 or something.)
undefined behaviour
so how come an access violation seems to lock up my program at times and other times just throw an exception? Is that just UB in action?
We have two winners!
11:49
why?
Because pointer arithmetic is only defined for two pointers pointing within the same array.
@Default: the standard only guarantees you can subtract pointers if they point to items within the same array or are the one-past value for that array
with single objects treated as arrays of length 1
so &a + 1 is valid
How about this one, what does it do?
int a = 47;
int b = 11;
std::cout << (&a + 1) - a << std::endl;
UB! :P
prints 1
no, wait
yes
1
11:51
Exactly, 1 is right.
What about this one?
@DeadMG nice you got 20K rep!!! :)
int a = 47;
int b = 11;
std::cout << (&a + 2) - a << std::endl;
yes, I do
wouldn't that be interpreted as a pointer?
undefined
11:52
@DeadMG Three in a row. You're on fire!
ow, it hurts
How was sleeping btw?
why is that last one UB?
terrible
I didn't sleep until 2:30am
@Tony Because &a + 2 is too far away :)
11:52
woke up at 4:30am and got up at 6:30 am
i'm confused.. cout << int* - int prints `int´?
oh ok
still feel pretty shitty and it's way past normal for me to be feeling better
You are only allowed to point to a thing or just beyond it, but not farther.
no, Default
that's not even close to a legal expression
11:53
@Default No, int* - int is an int.
T* would be more appropriate, as it's not dependent on the pointed-to type
I should read a good C++ book
@Default that does help! :) Personal Experience
@Default the expression's types are (int* + int) - int*, not int* - int
notice the last type in each of those, int pointer vs int
@DeadMG Well, you could do this...
int main()
{
    long i = 3;
    #define int i
    std::cout << int* - int << std::endl;   // prints -9 :)
}
11:56
pretty surethat it's undefined behaviour to define macros lexically identical to keywords
@FredNurk hm, sry.. What I meant was: (&a + 1) is int*, 1 is int, thus, int* - int printed 1 (which is int)
@DeadMG It is. That 4 for 4!
@Default Oh wait, that should have been (&a + 1) - &a. My mistake :)
@Default except it was int* - int* that printed one, not int* - int
that's half a point for me :)
@FredNurk It should have been, but wasn't :)
11:57
@FredO: Clearly you suck and we need a new quizmaster
@DeadMG I nominate you.
I don't
@Default nevermind me, I see correct code even when reading bad code :(
I nominate @DeadMG
even if I was up for it normally, I'm way too sick right now
11:58
@FredOverflow: Here's one for your pop quiz series: Given struct A{};struct B:virtual A{};class C:virtual B,A{};class D:B,public C,virtual A{} a; What's the order of destruction of 'a'?
class, ROFL
you got it filtered
@FredNurk I'm not an expert on virtual :(
ok, question then: what would std::cout << (&a + 2) - a << std::endl; print (that is a, not &a)
undefined
@Default Undefined behavior
11:59
ah.. :)
and
a is destructed last
because it's constructed first, because it's virtually inherited and
also.. how does (&a + 2) even work, when a is an integer. Because, that translates to a[2], right?
@Default The expression (&a + 2) already invokes UB, it does not matter what you subtract from it afterwards.
Default: Not necessarily
12:00
@Default &a is an int*.
a[2] only works when a is already a pointer or array
yep, following :)
ok
it's equal to (&a)[2]
sooo... access violation? :)
@DeadMG No, it's equal to &((&a)[2]).
12:01
undefined
cout << (&a + 2) << endl
yes, of course you're right
the result is a pointer to said element
not reference
@Default it's extremely unlikely to generate an access violation
@Default &a + 2 is undefined behavior, get over it :)
12:03
@FredOverflow Or any random number :P (&a + 1) - a == (&a + 1) - 47
@DavidRodríguezdribeas That a should have been &a, my mistake.
I am still waiting for the compiler that generates dragons for UB..
I personally prefer the compiler that sends engineers to your house and beats you around the head with a baseball bat
which is also covered by undefined behaviour
@DeadMG haha
@DeadMG I'd rather have undefined behavior fix me dinner, but then again, what would be served in the table would be undefined.
12:05
lol
hm, when I googled c++ undefined behaviour the chrome-page crashed
rofl, really?
while we're wishing, I'd rather have UB that does what I meant, every time
mine didn't
every program then becomes: int main() { strcpy(0, "boomstick"); }
12:06
lol
@DeadMG I guess my chrome is't working well today :P
you even have to write that?
my programs would be like
#define DeadMG
done
oh wait, that doesn't invoke UB
heh :P
lol
#define int DeadMG, plus including a stdlib header
12:07
#define int // undefined whoopsies
if you #define JonSkeet - does the program write itself?
doubt it
what if it's C#
still no
ugh
I'd much rather #define some_antibodies
hehe..
agree..
12:10
I have exams next wednesday
go go captain effective revision
12:24
@DeadMG have fun :)
13:08
better to write @AlfPSteinbach , that way he will get a notice of it.
@FredOverflow yes making the cctor explicit makes a diff
@FredOverflow given struct A { explicit A(A const&); A(int); operator int(); }; now the semantics is: A a = 0; fine. A b = a; not fine. A b(a); fine. void f(A); void f(int); f(a); not fine (selects first function, but first function's parameter initialization is invalid).
yeah, I just tab-complete :) the @ is the trick
sbi
sbi
13:24
Wow. I see that you're talking C++ again. Well, unfortunately I have work to do, so I can't stop you. Just you wait until I have the time at my hand!
3
13:58
8
A: What is the best comment in source code you have ever encountered?

Johannes Schaub - litbI like some of the comments in the GNU binutils. This one is from BFD som.c: /* You'll never believe all this is necessary to handle relocations for function calls. Having to compute and pack the argument relocation bits is the real nightmare. If you're interested in how this works, j...

 
3 hours later…
16:41
wow silence...
17:01
Hey guys
I'm writing tests in CPPUTest and wondering if there is a way to run tests in a specific order?
17:15
@jluebbert Why do you want to? Tests should be independent.
17:53
anyone here any good with delphi?
well i guess the question would be...are any of your formiliar with delphi?
@FredOverflow Well I'm testing my puzzle solver and I want to test code that runs after a specific number of moves in, but I think I figured it out. Thanks though.
0
A: C++ pointers - What values are held here?

Fred NurkPointers are envelopes, similar to those that get delivered in your daily mail. These envelopes hold addresses. You can follow an envelope to the house pointed to by the address it holds, and then see who lives there. Sometimes another envelope lives there. If so, you can follow that envelope...

18:24
ugh
shouldn't have eaten anything today
19:05
@DeadMG Dead you see a doctor today?
@FredNurk What do you need the envelope for? What's interesting is the address printed on the envelope, isn't it?
@FredNurk I found the description kind of weird... it looks good in the simple case, but "taking the address from an envelope to find where a different envelope lives"...
no
my parents told me that I was overreacting and I listened to them
bad idea :(
GO SEE A DOCTOR TOMORROW
19:28
@FredOverflow I tried to characterize it as the address is in the envelope, but on works too
sbi
sbi
@FredOverflow What an incredible Freudian slip!
@DavidRodríguezdribeas anthropomorphizing pointers breaks down at some level :), but I do find the street address analogy seems to work just as well as other analogies
pointer = URL, pointee = website
2
Although that doesn't really work on the type level -- a URL does not tell me anything about the kind of website it's linked to.
pointer = key on mobile phone, C++ = T9 algorithm, pointee = text in display (not necessarily what you intended)
Explaining pointers to x86 assembly programmers is quite easy:
pointer = ESI, pointee = [ESI]
I found a glitch on page 87 of TC++PL. Anybody has a copy? :)
sbi
sbi
19:39
@FredOverflow I have. I don't have it here, though. <useless_reply/>
@FredOverflow that's just explaining pointers in terms of pointers :)
19:54
@FredNurk Well, esi is just an address, not a pointer. Pointers are typed (except for void*), addresses are not :)
So that example also sucks.
a pointer either holds an address or a null pointer value
same for ints. ints are typed, numbers are not
@JohannesSchaublitb What exactly do you mean by "a pointer holds an address"?
@FredOverflow "the value of a pointer is an address", an object "holds" or has a value
I'd say a pointer is a typed address.
And a pointer variable holds a pointer.
Or, to be more precise, a pointer object, for example a cell in an array of pointers.
variables are objects in c++, so I don't think we need to go into that; incidentally that's not true in other languages
20:01
@FredNurk Yes, but there are objects in C++ that are not variables.
int* foo[42];
Here, foo[0] is a pointer object, not a pointer variable (because it has no name).
"all variables are objects" doesn't imply "all objects are variables" :)
Right :)
But it does imply: If X is not an object, than X is certainly not a variable.
So all non-objects are non-variables.
Do we have a FAQ (or FAQ candidate) for the C declarator syntax?
20:19
how about just referring to the C FAQ
why on earth is there even a difference between object and variable?
in what cases do they actually have different semantics?
@DeadMG variables are named objects, nothing more complicated than that
(at least in c++, other languages do different things)
20:44
right
so why do we have different terms for them?
because it's convenient
arguing over which is which out of two almost completely identical things is convenient?
sbi
sbi
20:56
@DeadMG Because there are also unnamed objects?
but they don't actually differ from named objects in any way at all
there is no language feature that operates on only variables or only objects
sbi
sbi
@DeadMG I think there is: You can bind a non-const ref only to a variable, not to an unnamed object.
that's not true
int a[] = { 1, 2 };
int& ref = a[1];
00:00 - 21:0021:00 - 00:00

« first day (103 days earlier)      last day (5071 days later) »