« first day (24 days earlier)      last day (4923 days later) » 
00:00 - 22:0022:00 - 00:00

12:39 AM
@tina: I believe UML adopted the "package" thing from Grady Booch's approach.
Here's the Wikipedia article on UML packages.
@tina: yeah, confirmed (I googled), but Booch called them class categories. "A class category represents a cluster of similar classes. Illustrate a class category by drawing a rectangle with two compartments." (from this page). Note that Booch notation predates UML and was assimilated into / adapted for UML.
@tina: you can think of it as a physical packaging thing. If you want to work with class X, and that almost always involves also Y and Z, then you'd like X, Y and Z to be packaged together in e.g. a single library file. Or whatever. :-)
uhm, yes
yes
unless you discover, by practical usage, that it would be nice to split some general support classes off in their own package(s), e.g. for reuse in other projects
?
@tina: since you only have one, easy... ;-)
yes
@tina: use cases as in UML use cases belong at system level, the interaction between system and users. that kind of use case has nothing to do with classes or packaging or any internals, at least as I understand it (practice may have changed, it's not like UML is very clear cut). so, two very different things.
@tina: huh?
@tina well I had to read up on that, and yes, you can bundle nearly anything into a package. I hadn't thought of that. question is whether it helps you to do that. See en.wikipedia.org/wiki/Package_%28UML%29
@tina try it. it'll probably work (it's conventional packaging of such, many 3d libs are built on top of 2d libs). if not, fix. all design and programming is iterative. like try something reasonable, if not work, fix it, or try something else.
@tina "work" = works in technical sense + feels right :-)
@tina remember, "No battle plan ever survives contact with the enemy. — Field Marshall
@tina that means, don't expect any design or coding attempt to work out first try. expect at least a few iterations. the thing is, one can't foresee everything, and one will be surprised, like, "hey, why on earth didn't I think of that?"
 
1:37 AM
@tina UML is about bringing clarity. if something is confusing, ditch it. like, if use cases don't bring clarity for your design of 2d and 3d classes, then why have them?
@tina sounds good
@tina there's one technique you can use, namely to code a mock-up in C++. a mock-up means not for real, just operations saying "i'm executed", so on. that can clarify dependencies and what's needed of functionality and so on.
 
@JerryCoffin reading this again in the starred messages, I realized you used "these" and I'm not sure we were even talking about the same thing: I meant a single post on meta to collect and list SO questions, not multiple posts
 
UML is not worth the pain that comes with it.
 
2:17 AM
@tina: perhaps you can associate class diagrams with package, or something. it's tool usage. It depends on the editor you're using.
 
2:36 AM
hello
evryone
I have a rather basic question to ask if I am allowed
to
How to allocate a permanent char array in C/C++? The value should remain in the memory even after closing the program and should change only when I make changes to it.
 
Is there a C room ?
 
yes
 
@BogusBoy How do I get to it xD
Or is this for C and C++ . . .
 
@Bogus: it's hardware question, not a language-related question.
 
2:44 AM
no I mean
 
@BogusBoy Cheers man
 
Like in objective C we have something called NSUserDefaults
which pretty much acts like a local database
My objective is to store a value in a c++ char array
and make it live even after the program closes so that the next time when I open my program and access it, I get the value that I set last
 
