Click here to Skip to main content
11,565,743 members (47,563 online)

Welcome to the Lounge

   

For lazing about and discussing anything in a software developer's life that takes your fancy except programming questions.

Technical discussions are encouraged, but click here to ask your programming question.

The Lounge is rated PG. If you're about to post something you wouldn't want your kid sister to read then don't post it. No flame wars, no abusive conduct, no programming questions and please don't post ads.
 
GeneralRe: I just.. Pin
kArViD0tnEt10-Feb-14 13:51
professionalkArViD0tnEt10-Feb-14 13:51 
GeneralWHats Kortrijk in Belgium like? Pin
Erudite_Eric9-Feb-14 5:18
memberErudite_Eric9-Feb-14 5:18 
GeneralRe: WHats Kortrijk in Belgium like? Pin
V.9-Feb-14 6:42
professionalV.9-Feb-14 6:42 
GeneralRe: WHats Kortrijk in Belgium like? Pin
Erudite_Eric9-Feb-14 7:03
memberErudite_Eric9-Feb-14 7:03 
GeneralRe: WHats Kortrijk in Belgium like? Pin
pwasser9-Feb-14 19:31
memberpwasser9-Feb-14 19:31 
GeneralRe: WHats Kortrijk in Belgium like? Pin
Erudite_Eric11-Feb-14 0:15
memberErudite_Eric11-Feb-14 0:15 
GeneralRe: WHats Kortrijk in Belgium like? Pin
JimmyRopes9-Feb-14 7:09
memberJimmyRopes9-Feb-14 7:09 
GeneralRe: WHats Kortrijk in Belgium like? Pin
Erudite_Eric9-Feb-14 7:54
memberErudite_Eric9-Feb-14 7:54 
GeneralRe: WHats Kortrijk in Belgium like? Pin
V.9-Feb-14 10:06
professionalV.9-Feb-14 10:06 
GeneralRe: WHats Kortrijk in Belgium like? Pin
Erudite_Eric11-Feb-14 0:16
memberErudite_Eric11-Feb-14 0:16 
GeneralRe: WHats Kortrijk in Belgium like? Pin
V.11-Feb-14 2:08
professionalV.11-Feb-14 2:08 
GeneralRe: WHats Kortrijk in Belgium like? Pin
d@nish 9-Feb-14 18:55
member d@nish 9-Feb-14 18:55 
GeneralRe: WHats Kortrijk in Belgium like? Pin
Erudite_Eric9-Feb-14 21:01
memberErudite_Eric9-Feb-14 21:01 
GeneralI hate it when I am too clever for my own good... Pin
OriginalGriff9-Feb-14 4:59
protectorOriginalGriff9-Feb-14 4:59 
So, I'm doing some analysis code, and I need a couple of moving averages - one over the whole sample, one over the last 30 samples, and one over the last ten samples.

Now, I don't fancy doing that in SQL, so I'm doing it in C#, and I decide the obvious thing to do is create a MovingAverage class that you Add samples to, and it sorts itself out. Easy peasy.

So I knock up the class framework, and the code that will use it, and then go back to fill in the class. And decide to make it generic because hey, I might want to use it again. Change everything to use generics - easy - and off we go...except...you can't sum generics, because they are based on object which doesn't implement arithmetic operators. And you can't restrict generics to classes that support arithmetic either...

So either I restrict it to just primitive types (int, double, blah blah blah) or I drop the whole idea...and you can't use primitive types as generic constraints...and it wouldn't work if you could, because primitive arithmetic is implemented via static inline functions at compile time, so you couldn't use 'em in a generic if you wanted to!

So...change it back Griff, change it all back... D'Oh! | :doh:
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)

