« first day (361 days earlier)      last day (4594 days later) » 

12:06 AM
iirc and is a C++ keyword, not suitable as name of function
 
It's not a keyword, but it's a preprocessing token that gets converted into an operator token.
That probably makes no difference: it's still reserved.
 
I almost forgot. At my first real job one of the coding guidelines was that we were to use the and, or and not keywords instead of &&, || and !.
 
They not keywords!
 
Sounds weird, but got used to it quickly.
 
There you have an escape clause.
 
12:19 AM
?
Where do I have what escape clause?
Ah, that they're not keywords?
 
I don't remember how it was exactly phrased in the document.
Who knows, perhaps they had anticipated the escape clause.
What sucked however, that they didn't use RTTI.
 
@RMartinhoFernandes oh yeah, Fred's declaration: int foo( double and b ) he he
 
@AlfPSteinbach Lolled.
 
12:39 AM
That would be an rvalue reference... probably you want int foo( double bitand b )
 
 
5 hours later…
5:19 AM
16
A: Can (should) we get rid of multiple punctuation marks?

Jeff AtwoodGreat idea, I totally support this, making it so: --- make sure all question titles end with at most one question mark update Posts set Title = dbo.RegexReplace(Title, '\?{2,}$', '?') where PostTypeId = 1 and Title like '%??' 7315 rows affected --- make sure all question titles end with at ...

Ugh, bad design ahead:
0
Q: Destructor for multiple constructors

MarkI have two constructors in C++ and one destructor. When I use the first constructor for my object the destructor is called to delete A[] which is what I want, but when I used the second constructor I don't need to call destructor but C++ compiler calls it anyways which causes an error. What is th...

 
5:48 AM
@RMartinhoFernandes What goes goes on in the heads of these people. I don't want to know :)
 
Apparently, he didn't make that up. It from some school thing that he is not allowed to change.
 
Misformation.
 
It's a sad school.
 
If you want to become a cook do they teach you to cut yourself? :D
 
If they tell how you can hold a knife to accidentally cut yourself, that could come in handy as something to avoid.
But if some "project" requires you to do it, well, it sucks.
 
5:58 AM
There's not many C++ courses that teach the language well. Most of them still start with C and introduce the concepts of classes much later. Templates and STL seem to be unheard of.
 
Ugh, 600KB of errors.
 
6:23 AM
> Indeed, Siberia today is suffering such an acute “man shortage” (due in part to massive rates of alcoholism) that both men and women have lobbied the Russian parliament to legalize polygamy. In 2009, The Guardian cited Russian politicians’ claims that polygamy would provide husbands for “10 million lonely women.”
Let's go to Siberia :D
 