@Bogus: just store it in some persistent storage like a file or Windows registry or that NS-thing (I'm not familiar with it) or whatever.
 
there must be some way
 
@tina I'm sorry I don't know
 
 
2 hours later…
4:38 AM
@tina no, no, don't do that. don't even think about it. never use a union.
@tina to get rid of it, think about how it would be used. express that functionality. possibly you'll need polymorphism (class inheritance), but you might get away with something simpler -- it depends on the functionality.
C++ language features to absolutely always stay away from: union, goto, volatile.
yes
is it fair to say that, except for the case of being a point, an S_Geometry object is intended to represent a shape?
in most cases C++ unions are used, or rather abused, to emulate (run time) polymorphism. polymorphism is where a pointer or reference is to an object where all that's known is that it is of some base class, but at run time it will really be of some derived class that overrides virtual member functions, add state, whatever.
it sounds like an abstract shape can be simple or a collection of shapes.
 
5:10 AM
@tina to get a handle on this i think you need to look away from UML design level a bit, and code up some exploratory program. Bjarne Stroustrup always used shapes as his initial introduction to polymorphism, so if you have one of his books look there for ideas.
a simple program might be one where shapes display themselves textually (not graphic), there is a function display that takes an abstract shape as argument and displays it, and main calls display with a square shape and then with a line shape.
@tina i know you're not getting it, that's why i'm recommending nitty-gritty programming of example program. Bjarne's latest book is very good beginner's book. it's used at Texas something-somthing university. And I believe but not sure that it has shapes example. I know for sure The C++ Programming Language has shapes example. But that book can be difficult to grok.
why not union: every place a union is used, the code using it must determine what the actual kind of object is. this makes it easy for bugs to creep in, and it makes it very difficult to later introduce some new type. often it's done by having a "type id" member that the using code must check. Bertrand Meyer went so far as to not have enumerations at all in Eiffel, to try to steer people away from that pitfall...
 
5:36 AM
Yeah, Bjarne discusses shapes in chapter 12 of his latest book Programming -- Principles and Practice using C++. It's available at Amazon, but chapter 12 is available for free as a PDF file. Direct from Bjarne Stroustrup himself... Enjoy. :-)
 
5:54 AM
@tina: I don't believe you read that chapter so fast. skimmed it, maybe. now this is sort of harsh judgment, but there's little point in advising when you think the advice is irrelevant. so, i think good approach is: (1) create example exploratory program, and then (2) ask further questions. or, feel free to ask about problems encountered doing that program.
@tina: i think you just have to trust that displaying abstract shapes is indeed very relevant to the lower level design problem. perhaps some others here can confirm that. what's important is not the effect but the means of achieving it. cheers :-)
 
6:28 AM
There are very few good, correct uses of unions in C++. They are no substitute for a proper class hierarchy.
 
6:45 AM
Hm, I read up on 9-intersection. I really distrust apparently academic papers where spaces are Very Significant. If the authors had common sense they wouldn't do that, thus, all the rest is also of highly suspect practical value, as I see it.
Uh oh, second alarm bell going off: this paper in addition to employing significant spaces (like Bjarne's joke about space as an operator in C++) ends with a comment that "human subjects testing" is necessary to confirm the mathematical results...
@tina: can't say I know it after skimming a paper and looking at some others. Basics of what they are, is trivial. What they're for, a mystery, but possibly connected to natural language queries. But it seems to me like something trivial that's intentionally obfuscated in unclear notation and mathematical jargon. And probably inefficient to calculate.
yes, minimimum boundary rectangle. does it make sense for 3d to find a minimum boundary rectangle?
ok. the 3d minimum boundary cube is, i surmise, a much harder problem.
@tina: it depends on a lot really, and i think you're totally missing out on polymorphism (which is relevant to packaging). and that classes aren't functions. so i think, again, that the way to go is to actually code up a small exploratory programming that naturally involves polymorphism, such as a program that displays two different kinds of shapes.
 
7:24 AM
ko
Here is an example of polymorphism in C++. You can (1) try to predict what it will output, (2) actually run it, (3) model it in UML, as a concrete example, (4) use it as basis for own exploratory program that displays two or more different shapes, then, or during that (5) ask about any problems, on SO or here (larger question on SO).
 
7:43 AM
Good day to you! So... a c++ chat?(Saw the icon just about 5 minutes ago) What is this? :)
 
dunno
:-)
 
I may then as well ask a question which I cannot figure out. How do you start a community wiki post? And how do you browse the community wiki posts? Anybody knows?
 
8:06 AM
@tina one possibility is for "MBR" to be an abstract interface, like Animal in example code. But the main thing is where you have the union of geometries. If it is at all reasonable as a single entity, then an interface or abstract class, again like Animal, is natural. But it's very difficult to think about such things without some concrete experience. So again I advice doing a concrete little program. :-)
 
sbi
8:25 AM
42
A: Should the community wiki police be shut down?

Jeff AtwoodImportant change End users can not mark questions wiki anymore, so the only appropriate way to get action on a question you believe really should be wiki, is to flag it for moderator attention. A couple points.. Vote-to-wiki will not be implemented. When the answer to a problem is "let's ma...

 
@tina: the implementations of MBR will most likely differ for 2d and 3d. but perhaps not, and perhaps, on the other hand the usage can't be naturally unified so then should perhaps just be separate for 2d and 3d. in short, i know too little about it to advise. but the union thing is different. because use of union, except for some very very special purposes, is known generally to be Just Bad. :-)
@tina: perhaps one way to see that is to take the example code I gave, and remove the inheritance. Make Animal a union of Dog and Elephant. Keep at it until the program, in its union-based incarnation, produces same results as originally...
 
