| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
<igbeserk> i need to enable my debugger i don't know how and why it got disabled <igbeserk> it happened before and i reinstalled it and it worked again <igbeserk> i tried reinstalling again and it was like 2 hours and it still wasn't finishing <igbeserk> so i cancelled it <moralcode> i use a lot of boost::shared_ptr<std::string>, is that good or bad? should i start using char* instead? <moralcode> nevermind shared_ptr makes me feel safe :) <james-_> moralcode: unless you have measured performance issues, I see no advantage in going to raw pointers. <james-_> And I don't imagine that your shared_ptr<string> is going to be the performance bottleneck in most cases. <moralcode> i see, read that boost::shared_ptr is slow on performance though <moralcode> ah ok <Genia4> slow? never <Genia4> overhead, yes <Genia4> but how many pointers are you really gonna use? <james-_> Slow? Um... probably you're reading people ranting. <Genia4> people will rant about anything <Genia4> including other people's rants <james-_> shared_ptr does use more dynamic allocation, but in most cases it just doesn't matter. <james-_> And updating ref counts takes a non-zero number of cycles... but still not a lot. <moralcode> good info, ill continue using shared_ptr :) <james-_> Or if you don't need shared semantics, just p*** strings around directly. <Genia4> there's scoped_ptr <Genia4> which is probably marginally more efficient, although I can't say for sure <james-_> scoped_ptr is more efficient; should be pretty much as quick as a raw pointer. <james-_> And no space overhead unless you need a custom deleter, I'd hope (hmmmn, does scoped_ptr even have support for custom deleters? I don't use it often.) <Genia4> scoped_ptr is good for cl***-level pointer member vars <james-_> Genia4: True, though I rarely need dynamically allocated things as members. (Not never, just rarely.) <Genia4> I do a lot (Qt crap :( ) <Genia4> anything that uses signals/slots is better off being dynamically allocated <Jostein-_> hi, dunno if this is the right channel to ask in... <Jostein-_> i've got a bunch of files which contains chinese text. all files are ansi-format, not unicode. opening them shows weird characters even when I have chinese installed on my winxp. is there a way to read the chinese text? <Genia4> because when that kind of stuff goes out of scope, dtor will be called <Genia4> and deleting stuff while there are signals pending is bad <james-_> capital B, "Bad". <james-_> Jostein: you need to know what encoding the files are in, for one. I don't think ANSI covers any Chinese character sets, though I may be wrong. <igbeserk> so does anyone know how to enable the debugger in microsoft visual studios .net? <moralcode> if there is an exception thrown that is unknown, is there a way to capture it? (it does not inherit from std::exception) <Genia4> yes <KimmoA> What's wrong with cout << "I'm alive!" << endl;? <Genia4> catch(...) <xdank--> set a breakpoint and run with debugger <james-_> igbeserk: google and Microsoft's website don't help? Try #winprog. <KimmoA> That's all the debug you need. <igbeserk> well i'm looking in the search help for the program <igbeserk> and it's giving me nothing <igbeserk> i'll try google then <Genia4> I need to start using exceptions and boost in my cod <Genia4> e <james-_> moralcode: you can catch(...), but you can't do much with it then except report it or rethrow it. <KimmoA> Exceptions = code-bloaters. <james-_> igbeserk: note: it might well be that it's Windows that you need to tell to use the debugger. <Genia4> james-_: how can you rethrow it? <james-_> KimmoA: Myths = bad <james-_> Genia4: "throw;" <Genia4> and what good will that do? <Genia4> it will travel up anyway <james-_> KimmoA: exceptions can make critical pieces of code smaller. <james-_> Genia4: it's useful (rarely) if you have a reason not to use RAII for some local cleanup. <moralcode> james-_, i already do catch(...) but i want to know what the exception is...trying to solve the problem <james-_> Genia4: or, it can be used to bring exception handling into a function. <KimmoA> james-_: Huh? How is that possible? <igbeserk> james: it's worked before like when i first installed it and previously and all this is the second time it gets to the point where the debugger doesn't want to work <james-_> KimmoA: by reducing the need for explicit tests of conditions. <james-_> igbeserk: I heard you the first time. <james-_> igbeserk: Windows has a framework for debugging. Visual Studio is one thing that can plugin into that. <moralcode> im using a xerces-method and it throws an exception...i already catch all the exceptions in the library but its not one of them, and it does not inherit from std::exception <moralcode> xdank--, im not very good with the debugger :/ <moralcode> might be time to practice now then :) <Genia4> why was kennedy killed? <james-_> moralcode: Windows? Sure it's not a structured exception reporting something like a bad pointer problem? <moralcode> james-_, it might be <Genia4> I mean, what did the killer say? <KimmoA> Bah. <moralcode> james-_, yes windows <KimmoA> Java made me hate exceptions. <Genia4> java overuses them <james-_> Checked exceptions seem to be a failed experiment. <Genia4> what's a checked exception? <xdank--> forcing exception handling at compile time <xdank--> ? <james-_> Genia4: ones where the compiler checks your functions' throw specifications. <Genia4> oh <Genia4> void func() throws whatever? <Genia4> yeah, gay <KimmoA> Okay... It seems to ignore my #ifndef and still runs the stuff inside it and #endif... What do you put in place of "foo" in "#ifndef foo"? "FOO", "Foo", "foo", "Foo.h" or something else? I have seriously tried to find an answer online. <Genia4> huh? <james-_> KimmoA: what the heck are you talking about? <james-_> KimmoA: you use #ifndef to check if something is not defined... so you have a reason for checking... so you know what to check. <KimmoA> Hmm... <KimmoA> I wanna check if something is included... <james-_> What do you mean, "check if something is included"? <moralcode> if someone has any idea: http://www.rafb.net/paste/results/O5TOU940.html <KimmoA> If the stupid header has been included, I don't wanna include it in this file... <james-_> KimmoA: why not? Shouldn't it be harmless? <KimmoA> Apparently not... <YUY0x7> #if !defined(UNIQUE_IDENTIFIER_FOR_THIS_HEADER) #define UNIQUE_IDENTIFIER_FOR_THIS_HEADER .... #endif <james-_> KimmoA: if not, you should probably fix the header if it's yours. <KimmoA> I get redefinition errors. <james-_> You need include guards in the header file, as YUY0x7 showed. <james-_> ***uming those are compile-time redefinition errors, as I guess they are, not link errors with multiply defined symbols. <YUY0x7> moralcode, where is the documentation of XMLString::substring ? <KimmoA> Compile-time. <KimmoA> Right. Now I remember how they work :) <moralcode> YUY0x7: http://xml.apache.org/xerces-c/apiDocs/cl***XMLString.html#z1009_0 <KimmoA> I ***ume that there's a good reason why this can't be done, but wouldn't it be possible for a compiler to know this somehow? <james-_> KimmoA: to know what? <KimmoA> To know what is safe to include. <james-_> KimmoA: note: sometimes including a header twice is deliberate. <YUY0x7> moralcode, the first parameter is expected to be allocated with enough space to receive the substring <moralcode> and the memory is released later by myself, so i ***ume that the memorymanager allocates the memory for *day <moralcode> YUY0x7, doesnt the memory manager sort that out? <YUY0x7> moralcode, what memory manager? <moralcode> YUY0x7, XMLPlatformUtils::fgMemoryManager <YUY0x7> oh, nope <moralcode> oh ok <YUY0x7> you're p***ing a char * const <moralcode> ah i see, i cant figure why i need to p*** the memorymanager in the first place <moralcode> stupid library <moralcode> cant take care of its own memory *grunt* <YUY0x7> i'm puzzled as to why they use char* strings instead of std::string <moralcode> me too, never going to use xerces again <james-_> 1. Xerces was around before the standard C++ library was decently portable, and 2. XML requires decent Unicode support, that standard C++ doesn't yet have. <james-_> Also Xerces is somewhat based on the Java version, I think. <moralcode> i see, good explanation <moralcode> doh <moralcode> expat or libxml2 it is then <james-_> It's still fugly interfacing to Xerces... <YUY0x7> using char* strings makes it more portable to unicode? <james-_> moralcode: if SAX2 is all you need, expat is simple and quick. <james-_> YUYU0x7: they use their own string cl***. <moralcode> james-_, yup thats all i need...sweet <moralcode> i thought standards were standards because people should follow them :) <james-_> moralcode: sometimes takes a while for compiler/library vendors to catch up. And C++98 was a little too inventive. <KimmoA> Bah. The stupid **** ain't workin'. <KimmoA> I do a #define FOO_H in the "main" file including the file, and then do #ifndef FOO_H\n#include "foo.h"\n#endif. <KimmoA> I guess it's wrong too. <moralcode> xml, std::string and unicode has been around for a while...they arent very fast <YUY0x7> <YUY0x7> #if !defined(UNIQUE_IDENTIFIER_FOR_THIS_HEADER) #define UNIQUE_IDENTIFIER_FOR_THIS_HEADER .... #endif <igbeserk> yea i'm finding no luck <igbeserk> i'll just reinstall it <james-_> KimmoA: header guards are used in the header file only; they are not normally mentioned anywhere else. <james-_> KimmoA: in particular, do *not* define the macro anywhere else. <KimmoA> But... but... <KimmoA> Of course not, but I must check it somewhere... <KimmoA> Sigh. BRB. <james-_> moralcode: Unicode has been quite a moving target. Windows and Java have it ugly, as they use 16-bit datatypes for Unicode, but Unicode hasn't fitted into 16 bits for a number of years. <james-_> KimmoA: you check it in the header: that's what the #ifndef line does. <vvortex3_> are you people still here? <moralcode> james-_, i see...wonder why developers are so slow :) <moralcode> unicode slowing down now? <vvortex3_> because we are payed by the hour <moralcode> kicking out xerces as of now
Return to c++ or Go to some related
logs:
"time of your life wav.""
politics linux-2.6.13-mppe-mppc-1.3.patch.gz
|
|