« first day (195 days earlier)      last day (4744 days later) » 

12:00 AM
g++ 4.5.1 and MSVC2010 both fail with 'ambiguous call'.
 
@PiotrLegnica interesting! What's ambiguous?
 
At line 46.
(MSVC also needed #include <iterator> for back_inserter).
 
g++ 4.6 works
 
f.cpp(47) : error C2668: 'copy_if' : ambiguous call to overloaded function
        f.cpp(16): could be 'OutputIterator copy_if<std::_Vector_iterator<_Myvec>,std::back_insert_iterator<_Container>,is_odd_functor>(ForwardIterator,ForwardIterator,OutputIterator,Functor)'
        with
        [
            OutputIterator=std::back_insert_iterator<std::vector<int>>,
            _Myvec=std::_Vector_val<int,std::allocator<int>>,
            _Container=std::vector<int>,
            ForwardIterator=std::_Vector_iterator<std::_Vector_val<int,std::allocator<int>>>,
 
@PiotrLegnica That looks like a bug in the standard library… they forgot to hide their own implementation of copy_if XvD
@PiotrLegnica Anyway you can fix that by qualifying ::copy_if on line 46
 
12:03 AM
With ::copy_if it compiles.
Yeah, figured. :P
 
I'm surprised that made it into the release, those guys are pretty good about that kind of thing.
 
19
Q: Theory on error handling?

StackedCrookedMost advice concerning error handling boils down to a handful of tips and tricks (see this post for example). These hints are helpful but I think they don't answer all questions. I feel that I should design my application according to a certain philosophy, a school of thought that provides a stro...

^ What do you guys think of some of the conclusions I've reach in this post?
Interesting? Or just plain obvious?
 
My view on logging is that logging is good, and you should be doing logging. Even if the error is about to be shown to the user.
C++ could use some standardised logging stuff in standard lib, akin to Python's logging module.
 
Anyone ever used std::clog?
 
Never knew it existed.
 
12:11 AM
@StackedCrooked I'm aware of its existence… but normally it's identical to cerr but with a buffer
 
It has a funny name, though.
 
@PiotrLegnica Only learned about it recently as well.
@PiotrLegnica :)
 
Log? Buffered? Ugh.
 
… and typically cerr doesn't go to a log at all
… and as you say, logs should be buffered no more than "genuine" error messages
 
Isn't std::cerr typically the output of "2"? As in: make 1>/dev/null 2>errors.
 
12:13 AM
@StackedCrooked yes
I just remembered, you *can* change the underlying file by assigning
`std::filebuf my_log( "my_path", /* write access etc */ )`
`std::cerr.rdbuf( &my_log );`
 
You might as well rebind stderr, and have C libs redirected as well.
I'm repeating myself.
 
@Potatoswatter code.google.com/p/stacked-crooked/source/browse/trunk/… I created a "ScopedRedirect" class for this once.
 
@PiotrLegnica depends how the app is executed!
@StackedCrooked Yeah, the ownership semantics are raw
 
@Potatoswatter I don't understand.
 
I wrote this ugly thing. It seems to work, and is only relevant in the debug builds anyway.
 
12:19 AM
@StackedCrooked You have to restore the previous rdbuf when the local one goes out of scope.
 
@PiotrLegnica Doesn't look too ugly to me. (You don't know where I've been man ;)
 
 
5 hours later…
5:13 AM
 
Xeo
5:27 AM
Wtf. India: Girl beheaded in front of her classmates.
 
5:46 AM
hmm
 
Let's not lose our heads over something like this.
 
Girl beheaded in front of her classmates., hmm
so she gave head in front of her class mates
 
@JohannesSchaublitb Kids these days..
 
wow that's fucked up
 
Hum, I like my humor like I like my cofee... black.
2
 
6:19 AM
ne body here ?
 
Xeo
6:50 AM
Omg. hell yes. Red Shift theme V4 with Firefox 4 support !!
 
7:12 AM
@FredOverflow the solution is easy: download rainbow table ISOs, pick the corresponding plaintext in O(1)
 
 
2 hours later…
8:51 AM
wow, very little activity today.... hmmmm
 
9:08 AM
Fridays...
 
@wilx wedding day
 
9:31 AM
Fridays? I thought that was Saturday.
 
@wilx no it's today man
 
10:02 AM
hi all
 
hi @Miss
how are you today?
 
fine
thanks
well i need help here if some can do... please
i want to learn c++ perfectly
 
@Miss takes many hours of hard labour to learn C++ perfectly
 
but i have HMM(hidden markup model) in C .. where i have to apply viterbi algorithm..
i need that code in c++./.
already i completed DTW in c++ .. and HMM relate to DTW .. but problem is that HMM is given to me in C..
i do't want to learn C for now..
i just want to concentrate on C++..
so in this case, i need help
 
@Miss C is a subset (more or less) of C++. If you want to learn C++ perfectly, you'll end up learning C.
 
10:15 AM
i need HMM code in my DTW C++ project..
ok but see i have dead line ..of two weeks...
i will take time to learn C++ ...
my previous project DTW is in C++..
and HMM is almost relate to DTW..
that means half things of project i have.. but HMM is missing in that DTW project
can any one help me please?
 
11:07 AM
@Miss Markov, not markup. Those ideas are at opposite poles of the programming spectrum — one refers to highly abstract math, the other to highly vague busywork.
 
ops sorry
if any one can help me than please....
 
@Miss Only help I can offer is advice to get an extension or reduce the project scope.
Preferably the latter.
 
ohh no.. i need it..
 
Image recognition was NEVER easy. You might narrow it down to classifying a fixed set of pictures, and refine the software to handle just those.
Within some very wide tolerance levels.
 
hy wait a second,
that project is of subject Speech recognition
 
11:19 AM
DTW is used for speech recognition according to my one-minute background search.
 
yes right
and i am talking about project of subject speech recognition...
 
Uh, what happened to your IR camera project?
 
well i am trying to analyze the pentild camera
 
Image recognition is sometimes like speech recognition in two dimensions, so I wouldn't be surprised if you had found an application there too.
 
IR camera still not working
ahh
 
11:22 AM
What is a pentild camera? The only Google hit for that word points back to you.
Perhaps PenTile… although the only sane thing would be to use a driver to change the PenTile matrix to standard RGB pixels…
 
wait........... sorry
Secumera Pro camera
i am trying to working with it
 
I see… that's a networked webcam.
 
and with that i have to know that how to extract frames from video
 
So… you are doing both image recognition and speech recognition at the same time??
 
yes
 
11:27 AM
and you're running late on both projects
 
but i need HMM in c++ code...
 
but you don't want to cancel either project or ask for an extension
 
well last date of project is next week but now professor extended it for one more week
 
hate to break it to you, but that won't get you there
 
can you please use simple and easy sentences so that i can understand easyly
 
11:30 AM
You might try programmers.stackexchange.com and honestly describe your overall situation, and the entire project.
 
hmm
 
They handle project management and career type questions there.
 
ah
so i should post question.. right?
 
That would be my advice…
well it's 4:30 am here and I need to sleep :vP .
Again, good luck and safe learning!
 
11:47 AM
@potatoswatter: i do't want to open a question for my problem
is it possible to send email to them?
 
@Miss we don't email other users on SO, you need to just do like everyone else and post a question SO
 
12:09 PM
@tonythetiger: i do't want to open a question..
 
@Miss then you're in the wrong place
 
what do you mean?
hm
 
I don't get why you don't want to open a question like the rest of us when we have a problem
 
well @tony i have sent email..
 
morning
 
12:17 PM
hahaha @DeadMG I just love you answer
 
well, I like to think that it gets straight to the point
 
@Drahakar nice answer @DeadMG
 
cpx
12:31 PM
Hello, Why does the following specialization fails to compile on VC++?
1. template <>
2. int compare<const char*>(const char* const &v1,
3.                       const char* const &v2)
4. {
5. 	return strcmp(v1, v2);
6. }
7.
8. template <typename T>
9. int compare(const T &v1, const T &v2)
10. {
11. 	if (v1 < v2) return -1;
12. 	if (v1 > v2) return 1;
13. 	return 0;
14. }
15.
16. int main()
17. {
18. 	compare("Hi", "World");
19. }
Errors:
1. error C2143: syntax error : missing ';' before '<'
2. error C2988: unrecognizable template declaration/definition
3. error C2059: syntax error : '<'
4. error C2143: syntax error : missing ';' before '{'
5. error C2447: '{' : missing function header (old-style formal list?)
6. error C2064: term does not evaluate to a function taking 2 arguments
 
@cpx isn't your specialization supposed to be after your template?
 
@cpx error: no matching function for call to ‘compare(const char [3], const char [6])’
^ This is the error I get on GCC.
Apparently the arguments are passed as an array instead of a char pointer.
 
template<typename T>
int compare (const T &v1, const T &v2)
{
	if (v1 < v2) return -1;
	if (v4 > v2) return 1;
	return 0;
}

template<>
int compare<const char*>(const char* const &v1, const char* const &v2)
{
	return strcmp(v1, v2);
}


int _tmain(int argc, _TCHAR* argv[])
{

	compare<const char*>("Hi", "World");
I got it to compile on VS2003 like this
 
Try this:

template<std::size_t Length1, std::size_t Length2>
int compare(const char (&v1)[Length1], const char (&v2)[Length2])
{
return strcmp(v1, v2);
}
^ This is a trick I learned from @sbi yesterday.
 
hi can i download VB 6.0 from internet ?
is VB 6.0 provided on internet?
 
12:44 PM
Everything is provided on the Internet.
 
@TonyTheTiger Seems to fail on GCC though...
 
cpx
It complies when I put it this way..
1. template <typename T>
2. int compare(const T &v1, const T &v2)
3. {
4. 	if (v1 < v2) return -1;
5. 	if (v1 > v2) return 1;
6. 	return 0;
7. }
8.
9. template <>
10. int compare<const char*>(const char* const &v1,
11.                       const char* const &v2)
12. {
13. 	return strcmp(v1, v2);
14. }
15.
16. int main()
17. {
18. 	const char *v1 = "Hi"; const char *v2 = "World";
19. 	compare(v1, v2);
20. }
 
@StackedCrooked hmm and I can't get yours to work on VS
 
cpx
I'm on VS2005.
 
12:46 PM
@cpx yea well now you put the template and the specialization in the right order and you've explicitly defined the type of the args passed
 
cpx
Yes but It should work implicitly.
 
sbi
@cpx Yes, the primary template has to be declared (but not necessarily defined) before any specialization.
 
Actually the simplest solution is adding this overload:
int compare(const char * v1, const char * v2)
{
return strcmp(v1, v2);
}
 
sbi
That's just the way the language is, no room for discussion.
 
@StackedCrooked the one you provided doesn't compile with me when I just pass string literals as it seems the compiler doesn't know which version of the template to use
 
sbi
12:49 PM
@StackedCrooked Yep, when it comes to function templates, my advice would be either to overload (that's what both of your solutions suggest) or to implement it using class template specialization underneath.
 
I get a "call to compare is ambigious" error
 
sbi
2 hours ago, by Tony The Tiger
@Miss takes many hours of hard labour to learn C++ perfectly
 
error C2668: 'compare' : ambiguous call to overloaded function
 
sbi
@TonyTheTiger Actually, it takes years, not hours.
 
@sbi @cpx From the book "C++ Coding Standards" chapter 66: "Don't specialize function templates."
 
12:51 PM
The real problem here is const char*. :P
 
@sbi off course :)
 
@TonyTheTiger Did you remove the other overloads?
 
@sbi I did not specify for how long you have to work many hours to learn perfectly :P
template<typename T>
int compare (const T &v1, const T &v2)
{
	if (v1 < v2) return -1;
	if (v1 > v2) return 1;
	return 0;
}

template<std::size_t length1, std::size_t length2>
int compare(const char (&v1)[length1], const char(&v2)[length2])
{
	return strcmp(v1, v2);
}


int _tmain(int argc, _TCHAR* argv[])
{
	int c = compare("Hi", "Hi");
 
sbi
@StackedCrooked Yeah, you can fully specialize them, but there's no partial function template specialization, because we have overloading for that. But the rules to pick an overloaded function are subtly, but notably different from those to pick a template specialization, and almost every time I tried to do this I ended up in a big, ugly tangled maze...
@TonyTheTiger LOL!
 
You can spend decades programming C++ and learning very little. It requires some dedication.
 
12:54 PM
@StackedCrooked that's for sure...
 
sbi
@StackedCrooked That's where the "hard labor" part comes in.
 
@sbi question is, "in the end, is it all worth it?" :P
 
@sbi And compiler differences on top of that..
 
sbi
@TonyTheTiger If you want, or must, learn C++ well, then this is moot, because, to be really good, you need to do that.
@StackedCrooked Yes, although, when GCC disagrees with VC, I have learned that GCC is right in at least 75% of all cases.
 
@sbi off course :)
 
12:57 PM
You do what you must, because you can.
 
@TonyTheTiger You can get by with knowing only a subset of C++ features. But it will result in code that is not as good as it could be.
 
@StackedCrooked yes I've seen that in code...
 
@TonyTheTiger I've seen much weird code lately. Function definitions that end with semi-colon. Classes that implement copy constructors where the compiler-generated one would be fine..
 
@StackedCrooked yea, some people don't know what C++ really is...
I'm sure @sbi has seen his fair share of ugly code
 
Everyone who reads others' code has seen ugly code. :P
 
sbi
1:01 PM
@StackedCrooked Unfortunately, most of the really amazing C++ features and idioms, those that make C++ code safe, maintainable (templates, exceptions, smart pointers), and fun to work with, are considered "advanced", and there's a lot of FUD around them, leading to newbies shying away from them, when they should embrace them.
 
@TonyTheTiger Lately I saw someone that always casted objects using C-style casts. He accidentally casted objects to the wrong class and wondered why stuff didn't work :)
 
sbi
@TonyTheTiger No, I haven't. I have learned to look away when bad code comes up. :)
 
@sbi interesting :)
 
C++ is being taught wrong, that's why.
 
agreed
 
1:02 PM
@PiotrLegnica Definitely. Teachers now nothing (in my experience).
 
it's being taught C-with-classes
 
If they even get to classes.
 
@sbi seems like my replacement is also shying away from templates and smart pointers... uh oh
 
but templates are the best thing evar
 
@DeadMG true, but it takes some time to get to grips with them
 
sbi
1:03 PM
@PiotrLegnica Indeed. The problem is that this has gone on for decades, and now many "old hands" consider right what they were taught 15 years ago.
 
maybe if you want to start doing SFINAE
 
Basics of templates are not that hard.
 
yeah
template<typename T> void func(const T& t) { std::cout << t; }
 
sbi
@TonyTheTiger Oh, that's not a problem for you. The problem for you is when you need to replace someone like this.
 
is hardly the world of difficulty
 
1:04 PM
@PiotrLegnica I strongly believe that conceptually templates are not hard to understand. It's just the strangeness of the syntax that scares people away.
 
@sbi I have, the guy before me on this project only used raw pointers plus some other really C type stuff
@DeadMG that is pretty easy
in my new job I will be doing more .NET so I'm gonna have to find a C++ pet project so I can continue to improve my C++ skills...
 
sbi
@PiotrLegnica There is hardly a subject where the basics are hard. It's what you do once you have understood those which might be hard. (Well, maybe except for some of physics. There the basics are hard.)
 
@DeadMG how did you go about doing all the game stuff you've been doing, are you reading some books on it or did you just dive in?
 
hi all i am in big problem
 
@Miss me too
 
1:09 PM
see this
i downlaoded VB 6.0 and there i guess there was included langauge pack
and i mistakenly click on any langage
 
sbi
Here's one to pour your Java hate into:
-3
Q: Does Java really impose writing dumb code?

gasanJust got onto this article saying that Java developer should write dumb code. Is it true? Should one who doesn't want to write dumb code move to another programming language (non-Java)?

 
now i am not getting that how to get English window..
please help me
@sbi can you please help me
what should i do?
 
@Miss uninstall and reinstall
solved!
 
I read DirectX 9.0c: A Shader Approach by Frank Luna
 
is there any other solution
 
1:12 PM
@Miss no
 
please i have to do project
 
@Miss there is no other solution, just uninstall and reinstall in the correct language, it can't take that long, and the more you come one here moan about it the more time you're losing
@DeadMG I remember now, I already asked you this.
 
it's ok, many admirers wish to know the source of my awesomeness
2
 
@DeadMG hahah :P :)
 