6:37 AM
Dart "Hello World" compiled to JS. (It's not a pretty sight.)
It generates 17000+ LOC.
 
anybody on line?
how many output lines can I put in a case of a switch statement?
 
Yay! My Wikibook Chapter is finally Complete!!!
 
sbi
Sometimes, Tomalak is an asshole. There, I said it. But he really, truly deserved it for that. Oh, and good morning to you, too!
 
wish there was an "authors" page in wikibooks though.
Is my article any good?
I'm starting to have second thoughts
Maybe I just wasted my time...
 
6:53 AM
@Howdy_McGee More than you should ever need. If you're hitting a limit, you really need to consider breaking up your code into smaller chunks -- and not because of any limitations of switch.
 
What's the character distinguishing limit for function names in gcc?
@sbi?
 
sbi
@IntermediateHacker You were saying?
 
What's the character distinguishing limit for function names in gcc?
 
@IntermediateHacker the who?
 
I just read it somewhere that compilers have a character distinguishing limit
 
6:56 AM
you mean a limit on identifier length?
 
i.e a two function names above a certain size e.g my_very_good_something_function and my_very_good_something_functton would not be distinguished
@cHao Yeah I guess
 
from `info gcc`:
> For internal names, all characters are significant. For external
> names, the number of significant characters are defined by the
> linker; for almost all targets, all characters are significant.
 
7:16 AM
That's some old geezers playing that Limp Bizkit song!
(I'm joking)
 
@RMartinhoFernandes why didn't anyone recommend std::vector? lazy folks
@sbi that looks like Pete Townshend?
 
sbi
@AlfPSteinbach That looks like Who? (SCNR)
 
7:36 AM
toast is a reserved function name in the C standard.
island is another.
 
7:52 AM
?
oh, was that inappropriate? we've all cut our fingers, yes?
 
sbi
@AlfPSteinbach Ugh. And you once objected me posting a pic of a dead kitten?! Hypocrite!
 
grins
Anyone in support of this?
209
3D Graphics, Modeling & Applications

Proposed Q&A site for 3D graphics creators.

Currently in commitment.

this is uses initializer list ? -> std::multimap<std::string, int> = {{"the", 10}, {"cat", 4}, {"is", 3}, {"black", 9}, {"the", 20}};
i am right?
 
8:41 AM
@MrAnubis yes that's an initializer list
 
sbi
8:55 AM
@MrAnubis, @Tony: I had to google for a while to be able to confirm this. I learned that C++ now has initialization lists and initializer lists. That is really confusing and no help at all to those teaching the language.
 
9:07 AM
@sbi and do you happen to know the difference?
 
sbi
@TonyTheLion It's this vs. that.
 
sbi
9:25 AM
What did one BlackBerry user say to the other BlackBerry user? Nothing.
I understand that this concerns you, @Tony?
 
Howdy
 
@sbi yes, it hasn't been working properly for three days now, urghhhh
 
sbi
Current Status of #RIM EMEA outage: 50% of BIS and BES connections restored, BIS Browing, BBM and Push API still disabled. #NOC #BIS
 
oh thanks for the info
 
sbi
@TonyTheLion If you look at this guy's tweets, you can see that he's really pissed.
 
9:35 AM
@sbi yea well, I'm starting to feel the same way
I bought a blackberry for the very reason that it has BBM. Now I can't fucking use it
 
9:46 AM
If I have this ctor,
Matrix4 :: Matrix4(const float m[16])
it's not possible to use initializer lists right? Since I want to copy the whole array?
Right now I'm using a function inside the ctor,

set(m);

which, copies the array,

memcpy(this->m, m,16 * sizeof(float));
 
sbi
@ManofOneWay I think this might be possible when you use initializer lists, but I'm hazy on C++11. Otherwise you will have to copy, but I'd strongly encourage the use of std::copy() over the C std lib. (I'd beat up my vendor if their std::copy() wouldn't fall back to std::memcpy() for built-ins, though, so in the end the result should be the same.)
@ManofOneWay Oh, and you cannot pass arrays like this, they will always decay to pointers, and all size information lost. If you want to pass an array, you need to pass it per reference: Matrix4::Matrix4(const float (&m)[16]).
 
10:02 AM
@sbi What do you mean by size information?
 
sbi
@ManofOneWay The array's size, 16 in your case.
 
@sbi Hmm, are you saying I can get the size of the array if I send a reference? I don't follow
 
sbi
@ManofOneWay void f(T a[N]) is the very same as void f(T a[]), which is a synonym for void f(T* a). That's stupid and annoying, but that is what C was designed to do 40 years ago. If you want to pass an array to a function with certain dimensions, you need to pass it per reference: void f(T (&a)[N]). Do you understand this now?
 
@sbi So the difference will be that the ctor will give a compile error if I try to pass in an array not equal to N ?
 
sbi
@ManofOneWay When you pass per reference, attempts to pass arrays of other dimensions will lead to compiler errors.
 
10:11 AM
Ah great
Thanks =)
Btw, using std::copy, it seems that I have to use some nasty iterators?
I'm not used to that
 
sbi
@ManofOneWay 1) Iterators are not nasty. 2) You cannot program in C++ when you shun iterators. 3) Pointers are (random access) iterators.
4
Off the top of my head, std::copy(m, m+16, this->m) should do.
 
Nice, I will have a more closer look at it later today
Thanks for all the help!
Bye
 
argh
caught a cold
 
10:41 AM
@DeadMG get some tea ( i am going to get it to:) )?
 
ugh, no thanks
don't want to make it worse
 
@DeadMG who told you tea makes the cold worse?
 
nobody did
 
@DeadMG and why do think then tea is not good in cold?
 
because it's horrible stuff
 
10:44 AM
ok
 
aside from the fact that I have no access to it whatsoever
 
