Type: Posts; User: razzle
Search took 0.02 seconds.
March 4th, 2014, 03:47 AM
Well, I think my formulation as a Set Cover problem is correct. In the Wikipedia entry Dominating Set is listed as related so I guess both formulations are possible.
Set Cover is also NP-complete...
March 3rd, 2014, 06:41 PM
I'd say it's a set cover problem.
Associated with every user there's a set of friends (a friend-set).
There's also the set of all users that should be reached (the target-set).
March 1st, 2014, 12:46 AM
Well, regarding my comment on getter/setters. They're fine because they provide a certain level of encapsulation. So if a class has properties, expose them using getters/setters. It's just that by...
February 28th, 2014, 08:28 AM
The choise between by value and by const reference is a question of efficiency alone. Pass by value involves a copy of the parameter to be produced and the more this costs the more attractive pass by...
February 28th, 2014, 08:16 AM
Yet another aspect is design.
The only reason for the use of getter/setter methods is to increase the level of encapsulation by hiding implementation. When the getter is returning a reference to...
February 28th, 2014, 04:53 AM
A final touch would be to remove everything virtual.
As newbie (and well beyond that) you only have to concern yourself with how to implement two types of classes cleanly. These are value classes...
February 27th, 2014, 01:13 AM
Use a unique include guard in every .h file like say this in read_qacct.h,
February 22nd, 2014, 05:37 PM
You use C++/CLI.
It was specifically designed to handle these kinds of question.
February 22nd, 2014, 05:12 PM
What post are you replying to and why?
February 22nd, 2014, 02:07 PM
One reason for your current problem may be that you have accidentally added the same Actor object pointer twice into the list. Then you will be deleting the same object twice which leads to...
February 22nd, 2014, 06:58 AM
The only company you can trust won't let you down like this is IBM. It's amazing what number of obscure languages they keep supporting decade after decade after decade. Remember that the next time...
February 19th, 2014, 06:03 PM
No it doesn't. From the Wikipedia entry to functional programming:
"Iteration (looping) in functional languages is usually accomplished via recursion. Recursive functions invoke themselves,...
February 19th, 2014, 01:44 AM
You're absolutely right.
As we all know C++ is especially well suited for us old-timers with an ancient education who want to hang on to C style coding the last few years before retirement. A good...
February 19th, 2014, 01:09 AM
I was surprised that C++ was used as model language in what seems like a basic programming course. But then I realized this thread is almost 10 years old and at that time the marginalization of C++...
February 18th, 2014, 09:59 AM
No you are wrong. The call of a virtual function is not resolved (or bound as it's also called) at compiletime. The type checking can be performed at compiletime unless a downcast is involved. But...
February 18th, 2014, 09:27 AM
No you're opinionated and/or have never used a functional language.
Your "advice" as to when recursion is appropriate is very arbitrary to say the least. For example visiting the first 10 nodes of...
February 18th, 2014, 05:59 AM
Polymorphism is polymorphism and it serves the purpose of polymorphic behaviour regardless of when it's resolved, be it at compiletime or runtime.
The only difference is that the CRTP...
February 18th, 2014, 05:35 AM
This is a flawed argument.
If devirtualization were required by the standard then it would cease to be an implementation detail.
February 18th, 2014, 04:41 AM
Are you sure?
Tail recursion is well studied and a staple of functional programming. Most C++ compilers will be able to replace tail recursion with an iterative equivalent so there will be no...
February 16th, 2014, 07:46 PM
Integer division of integers will produce an integer (according to the rules of integer division).
There's no implicit conversion taking place at all.
February 16th, 2014, 07:30 PM
There's iteration and there's recursion.
They said so in class and I told you here.
You listen up now.
February 16th, 2014, 05:45 PM
Then that's the problem because iteration and recursion don't work the same.
February 16th, 2014, 05:42 PM
Should there be any?
Who needs them really?
Who hires anyone on a certification?
Solid basic education and coding experience is what matters. Such people will absorb and adapt to any...
February 16th, 2014, 05:26 PM
Maybe you didn't copy right? Why don't you ask the one who wrote the code! :)
From a principal standpoint, the two approaches you're trying here are iteration and recursion and they will look very...
February 16th, 2014, 05:09 PM
If you want to stick with C, rand() is fine. Here are a couple of references,
Click Here to Expand Forum to Full Width