sbi
@Miss No, I won't. I'm here to discuss C++, Singletons, sex, and what not. I'm not here to solve all your computer problems. That's what other sites are for. From the one look I had at that, you seem to have trouble installing something. That's what either superuser.com or serverfault.com are for.
 
1:17 PM
@sbi: Yeah, I just ignored her
 
@DeadMG I've joined you, cuz it's really annoying me
 
Has Alf showed up yet?
 
@StackedCrooked no Alf
 
sbi
@TonyTheTiger Well, apparently, he was on SO an hour ago: stackoverflow.com/users/464581/alf-p-steinbach
 
@sbi I guess maybe he started finding the chat a bit too distracting
which it can be, lol
 
1:22 PM
@TonyTheTiger Certainly on Fridays ^^
 
@StackedCrooked lulz
 
sbi
@TonyTheTiger It's not like he has much to do. He said he doesn't currently have a job. Maybe that's changed?
 
@sbi : There's a difference between the occasional quick question, and 24/7 live support chat.
 
@sbi perhaps yes, should hope so for him really :)
 
We don't do the later.
 
1:24 PM
@Xaade yea but answering her questions gets you nowhere as she never provides enough data to solve the problem
I've tried, so trust me on this
 
and it's not like you even get +rep
 
@DeadMG repwhore
 
