Click here to Skip to main content
15,844,903 members
Home / Discussions / C#
   

C#

 
SuggestionRe: Generate unique number from C# string Pin
Richard Deeming4-Apr-18 8:30
mveRichard Deeming4-Apr-18 8:30 
AnswerRe: Generate unique number from C# string Pin
Pete O'Hanlon4-Apr-18 9:45
subeditorPete O'Hanlon4-Apr-18 9:45 
AnswerRe: Generate unique number from C# string Pin
BillWoodruff4-Apr-18 15:00
professionalBillWoodruff4-Apr-18 15:00 
QuestionSerialPort.ReadLine() ? Pin
ibrahimayhans2-Apr-18 3:11
ibrahimayhans2-Apr-18 3:11 
AnswerRe: SerialPort.ReadLine() ? Pin
Gerry Schmitz2-Apr-18 7:49
mveGerry Schmitz2-Apr-18 7:49 
Questiondesigning around the need for an abstract static method Pin
Alexander Kindel1-Apr-18 16:21
Alexander Kindel1-Apr-18 16:21 
AnswerRe: designing around the need for an abstract static method Pin
Alexander Kindel1-Apr-18 17:02
Alexander Kindel1-Apr-18 17:02 
GeneralRe: designing around the need for an abstract static method Pin
Alexander Kindel1-Apr-18 21:25
Alexander Kindel1-Apr-18 21:25 
After more tinkering, though a common base class makes conceptual sense to me, I don't think I can make the details work. The algorithms that apply to both Numbers and Polynomials need to know that the objects they're acting on can be added and multiplied, so I figured I would put methods for those operations in the base class. The problem is, it shouldn't be possible to multiply a Number with a Polynomial, which rules out the obvious choice of something like
C#
protected abstract ArithmeticObject Multiply(ArithmeticObject a);

Maybe I can do something with a generic method?
C#
T Multiply<T>(T a);

Perhaps defining an IArithmetic<t> interface that contains all the necessary operations, and having Number and Polynomial each implement it.
GeneralRe: designing around the need for an abstract static method Pin
#realJSOP2-Apr-18 2:05
mve#realJSOP2-Apr-18 2:05 
GeneralRe: designing around the need for an abstract static method Pin
Alexander Kindel2-Apr-18 9:45
Alexander Kindel2-Apr-18 9:45 
AnswerRe: designing around the need for an abstract static method Pin
Gerry Schmitz2-Apr-18 7:44
mveGerry Schmitz2-Apr-18 7:44 
AnswerRe: designing around the need for an abstract static method Pin
BillWoodruff2-Apr-18 22:43
professionalBillWoodruff2-Apr-18 22:43 
GeneralRe: designing around the need for an abstract static method Pin
Alexander Kindel7-Apr-18 17:06
Alexander Kindel7-Apr-18 17:06 
GeneralRe: designing around the need for an abstract static method Pin
Alexander Kindel8-Apr-18 1:57
Alexander Kindel8-Apr-18 1:57 
AnswerC# Pin
Member 137573041-Apr-18 9:59
Member 137573041-Apr-18 9:59 
GeneralRe: C# Pin
OriginalGriff1-Apr-18 9:31
mveOriginalGriff1-Apr-18 9:31 
GeneralRe: C# Pin
PIEBALDconsult1-Apr-18 10:01
mvePIEBALDconsult1-Apr-18 10:01 
QuestionPlease help me with my basic c# calculator loop function Pin
Florence Gray31-Mar-18 16:46
Florence Gray31-Mar-18 16:46 
AnswerRe: Please help me with my basic c# calculator loop function Pin
OriginalGriff31-Mar-18 21:00
mveOriginalGriff31-Mar-18 21:00 
AnswerRe: Please help me with my basic c# calculator loop function Pin
Richard MacCutchan31-Mar-18 21:58
mveRichard MacCutchan31-Mar-18 21:58 
RantCoding error missing reference Pin
uighgg ojgeojge31-Mar-18 2:36
uighgg ojgeojge31-Mar-18 2:36 
AnswerRe: Coding error missing reference Pin
OriginalGriff31-Mar-18 2:47
mveOriginalGriff31-Mar-18 2:47 
QuestionRe: Coding error missing reference Pin
uighgg ojgeojge31-Mar-18 2:58
uighgg ojgeojge31-Mar-18 2:58 
GeneralRe: Coding error missing reference Pin
OriginalGriff31-Mar-18 3:28
mveOriginalGriff31-Mar-18 3:28 
GeneralRe: Coding error missing reference Pin
uighgg ojgeojge31-Mar-18 3:34
uighgg ojgeojge31-Mar-18 3:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.