« first day (224 days earlier)      last day (4722 days later) » 

2:25 AM
May 24 at 18:56, by sbi
Someone made the c++11 tag a synonym of the c++0x tag: http://stackoverflow.com/tags/c%2b%2b0x/synonyms. IMO calling this "wrong" would be a serious understatement. As someone else (@jalf?) said: That's as if we'd still refer to Vista as "Longhorn". (Please star this if you agree with me that this is wrong.)
@sbi did you complain to the meta already?
I think that's a serious bug
 
3:02 AM
Hi all .
 
 
2 hours later…
Als
4:56 AM
sigh..
Leaking rep...
 
cpx
5:15 AM
12
Q: Reputation Page can't add

SLaks (click to enlarge) Last time I checked, 10 + 10 + 10 + 50 ≠ 20. It survived a couple of reloads, although it's now correct.

 
i dressed myself late. is this right sentece
>
 
 
1 hour later…
Als
6:34 AM
ridiculous i got downvoted on this...
4
A: Declaring array of int

Als#include<iostream> int y[10]; void doSomething() { int x[10]; int *z = new int[10]; //Do something interesting delete []z; } int main() { doSomething(); } int x[10]; - Creates a array of size of 10 integers on stack. - You do not have to explicitly delet...

 
 
1 hour later…
sbi
7:56 AM
@JohannesSchaublitb No, I didn't get around doing this. (I had a hell of a week.) And I won't be able to do so before late tonight (GMT+1), and might be too exhausted to do so.
 
Xeo
8:07 AM
morning
@Als Have my upvote against pedanticness
 
Als
@Xeo: Thanks! really messy out there!
@sbi: Hey mr grumpy long time!
 
Xeo
8:33 AM
Wow. A WinRAR installer packed in a .rar archive...
Mornin' Mr. Tiger.
 
sbi
@Als Hi. And Goodbye. (I'll have to feed the kids now (breakfast time over here), then I'll go buy groceries, and then I'll take this herd of kids to the garden. So it'll be a busy day and I won't be at my computer until late in the evening.)
 
@sbi have fun and good morning too!
 
Xeo
@sbi Heh, and I'm sitting here, having school. :(
And worst of all, Java.
 
@Xeo uh? on Saturday?
 
Xeo
@TonyTheTiger Yep.
We get free time on mondays though, as compensation
And we have extremely much free time lately anyways.
 
8:45 AM
oh I see
 
Xeo
But it's Java...
 
Als
9:07 AM
Hey
 
9:22 AM
Hello
 
Als
@TonyTheTiger: hey tiger! saturday whats up for it?
I faced a pedantic attack this morning! :P
 
@Als I saw you were getting attacked by pedants
Saturaday brings work, I have to do some work
 
Als
@TonyTheTiger: Oh..I see
Not so fun working on saturdays
 
I know, but I have to get some stuff done....
what are you doing today?
 
Als
Since I survived the pedant attack, plan to read some about templates & I badly need a haircut!
so planning for that..
 
9:33 AM
@Als hahah, yea me too actually... thanks for reminding me there also a life outside of the computer... lol
how long you been doing programming for?
 
Als
@TonyTheTiger: True that, its those hectic times...that make forget everything else
about 6+ years
 
@Als oh wow, way longer then me then
 
Als
I don't have a software engineering background though
 
@Als you came from another industry ?
 
Als
I have a bachelors in Instrumentation Engineering :P
 
9:35 AM
@Als what's that?
 
Als
Instrumentation is a branch of engineering which deals with measurement and control of different parameters
lets say temperature/pressure control in heavy industrial plants
SCADA, PLC stuff like that
 
oh I see, interesting
so why'd you end up changing to dev then?
was it not interesting for you?
 
Als
In the industrial world what matters is the practical experience and the study of bachelors had all theory and no practicality
 
oh yea, that's true
 
Als
they had us nuclear instrumentation and we never went anywhere near a nuclear plant
naturally i lost the interest
 
9:38 AM
yea I can understand that
 
Als
Turning to Software was easier(the place where i come from is outsourcing hub as u know)..interesting..more rewarding
 
oh I see.... yea I know a lot of dev is being outsourced to Asian countries, I also think there's some very smart people in Asia that work with computers
 
Als
I will say very smart and very dud...equally!
 
hahaha
 
Als
:) unbiased assertion!
:P
 