GeneralRe: I hate it when I am too clever for my own good... Pin
PIEBALDconsult9-Feb-14 5:05
memberPIEBALDconsult9-Feb-14 5:05 
GeneralRe: I hate it when I am too clever for my own good... Pin
OriginalGriff9-Feb-14 5:17
protectorOriginalGriff9-Feb-14 5:17 
GeneralRe: I hate it when I am too clever for my own good... Pin
PIEBALDconsult9-Feb-14 5:57
memberPIEBALDconsult9-Feb-14 5:57 
GeneralRe: I hate it when I am too clever for my own good... Pin
OriginalGriff9-Feb-14 6:36
protectorOriginalGriff9-Feb-14 6:36 
GeneralRe: I hate it when I am too clever for my own good... Pin
harold aptroot9-Feb-14 5:33
memberharold aptroot9-Feb-14 5:33 
GeneralRe: I hate it when I am too clever for my own good... Pin
OriginalGriff9-Feb-14 5:44
protectorOriginalGriff9-Feb-14 5:44 
GeneralRe: I hate it when I am too clever for my own good... Pin
Kornfeld Eliyahu Peter9-Feb-14 6:38
professionalKornfeld Eliyahu Peter9-Feb-14 6:38 
GeneralRe: I hate it when I am too clever for my own good... Pin
PIEBALDconsult9-Feb-14 6:44
memberPIEBALDconsult9-Feb-14 6:44 
GeneralRe: I hate it when I am too clever for my own good... Pin
Kornfeld Eliyahu Peter9-Feb-14 7:02
professionalKornfeld Eliyahu Peter9-Feb-14 7:02 
GeneralRe: I hate it when I am too clever for my own good... Pin
PIEBALDconsult9-Feb-14 7:07
memberPIEBALDconsult9-Feb-14 7:07 
GeneralRe: I hate it when I am too clever for my own good... Pin
Kornfeld Eliyahu Peter9-Feb-14 7:18
professionalKornfeld Eliyahu Peter9-Feb-14 7:18 
GeneralRe: I hate it when I am too clever for my own good... Pin
Jörgen Andersson9-Feb-14 9:07
professionalJörgen Andersson9-Feb-14 9:07 
GeneralRe: I hate it when I am too clever for my own good... Pin
Kornfeld Eliyahu Peter9-Feb-14 9:22
professionalKornfeld Eliyahu Peter9-Feb-14 9:22 
GeneralRe: I hate it when I am too clever for my own good... Pin
Jörgen Andersson9-Feb-14 9:49
professionalJörgen Andersson9-Feb-14 9:49 
GeneralRe: I hate it when I am too clever for my own good... Pin
Kornfeld Eliyahu Peter9-Feb-14 9:53
professionalKornfeld Eliyahu Peter9-Feb-14 9:53 
GeneralRe: I hate it when I am too clever for my own good... Pin
Jörgen Andersson9-Feb-14 10:10
professionalJörgen Andersson9-Feb-14 10:10 
GeneralRe: I hate it when I am too clever for my own good... Pin
Brisingr Aerowing9-Feb-14 6:52
professionalBrisingr Aerowing9-Feb-14 6:52 
GeneralRe: I hate it when I am too clever for my own good... Pin
Mike Hankey9-Feb-14 7:23
memberMike Hankey9-Feb-14 7:23 
GeneralRe: I hate it when I am too clever for my own good... Pin
Andy Brummer9-Feb-14 14:57
sitebuilderAndy Brummer9-Feb-14 14:57 
JokeRe: I hate it when I am too clever for my own good... Pin
TnTinMn9-Feb-14 17:44
memberTnTinMn9-Feb-14 17:44 
GeneralRe: I hate it when I am too clever for my own good... Pin
BillWoodruff9-Feb-14 21:35
memberBillWoodruff9-Feb-14 21:35 
GeneralRe: I hate it when I am too clever for my own good... Pin
OriginalGriff9-Feb-14 21:43
protectorOriginalGriff9-Feb-14 21:43 
GeneralRe: I hate it when I am too clever for my own good... Pin
CBadger9-Feb-14 22:50
professionalCBadger9-Feb-14 22:50 
GeneralRe: I hate it when I am too clever for my own good... Pin
Fueled By Caffeine10-Feb-14 0:31
memberFueled By Caffeine10-Feb-14 0:31 
GeneralRe: I hate it when I am too clever for my own good... Pin
irneb10-Feb-14 0:38
memberirneb10-Feb-14 0:38 
GeneralRe: I hate it when I am too clever for my own good... Pin
Gary Wheeler10-Feb-14 0:51
memberGary Wheeler10-Feb-14 0:51 
GeneralRe: I hate it when I am too clever for my own good... Pin
OriginalGriff10-Feb-14 0:59
protectorOriginalGriff10-Feb-14 0:59 
GeneralRe: I hate it when I am too clever for my own good... Pin
Gary Wheeler10-Feb-14 1:15
memberGary Wheeler10-Feb-14 1:15 
GeneralRe: I hate it when I am too clever for my own good... Pin
OriginalGriff10-Feb-14 1:23
protectorOriginalGriff10-Feb-14 1:23 
GeneralRe: I hate it when I am too clever for my own good... Pin
Gary Wheeler10-Feb-14 1:34
memberGary Wheeler10-Feb-14 1:34 
GeneralRe: I hate it when I am too clever for my own good... Pin
Simon O'Riordan from UK10-Feb-14 5:09
memberSimon O'Riordan from UK10-Feb-14 5:09 
GeneralRe: I hate it when I am too clever for my own good... Pin
OriginalGriff10-Feb-14 5:32
protectorOriginalGriff10-Feb-14 5:32 
GeneralRe: I hate it when I am too clever for my own good... Pin
James Curran10-Feb-14 1:40
memberJames Curran10-Feb-14 1:40 
GeneralRe: I hate it when I am too clever for my own good... Pin
Richard Deeming10-Feb-14 3:48
professionalRichard Deeming10-Feb-14 3:48 
GeneralRe: I hate it when I am too clever for my own good... Pin
Simon O'Riordan from UK10-Feb-14 5:07
memberSimon O'Riordan from UK10-Feb-14 5:07 
GeneralRe: I hate it when I am too clever for my own good... Pin
OriginalGriff10-Feb-14 5:30
protectorOriginalGriff10-Feb-14 5:30 

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

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


Advertise | Privacy | Mobile
Web04 | 2.8.150624.2 | Last Updated 30 Jun 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid