Click here to Skip to main content
15,902,896 members
Home / Discussions / C#
   

C#

 
GeneralRe: Error in setup project Pin
Muammar©11-Jan-08 19:13
Muammar©11-Jan-08 19:13 
GeneralOutlook type control... Pin
Pankaj - Joshi9-Jan-08 22:43
Pankaj - Joshi9-Jan-08 22:43 
GeneralRe: Outlook type control... Pin
Giorgi Dalakishvili9-Jan-08 22:48
mentorGiorgi Dalakishvili9-Jan-08 22:48 
Generaldatagridviewcheckbox Pin
kiran@p2softech9-Jan-08 22:31
kiran@p2softech9-Jan-08 22:31 
GeneralRe: datagridviewcheckbox Pin
Justin Perez10-Jan-08 3:44
Justin Perez10-Jan-08 3:44 
QuestionHow to do math operations with generic function arguments? Pin
Chesnokov Yuriy9-Jan-08 22:30
professionalChesnokov Yuriy9-Jan-08 22:30 
GeneralRe: How to do math operations with generic function arguments? Pin
CKnig9-Jan-08 22:54
CKnig9-Jan-08 22:54 
GeneralRe: How to do math operations with generic function arguments? Pin
NassosReyzidis10-Jan-08 3:35
NassosReyzidis10-Jan-08 3:35 
try this :

<br />
public T Mean(T[] vec) where T : Int32,Double,Fload,.....<br />
{<br />
   tmp = default(T); //Return the default for each Primitive, for No primitive this is equal to null<br />
   foreach (T v in vec)<br />
      tmp += v; <br />
   return (tmp / vec.Length) as T; //mask to the Generic type<br />
}<br />


Hope that helped
Nassos

"Success is the ability to go from one failure to another with no loss of enthusiasm."
Winston Churchill

"Quality means doing it right when no one is looking."
Henry Ford


GeneralReceive data of Unkown Size Pin
Waqas Badar9-Jan-08 22:21
Waqas Badar9-Jan-08 22:21 
GeneralRe: Receive data of Unkown Size Pin
satsumatable9-Jan-08 22:39
satsumatable9-Jan-08 22:39 
GeneralRe: Receive data of Unkown Size Pin
Waqas Badar10-Jan-08 0:30
Waqas Badar10-Jan-08 0:30 
GeneralRe: Receive data of Unkown Size Pin
satsumatable10-Jan-08 0:36
satsumatable10-Jan-08 0:36 
GeneralRe: Receive data of Unkown Size Pin
Waqas Badar10-Jan-08 0:45
Waqas Badar10-Jan-08 0:45 
GeneralRe: Receive data of Unkown Size Pin
satsumatable10-Jan-08 0:50
satsumatable10-Jan-08 0:50 
GeneralASCII value of a char Pin
dipak.dipak9-Jan-08 22:13
dipak.dipak9-Jan-08 22:13 
GeneralRe: ASCII value of a char Pin
satsumatable9-Jan-08 22:38
satsumatable9-Jan-08 22:38 
QuestionMicrosoft Practice and Patterns Pin
satsumatable9-Jan-08 21:02
satsumatable9-Jan-08 21:02 
GeneralRe: Microsoft Practice and Patterns Pin
dhans9-Jan-08 22:12
dhans9-Jan-08 22:12 
GeneralRe: Microsoft Practice and Patterns Pin
satsumatable9-Jan-08 22:57
satsumatable9-Jan-08 22:57 
GeneralRe: Microsoft Practice and Patterns Pin
Vasudevan Deepak Kumar9-Jan-08 23:31
Vasudevan Deepak Kumar9-Jan-08 23:31 
GeneralRe: Microsoft Practice and Patterns Pin
Vasudevan Deepak Kumar9-Jan-08 23:33
Vasudevan Deepak Kumar9-Jan-08 23:33 
GeneralRe: Microsoft Practice and Patterns Pin
Luc Pattyn10-Jan-08 4:23
sitebuilderLuc Pattyn10-Jan-08 4:23 
Generalrandom display Pin
angels7779-Jan-08 20:53
angels7779-Jan-08 20:53 
GeneralRe: random display Pin
Abhijit Jana9-Jan-08 21:21
professionalAbhijit Jana9-Jan-08 21:21 
GeneralRe: random display Pin
angels77710-Jan-08 0:35
angels77710-Jan-08 0:35 

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.