9:41 AM
so it's easy to find a good paid job there as a software dev?
 
Als
Yes, I think so, We produce herds of Engineers every year
 
oh ok, lulz
 
Als
and most of them get picked up by software cos through campus interviews
 
i see
 
Als
u pay a freshman less make them do the same not so skilled work and u save on the pay out to experienced programmers...thats the tag line
 
9:44 AM
hmmm yea
 
Als
How long have you been programing? And you from software background?
 
so have you ever been to Europe or the US?
 
Als
Well, I have worked in France, Sweden, Denmark, Japan & was almost about to go to the US when i changed my job.
 
I have been really coding for about 2 years, I've had an interest in IT from when I was about 12, actually tried to learn C++ when I was 13 (quit though, too hard) and then picked up development again about 2.5 years ago.
oh wow, pretty cool... so you've seen some of the world, nice :)
 
Als
:)
that makes me ask, how old are you now?
i hope not 16! lol
 
9:46 AM
been doing IT support for my family ever since... ugh
no I'm 24
 
Als
geez you are younger!
 
oh, you're older then me?
 
Als
darn I am...
 
Als
I am not saying how much:P
haha
 
9:48 AM
I figured...
it always surprises me that people in their 30's or even 40's can spend time on a chat like this
 
Als
You have learned well for just 2 years of exp in programing
 
oh thank you :)
 
Als
Im not that old though...but well I guess its kinda different for family personnel
 
as long as I keep learning, cause I always feel like an idiot around here, so many people with SOO much knowledge
@Als family personnel?
 
Als
Thats true and I agree, I feel similar, but the fact is One can't be good at it without ACTUALLY working on it
 
9:50 AM
yea true, requires a lot of doing and a lot of time invested in it
because there's a lot to know
 
Als
the kind of IT service industry I work in, its making ends meet rather than developing special skills
one day you work on C, then C++ then Java..oh no Android...back to scripts and just a mess
 
like yesterday I helped a guy on here with some kernel code... I happened to have a book or two lying around about kernel/driver dev, learned a lot doing that.
 
Als
I meant people with families should find it hard to chat around here
 
@Als oh yea I'm sure, I'm still a loner, got no family or kids to worry about, not even a gf
don't think that girls want nerds like me
lol
 
Als
@TonyTheTiger: haha you have to show them your stripes
 
9:53 AM
lol :) yea, but I can't talk to girls about C++ or whatever... they'll run away
hahah
 
Als
@TonyTheTiger: Yeah!
And one thing i want to complain is the lack of female population on SO!
lol
Lately, I have been miffed by this one pedantic critic Nawaz, who kind of mocks peeps
 
I have the same complaint
@Als yea well, C++ is a language for pedantics.... so you can't expect anything else but pedants
look at some of the discussion going on in this room at times
 
Als
@TonyTheTiger: Haha I know
 
people here get into furious arguments about very little things
 
Als
yeah But thats okay if the nerds in arguments are experienced programmers
 
9:58 AM
you don't think this nawaz guy is experienced? he seems to be...
 
Als
He is I think so vastly but this guy always keeps popping around everywhere telling me to not say the words stack & heap to a newbie who is asking about difference in new and array
 
but he just made a point that wasn't really valid.... anyways @JerryCoffin seems to have put it straight for ya
@Als yea well, problem is that there is a lot of misconception about these things and I guess he just wants to avoid spreading confusion
 
Als
Frankly, I don't even want to enter the detail of that but the thing is one has to consider the context of the Q where these words are being quoted.
 
surely, I agree with that
 
Als
Using fancy freestore is just going to throw a newbie away in to a realm they are not even aware of
You cant just pick up a stick and start whacking everyone saying stack and heap
Geez, I got downvoted on Meta!
lol
this is incredible
2
Q: Reputation change in profile and in rep report are different

AlsIf I highlight my username a lil dialog shows 215 under todays reputation. If I visit my profile it shows 175 as today's reputation. If I visit http://stackoverflow.com/reputation it shows: ** rep today: 215 ** rep this week (5/22/2011 - 5/28/2011): 554 ** rep this month (5/1/2011 - 5/31/201...

 
10:06 AM
ugh I hate it when you get downvoted and no explanation is given as to why...
 
Als
hehe
 
@Als actually when I read one of Stroustroup's books on C++, that's the word he used
 
