« first day (375 days earlier)      last day (4558 days later) » 

3:02 PM
lol
 
@sbi It took me all of what, a google search for iPhone WaitForSingleObject
 
@sbi yep. it's objective c
 
sbi
@Xaade I'm not sure about how this is supposed to reply to my message.
@cHao Thanks.
Now, out of my what-I-always-wanted-to-ask box:
Is there an Objective C++? If so, what are the differences to Objective C?
 
Yes there is.
Not sure if that's good or bad, but there is.
 
not sure. seems like it'd be kinda pointless, though -- i mean, c++ is "c with classes", and the whole point of objective-c is to add classes
 
user784668
3:08 PM
Pointless?
 
sbi
Ok. So, what are the differences?
 
user784668
You can write code that's twice as unreadable!
 
lol
 
It's C hybridized with that horrid bastardization of Smalltalk syntax, and C++ features like templates bolted on top.
 
eh. i like smalltalk syntax. i hate what obj-c turned it into, though
 
3:10 PM
The stuff of nightmares.
 
sbi
@RMartinhoFernandes Ah, Ok. Thanks for the clarification!
 
better :)
 
@Xaade there you go, your answer was accept.
The power of SO chat :)
 
Oh, and I forgot to mention that the semantics of the three languages are far from unified, so there's a lot of pain involved.
It's more like someone threw the three syntaxes into a bowl, mixed it, and Objective-C++ came out.
 
@sbi It's a stretch. But I said, getting around Objective-C wasn't too hard, because a boilerplate google search found the answer.
 
3:13 PM
As far as I know, it could have resulted in Nyarlathotep. We were lucky.
I never tried it, but I witnessed a friend of mine delving into the horror.
 
user784668
@RMartinhoFernandes: I'm not sure we were really that much lucky. Nyarlathotep can't be much worse than Objective-C++.
 
What's funny about Obj-C is that it apparently has autorelease semantics, but people are still doing refcounting manually.
 
I have some social eccentricities, which are caused by something akin to asperger
 
@CatPlusPlus Just like C++ has autorelease semantics, but people are still managing memory manually.
In fact, doing your own memory management manually is seen by some as something to be proud of.
 
far as i've heard, auto-release is kinda a recent addition to obj-c
 
3:20 PM
But THE PERFORMACE.
We can't lose a NANOSECOND here.
 
lol
 
That's unacceptable!
 
user784668
@RMartinhoFernandes: exactly. I know people who think that (semi-)automatic memory management is a good thing only for the ones who are unable to manage memory manually.
 
Who needs exception safety, anyway.
 
We have a proverb here, it roughly translates as "he who has a donkey but walks on foot is even more stupid." (the Portuguese word for "donkey" can stand for "stupid". And it rhymes in Portuguese.)
 
user784668
3:21 PM
True Programmers (tm) are managing the memory manually all the time, aren't they?
 
Oh, right, we don't use exceptions, because exceptions are TOO DAMN SLOW.
 
user784668
@CatPlusPlus: I actually have chosen not to use exception in some code for this exact reason. But this was in the embedded world, which is quite different from the desktop world.
 
user784668
@RMartinhoFernandes: could you tell us the Portuguese version? I'm curious how it sounds.
 
@Fanael "Quem tem burro e anda a pé, ainda mais burro é."
Good luck reading that :)
 
"When you want a burrito, it won't be as good as my burrito".
Maybe.
 
3:29 PM
lol
According to Google Translate, it's "Who's ass and walks the walk, is even more stupid."
Totally messed up.
 
Sounds like google translate is as reliable as "Hey convert my VB to C#" converters.
 
0
Q: CreateProcess not working

Eduard LucaI am having problems with getting the following code to work in C++ (VC++ console app). It simply doesn't create the process, but it prints out the error text. static void main(){ char *hotkeyexe = "cmd"; PROCESS_INFORMATION pi; STARTUPINFO si; if(!CreateProcess(hotkeyexe, "", 0...

Gotta admit, I haven't seen static void main yet.
 
@CatPlusPlus How will the loader be able to find it if its static?
 
3:33 PM
It's MSVC. Who knows.
 
Compiler forces it to be non-static, I presume.
It's handled specially anyway.
 
