Click here to Skip to main content
15,914,392 members
Home / Discussions / C#
   

C#

 
GeneralRe: SURF and flann to image retrieval in emgu CV Pin
Member 136054437-Jan-18 22:37
Member 136054437-Jan-18 22:37 
AnswerRe: SURF and flann to image retrieval in emgu CV Pin
Pete O'Hanlon4-Jan-18 5:20
mvePete O'Hanlon4-Jan-18 5:20 
GeneralRe: SURF and flann to image retrieval in emgu CV Pin
V.4-Jan-18 18:51
professionalV.4-Jan-18 18:51 
GeneralRe: SURF and flann to image retrieval in emgu CV Pin
Member 136054437-Jan-18 22:36
Member 136054437-Jan-18 22:36 
QuestionBAL,DAL Pin
Member 136064294-Jan-18 0:38
Member 136064294-Jan-18 0:38 
AnswerRe: BAL,DAL Pin
OriginalGriff4-Jan-18 1:00
mveOriginalGriff4-Jan-18 1:00 
AnswerRe: BAL,DAL Pin
Gerry Schmitz4-Jan-18 10:42
mveGerry Schmitz4-Jan-18 10:42 
GeneralRe: BAL,DAL Pin
Member 136064294-Jan-18 19:20
Member 136064294-Jan-18 19:20 
QuestionEntity Framework Query Problem Pin
Kevin Marois3-Jan-18 18:38
professionalKevin Marois3-Jan-18 18:38 
AnswerRe: Entity Framework Query Problem Pin
Vincent Maverick Durano3-Jan-18 19:59
professionalVincent Maverick Durano3-Jan-18 19:59 
QuestionBlink an image in wpf c# Pin
Hervend2-Jan-18 23:01
Hervend2-Jan-18 23:01 
AnswerRe: Blink an image in wpf c# Pin
Pete O'Hanlon2-Jan-18 23:07
mvePete O'Hanlon2-Jan-18 23:07 
AnswerRe: Blink an image in wpf c# Pin
Eddy Vluggen3-Jan-18 2:37
professionalEddy Vluggen3-Jan-18 2:37 
AnswerRe: Blink an image in wpf c# Pin
Gerry Schmitz3-Jan-18 5:35
mveGerry Schmitz3-Jan-18 5:35 
QuestionIs it wrong to pass an object into a method, change something and then pass it back to the caller? Pin
User987432-Jan-18 22:15
professionalUser987432-Jan-18 22:15 
AnswerRe: Is it wrong to pass an object into a method, change something and then pass it back to the caller? Pin
Pete O'Hanlon2-Jan-18 22:20
mvePete O'Hanlon2-Jan-18 22:20 
GeneralRe: Is it wrong to pass an object into a method, change something and then pass it back to the caller? Pin
User987432-Jan-18 23:06
professionalUser987432-Jan-18 23:06 
AnswerRe: Is it wrong to pass an object into a method, change something and then pass it back to the caller? Pin
OriginalGriff2-Jan-18 22:45
mveOriginalGriff2-Jan-18 22:45 
GeneralRe: Is it wrong to pass an object into a method, change something and then pass it back to the caller? Pin
User987432-Jan-18 23:06
professionalUser987432-Jan-18 23:06 
GeneralRe: Is it wrong to pass an object into a method, change something and then pass it back to the caller? Pin
Marc Clifton6-Jan-18 4:19
mvaMarc Clifton6-Jan-18 4:19 
AnswerRe: Is it wrong to pass an object into a method, change something and then pass it back to the caller? Pin
BillWoodruff4-Jan-18 23:07
professionalBillWoodruff4-Jan-18 23:07 
If you really want method chaining a la functional programming, .NET Extension Methods (C# >= 3.0) are very useful (example code below).

The "virtue" I see in using 'ref and 'out parameters is that your code is forced to "make visible," for both calling and called code, what is going on. imho, visible == maintainable.

Example of extension methods:
public class SomeObj
{
    public string SomeParam { get; set; }

    public int Id { get; }

    public Dictionary<string, DateTime> ParamLog { get; set; }

    public SomeObj(string sparam, int id)
    {
        SomeParam = sparam;

        Id = id;

        ParamLog =  new Dictionary<string, DateTime> {{sparam, DateTime.Now}};
    }
}

public static class SomeObjExtensions
{
    public static SomeObj SetSomeParam(this SomeObj obj, string newsparam)
    {
        if (obj.SomeParam.Equals(newsparam)) return obj;

        obj.SomeParam = newsparam;
        obj.ParamLog.Add(newsparam, DateTime.Now);

        return obj;
    }

    public static SomeObj Clone(this SomeObj obj, string newsparam)
    {
        var newobj = new SomeObj(newsparam, obj.Id);

        // see note below
        newobj.ParamLog = new Dictionary<string, DateTime>(obj.ParamLog);

        return newobj;
    }

}
Note: for issues in cloning Dictionaries see: [^]
«While I complain of being able to see only a shadow of the past, I may be insensitive to reality as it is now, since I'm not at a stage of development where I'm capable of seeing it.» Claude Levi-Strauss (Tristes Tropiques, 1955)

GeneralRe: Is it wrong to pass an object into a method, change something and then pass it back to the caller? Pin
User987435-Jan-18 13:18
professionalUser987435-Jan-18 13:18 
GeneralRe: Is it wrong to pass an object into a method, change something and then pass it back to the caller? Pin
BillWoodruff5-Jan-18 21:13
professionalBillWoodruff5-Jan-18 21:13 
GeneralRe: Is it wrong to pass an object into a method, change something and then pass it back to the caller? Pin
Marc Clifton6-Jan-18 4:14
mvaMarc Clifton6-Jan-18 4:14 
GeneralRe: Is it wrong to pass an object into a method, change something and then pass it back to the caller? Pin
BillWoodruff6-Jan-18 7:40
professionalBillWoodruff6-Jan-18 7:40 

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.