@TonyTheTiger : Not really addressing anyone, but just making the comment.
 
kek
 
The problem is, every question she asks leads to another question.
 
1:25 PM
@Xaade yea I was talking about someone
grrrrr
and an outright refusal to post a proper question of SO, shows no willingness to actually get proper help, if you ask me
 
@StackedCrooked : Watching Oh My Goddess now.
 
I haven't got out my real tiger roar yet, so she may consider herself lucky :p
 
I know that show has obvious sexual innuendo.... but there's a lot of very subtle stuff, which is even more funny.
Especially once Urd shows up
 
@Xaade tsk tsk, sex again?
 
@Xaade The OVA from the 90s or the new TV series from the 2000s?
 
sbi
1:27 PM
@Xaade Yep, and Miss, much like tina, expects the latter.
 
Where there's one part where the guy gets turned into a motorcycle. Urd is talking about the situation with Beldandy and sits on the seat. He honks. And she says oh sorry.
 
sbi
@Xaade Well, you were referring to my message referring to Miss, so...
 
@Xaade You've probably heard "Oh Keiichi!!" about 100 times now :)
 
Then the next scene, she's caressing the seat in a pity him moment, and he starts honking like crazy.
 
@Xaade Don't remember that really. Been a while.
 
1:29 PM
Get the joke now?
 