Als
Yes, true
How many newbies know of freestore and how many are aware of stack or heap?
One can only explain in terms that they are aware of
 
Ironically, you cannot free stuff on the "free store" :)
 
funny how you get "Popular Question" badges for questions like this
2
Q: LEAL Assembler instruction

Tony The TigerI have the following instruction and I'd like to know what the function is of the 0x10 in regards to this LEAL instruction? Is it a multiply or addition or is something else? leal 0x10(%ebx), %eax Can someone please clarify? This is x86 assembler on a Linux box.

 
Als
10:10 AM
@FredOverflow: Hello
 
@FredOverflow you mean you delete stuff on the freestore?
 
Als
ahhh....bloody pedants....!!
 
hi nubs
 
Xeo
10:11 AM
@TonyTheTiger Nope, you delete stuff on the heap
 
Als
Dead Man Talking!
 
the freestore is the Standardese for the heap
 
@Xeo isn't heap and freestore kinda synonymous?
@DeadMG that's what I thought
 
Als
so saying the words stack and heap are a criminal offence in SO?
 
nah, they're widely accepted
nobody talks about the free-store unless they're being extremely, extremely Standard
 
Xeo
10:14 AM
@DeadMG gotw.ca/gotw/009.htm This article says otherwise
 
@Als When I was learning C, I was aware of the general CS concept of a stack (i.e., LIFO), but not of hardware stacks. I've never needed the latter to properly understand C (and latter C++) and I still view explanations that rely on details of the implementation rather than the idea itself (here, the language).
 
@Xeo: That article was "updated" in 2000
 
Als
@DeadMG: Pedant war on that
5
Q: Declaring array of int

MaysamIs there any difference between these two declarations? int x[10]; vs. int* x = new int[10]; I suppose the former declaration (like the latter one) is a pointer declaration and both variables could be treated the same. Does it mean they are intrinsically the same?

 
that's at least one and nearly two Standards behind the current
and that article, well, since nobody in C++ uses malloc or free anyway then it's of little concern
 
Hardware 'stacks' and 'stack' the data structure do share a name but as a beginner what does that really tell you?
 
10:17 AM
there are hardware stacks?
 
Als
I believe every newbie is taught f stack as an LIFO
but hardware stacks i aint aware of that
 
That's the stack in 'the variable is allocated on the stack' isn't it?
 
Als
so every newbie is basically aware that we refer the LIFO when we say stack
 
the C++ stack is not implemented in hardware
 
Als
well why even say function call stack then?
 
10:19 AM
the call stack is implemented in software too?
 
Xeo
9
Q: What is the origin of the term "heap" for the free store?

UriI am trying to find the official (or a good enough) reason that the free store is commonly referred to as the heap. Except for the fact that it grows from the end of the data segment, I can't really think of a good reason, especially since it has very little to do with the heap data structure. ...

10
Q: C++, Free-Store vs Heap

Nick DandoulakisDynamic allocations with new/delete are said to take place on the free-store,while malloc/free operations use the heap. I'd like to know if there is an actual difference, in practice. Do compilers make a distinction between the two terms? (Free store and Heap, not new/malloc)

those where the questions I could find on this topic
 
Als
@Xeo: Interesting
 
I think the call stack is actually a software implemented thing...
 
the call stack is just a bunch of return addresses on the regular stack
 
hardware has no notion of this stack I think
yea that's what I meant
 
10:23 AM
@Als My point is not that the name is ill-chosen. It's that relying on others to understand a concept because it shares the name with a related one is a misguided notion (IMO). Just because I expect someone to know of the CS tree structure, I don't expect them to understand what I mean by e.g. the term 'the tree of reachable references' alone when explaining GC.
 
I think the CRT heap is implemented as a linked list of memory blocks
 
Actually, many processors have dedicated instructions to deal with the call stack. Like push and pop and call and ret and enter and leave on the x86.
 
yeah
but the fundamental stack memory itself is just a bunch of RAM
 
x86 even has a stack segment called SS :)
I believe Smalltalk doesn't have a call stack, right? The activiation records are on the heap or something. This makes using lambdas much easier.
 
the call stack of all native functions needs to be on the normal stack
I think
 
10:33 AM
Does Smalltalk have native functions?
 
how should I know?
 
@DeadMG This answer suggested to me that you did know.
 
