2,898 Posted Topics

Member Avatar for nstrazimiri

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.

Member Avatar for caperjack
0
394
Member Avatar for shupa_1

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.

Member Avatar for castajiz_2
0
332
Member Avatar for theguitarist

> 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 …

Member Avatar for Reverend Jim
0
386
Member Avatar for Dani

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 …

Member Avatar for Dani
0
2K
Member Avatar for london-G

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 …

Member Avatar for <M/>
0
119
Member Avatar for David W

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 …

Member Avatar for deceptikon
0
468
Member Avatar for JameB

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 …

Member Avatar for iamthwee
0
771
Member Avatar for leonidas007

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 …

Member Avatar for mike_2000_17
0
152
Member Avatar for Jordancrack

What is the question? What have you tried so far? And what is the specific problem you are facing with your code?

Member Avatar for mike_2000_17
-2
72
Member Avatar for phorce

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 …

Member Avatar for mike_2000_17
0
295
Member Avatar for ddm

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.

Member Avatar for David W
0
584
Member Avatar for f14dtom

>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 …

Member Avatar for Vasvi
3
743
Member Avatar for MasterHacker110

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, …

Member Avatar for MasterHacker110
0
215
Member Avatar for triumphost

@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 …

Member Avatar for triumphost
0
702
Member Avatar for vishalonne

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 …

Member Avatar for mike_2000_17
0
183
Member Avatar for aVar++

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 …

Member Avatar for Reverend Jim
0
197
Member Avatar for pars99

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 …

Member Avatar for pars99
1
216
Member Avatar for nitin1

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 …

Member Avatar for jwenting
0
351
Member Avatar for james.lu.75491856

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 …

Member Avatar for mike_2000_17
0
267
Member Avatar for adil.ghori

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' …

Member Avatar for adil.ghori
0
947
Member Avatar for MrEARTHSHAcKER

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 …

Member Avatar for jwenting
0
248
Member Avatar for charles.dupree.37

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 // <-- …

Member Avatar for charles.dupree.37
0
7K
Member Avatar for glenwill101

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++)

Member Avatar for glenwill101
0
418
Member Avatar for tanatos.daniel

> 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 …

Member Avatar for deceptikon
0
412
Member Avatar for Labdabeta

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 …

Member Avatar for Labdabeta
0
257
Member Avatar for Ancient Dragon

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, …

Member Avatar for Ancient Dragon
0
314
Member Avatar for pars99

> 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 …

Member Avatar for mike_2000_17
0
2K
Member Avatar for tanatos.daniel

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 …

Member Avatar for tanatos.daniel
0
449
Member Avatar for Labdabeta

> 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 …

Member Avatar for mike_2000_17
0
410
Member Avatar for james.lu.75491856

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 …

Member Avatar for james.lu.75491856
0
475
Member Avatar for GrimJack

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.

Member Avatar for diafol
0
624
Member Avatar for Labdabeta

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 …

Member Avatar for Labdabeta
0
303
Member Avatar for irtza

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 …

Member Avatar for vijayan121
0
4K
Member Avatar for Dani

> 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. …

Member Avatar for Dani
8
326
Member Avatar for Frank_5

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) && ( …

Member Avatar for mike_2000_17
0
4K
Member Avatar for nitin1

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 …

Member Avatar for rubberman
0
146
Member Avatar for lewashby
Member Avatar for rubberman
0
147
Member Avatar for NardCake

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 …

Member Avatar for james.lu.75491856
0
215
Member Avatar for Reverend Jim

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. …

Member Avatar for ddanbe
2
159
Member Avatar for phorce

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.

Member Avatar for mike_2000_17
0
787
Member Avatar for nchy13

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 …

Member Avatar for AndrisP
0
341
Member Avatar for Nihil777

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 …

Member Avatar for Nihil777
0
486
Member Avatar for jayreis

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, …

Member Avatar for Dani
6
407
Member Avatar for pars99

It allows you to do [atomic operations](http://wiki.osdev.org/Atomic_operation) on variables.

Member Avatar for rubberman
0
252
Member Avatar for nchy13

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 { …

Member Avatar for mike_2000_17
0
194
Member Avatar for daniel.mukolwe
Re: loop

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.

Member Avatar for mike_2000_17
-1
56
Member Avatar for DavidB

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 …

Member Avatar for anfelar
1
326
Member Avatar for GrimJack

> 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 …

Member Avatar for Agilemind
0
375
Member Avatar for strRusty_gal

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 …

Member Avatar for vijayan121
0
207
Member Avatar for avarionist

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 …

Member Avatar for DeanMSands3
0
3K

The End.