sbi
@TonyTheTiger You started that by bringing whores to the chat! Now don't blame the others.
 
@StackedCrooked @Xaade what are you talking about?
 
@TonyTheTiger Google "Ah My Goddess!" (or Youtube)
 
Oh.... don't get it yet huh.
One hint. If the handle bars are his hands.... then his seat is ____.
 
@sbi I'm not blaming anyone, I'm merely pointing out tidbit of interesting information... and yes I'm proud of introducing whores to our lounge :p
 
1:30 PM
@Xaade Yeah, but a motorcycle seat has no nerve endings.
 
@StackedCrooked Whatever dude.
It also doesn't have any eyes.... and he knew Urd sat on his "lap".
 
@Xaade Hehe :) I'll have to rewatch that episode to see if that's really the joke, or you're just imagining things :)
 
It could be me
 
@sbi cuz we're all repwhores in disguise really :P
 
But Beldandy starts caressing the seat at a fast pace, and he's like honking really quickly in the next scene....
And Japanese are really fond of subtle sexual innuendo.... so I question everything.
 
1:32 PM
@Xaade Are you making this up?
 
NO
I swear
He like honks 5 times and his headlights light up with each honk.
 
@Xaade no cursing :P
 
When urd sits on him, he honks once and his tail-lights light up once.
I may be misinterpreting.... but it doesn't matter, cause when you frame it like that, it's even MORE funny.
 