@DeadMG whatever fact you got about tea is wrong i can confirm lol
 
hmmm
you can confirm that actually, I do have some access to tea?
curious
or that actually, I enjoy it?
perhaps you'd care to give your reasonings
 
@DeadMG I stopped having colds after I graduated. Contamination happens mostly in schools it seems.
Washing hands frequently is a good way to prevent a cold.
 
I expect it won't be too long before my immune system beats it back
just not a fun combination with my existing digestive issues
 
10:49 AM
I once read that in the past opium was sometimes used to relieve the symptoms. I'm not sure if it's a good idea though. You could always try to ask your pharmacist :D
 
that counters the fact that I don't like it, or that there's none nearby that I can access, how, precisely?
 
What's a singleton incident ?
 
@DeadMG holy grails , i lose , you win :)
 
@MrAnubis How these things usually go.
I need to trot off to a lecture now
 
10:51 AM
@IntermediateHacker it's when people use singletons, I guess
 
try not to have fun in my absence
 
@IntermediateHacker A single incident?
 
s/use/inflict upon their code I guess
 
12 hours ago, by Cat Plus Plus
room topic changed to Lounge<C++>: Days without singleton incident: 0 [c++] [c++11] [c++-faq]
 
@DeadMG you offended?
 
10:54 AM
I hate people who poke me for no reason on facebook. :(
I've got like 11 Pokes.
it's annoying
 
sbi
@IntermediateHacker Are you ticklish?
@DeadMG When I was young, we once picked up a lost Brit at a Berlin train station and housed him for a few days. We had a great time together, and both sides benefited a lot. One of the oddest things was that he came stating he doesn't like tea at all, and went a convert. When I was in England many years later, I found out why: The way Brits drink tea is simply horrible. :)
 
@sbi what do they do to it? Other than some weird preference for boring flavors, I mean
 
@sbi How do they drink tea?
 
sbi
@jalf They put too much of it in their pots and do not take them out before it starts to taste terrible. If you get the last cup form the pot, it almost razes the very taste buds from your tongue. // @IntermediateHacker
When I was drinking lots of tea (several pots a day, six cups a pot, of which my then girlfriend never had more than a third), I would let it infuse for a certain time (depending on the kind of tea), and then take the leaves out. And I used much less tea leaves than they do in Britain.
 
11:20 AM
Hi there.
Damn, I've got nothing to do.
 
hi
how are functions bound statically? Function pointers?
 
The compiler binds them.
 
11:41 AM
yeah but how?
What do you mean by bind?
 
The same as you, I hope.
 
You asked how functions are bound. I told you the compiler binds them.
 
Yeah but how?
how does it bind them ? pointers?
 
It just makes sure every function call calls the implementation.
It uses addresses, but the specific process can be a bit more involved (due to linking with other libraries and stuff).
 
11:45 AM
So it binds the function call or name to the function definition?
 
Yes.
When you get "unresolved reference" linker errors, it means it could not find an implementation to bind the calls to.
 
mmn...
I am just wondering why compilers can't resolve the virtual functions at compile time. I guess the vpointer can only point to one definition at a time.
so if I have shape->draw();//circle draw shape->draw() //square draw;
if the compiler tries to resolve at compile time, then shape draw would only point to the square draw function
 
Suppose you have Shape& get_a_shape_from_somewhere_that_could_be_a_rectangle_or_a_circle();
 
long function name :)
 
Shape& s = get_a_shape_blah_blah(); s.draw(); // what function should this resolve to?
Sometimes it will be a rectangle, and at others it will be a circle.
That function could even ask the user what he wants to draw.
Certainly the compiler cannot guess that.
 
11:51 AM
evening
 
Good afternoon.
 
attended an algorithm analysis lecture
my God, that guy was horrendously boring
 
Why am I not surprised?
 
kek
 
Complexity and that kind of thing?
 
11:54 AM
@RMartinhoFernandes I see. Danke :).
 
We really have an issue with too many unqualified close-voters.
0
Q: strings with the arrays

WhoCareshello i have an struct like this: struct Student { string name,lettergrade; int stdnumber,*examgrades; double avarege; }; I have to make a programme which it calculates student's avarege and letter grades. I have to use this functions: void getdata(); double calcgrades(); void show(); void ...