whats a motivational killer for you guys?
 
8:56 AM
when someone makes me write ugly code because it is in our coding standard
 
ok
 
for example, instead of enum A {...} we have to write struct A {enum Enum {...}}
:D
 
@Armen: that's a good idea.
 
@Alf: I know the reason and rationale behind it, but in some cases it is absolutely unnecessary
 
@ArmenTsirunyan well, yes
 
9:01 AM
The hungarian notation is also killing me :( We have an even more perverted kind of HN, we must name all out input parameters beginning with i_ - how I hate it :(
 
sbi
9:11 AM
@Armen have you seen that link I posted regarding your CW question?
 
how do you store a bunch of raw pointers in a list through a for loop?
 
sbi
(Surprisingly, the chat's suddenly stopped putting in names in front of message when I reply to someone's message. Did I mention I find the chat features confusingly instable?)
 
@sbi What do you mean? This works.
 
@sbi, yeah I did, I understood the "how to mark a post as wiki" part
but how can I browse them? They aren't tagged in a special way are they?
 
sbi
@AlfPSteinbach This didn't:
51 mins ago, by sbi
42
A: Should the community wiki police be shut down?

Jeff AtwoodImportant change End users can not mark questions wiki anymore, so the only appropriate way to get action on a question you believe really should be wiki, is to flag it for moderator attention. A couple points.. Vote-to-wiki will not be implemented. When the answer to a problem is "let's ma...

 
9:16 AM
@sbi: this didn't what?
 
sbi
@Armen For the message I linked to, @addressing didn't work.
Replying also failed to properly address Tony in a message from me ~10hrs ago
10 hours ago, by sbi
"Would you take your time to get it right or rush it so the boss can have what he wants?"
Wouldn't that depend on what does the boss wants?
@ArmenTsirunyan I don't think there's a feature on SO that lets you browse CW questions.
(Now it worked. Did I say this is confusing?)
 
@sbi: oh, OK then. I want to browse subjective and argumentative questions :) Are these the wiki ones?
 
 
4 hours later…
1:08 PM
hello everyone
 
user69820
hello
 
user69820
segmentation fault
 
2:24 PM
@tina It depends. In mathematical sense the minimum bounding rectangle for two points is of zero width, and oriented in the direction of the line through the points. But much of the point of bounding rectangles is to support efficient pruning of possible intersections. And for that purpose the bounding rectangle may be constrained to be parallel with x- and y- axis, and is "minimum" only within that constraint.
 
2:41 PM
@tina A lot of what you are asking could be found via Googling about the subject area, in your last case just Googling 'bound box' would have given you loads of articles about to define and use them. If you are going to ask a complex question, then you probably should do a proper SO question, unless it is a real quick thing
 
3:06 PM
I have #include<sstream> in one CPP file and then including the header of that file into my main I cannot include the sstream in my main anymore, cause it says std::Mutex is already defined? Any ideas?
 
@Tony: reduce the problem to a minimum but complete program. Post that code as SO question (or in [comp.lang.c++], wherever). Be sure to state which compiler, etc.
 
3:41 PM
he he he, room two is the best room. </shameful jokes>
 
4:29 PM
@Tony: sounds like the include guard for <sstream> is broken
@Tony: you should look at it to verify (and possibly report a bug), but you can work around it in your project with an "outside" include guard: #ifndef MYPREFIX_INCLUDED_SSTREAM #define MYPREFIX_INCLUDED_SSTREAM #include <sstream> #endif (in all locations where you include sstream now)
 
sbi
4:50 PM
First time I found a dupe using the new c++-faq tag!
0
Q: what is this syntax in cpp

chaiHello everyone, I am finding this syntax strange in cpp TagDetails::TagDetails(QWidget *parent) : QDialog(parent), ui(new Ui::TagDetails) This is declaration of constructor in Cpp... What does the thing after colon stand for i.e. what does ui(new Ui::TagDetails) mean here. What is the colon f...

Hurray!
 
5:23 PM
how did you find it using the tag?
meh, I have to go in about 10 mins anyway
@Tony: BTW, the workaround would probably go in a local header; you could even impose that your header is used for #include <sstream> (the header needs an absolute path in that case) with the right compiler options
@sbi: note retagging it also finds that question at the top of the related list :P (of course, the OP couldn't tag it, since you can't name syntax you don't know, so I'm not entirely serious here — but anyone else can retag it and then it will be found)
 
sbi
5:53 PM
@RogerPate I knew there was a question like this, and I hoped I remembered because I had just tagged it c++-faq, so I went to the tag's page and searched for colon. Took me probably 20secs to find find that and vote for close pointing at the original message. :)
 
6:14 PM
@sbi: just checking that a list on a tag wiki or SO/SO.meta post would've met the same use case (and it appears it would)
 
oh hai
 
sbi
@RogerPate I thought we had agreed to disagree on that? :)
Hi @DeadMG, nice to see you 'round here.
 
