This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int Average(int a, int b) | |
{ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int SystemMathAverage(int a, int b) | |
{ | |
return System.Math.Average(a, b); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int SimpleAverage(int a, int b) | |
{ | |
return (a + b) / 2; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int ConversionAverage(int a, int b) | |
{ | |
return (Int32)(((Int64)a + (Int64)b) / 2); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void TestAverageMethod(Func<int, int, int> method) | |
{ | |
string methodName = method.Method.Name; | |
List<string> failureText = new List<string>(); | |
int passCount = 0; | |
int testCount = 0; | |
Action<int, int, int> test = (a, b, expected) => | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int LinqAverage(int a, int b) | |
{ | |
int[] inputArray = new int[] { a, b }; | |
return (int)inputArray.Average(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int JessesAverage(int a, int b) | |
{ | |
return (a / 2) + (b / 2) + (((a % 2) + (b % 2)) / 2); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
namespace Jesse.LanguageClassHelper | |
{ | |
/// <summary> | |
/// A queue that returns items in random order | |
/// </summary> | |
public class RandomOrderQueue<T> | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.controller('Page1Controller', ['$scope', 'navigation', function($scope, navigation) { | |
$scope.navigate = function (navigationParameter) { | |
navigation.navigate('/Page2', navigationParameter); | |
}; | |
}]); |
OlderNewer