Click here to Skip to main content
15,884,801 members
Home / Discussions / C#
   

C#

 
AnswerRe: Coding Challenge Pin
Mycroft Holmes26-Aug-17 22:20
professionalMycroft Holmes26-Aug-17 22:20 
AnswerRe: Coding Challenge Pin
BillWoodruff26-Aug-17 19:44
professionalBillWoodruff26-Aug-17 19:44 
AnswerRe: Coding Challenge Pin
Peter_in_278027-Aug-17 1:41
professionalPeter_in_278027-Aug-17 1:41 
AnswerRe: Coding Challenge Pin
Richard Deeming29-Aug-17 2:28
mveRichard Deeming29-Aug-17 2:28 
GeneralRe: Coding Challenge Pin
Mycroft Holmes4-Sep-17 21:06
professionalMycroft Holmes4-Sep-17 21:06 
SuggestionRe: Coding Challenge Pin
Richard Deeming5-Sep-17 1:55
mveRichard Deeming5-Sep-17 1:55 
GeneralRe: Coding Challenge Pin
Mycroft Holmes4-Sep-17 22:24
professionalMycroft Holmes4-Sep-17 22:24 
GeneralRe: Coding Challenge Pin
Pete O'Hanlon4-Sep-17 23:24
mvePete O'Hanlon4-Sep-17 23:24 
Taking the example below, this should do it:
C#
Values.Select(
  p =>
    new
    {
      avg = Values.Skip(1).Take(Values.Count - 1)
        .Where(x => Math.Abs(x) > double.Epsilon)
        .Zip(Values, (second, first) => (second - first)/second)
        .Average()
    })
  .Select(x => new {x, last = Values.Last()})
  .Select(@t => new {@t, aver = @t.last + (@t.last*@t.x.avg)})
  .Select(@t => new {value1 = @t.aver, value2 = @t.aver + (@t.aver*@t.@t.x.avg)}).First();

This space for rent

GeneralRe: Coding Challenge Pin
Richard Deeming5-Sep-17 2:04
mveRichard Deeming5-Sep-17 2:04 
AnswerRe: Coding Challenge Pin
Pete O'Hanlon29-Aug-17 3:53
mvePete O'Hanlon29-Aug-17 3:53 
Questionc++ const in c# (I assume, once again) Pin
User 1106097925-Aug-17 8:04
User 1106097925-Aug-17 8:04 
AnswerRe: c++ const in c# (I assume, once again) Pin
OriginalGriff25-Aug-17 8:37
mveOriginalGriff25-Aug-17 8:37 
GeneralRe: c++ const in c# (I assume, once again) Pin
User 1106097925-Aug-17 8:43
User 1106097925-Aug-17 8:43 
GeneralRe: c++ const in c# (I assume, once again) Pin
User 1106097925-Aug-17 9:01
User 1106097925-Aug-17 9:01 
GeneralRe: c++ const in c# (I assume, once again) Pin
harold aptroot25-Aug-17 8:41
harold aptroot25-Aug-17 8:41 
GeneralRe: c++ const in c# (I assume, once again) Pin
User 1106097925-Aug-17 8:47
User 1106097925-Aug-17 8:47 
AnswerRe: c++ const in c# (I assume, once again) Pin
jschell25-Aug-17 9:40
jschell25-Aug-17 9:40 
GeneralRe: c++ const in c# (I assume, once again) Pin
User 1106097925-Aug-17 9:50
User 1106097925-Aug-17 9:50 
AnswerRe: c++ const in c# (I assume, once again) Pin
Pete O'Hanlon25-Aug-17 12:19
mvePete O'Hanlon25-Aug-17 12:19 
GeneralRe: c++ const in c# (I assume, once again) Pin
User 1106097925-Aug-17 12:47
User 1106097925-Aug-17 12:47 
AnswerRe: c++ const in c# (I assume, once again) Pin
Gerry Schmitz26-Aug-17 8:54
mveGerry Schmitz26-Aug-17 8:54 
AnswerRe: c++ const in c# (I assume, once again) Pin
Bernhard Hiller28-Aug-17 3:39
Bernhard Hiller28-Aug-17 3:39 
GeneralRe: c++ const in c# (I assume, once again) Pin
User 1106097928-Aug-17 3:54
User 1106097928-Aug-17 3:54 
QuestionCreate .NET COM dll as existing C++ COM Pin
MrKBA24-Aug-17 22:38
MrKBA24-Aug-17 22:38 
AnswerRe: Create .NET COM dll as existing C++ COM Pin
Pete O'Hanlon24-Aug-17 22:44
mvePete O'Hanlon24-Aug-17 22:44 

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.