no, my implication was that if the call stack is on the heap, then they probably aren't
but as to the definite rather than the my opinion of the probable, then I would have no clue
 
"the call stack is on the heap" sounds a little contradictory, doesn't it? :-)
And what about Stackless Python? If I'm not mistaken, it has no stack at all (hence the name).
Stackless Python, or Stackless, is a Python programming language interpreter, so named because it avoids depending on the C call stack for its own stack. The most prominent feature of Stackless is microthreads, which avoid much of the overhead associated with usual operating system threads. In addition to Python features, Stackless also adds support for coroutines, communication channels and task serialization. Stackless microthreads are managed by the language interpreter itself, not the operating system kernel—context switching and task scheduling is done purely in the interpreter...
"for its own stack", hm...
 
hmmm stackless python with a stack...
 
10:39 AM
hey
how can I figure out when exactly a destructor gets called in C++?
 
Xeo
@Nils if it's an object on the stack, at the end of the scope. if it's on the heap (heh), when calling delete. For temporaries on the stack, it's at the end of the full expression (i.e., at the semi-colon ";")
 
yep
 
@Nils At the end of the lifetime of the object, or when you explicitly invoke the destructor
 
Xeo
@LucDanton Well, yeah, that describes it more concise.
 
yep if objects share resources and the deconstructor frees them and you accidentally copy them (temporally) then you have a problem..
 
10:42 AM
@Xeo I didn't mean to slight you. I was slower to type and midway through it I just went on until I hit 'enter'.
@Nils Yes, that's why the rule of three is important
 
Xeo
@LucDanton Let's say I just described the "end of the lifetime" part :)
 
@Nils By writing std::cout << "destructing " << (void*)this << std::endl; in the destructor body?
 
So if I would just disallow copying that would be an option..
 
Xeo
Btw, what type is this exactly? T* or T* const?
 
@FredOverflow That's what I did
 
10:46 AM
@Xeo this is T* in normal member functions and const T* in const member functions.
 
Xeo
Hmm... brb.
 
The this pointer itself is never const, since it is an rvalue, and there is no such thing as a scalar const rvalue.
 
@Xeo (cv) T*, but this is an rvalue and is non modifiable
 
Xeo
Ahh, so it's an rvalue, k
Because I thought of just swapping this pointers for a moment.
 
Yeah, this is one of the few exceptions of an rvalue with a name :)
@Xeo Impossible, you cannot assign to this. What would the semantics of that be?
0
Q: What's the meaning of MOV EAX, DWORD PTR SS:[EBP+8h] and how can I translate it into AT&T format?

xxbidiaoI'm using Code::Blocks to code, but one of the code I referenced is from Visual C++,so I have difficulties on the difference...:( the full code are here NAKED void ijlWrite() { __asm { PUSH EBP MOV EBP, ESP MOV EAX, DWORD PTR SS:[EBP+8h] MOV ECX, ssQuality MOV...

Is my comment about the infinite recursion accurate?
@Nils Did the result baffle you? Or why did you ask?
 
10:55 AM
Well I first wondered why a pointer was no longer valid when I called a function before which did not change the pointer (because the deconstructor of my wrapper got out of scope, which then called free)
and it took me a while to realize that ;)
 
Xeo
@FredOverflow Maybe not, because it's calling a pointer to (maybe) another ijlWrite function
 
BTW it's destructor, not deconstructor ;-)
 
Xeo
At least I'd translate lpfn to long-pointer function
 
Ah, I see, it's an indirect call. Comment removed, thanks.
 
eclipse marks deconstructor and destructor as a spelling error
 
Xeo
11:03 AM
0
Q: What is the difference between the heap and the free store?

XeoOriginally a pedantics war on @Als answer here, it also sparked a discussion in the C++ chatroom. This article by Herb Sutter distinguishes between the two, but is also over a decade old, as it clearly was written before 2000 and also talks about the standard draft, which can only mean C++98 dra...

@DeadMG, @Als
 
0
A: What's the meaning of MOV EAX, DWORD PTR SS:[EBP+8h] and how can I translate it into AT&T format?

FredOverflowCan't you just write the function in C++? A little more type information would help, but how about this? void ijlWrite(int* p, int i) { p[80] = ssQuality; lpfnIJLWrite(p, i); }