@Xaade You should see the One Piece episode where Luffy ends up on an island were only women live. He gets a disease were mushrooms start growing on his body. The women think he's a girl (they don't know what a man looks like). And start pulling out the mushrooms.. But one doesn't give way..
 
Especially given he's still so shy of romance with Bel
 
1:35 PM
That was probably the wrongest moment in the entire series. There was one fat lady that really pulled it with all her might.. Oh man.
 
@StackedCrooked : Yeah, but One-Piece is a little more vulgar.... OMG (Oh my...) is VERY subtle in its innuendo, because the main characters are mostly innocent.
Like when Urd says to transfer his DNA to the system he must KISS Bel. Then she says "Of course the other thing you could do would be THAT MUCH better... but a kiss will work as well."
@StackedCrooked : One Piece has too many episodes....
Seems by now they would have found something.
 
@Xaade Not enough for me, I'm waiting for ep 496 impatiently...
 
What's the point.... are they ever going to accomplish anything.
I like the short one or two season anime, that have a beginning and an end. That leave you with this slight "sadness" whenever it's over, like you've had a great adventure but life moves on. It makes you want to imagine what might happen later in the characters life. When you feel that, you know you really connected, and it's "changed" you somewhat (you've learned something).
I don't get that feeling much from American stuff.... especially TV
 