user784668
I'd rather worry about the linker, not the loader.
 
Why? Do you call main anywhere? :)
 
Hello, I'm getting the hang of this shit
 
what shit?
 
3:36 PM
socket shite lol
 
user784668
@FredOverflow: It's the linker what fills the relevant fields in the executable's header.
 
If the linker links main, the loader should have no problem.
The loader will call CRTmainstartup or whatever that thing is called or something.
 
Loader doesn't call main, anyway.
 
What function calls main? And who calls that function? :)
 
Start symbol is specified in the image header, but it's always inside runtime support code in a hosted environment.
So loader calls that.
 
3:39 PM
is this valid: const const_iterator
?
 
Yes, but quite pointless.
 
Sure, just like const T* const is valid.
 
user784668
@bamboon: yeah.
 
@CatPlusPlus Why? You get two different consts there.
 
user784668
@CatPlusPlus: care to explain why it's pointless?
 
3:40 PM
I don't think it's pointless.
 
It's not very useful though.
 
It's a read-only iterator that you cannot modify.
 
Maybe as a local variable, but as a member it's probably not a good idea.
 
Are iterators as members ever a good idea?
 
@Fanael What would be the use case?
 
3:42 PM
use case shmuse case!
 
ok thanks, was just wondering
 
user784668
@CatPlusPlus: const const_iterator end = something.end(); for(const_iterator it = something.begin(); it != end; ++it) { /* ... */ }
 
looks reasonable
 
@FredOverflow When you're writing an iterator!
 
though end can change
 
3:43 PM
1
Q: How to write function neatly? considering log, one return, no more indentation?

xiaoming There is a function Foo, Foo first calls Bar(), and then some statements; then Foo calls Walk(), and then some statemenets; then Foo calls Run(), and then some statements; then Foo calls Fly, and then some stamentments. There some ways, I can write Foo(), As it shows. Some one is clean, b...

 
i mean the something.end()
 
The fact that it leaks end into surrounding scope is more bleagh to me than being able to change end.
Also, micro-optimisation.
 
TL;DR: Someone who's coding C and compiling with a C++ compiler.
 
Also, did you ever managed to increment end()?
Also, debug iterators catch that.
 
You can decrement it!
 
user784668
3:44 PM
@CatPlusPlus: I even managed to decrement it! :P
 
But you can't when it's const!
Ha!
 
user784668
Exactly!
 
That was the (rather pointless) point of making it const wasn't it?
 
user784668
If it wasn't, I could!
 
I lost the point.
 
3:45 PM
.
There, keep it.
 
Fuck someone upvoted that "wall of code; no exceptions" question.
We (well, at least me) don't want these kinds of questions here. We shouldn't give incentives.
 
bye
 
> If the object is "Base" it can't, but, if the object its base, it does, because its overriden.
Can someone read this for me?
 
user784668
@CatPlusPlus: the fact that it leaks end into the surrounding scope isn't that bad if you're keeping your functions small.
 
One does not simply leak variables.
 
3:50 PM
 
@FredOverflow What does that mean?
Is that sign language or something?
 
"Come with me if you want to live".
 
sbi
I have, here, on SO proper, and elsewhere, explained numerous times why I think that you cannot properly learn C++ without reading a good C++ book. Looking for a place to put this down, so we can always refer to it, I was considering The Definitive C++ Book Guide and List. What do you think about adding a paragraph about this to the top of the question?
 
Oh, definitely!
 
user784668
3:57 PM
@sbi: why do you think that one cannot properly learn C++ without reading a good C++ book? :P
 
sbi
@Fanael For this I would refer you to that yet-to-be-written paragraph. :)
 
That question has 60k+ views and it's the second question most linked to in the site (the first one is that silly one about the regexes and Tony the Pony). A nice explanation of why its contents are important would help lots.
@TonyTheLion are you a friend of Tony the Pony?
 
That's his undercover alias.
 
@RMartinhoFernandes yea he's my best buddy :P
 
@RMartinhoFernandes That's Robert Martin, the #1 promoter of making your functions as small as possible.
@Fanael Because the Internet is full of misinformation about C++.
 
4:11 PM
@FredOverflow Oh, Uncle Bob?
 
