2,898 Posted Topics
Re: What about the CPU's heat sink? If you removed it and didn't glue it back on with proper heat conducting glue, the CPU will overheat in a matter of seconds and shut down. Just a thought. | |
Re: What have you tried? We do not simply provide ready-made answers to homework questions. You need to show some efforts to try to do it yourself, and point to the specific coding errors that you have trouble resolving. We can help you from there, but not before. | |
Re: > Could reading a CLRS and working day and night at topcoder help me? I would say that it doesn't hurt. From time to time, I pick up on some simple or classic problems to challenge myself a little bit (without having to devote too much time to it). But … | |
Re: That's a good idea RevJim. There could be a button under the "Tutorial" tab that says something like "Propose a Tutorial Topic" or something like that. In other words, it would be nice to have an "official" place for people to manifest their desire for a particular topic to be … | |
Re: I often joke that I can read and write C++ code faster than English. It's probably true in sheer number of lines. But this is definitely just something you acquire with time. And yes, for a long time, I would always have to refer back to previous code for lots … | |
Re: I'm not sure this is really what you should expect a beginner to produce... seems a bit too advanced. Anyways, here are a few nit-picking remarks. 1) They are not called "template functions", they are called "function templates". This is an easy slip of the tongue, but the latter (and … | |
Re: The main library that is used for manipulating PDF files is the Poppler library ([home-page](http://poppler.freedesktop.org/), [wiki](http://en.wikipedia.org/wiki/Poppler_(software))). This is the library that is used for virtually every tool in the Unix/Linux world that deals with PDFs. However, you should consider using an existing tool. The set of command-line tools that come … ![]() | |
Re: At line 211, you cannot have `public:` within a function body. This is only allowed (and meaningful) at the class scope. Remove it and it should solve the errors. Also, you should learn to indent and space out your code better, it will be really helpful in the future to … | |
Re: What is the question? What have you tried so far? And what is the specific problem you are facing with your code? | |
Re: I'm sorry, but I am not able to make heads or tails of what you are trying to do. Can you show a minimal "toy" example that shows what you want to do? Use this as the starting point: class Foo { public: enum FooType { A = 0, B … | |
Re: I concur with the others. Without saying what the problem is (how it manifests itself), there is little chance that anyone is going to comb through the code to find the error. | |
Re: >Does anyone like to use Linux over the Microsoft XP or System 7/8. Everyone that I know who has ever tried to use Linux for any substantial amount of time (usually compelled to do so because of job, or just out of curiosity) and who is the least bit competent … | |
Re: I think it's slightly off, but close. A typical point that is raised when discussing the idea of writing kernel code (or similar high-performance low-level code) in C++ is that operations such as `new`, `delete` and `dynamic_cast` (not `static_cast`) do not have a **deterministic timing** (or latency). In other words, … | |
Re: @AD: Let me clear that cloud of confusion. Clang is the C / C++ / Objective-C / Objective-C++ front-end for the LLVM compiler back-end. It is a GCC-compatible compiler suite (i.e., you can usually replace any clang-llvm tool with a GCC one, like the linker or standard libraries). Clang is … | |
Re: There is generally no difference between using an index or using a pointer. Using pointers is technically faster, but using an index will usually result in the same code once the compiler has optimized it (unless it is really bad at optimizing or that the context makes the preservation of … | |
Re: Yes, I use compressed air as well, it is pretty much the only way to clean it, and it is also sufficient (it clears the dust, which is really the only thing that is dirty'ing up your PC). I guess the only other thing that could be used is a … | |
Re: The problem is that there is no such thing as a "multi-character" type. Something like `'ball'` is not valid in C++ (although compilers must accept it, for some odd reason, but the value that the compiler gives to them is not defined). And because "choice" is a character, it will … | |
Re: Asking about what they are looking for is pretty bad. It is literally like saying "hey, tell me what you want to hear and I'll echo it right back to you.". It's a very old used-car-salesman trick: tell me what kind of car you need and, just like magic, I'll … | |
Re: Well, if one were to go by [phrenology](http://en.wikipedia.org/wiki/Phrenology), the shape of this "dude"'s head is very telling, and disturbing. The flat shape of the back of his skull indicates that he is devoid of any sense of morality, parenting skills, and capacity to remain faithful to his word (cheating on … | |
Re: This may help, I've compiled with maximum warning levels, using Clang compiler, I get the following warnings: sales_receipt_prog.cpp:238:1: warning: control may reach end of non-void function [-Wreturn-type] } ^ sales_receipt_prog.cpp:314:1: warning: control may reach end of non-void function [-Wreturn-type] } ^ sales_receipt_prog.cpp:263:15: warning: variable 'last' is used uninitialized whenever 'if' … | |
Re: I'm sorry to say, but without knowledge of basic calculus you can't really do much. It's like asking about how to learn to build a house without knowing how to operate a hammer. I took some machine learning classes back in the day too, and I don't remember it being … | |
Re: The declarations are marked as `const`, which is correct. However, your definitions (in cpp file) are not marked `const`, which makes the declarations incompatible with the definitions. You need to match them exactly: Declarations: string get_name() const ; int get_age() const ; Definitions: string person :: get_name() const // <-- … | |
Re: You just forgot the `*` next to the type `Object` in your for-loop. It should be: for( std::map<string, Object* >::iterator itr=_c.begin(); itr < _c.end(); itr++) | |
Re: > I tried this, but i get debug assertion failed. My guess is that you shouldn't use `delete` to deallocate the string's memory which was allocated with `strdup` (which is not a standard function, btw). Conventionally, it is probably safer to assume that its memory was allocated with `malloc`, and … | |
Re: I don't see any reason for the ExposedA and ExposedB classes to enter the inheritance scheme at all. And also, from your simple example, I don't see any reason for B to inherit from A, but I assume that in your real this is needed. Anyhow, the point is that … | |
Re: If you boot from the LiveCD, you should be able to pull up a terminal and enter this: $ sudo fdisk -l to list the hard-drives, partitions and their formatting information. That's the first information you should fetch (and post here), to know what Ubuntu is actually seeing. In general, … | |
Re: > Using C++, you can ask the operating system to set voltage values on those connectors. Some operating systems will only allow you to set it to low (usually zero volts) or high (some other value, 5V comes to mind, but it's hardware dependent). If the operating system is happy … | |
Re: There are also a number of additional serious problems with your code. 1) Your copy-constructor is wrong: CLibrary::CLibrary(CLibrary &B) { mA = new CArticle*[MAX]; mA = B.mA; // <-- Problem! Assign the pointer 'B.mA' to the pointer 'this->mA' // the memory you just allocated (with new) is leaked, and both … | |
Re: > I was wondering if there is a way to say do this: > ... > Instead of having to do this: > ... > I would have thought that if it wasn't possible that C++11 would have fixed that, given that it created the `&&` move constructor, why couldn't … | |
Re: Version 1: "I'm having trouble with this math problem, can you give some pointers?" "No, I'm sorry, it wouldn't be safe. You'll have to ask my garbage collector." Version 2: "I'm having trouble with this math problem, can you give some pointers?" "Only if I can trust you to increment … | |
Re: I raised this issue of [privacy in the cyber-world](http://www.daniweb.com/community-center/geeks-lounge/threads/451854/expectation-of-privacy-in-the-turing-era) a few months ago. You might want to give it a read. ![]() | |
Re: It is pretty obvious that you cannot use actual recursive calls in the implementation. Any recursion can be turned into a loop of some kind, usually supported by a queue or stack data structure to hold what would have been the stack-frame if it were implemented with recursive calls. Doing … | |
Re: The reason why your code compiles is because your compiler implements a non-standard extension called VLA ([Variable Length Arrays](http://en.wikipedia.org/wiki/Variable-length_array)). This is a C99 feature (1999 C language standard) which allows for "static" arrays to have a length that is determined at run-time (not a compile-time constant). It is not standard … | |
Re: > the feature has existed for a few days already and no one has noticed :( I had noticed it (couple of days ago or something like that), but I wasn't sure if it was there before that and I just hadn't noticed it, or if it was something new. … | |
Re: I prefer my Generic Programming (GP) version of bubble-sort: template <typename ForwardIter, typename Compare> void bubble_sort(ForwardIter first, ForwardIter last, Compare comp) { ForwardIter current_next; for(bool swapped = true; (swapped && (!(swapped = false))); --last) for(ForwardIter current = first; (current_next = std::next(current)) != last; ++current) if ( comp(*current_next, *current) && ( … | |
Re: The compiler explains it pretty well: error: 'i' is a protected member of 'A' That's pretty much all there is to it. The member function `g` is a member of class `B`, and the function `f` is a friend of class `B`. They both can only have access to private … | |
Re: I remain unconvinced of the merits of D. I find many of the design decisions questionable and many others rather inconsequential. But there are certainly some nice things about the language. Here are some specific points (omitting things that haven't been changed from C++): **Modules vs. namespaces**: *I disapprove* I … | |
Re: That poutine looked disgusting: uncooked fries, no proper "couic-couic" cheese, too little gravy, and with syrup on it (who puts syrup in a poutine?!? I thought I had seen every variation out there, never seen that before). I also loved the "Canadians have an evolutionary adaptation called socialized medicine", priceless. … | |
Re: Are you using a MAC? Because a quick [google search](https://www.google.ca/search?q=%22library+not+found+for+-lcrt0.o%22&oq=%22library+not+found+for+-lcrt0.o%22&aqs=chrome.0.69i57.1025j0&sourceid=chrome&ie=UTF-8) makes it pretty clear that this is a MAC OS X issue. | |
Re: The standard input: cin >> str; will read the text that has been inputted only up to the first space character (or new-line, or tab, etc.), and it will store that resulting text (i.e., the first word) as a null-terminated string in the memory pointed to by `str`. So, the … | |
Re: I believe you need to do a grub recovery. The fact that you installed Ubuntu and Windows on separate hard-drives might be the root cause of this issue. How exactly did you proceed to do the installation? I know you went through the Ubuntu install menus, but what I want … | |
Re: I really enjoyed the interview. It was quite endearing how Dani was giggling the whole time. One thing I got out of this interview is that Dani, you really got your shit together! (pardon the language) I mean, you clearly understand this business well, from the technical and marketing side, … | |
Re: It allows you to do [atomic operations](http://wiki.osdev.org/Atomic_operation) on variables. | |
Re: No, it is not about `exception& e` being const. It is about the base-class function `char* what() const;` not being the same function as the derived class function `char* what();`. Imagine it this way, consider that a function marked as "const" has a different name. As so: class Base { … | |
Re: Have you tried? We don't do people's homework here. Show some effort at solving the problem yourself and what specific problem you are having with it. | |
Re: I think these drag-and-drop encryption things are usually implemented in the Windows driver that is loaded when you plug in the USB drive. Or, possibly, as part of the file-system used to format the USB drive. I think that once you re-format / wipe the USB, or disable that special … | |
Re: > Weapons are trivial for America to function, once they're gone it's OVER. That's extremely sad. It's sad that you consider it a defining aspect of America; that people keep a piece of equipment in their house and be prepared to use it to kill their neighbors. In some countries … | |
Re: There are a few options. Because a map iterator is only a bidirectional iterator (as opposed to a random-access iterator), you cannot simply write `it + 4` to advance the iterator by four as you can with a random-access iterator. I guess the first option is to use `std::advance` to … | |
Re: Well, as a robotics engineer, I can tell you that hardware programming is far from obsolete. It is in fact probably the most important and time-consuming task when dealing with robots and other similar stuff. One thing that is important with hardware programming is what you are programming on. If … |
The End.