@Nils Well, destructor is the correct term.
In object-oriented programming, a destructor (sometimes shortened to dtor) is a method which is automatically invoked when the object is destroyed. Its main purpose is to clean up and to free the resources (which includes closing database connections, releasing network resources, relinquishing resource locks, etc.) which were acquired by the object along its life cycle and unlink it from other objects or resources invalidating any references in the process. The use of destructors is key to the concept of Resource Acquisition Is Initialization (RAII). In binary programs compiled with the GN...
 
pretty sure that destructor is the Standard term
 
@FredOverflow ok, had that in mind too
What are all the (usual) warning options that gcc has to offer? I use -Wall -Wextra.
 
lol invoking g++ from nvcc with -pedantic produces soooo much output
I was wondering if it would even teminate.
I'm off cu
 
@FredOverflow quite befitting for C++ programmers
lol
 
There is also -Weffc++ which warns about violations of rules of thumb described in "Effective C++". No kidding!
 
@FredOverflow wow, pretty cool!
 
> When selecting this option, be aware that the standard library headers do not obey all of these guidelines.
LOL
 
11:32 AM
hahah :P
 
Hm, if I write a class with a pointer data member, a constructor and a destructor, I get:
warning: 'class Foo' has pointer data members [-Weffc++]
warning:   but does not override 'Foo(const Foo&)' [-Weffc++]
warning:   or 'operator=(const Foo&)' [-Weffc++]
That seems quite useful!
 
That warning option always ends up getting in the way though.
 
Xeo
@FredOverflow It doesn't warn about the destructor?
 
@Xeo What do you mean? I wrote a destructor.
Without the destructor, it doesn't warn me at all, btw.
 
Xeo
Ah, sorry, I overlooked that first sentence before the warnings
 
11:47 AM
does anybody know what it means with 'as a function of time'? as in 'animate the camera as a function of time'
my math sucks somewhat
 
it means that the camera is animated at a certain rate
 
hi
 
Als
Hey Sorry! My internet connection couldnt bear our pedantic horror and broke me down before..
Lemme see what did i miss...a q from @Xeo..
@Xeo: +1 for you for the Q
 
@TonyTheTiger It means the camera's position and rotation and other stuff depends on the current time.
 
Als
I see a @Node as first one in the people in the room, that makes you the Head of the List :)
 
Xeo
12:09 PM
Searching for this in the C++0x draft is kinda... difficult
 
Als
I would love to have a kinda of functionality which alerts or pops up when a new Q gets asked on particular tag, it seems we had it a feed functionality for new Q's but not anymore...
 
Xeo
anyone got the c++03 standard handy?
 
@DeadMG does a project using D3D have to be a win32 project or MFC?
or can you start with a simple console too?
not sure if D3D can be used to draw a window on the screen...
@FredOverflow Thanks for that :)
 
12:25 PM
you have to have an HWND to draw to
 
hmmm ok
ugh but Win32 is C...
 
sure, but you need like, 100 lines of it for D3D and that's it
I mean
you need WinAPI for input and stuff anyway
 
did you use it in your engine?
 
yes
 
oh yea, I found it now, you nicely put it in one place :)
 
12:40 PM
yeah
as you can see, it wasn't a huge amount
 
SetWindowLongPtr not sure what this function is actually doing, MSDN says 'changes an attribute of the specified window'. To me a window attribute would be it's size or something, but this is not what it changes.
 
it's a variable attached to the HWND
basically, it's used to associate this with the WindowProc, so I can make an OO callback
 
hmm ok
I've never heard of this either UIPI hierarchy, it's mentioned in the SetWindowLongPtr MSDN docs....
ha! Found it: UIPI = User Interface Privilege Isolation
 
I've never heard of it either
 
User Interface Privilege Isolation (UIPI) implements restrictions in the windows subsystem that prevents lower-privilege applications from sending window messages or installing hooks in higher-privilege processes.
Higher-privilege applications are permitted to send window messages to lower-privilege processes. The restrictions are implemented in the SendMessage and related window message functions. Not all window messages that are sent from a lower-privilege process to a higher-privilege process are blocked. Generally, “read” type messages, for example WM_GETTEXT, can be sent from a lower-privilege to a higher-privilege window. However, write type messages, such as WM_SETTEXT, are blocked
from here
 
12:47 PM
however, since there's no inter-process communication going on, UIPI won't interere
interfere*
 
surely, was merely curious as it is mentioned in that documentation
 

« first day (224 days earlier)      last day (4722 days later) »