@sbi indeed, mah first time clicking the "chat" link
 
sbi
6:30 PM
@DeadMG Well, it's quite dull here at the moment. Usually most of the action is when I'm sleeping, although I have stirred up folks here now and then during my waking hours. :)
 
@DeadMG Run! Escape while you still can!
 
sbi
Wow, James is awake, too!
 
No! I refuse to run, good sir! I shall clear out the demon spawn!
 
@sbi I'm just checking that my idea is still sound: if I find a use case that definitely cannot be met with a tag wiki or post, I will gladly stop believing it's a better avenue
 
@sbi I'm always awake, even when I'm sleeping. :-D
 
6:36 PM
Everyone has chat links in their profile, right? :)
 
@RogerPate Huh, people still use IRC?
 
@RogerPate: No, nor do I plan on it :P
 
sbi
@RogerPate No, I haven't, but it seems a good idea.
 
@James: snowman!
 
6:51 PM
@RogerPate At my last place of work, I changed my Active Directory display name to the Unicode Snowman character :-D
 
haha
how about three snowmen for an SO display name?
@AlfPSteinbach been using it for over 15 years, why stop? in many ways it's still much easier and better for me than SE chat
 
sbi
@JamesMcNellis Is that a CAPITAL LETTERS snowman??
(I didn't know there was such a Unicode char. Or what is it?)
 
sbi
@James Ah, thanks!
 
http://☃.net/ (xn--n3h.net)
 
6:56 PM
@RogerPate Apparently ☃ is not a letter, number, space, or other recognized character :(
 
sbi
BTW, would you guys object to having the feed throw in messages again instead of that overlay thing at the top of the chat window?
Feeds would have the advantage that they change my browser's tab's title, making me see that there are new messages with a glance at the task bar. I think I would like to have new questions be shown this way
 
@sbi: it's too noisy for all [c++]
 
@sbi I just ignore the messages, so feel free to do whatever.
 
@sbi: could you try a separate feed reader program?
 
sbi
@Roger That wouldn't get me the nice browser title bar display.
Can't we have both? Then you could ignore the "Feed" guy.
 
6:59 PM
surely you can find one that would update frequently (e.g. once every 1-2 minutes) and incorporate an unread count in the title bar
no, we can't have both, because I do use that drop down :P
I also think new users wouldn't know they can hide Feeds, making it much harder for them to chat — leading to frustration and stagnation of this chat room
 
sbi
@Roger You're right, we can't have both. :(
 
you could [feature-request] on meta for the feed setting to be per-user
 
sbi
(That new user argument is not valid. BTW, since new users also don't know how to edit messages, reply to other people's messages etc. You don't want to disallow all of that because they don't know, do you?)
 
them not knowing how to edit doesn't actively frustrate them by making it harder to read everyone else's messages; nor do people find it hard to reply in general — they just do it, and lack that arrow link back to the previous message
 
sbi
@RogerPate Yeah, I could. Or we could make a straw poll. That might turn out in my favor. :)
 
7:03 PM
$10 will buy my vote.
 
sbi
@James You're cheap.
 
@James: ten 2005 Zimbabwean dollars on their way to you now, just tell me the address (though the stamp is worth about 1000× more)
 
I've never been to Zimbabwe.
 
Is this OK on Stack Overflow? And anyway, do any of you know why the OP's code fails?
 
@Alf: non-answers with more information are very occasionally appropriate; this looks to be one of those times
if you're worried about appearing to be gaming rep, you could make it CW — but don't feel obligated
 
7:13 PM
@AlfPSteinbach Yes; if you have something helpful and directly related to the question that won't fit in a comment (or can't be formatted in a comment), I don't see anything wrong with posting it as an "answer," even if it doesn't answer the question.
 
non-answers of other kinds should be downvoted and flagged
 
sbi
0
Q: Can we have per-user settings for feeds, please?

sbiI prefer to have that Feed guy throw in messages rather than that subtle "extra area on the screen". (That's because this makes it show on my browser's title bar.) Other rather like the opposite. So can we make this a per-user preference rather than per-feed/per-room?

 
I once saw someone who "answered" merely to include a ASCII drawing of a ghost as code comments...
 
@RogerPate Was the question about ghosts?
 
I forget the details, I just remember it was only tangentially related and intended as a humorous "comment" (but didn't fit in a comment)
it was quite long and highly voted; a big distraction from the real answers
("comments are a second class citizen" and all that, vs answers being the point of the site)
anyway, have to go
 
7:57 PM
Yo gang
Is it possible to extern "C" a declaration for a namespaced function? i.e. extern "C" void Foo::Bar() {} ?
 
@Mike: it serves no useful purpose to declare a function in a namespaces as extern "C" because the C name mangling doesn't include information about types or namespaces.
 
@Alf P. That's what I figured. :(
@Alf P. Thanks!
 
But now, folks, is THIS ok on SO?
 
@Mike: you'd need to use extern "C" when declaring the function, and extern "C" identifiers are implicitly and additionally in a "separate namespace" where you can't overload and can't declare another with the same name (even in another C++ namespace)
 
sbi
@Alf I think it's generally considered good practice to post an actual answer and then cite your sources.
 
8:10 PM
@Alf: Why not put that in a comment? (or expand on it as a "real" answer as sbi suggests)
 
sbi
Quoting is also Ok.
 
@Roger thanks.
 
@Mike: by "when declaring the function", I mean all declarations, including the one in namespace Foo { void Bar(); }
 
@Roger so namespace Foo { extern "C" __declspec(dllexport) void Bar(); } ?
 
@sbi, @roger: i though it was simplest to just link to the answer (to the same question, by the same guy) since it isn't my own answer. Not even sure if I understand it.
 
sbi
8:15 PM
@Alf Then I would consider a comment more appropriate.
People come to SO for answers, they go to google for links to answers.
 
@Mike: sure
@Alf: I'm not saying it's wrong as an answer with just a link, but, especially in this case, fair-use or licensed quoting or putting it in your own words would make a much better answer
@Alf: whereas "hey, check this other resource" seems like comment material
 
@Roger So then, if I'm using GetProcAddress on that dll, I assume that I just reference the exported function name without any namespace stuff because I used "C" declaration style.
@Roger so @Alf is correct in saying that using namespace in this way really makes no sense.
 
@Mike: sounds about right, you'd need to check GetProcAddress's docs
 
@Roger thanks, man.
 
sbi
@Roger Didn't you say you have to leave 3hrs ago?
 
8:18 PM
@Mike: it does make sense to include in your own namespace, but extern "C" functions always have this particular naming constraint in addition
 
Sure.
 
@sbi: I did; I left; I conquered; I returned.
@Mike: e.g. namespace A { extern "C" void f(); } namespace B { extern "C" void f(); /*not allowed*/ }
 
@Roger thanks for the clarification
 
(it's not allowed in the standard rather than being an implementation issue; the standard specifies a little bit of how language linkage works for C but not at all for other languages)
 
@RogerPate cool
 
8:41 PM
(of course it doesn't work in chat... :P)
 
8:55 PM
What is the best way to write the data in a struct/class to a file, so that it can be retrieved later? It's mostly basic stuff except a vector of vectors of a class.
 
@Bocochoco Define "best". But anyway, take a look at Boost serialization.
 
Well, I need to be able to read the data from that file back into the same structure
the struct/class are pastebin.com/UZJq20UY
I made a test file in a hex editor, and I can read it in just fine, but I can't seem to write the data out
 
@Bocochoco Why not just post your current code, an explanation of what you expect it to do, and the results you actually get, as an SO question.
 
O_o Why hadn't I thought of that..
 
9:51 PM
Greetings and salutations.
 
sbi
@Maxpm Hi.
 
00:00 - 22:0022:00 - 00:00

« first day (24 days earlier)      last day (4923 days later) »