@Xaade The story is steadily progressing. Luffy and his crew are currently on the verge of entering the second half of the grand-line aka "The New World". Cool stuff.
 
Examples:
RahXephon, Eureka 7, Cowboy Bebop, Samurai Champloo
Without an end..... the story becomes more meaningless the longer it continues.
 
1:44 PM
@Xaade I've heard other people say that as well. However, I don't care, as long as the anime can retain a high quality; the more episodes the better.
 
Anime is all about two things. Character progression, and theme. The theme is usually there to teach you or have you explore and idea.
The theme has to die in an anime that goes on for too long, because they have to move on..... and character progression is too slow in a never ending anime.
 
sbi
@TonyTheTiger What disguise? :)
 
@Xaade Yeah, you can rationally explain what I should like or not. However, that won't change anything :p
 
@StackedCrooked : I did nothing of the sort. I rationally explained why I like what I like.
 
@Xaade Ok, fair enough :)
 
1:48 PM
I felt a piece of me is forever stuck with Renton and Eureka.
 
@sbi the disguise that rep is really what brings us together :p
 
agree with me. Dis both declarations has no diference right?

struct resbuf* ptr = NULL;
struct resbuf *ptr = NULL;
 
@Xaade Heh, I didn't finish that one. Somehow I got bored near the end :/
 
@cyberrog the same yes
 
I know that's sounds sobby..... but that's just the thing. The draw is so powerful, it happens to me.
It got a little slow in the middle of the second season.... mostly because he gets a little tired.
And the monologue becomes more thoughtful and fills more time
Especially right before he switches "crew". It speed up when he returns, and just escalates every episode after that.
Then has another slow moment after he enters the barrier.... then escalates SUPER FAST after that.
At the end, there's just stuff flying everwhere like Bourne movie.
 
1:53 PM
@cyberrog yes, space is different in the second
 
sbi
@TonyTheTiger One rep to find them, and in the chat to bind them?
3
 
lol
 
@cyberrog : One is more "correct", and the other is this stupid thing we do here that has intellisense argue with us over where the * belongs.
 
@sbi lol
 
@sbi : One Rep point to rule them all. 9 Given to @sbi, 7 to @Tony, and 3 to @Dead.
 
1:56 PM
hey
 
@Xaade Btw, I think I started to appreciate black tea more because of Belldandy ;)
 
unless I got the 3 rep points of Awesomesauce! compared to @Tony's 7 Rep Points of Gender Changing, I'm insulted™
 
what does it means

struct resbuf* SomeClass::myVar = NULL;
 
@DeadMG lol
 
1:57 PM
@cyberrog: It means that you need to pick up a C++ textbook and learn C++
 
9 to mortal men, and @sbi is an old grumpy man.
 
@Xaade rofl
 
After that, I flipped a quarter.
 
@DeadMG i dont mean that
 
I do
 
1:58 PM
@cyberrog you implicitly are saying that
 
you're not talking about SFINAE in the depths of template metaprogramming here
 
@cyberrog It's the definition of a static data member.
 
that's pretty basic C++, and you should know what it means
 
it looks like it declare a variable of the struct typein a static way
 
if you intend to use it
 
1:59 PM
I know that SomeClass::myVar makes it static, but, what about the struct resbuf* in the beggining.
 
It's probably a static variable in the class definition.
 
ignore the struct keyword
 
@cyberrog pointer
 
it's worthless in C++ in this context
 

« first day (195 days earlier)      last day (4744 days later) »