Never seen his picture.
 
sbi
@RMartinhoFernandes Ok, that makes one yay and no nay, so I'll do it.
 
I think the proper term is "aye", not "yay".
 
sbi
It's CW anyway, so you guys can stomp in later and trample all over my paragraph.
@CatPlusPlus And who enjoys using the proper terms all the time?!
 
4:13 PM
@CatPlusPlus Since I was the one giving it, I can confirm it was a "yay" :P
 
@FredOverflow did u know robert martin is also a clc++m moderator?
 
user784668
@FredOverflow: so are books. That's why sbi said good books. Don't see why the same logic can't be applied to the information on the Internet.
 
@sbi Pedants.
 
@sbi Pretty much all room owners here have full edit privileges.
 
@RMartinhoFernandes You can also see his moving pictures.
 
sbi
4:14 PM
@RMartinhoFernandes Thanks for backing me up! :)
 
@Fanael It's rarer and spread over (I mean, not counting StackOverflow :).
 
sbi
@CatPlusPlus Pedants are rare in this room, though.
 
@AlfPSteinbach Really? I thought he hated the language?
 
Also, there are good books on the Internet. So you can have your cake and eat it too :)
 
(That involves copying.)
 
4:16 PM
so I have a problem, as I'm emptying my deque, I come to the last element, then it tries to deref the next element to pop out, but it crashes, as there's nothing there. How can I check that we're at the last element and we shouldn't try take the next one?
 
he was an editor of the C++ Report
 
@TonyTheLion deque.empty()?
 
sbi
@Fanael Because there are almost no good resources for learning C++ on the Internet. In fact, I know only a single one, and I've been looking for them for more than a decade.
 
@TonyTheLion Code.
 
@sbi SO?
 
4:17 PM
:1751644 if (!rects.empty()) {
		rects.pop_front();
		current_r = &rects.front();
	}
	else
		current_r = NULL;
 
I think you probably want to refill the deque when empty.
 
so on the last one, the deque is not empty, so it goes inside the if statement
 
not a good idea
 
@TonyTheLion Oh, you need to test after popping.
 
sbi
@FredOverflow SO isn't good for learning C++. (That's why we advocate to read books, remember?) No, the one I have heard is good is Eckel's Thinking in C++. Well, now that I write this, I see that it actually is a book, too...
 
4:18 PM
:)
 
2 mins ago, by R. Martinho Fernandes
Also, there are good books on the Internet. So you can have your cake and eat it too :)
 
sbi
@RMartinhoFernandes Yeah, I know. Eckels' is the only one legally available I'm aware of, though.
 
@RMartinhoFernandes Oh, I thought he meant books that taught you about the Internet.
 
sbi
@AlfPSteinbach That's an excellent article, and there are many other excellent articles out there, but none of them are a good tutorial for learning C++.
 
4:21 PM
@sbi well my tutorial was/is linked from the faq but it's not on the net any more, and i'm sorry i don't have to energy to update it. marshall wanted to host it on the faq site, though. but that's two years ago i think.
by the way you can all wish me happy birthday if you wish
because i'm one year older today <g>
 
sbi
Hey, Happy Birthday, @Alf!
 
Happy birthday.
Hope you have your cake and eat it too.
 
sbi
I was first. Please queue from the right. And no jumping the queue, please.
 
user784668
 
4:24 PM
IntelliPoint has peak private bytes of 260MB. Neat. A mouse driver taking more than booting Firefox.
 
@CatPlusPlus Holy mother of mice!
 
ok thanks @RMartinhoFernandes, fixed that issue
@CatPlusPlus OMG, that's a lot
@RMartinhoFernandes is the R. part of your name or does it stand for Robot?
 