This is a perfectly valid question, even if it needs editing, yet it has 3 "non-constructive" close votes.
 
12:22 PM
Hmm, though I think there's a point here:
53
Q: Stack Overflow has too many "too localised" new questions

Tomalak Geret'kalSO started off as a site for interesting programming questions. Although the odd "help me please" localised debugging help question would pop up once in a while, this was inevitable so we just sort of lived with it, right? Now it feels as if the vast majority of questions are those which we mig...

The number of help vampires has been rising lately.
 
sbi
12:53 PM
Haven't you guys been joking about dart being compiled to JS yesterday?
Last night's design by committee of Intercal 2012 included compiler that spat out C that's compiled into JavaScript, using XSLT. #gotocon
I think this refers to the same. :)
 
Woo, Intercal is getting an update?
 
sbi
@RMartinhoFernandes Sigh. I think he was making a joke, you know.
 
Yes, and I was just being silly.
 
sbi
@RMartinhoFernandes Shame on me.
 
The idea of processing C with XSLT scares me.
 
sbi
12:56 PM
@RMartinhoFernandes XSLT scares me no matter what else is involved.
 
That's a reasonable point of view.
 
@RMartinhoFernandes Let's be fair- it was edited from "worthless"
 
1:16 PM
I've heard thrown around that C++ exceptions are expensive even if not thrown.
Does this have any degree of truth?
Or it is just another silly thing game developers believe in their quest to write crappy code?
 
sbi
When the C++ exceptions were conceived, one of the most important goals was that exceptions can be implemented in a way that they cost next to nothing when not thrown, at the expense of high performance costs when thrown. I don't know what the current state of the art is, though.
 
Anyone willing to try this new Vim plugin anytime soon?
 
I'd have to install libclang.
 
it's basically free to not throw exceptions
and I believe, almost free to try {}
 
I was disappointed by vanilla clang-complete, completion took too much time.
 
1:21 PM
as far as I understand it, not that I'm an expert here, but exceptions are pretty much, if not exactly, no performance at all to not throw
 
@DeadMG It's free to try {}, but if you don't cancel your subscription before the try {} period ends.... you'll be charged the normal debugging cost.
 
I know for a fact (I measured) that unless a throw happens in C#, there's no noticeable slowdown. When someone asserted that thing about C++ it surprised me.
 
lol
@RMartinhoFernandes The CLR and MSVC++ have the same exception handling implementation
they fall back to SEH, Structured Exception Handling
 
Is it weird that I have an unhandled exception hook in unmanaged portion of my code, and it's catching unhandled managed exceptions?
 
no
as I just said, the CLR and the native CRT both fall back to SEH
 
1:25 PM
Not only that.... it overwrote my managed unhandled exception hook
 
that means that if you have an unmanaged catch(...) {} and the compiler is set to catch all SEH exceptions in those blocks (not only those it threw) then you will catch any exception
 
Is there any way for me to hook managed and unmanaged unhandled exceptions separately. The native hook can't get he managed stack-trace.
 
you need to change the settings of the C++ compiler
 
I think you're misunderstanding me.
 
the default setting is to only catch SEH exceptions that are marked as being thrown by C++
and ignore the rest
 
1:27 PM
You can setup a hook to the process to get all unhandled exceptions (no catch needed).
 
yes
 
I'm forgetful of the correct terminology.
 
a vector exception handler
 
Yeah, that thing is catching all managed exceptions. Which is fine except, when we dump, we can't dump the managed stack-trace from native code.
 
I believe that the CLR tags all it's exception objects with a magic value
you could code your own SEH hook that checks for the magic value and if it's present, goes to managed code
 
1:30 PM
How exactly would I "go to managed code"?
 
or more relevantly, simply returns, causing Windows to find the next vector handler- probably the one added by the CLR
well
 
Look, FUD:
-1
Q: C++ framework similar to .NET

user931670I know the standard library exists and I know about Boost. Anyway I did some .NET as a part of an internship and I enjoyed the simplicity of the library. In C++ it would take a lot of magic and tricks to achieve some of the very simple and quick things that say python, java or .NET can do. Howeve...

 
Unless I just manually call a managed method.
 
according to the docs
 
@Xaade Turn left after the fountain.
 
