2,898 Posted Topics
Re: This line declares a variable called `pNf` which is an auto-pointer to a `Notification` object, and it is initialized to `_queue.waitDequeueNotification`. The `AutoPtr` is a [class template](http://www.learncpp.com/cpp-tutorial/143-template-classes/). And the `Notification` class is it's template argument, making `AutoPtr<Notification>` an auto-pointer to a notification object. I believe that it is essentially equivalent … | |
Re: > it should print 10(1+2+3+0+1+2+0+1+0) So, you want to add together the first three digits of each row. Right? I say that because NathanOliver's code assumes that you want to interpret the first three digits as one number, and add the three (for each row) together, i.e., it should print … | |
Re: Reverend Jim thought that you were talking about 4K as in 4 kilobytes (or 4KB), and by that measure, the size of a 4KB file is, well, `4 * 1024` bytes. He simply did not realize you were talking about that new ultra-high-definition format for video and televisions that is … | |
Re: If you print out all the class sizes, things will become a bit clearer. If I run the following: #include<iostream> using namespace std; class Base {}; class D1 : public Base {}; class D2 : virtual public Base {}; class DD : public D1, public D2 {}; int main() { … | |
Re: Here is where the logic is wrong: "since the default is only and only executed when no case matches" That's not true. **If** no other case matches, **then** the switch will jump to the default case. It's an "if-then" rule, not a "[if-and-only-if](http://en.wikipedia.org/wiki/If_and_only_if)" rule. The fact that no other case … | |
Re: Since robotic motion planning is, generally-speaking, the topic of my PhD thesis, I can tell you quite a bit about this, probably far more than you really want to hear. I'll just try to give you a quick overview, with some key terms and places to start looking. If you … | |
Re: We need more detail. You say you are using a custom version of shared-ptr, and the error seems to be in that custom class. So, we need to see that code, otherwise there is really no way to tell where the error might come from. | |
Re: You cannot do a forward declaration of a class outside of its namespace, you need to do this: namespace std { template <class> struct hash; } I think that will solve it. Also, I'm pretty sure you need the `template <>` on the definition of the hash's `operator()` for your … | |
Re: This is indeed an interesting discussion. There's a lot of talk about "speed" here, but that is rather vague and inaccurate. What makes RAM "fast" is the low [CAS latency](http://en.wikipedia.org/wiki/CAS_latency). It is not so much a matter of bandwidth (bytes per second), it is a matter of response time or … | |
Re: Given that the biggest vulnerability in any network is the human beings using it (e.g., not protecting physical access to key machines, leaving for a break and leaving the computer logged in, using simple passwords or none at all, visiting dubious websites while at work, etc..), I would fear that … | |
Re: > what he is really doing and how can i protect my account ? and what methods he's using ? You should ask him. But I have a feeling he is imaginary... and that you're just fishing for some tips on how to hack people's accounts. | |
Re: The old town of Quebec city:  | |
Re: @sami9356: We don't appreciate it much when people simply copy-paste their assignment questions to this forum. You are unlikely to simply get an answer. The answer to your question can be found within some explanations of how to correctly and efficiently implement an assignment operator, here are a few tutorials … | |
Re: The mechanism for calling virtual function is, technically-speaking, unspecified or implementation-defined, meaning that there is not actual guarantee about how it is actually done. However, it is almost always accomplished the same way, via a virtual table. So, for each class that defines or inherits virtual functions, the compiler will … | |
Re: The second option seems pretty good. I think that you will be perfectly happy with integrated graphics, like Intel HD Graphics that come with their boards. The only thing that is a little weak with option 2 is the amount of RAM, I think that 4GB of RAM is a … | |
Re: Contrary to popular belief, the debate between Christopher Columbus and his peers was not about whether the Earth was round or flat, they all agreed it was round, but they disagreed on the size of it and the size of the Eurasia. The consensus on both sizes of the Earth … | |
Re: If you do a hard shutdown (by holding the power button of the computer until it shuts down), does it still turn back on by itself? If it does, then it must be some sort of hardware issue. Maybe the power-button was wired up wrong? | |
Re: OOP is a programming paradigm, which is to say, it's a way to reason about the code, i.e., the way you see / understand the code. It's a kind of philosophy, if you want. In very general terms, it's about looking at the overall application as a collection of objects, … | |
Re: How do you know that this is not a delay created by your email server? In the old days, it was common for some emails server to be slow or have a naturally delay (and 1 hour wasn't uncommon). AFAIK, this is no longer a common issue. | |
Re: When it comes to laptops, I have always found that Toshiba or Acer are pretty safe bets. I think HP is OK too. I've never trusted the quality of Lenovo, Sony or Dell, for laptops. That's just my 2 cents. Btw, your specs are very close to what I have … | |
Re: It's snowing a bit (probably about 5cm by the end of the day), and it's pretty cold, about -20 C (about -5 F), but it feels much colder with the high winds and high humidity. | |
Re: Moschops is mostly correct. There are standard guarantees about the memory layout of the data members of a class, but it has to meet a number of requirements / restrictions. In standard terminology, this kind of class is called a *standard-layout* class, and it has the following requirements: 1. It … | |
Re: The main thing that determines longevity is inertia. The only reason people still use Fortran or Cobol is because of inertia. To some extent, C as well, although it is often a practical (minimal) language for small tasks. Therefore, the languages that are likely to live for at least a … | |
Re: There must be a purpose to what you want to do, otherwise, there can be infintely many ways to partition countries or the Earth. There are natural partitions (tectonic plates, geology, climate, basins (watersheds), etc.). There are geo-political partitions (country, province / state, county / parish / district, municipalities, etc.). … | |
![]() | Re: I'm not sure I understand what you mean. I guess you are asking about how to make a game that has the same level of graphics quality from a 10-year-old game, but on today's hardware? It is certainly possible. To understand this, you have to know that there are two … ![]() |
Re: Use [VLC](http://www.videolan.org/vlc/index.html). Windows media player is a joke. | |
Re: The first thing to try is the install additional drivers. To do this, open up the **Software & Updates** tool from the Dash and click the **Additional Drivers** tab. Follow the on-screen prompts to check for, then enable, any **proprietary drivers** (not open source) available for your system. This is … | |
Re: I agree that this issue is annoying. There are similar issues with code blocks inside of quotes. I think the markdown renderer could use a bit of re-working. | |
Re: > What is intelligence anyway,.. Technically, many systems are intelligent to a degree, and often in very narrow bands. That is clearly one of the core questions that people have been trying to answer, and there is definitely no clear line separating what we would recognize as real "intelligence" and … | |
Re: Are you sure that you are placing the studentName.txt file in the same folder as the .exe file that is generated by the compiler? I suspect that the file you think it's using is not the one that it is actually using. When you load `"studentName.txt"`, it will open the … | |
Re: When you have **column-major** ordering, that matrix would look like this in memory: AA AB AC AD BA BB BC BD CA CB CC CD DA DB DC DD When you have **row-major** ordering, that matrix would look like this in memory: AA BA CA DA AB BB CB DB … | |
Re: There are mainly two easy ways to "parallelize" the operations in a for-loop like this. One option is to use SSE(2-3) instruction sets. SSE instructions sets can basically perform multiple (4) floating point operations at once (in one instruction). This is something that the compiler can do automatically. If you … | |
Re: What is really important is to resize by an amount that is proportional to the current amout in the array. Typical factors vary from 1.25 to 2. The reason why it is important to use a growth factor like that is because it makes the cost of allocation (and copying) … | |
Re: I agree with Dani and carl.potak in that a really good fit might be the middle group between client / management and the professionals (programmers / engineers). This could be anywhere from project manager to sales representative. You might not see yourself doing programming (software engineering, etc.) work, but with … ![]() | |
Re: An error like "too many levels of symbolic links" means that you must have a recursive (i.e., circular) set of symlinks. In other words, you must have created a symlink (maybe for `.bashrc` or `/bin/bash`) which directly or indirectly refers back to itself. When that happens, the OS follows the … | |
Re: This is indeed something of a problem. It is always difficult to jump into a new and large code-base. You should concentrate on any available overview documentation (e.g., explaining how it works or is structured), tutorials (e.g., showing how to make mods), and reference documentation (e.g., class references). If you … | |
Re: The problem is that your `operator==` function is defined in the header, which means that it will be compiled for each cpp file that includes it, leading to multiple definition errors (see [One Definition Rule](http://en.wikipedia.org/wiki/One_Definition_Rule)). What you need to do is declare the function in the header and implement it … | |
Re: You just need to move line 7 to between line 11 and 12. That will fix it. | |
Re: [System76](https://www.system76.com/) is another well-known company that sells computers with Linux pre-installed. Burning the image to a DVD is not a particularly good option, in my opinion. Booting up from a DVD is very slow. You should put it on a USB stick instead. This is going to be faster when … | |
Re: The problem is that you are looking in the wrong places. The reason why you cannot execute files on a USB is because the automatic mounting of USB drives in Ubuntu is somehow set to read-write permissions, but no execute permissions. Basically, the mount permissions are a mask that apply … | |
Re: I second rubberman on his suggestion. I use ffmpeg whenever I need to do any kind of video / transcoding work, it's phenomenal. But I would just like to add that technically ffmpeg is deprecated in favor of "avconv" from the [Libav project](http://en.wikipedia.org/wiki/Libav). avconv is technically an almost drop-in replacement … | |
Re: Yes, as AD says, you have to specify the output name with the `-o` option. Clang uses all the same options as GCC, as much as possible. So, if you need instructions on using clang and you can't find what you need, just look for instructions on using GCC, they … | |
Re: The memory leak is the least of your worries. This function is riddled with undefined behavior, memory leaks, heap corruption, memory corruption, and general mayhem. I'm surprised that it makes it as far as completing one iteration. 1) When you allocate a single object with the `new`, you need to … | |
Re: I agree with rubberman that you don't really need to know assembly these days for most tasks. There are still some dark corners in which you will find assembly code, which mostly include very low-level pieces of things like operating systems or compilers, very critical functions that need nano-optimization (i.e., … | |
Re: Hello and welcome. (Gruss Gott und willkommen!) I hope to see you around in the C++ forum. | |
Re: Dell is alright for desktop computers, they have good bargains and you can hand pick it all. However, Toshiba is far superior on laptops. They build really solid machines, and their consumer service is great. At least, that's been my experience, a grain of salt. | |
Re: The problem is that you are trying to sort `BankAccount` objects, but that class does not have a less-than comparison operator. The standard sort algorithm (unless otherwise specified) will use the less-than `<` operator to order to values. You need to overload that operator to be able to use the … | |
Re: > So Linux, is like kind of worktable and all the applications are tools? Yes, like any other operating system. The main difference with Linux is that it is far more deeply modular. Except for the kernel itself, which is one monolithic block (but modules can be added to it), … | |
Re: Everything is fine except for the part where you test the palindrome. You need to break out of the loop as soon as you find a mismatching character. Currently, the way it is, you are going to loop until the last character, and the bool `isPalindrome` will only reflect the … |
The End.