I think I maybe a bit slow... :(
 
user784668
yup, lol
 
4:26 PM
R. Daneel Olivaw is a fictional robot created by Isaac Asimov. The "R" initial in his name stands for "robot," a naming convention in Asimov's future society. Olivaw appears in Asimov's Robot/Foundation Series, most notably in the novels The Caves of Steel, The Naked Sun, The Robots of Dawn, Robots and Empire, Prelude to Foundation, Forward the Foundation, Foundation and Earth. Since he also appears in all of the books of the Second Foundation Trilogy, Daneel is the most commonly appearing Asimov character. He was constructed immediately prior to the age of the Settlers, and lived at leas...
 
lol
omg, I am epically slow
damnit :(
 
user784668
@TonyTheLion: have you profiled yourself to see where the bottlenecks are?
4
 
@Fanael euh, yea, I have a bottleneck in the ability to comprehend things :P
 
user784668
4:39 PM
0
Q: Const with smart pointers in C++

lucas clementeI'm writing a smart pointer implementation in C++, and I'm having some trouble with const-correctness. Below is an excerpt from the code: template <class T> class Pointer { T* pointee; public: Pointer(const Pointer<T>& other) { // must be const Pointer& for assignment...

 
user784668
@RMartinhoFernandes: why you deleted your answer?
 
user784668
why have*
 
@Fanael It's a duplicate of an existing one.
 
user784668
@RMartinhoFernandes: yup, but your answer was better than zennehoy's, I think.
 
I don't see what the difference was.
He even used a similar example.
 
user784668
4:43 PM
Now that I don't see yours, I can't say what I liked more in it.
 
I can make it visible for an instant :)
@Fanael Tell me when I can delete it again :)
 
user784668
OK, you can.
 
user784668
Frankly, now I don't know why.
 
user784668
Maybe it was due to formatting.
 
Well, yeah, I liked the presentation of mine better, but I'm a bit biased.
 
sbi
4:49 PM
Ok, so I have added a leading paragraph to the book list question explaining why learning C++ from a book is a good idea. I'm not proud of it, so please feel free to improve on it.
 
Als
Hola....Happy Diwali!
 
Hey, yesterday was my birthday and no one said happy birthday :(
 
user784668
What a shame.
 
ha ha
 
@LewsTherin you mean nobody here? or nobody at all?
 
4:52 PM
At all.
 
Awww.
That's sad.
 
meh, maybe...
get used to it eventually guess.
 
user784668
Were you staying all the day home by any chance?
 
Of course, but there is facebook :)
 
@Als Is that an Indian Holiday or something?
 
user784668
4:54 PM
@LewsTherin: if you were, then honestly, I'm not surprised.
 
Als
@RMartinhoFernandes: Yes,the biggest Indian festival, The festival of Lights.
 
@LewsTherin You didn't tell anyone!
 
Als
Deepavali or Diwali, popularly known as the "festival of lights," is a festival celebrated between mid-October and mid-November for different reasons. For Hindus, Diwali is one of the most important festivals of the year and is celebrated in families by performing traditional activities together in their homes. For Jains, Diwali marks the attainment of moksha or nirvana by Mahavira in 527 BC. Deepavali is an official holiday in India, Nepal, Sri Lanka, Myanmar, Mauritius, Guyana, Trinidad & Tobago, Suriname, Malaysia, Singapore, and Fiji. The name "Diwali" is a contraction of "Deepaval...
 
@Als Well, then, Happy Diwali to you too :)
 
Als
@RMartinhoFernandes: Thank you ::)
 
4:55 PM
@RMartinhoFernandes that's true ha ha I just wanted to moan for the sake of moaning.
@Fanael I thought that was what facebook was for. A cheap birthday card lmao
 
user784668
@LewsTherin: Facebook is for stealing personal information.
 
@Fanael Yep, that's why I removed my birth date on it. And any personal info for that matter. I have tried deleting my account and failed
 
user784668
Oh. Too late.
 
user784668
I never put any personal info there.
 
The djinni is out of the bottle. You can't put it back in, you have to make your wishes.
 
4:59 PM
i think your birhtday is really one of the most unimportant info about you
 
sbi
> I only now see that this even recommends a book by Herb Schildt. Ugh. That man wrote so legendarily bad books, there's memes about him out there. Sorry, but any answer recommending a book by Schildt should catch a downvote as an automatic service by the system from anyone unhappy enough to have been looking at it. - sbi
 
@Fanael Once they have it they got it. Ugh, I hoping those Anonymous fellas would do some damage. They need to delete that stuff
 
@sbi Yes, there's a big answer there with one of those.
 

« first day (375 days earlier)      last day (4558 days later) »