1:30 PM
every "all exceptions" handler is called in sequence
and you can return a value to say "Go to the next handler"
so if the CLR adds a handler, your handler gets called first
but you can just return a value which says "Go to the next handler" and then the CLR's handler will be called as if your handler never existed
 
Yeah, I tried added an Application Unhandled Exception event. However, since the native handler is added second, it must be wiping out my event, cause my event is never called.
 
i.e., return EXCEPTION_CONTINUE_SEARCH
no, the CLR's handler should get called first, if it is added first
but perhaps the CLR one is set to lower priority?
 
Would the native one literally wipe my managed one?
 
no
what you should do is return EXCEPTION_CONTINUE_SEARCH, which says to Windows, "This ain't the right handler, go call the next"
and "the next" should be the CLR's handler
 
        AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(Application_ThreadException);
That's what I added.
 
1:35 PM
don't know enough about CLR
 
But I add that one first.
 
depends on how it's implemented
the WinAPI function allows you to set priorities and stuff
 
I see.... maybe I'll get my terminology right first, and post a question.
 
no no no
just get your native handler to return EXCEPTION_CONTINUE_SEARCH
and you should be ok
 
I'm not sure even if my managed one is called that it will work, since the dump process is native.
But you said my managed one should be called first.
I'll check into that priorities thing.
 
1:37 PM
I said that it could depend on how it's implemented, because the WinAPI function that it will delegate to allows you to set the order, in a limited fashion
I don't believe the table can be inspected
 
Oh you mean, priority would be a "hidden" setting?
 
well, the WinAPI function allows you to set it, but the documentation is quite unclear
and I didn't see any functionality that would allow you to view the current handlers and orderings
 
HAHAHAH.... C++ too hard. Can make easy-cake plase?
-1
Q: C++ framework similar to .NET

user931670I know the standard library exists and I know about Boost. Anyway I did some .NET as a part of an internship and I enjoyed the simplicity of the library. In C++ it would take a lot of magic and tricks to achieve some of the very simple and quick things that say python, java or .NET can do. Howeve...

 
Yeah, so much silliness there.
Pity C++ doesn't support funbags.
 
I want kaywerds make coad for mah! Werk no fawn.
 
1:49 PM
But seriously, who the heck writes a tool to replace your code so you can convert between numbers and strings?
 
Someone who needs to store data in XML?
 
Even if you didn't think of writing a function (what?), you have the preprocessor.
 
Oh I see.... not that it needs doing, but that you want the code to automagically do it for you.
Isn't that what operators are for.
 
@FredOverflow hi.
Have a look at this:
in Haskell, 9 hours ago, by R. Martinho Fernandes
0
A: Solve the eight queens problem at compile-time

Martinho FernandesI came up with a solution that uses the Haskell type system. I googled a bit for an existing solution to the problem at the value level, changed it a bit, and then lifted it to the type level. It took a lot of reinventing. I also had to enable a bunch of GHC extensions. First, since integers are...

 
Overload operator = in string to allow an argument of int.
 
1:51 PM
Pity it hits implementation limits like there's no tomorrow :(
 
@FredOverflow wie gehts
 
pfft
in "DeadMG++" there are no implementation limits
 
hey
 
1:56 PM
my current implementation plan really will have effectively no implementation limits
 
@RMartinhoFernandes There's no implementation.
 
at least, no more than you would find at run-time
 
@LucDanton That explains it.
 
@LucDanton Heh, yeah- difficult to limit an implementation that doesn't exist
but I was more referring to the idea of how I was going to do it
 
I don't understand how can programs be computed at compile time? Even int c = a+b isn't computed at compile time? This is some new programming?
 
1:58 PM
@DeadMG So, an implementation-specific implementation limit, is what you're saying?
 
lol
 
@LewsTherin The meta-program I posted works with types, not values.
 
sure, but one that's way, way higher than "max recursion depth 1k"
 
Hi all ! Back to my room after a long gap :(
 
1:59 PM
@DeadMG The limit is configurable in GHCi. But even 1000 was not enough and took too long for me to explore more.
 
Anyway, implementation limits are not here to restrict what will compile or not, it's to guarantee what will compile portably.
 

« first day (361 days earlier)      last day (4594 days later) »