| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
<jamesd-> noam: Java GC is mostly about reclaiming memory; correct robust code can't rely on finalizers, and making correct finalizers even when they do run is relatively hard. <jamesd-> So you have to use finally all over the place in client code in Java, as it doesn't even have C#'s using thing. <jamesd-> Luckily most of the time all you care about is memory being reused, and GC is just fine for that. <_m_> noam_: believe me, I know the advantages of GC pretty well. I still prefer C++ over Java. <noam_> so do i <jamesd-> Hurrah! We all understand GC! Let's sing a song and hold hands. <noam_> what song will that be? <jamesd-> Um... the British National Anthem? The Chicken Song? Jilted Kid John? <jamesd-> Quite a garbage collection there. <cynic> gc just makes me uneasy and gui apis keep on trying to emulate it as if SWI was a great hit <cynic> I mean java-like gc <binrapt> Wow, you put two spaces after question marks and exclamation marks! <_m_> You apparently don't, binrapt! <noam_> SWI? <binrapt> I apparently do not, indeed! <jamesd-> Old habits die hard. <cynic> standard whacked interface <noam_> that comparison table says that c++ has "modules" <jamesd-> Walter's D vs C++ comparison table? Has he made it any less misleading recently? <binrapt> He has not <cynic> it was insane years ago, is it still the same? <binrapt> I suppose so <jamesd-> Ah well. Shame, D seems decent, I'd think some integrity in marketing it wouldn't hurt. <cynic> trying to dis c++ for weaknesses that don't exist is bad marketing imo <jamesd-> I might prefer it to Java or C#, even though both do now have some form of generics and automatic boxing/unboxing to save my eyes. <jamesd-> D leans towards building more into the language, which avoids some of C++'s warts. C++ aims to make it possible to do almost everything in libraries, which is powerful but not perfect. <noam_> so C++ doesn't "support all c types" <jamesd-> noam: C++98 doesn't support all C99 types. <jamesd-> If D does, that's a pleasant surprise. <cynic> and macros <jamesd-> Though why it would have _Bool is a mystery to me. Or _Complex. Ugly names. <cynic> at least they follow a naming convention <noam_> C has "direct access to C" <_m_> cool, isn't it? <jamesd-> C is *really* good at interoperability with C. So long as your compilers agree on an ABI. <noam_> amazing, how they've implemented that <noam_> java and c# use non-existent debuggers <mauke> Perl is even better at interoperability with Perl; all Perl implementations use the same ABI! <cynic> all perl implementations belong to <_m_> Java is ever betetr at interoperability with Java. All Java implementations use compatible machines. <mauke> even gcj? <_m_> What's gcj? <cynic> java interpreter for gnu compiler collection <cynic> or is it compiler <mauke> it can generate native code <_m_> I didn't touch Java in this millennium. <spsoup> Zeed: for what? <Kniht> m: http://forum.crystalxp.net/index.php?act=findpost&pid=7448 <Zeed> c++ :) <Kniht> m: http://sv2.3dbuzz.com/vbforum/showthread.php?s=&threadid=55409 <_m_> calc !tutorial <CalcMe> !tutorial = C++ is not the sort of thing you learn (well) from a bunch of second-rate tutorials on the Web. The preferred method is to buy a good book (e.g. Koenig & Moo's "Accelerated C++"), get a good C++ compiler or development environment (e.g. Dev-C++), and practice a lot. You could even take a course at your local community college. <pepsi_> I have a c++ exam tomorrow.. give me something tricky to read up about <palomer> const_cast <_m_> calc answer this <CalcMe> answer this = Given struct A{};struct B:virtual A{};cl*** C:virtual B,A{};cl*** D:B,public C,virtual A{} a; What's the order of destruction of 'a'? <noam_> er. <cynic> I haven't seen the point in virtual inheritance yet, so no answer for that diamond inheritance <noam_> diamond? <cynic> look it up <noam_> that's no diamond inheritance. <palomer> diamong inheritance sounds _evil_ <_m_> This one is more like a piece of coal then like a diamond. <cynic> oh <_m_> a/then/than/ <jamesd-> cynic: seen IOStreams? <cynic> jamesd-: yes, I have it right here <jamesd-> cynic: iostream inheriting from istream and ostream, which both inherit from... blah de blah... <cynic> I know there's a dual inheritance there <jamesd-> And that it's virtual, as there's common data in the base cl***... <palomer> shift left corresponding to multiplication means we usually read bit strings from right to left, right? <jamesd-> palomer: read them how you like. It just means that we consider the right-most bit to be the least significant. <palomer> gotcha <ismell> hrmmm question, i have a node template cl***, how could i make a node of node pointers ? node<node*> *cities; doesnt work <_m_> calc q <CalcMe> q = We are able to recognize a properly asked question even without the word "question" introducing it. <mauke> ismell: node isn't a type <_m_> node<node<whatevertype>*> <mauke> node* doesn't make sense <ismell> well i want to make pointers to the nodes <ismell> hrmm im going to have to rethink this <cynic> std::deque<node <cynic> *> <ismell> deque ? <_m_> cynic: doesn't work. node is not a cl***. <cynic> cl*** node; // =P <ismell> yeah im going to have to rethink this <ismell> template <cl***name Item> cl*** node ;) <cynic> ah you didn't instantiate it <jamesd-> ismell: a node<node<foo>*> might make sense. <ismell> il just point to the data inside the Item <ismell> node i mean <ismell> node<void*> *cities; ? that work <ismell> then i would have to cast it anytime i use it <ismell> meh nm <Mirza> cout << line << ' ' << ul << endl; ... line is a string, ul is an int.. result: " 6sconsin" ... what's going on here? :S <Mirza> if i follow the string by and endl it looks okey.. <cynic> Mirza: the output order is probably unspecified until you flush <mauke> no <mauke> line contains \r <cynic> but I have seen it do that without a \r <_m_> hehe, someone opened a text file in binary mode. <jamesd-> endl does flush. A control character in line is likely, like character code 13 at the end. <Mirza> crlf stuff? will opening it in text mode automagicfix all? <_m_> If you're on a crlf system, yes. <jamesd-> Mirza: in text mode, a newline (however your system represents it) will be read in as '\n'. <Mirza> i'm on a mac, the file is from a linux i think <jamesd-> No magic. Just translating between the OS representation and the C++ representation of newline. <jamesd-> Linux doesn't use CR (character 13) in text files. <_m_> text mode makes the iostream implementation automatically convert between the internal representation of end-of-line (\n) and the external representation (system defined). <jamesd-> The Mac can normally cope with it. <Mirza> alright, text mode baby <Mirza> what a weird output tho.. what does /r mean that makes it like that? <jamesd-> Mirza: carriage return means "go to the left margin". <_m_> \r is for CR, carriage return. Think of an old typewriter. <Mirza> oh, so it does that without skipping to the next line :D <_m_> yup <Mirza> neat...... :X <_m_> And so you lost the Wi of Wisconsin. <palomer> omg <Mirza> alright, thanks, makes sense <palomer> vector<> doesn't have push_front! <_m_> Didn't I tell you yesterday to sort the vector backwards? <palomer> I wasn't here yesterday <_m_> (maybe, I told someone else) <cynic> maybe he's not that sort of a person <_m_> palomer: you might want to consider std::deque instead of std::vector. <Mirza> hm so how do i specify text mode when using ifstream.open? there's just ios:binary listed.. <cynic> you remove that <Mirza> i just used open(name) before.. it puts binary as default i guess? so just open(name, ) ? <Mirza> ios:in <Mirza> ? <cynic> you remove the comma as well, else you get a syntax error <jamesd-> pcalc guess <jamesd-> Hmmmmn. <palomer> gah, when has it been so hard to move between ints and vector<bool> ? <jamesd-> gotta get work account fixed up with CalcMe. <jamesd-> palomer: why on earth are you using the-evil-vector-bool? <ismell> std::cout << "oCity Now: " << oCity->data << " At:" &oCity->data << std::endl << std::endl; if oCity is my node, and data is my City, couldent i just add the & to get the address of data ? <ismell> &(oCity->data) doesnt work either <_m_> Mirza: if you don't use ios::binary then you'll have text mode. <cynic> ismell: you are missing another operator<< <Mirza> i didn't use that, and it gave me my little output problem :/ <ismell> oh wtf <ismell> hahah
Return to c++ or Go to some related
logs:
beginner Kurt Cobain football
|
|