Hi, as I am doing a small chat application in vb.net (windows form), I'm having problem for the design of my chatbox. I would like text messages to be selectable so user can copy(ctrl+v) it but not usernames which displays who sent the message. What form controls should I use in order to accomplish this and what properties to change from...
When do you use each inheritance?
class Base{};
class Derived: protected Base{};
class Derived2: public Base{};
My case:
I have class called Snapshot which only contains GetXXX methods. It is a light-weight classed used to store current state of the Value class. I also use it for recovery, keeping instances of this class long after ...
Why is virtual behavior being prevented?
class MyClass
{
//........
virtual double GetX();
virtual double GetSomethingElse();
virtual double GetT();
virtual double GetRR();
//........
};
class Processor
{
private:
typedef double (MyClass::*MemFuncGetter)();
...
I am looking for suggestions for an interface name.
The interface is for the primitive CRUD methods that will be defined later in the DAL, however I need to use it in a lower-level API. The interface itself will just have the four members, Create(), Read(), Update(), and Delete().
I am currently thinking something along the lines of ID...
During the process of designing new features in your software, which process is the best practice
Design the Interface that the Class will implement.
Writing the Class and extracting the Interface later.
If going the route of number 2, when do you decide that an Interface is needed?
...
I have a class and the storage of its information is going to depend on if it is getting consumed by a web or windows application. I was going to use the factory pattern to pass out the correct object. I guess the caller would then store that object appropriately if I did not want to have recreate the object. Anybody have other sugges...
I'm new to c# and I'm trying to figure out if I can create multiple derived class libraries that each represent a specific item. I'll call the two class libraries ClassA & ClassB. Each class will share a BaseClass (namespace BaseNS).
I then created a c# app that refrences both ClassA and ClassB. This generated an error because they b...
Is there a pattern where I can inherit enum from another enum in C++??
something like that:
enum eBase
{
one=1, two, three
};
enum eDerived: public Base
{
four=4, five, six
};
...
I would like to implement a nodal-interface, basically a DAG where each node performs an operation on it's input connections, and outputs something (which you can connect to another node)
Some example applications:
Apples "Shake" - screenshot
The Foundrys "Nuke" - screenshot
MindNode - screenshot
vvvv - screenshots
Quartz Composer - ...
Are there video tutorials for Microsoft Best Practices with the same caliber as asp.net and windowsclient.net Learn section?
What I meant by Best Practices are practices wherein you develop just any kind of application. Take a look at the site for more info: http://msdn.microsoft.com/en-us/practices/default.aspx
...
I was going through a legacy code and found the following snippet:
MyClass::~MyClass()
{
EnterCriticalSection(&cs);
//Access Data Members, **NO Global** members are being accessed here
LeaveCriticalSection(&cs);
}
I am wondering will it help by any chance to guard the destructor ?
Consider a scenario :
1. Thread1 - About to...
We have all heard of Premature Optimization, but what do you thing about Premature Refactoring? Is there any such thing in your opinion? Here is what I am getting at.
First off, reading Martin Fowler's seminal work "Refactoring" quite literally changed my life in regards to programing.
One thing that I have noticed, however, is that i...
What's the point of both? When do you think it's appropriate to use either?
...
There are many different bad practices, such as memory leaks, that are easy to slip into a program on accident. Sometimes, they might even be able to jury-rig your program together.
I'm working on a project right now and it works if I deliberately put a memory leak in my code. If I take the leak out, the code crashes. Obviously this is...
I have 2 classes for the game i am making,
gui class and the logic class, for a game of noughts and crosses. The GUI class has a method that uses an array of JButtons and returns them all with the same anonymous inner class action listener
The problem is this, when i click the button i want the text to change to an x or a o dependant ...
In our legacy code, as well as our modern code, we use macros to perform nifty solutions like code generations, etc. And we make use of both the # and ## operators.
I am curious how other developers use macros to do cool things, if they use them at all.
...
I personally find that makes the life of a developer who has recently joined the project a very sad one. Without almost perfect understanding of the framework mechanisms it makes developing and debugging like a torture, since whenever I get an error or an unexpected behavior I have not a slightest idea where to look. In some rare cases C...
First I will give a specific case, and the I would like to see if it can be applied to a general problem.
Say I have map. And I want to get all the keys meeting a certain criteria.
For example all keys that contain "COL". My naive implementation will be
template<typename T>
void Filter (map<string, T> & m, std:set<string> & result, ...
I've been trying to do this a number of ways, but none of them seem graceful enough. (I'm also wondering if CPAN or Moose already has this. The dozens of searches I've done over time have shown nothing that quite matches.)
I want to create a type of class that
is a Base + Facade + Factory for other classes which load themselves as d...
This is probably very easy, but I'm stumped. I would like to create a general purpose class which will be used multiple times in my program. I want this to be very lightweight and super fast.
For a very simple example in C#:
public class SystemTest
{
public TestMethod(string testString)
{
if(testString == "blue")
...