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
const person = { firstName: "Cedd", lastName: "Burge" }; | |
return converge(compliment, [firstName, lastName])(person); |
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
isIsogram :: String -> Bool | |
isIsogram = map toLower . filter isLetter . sort . group . all (length . (==1)) |
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
isIsogram :: String -> Bool | |
isIsogram = all ((1==) . length) . group . sort . filter isLetter . map toLower |
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
public int? Accept(Reservation reservation) | |
{ | |
if (!IsReservationInFuture(reservation)) | |
return null; | |
try { | |
var reservedSeats = | |
ReadReservations(reservation.Date) | |
.Sum(r => r.Quantity); | |
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
public double CalculateDesignTurbulence( | |
double windSpeed, | |
double designTurbulence | |
double designTurbulenceShape) | |
{ | |
return | |
designTurbulence | |
* | |
( | |
( |
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
public double CalculateDesignTurbulence(double windSpeed, double designTurbulence, double designTurbulenceShape) | |
{ | |
return designTurbulence * ((((15 / windSpeed) + designTurbulenceShape) / (1 + designTurbulenceShape)) + (1.28 / windSpeed * 1.44)); | |
} |
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
/*...*/ namespace BeerSong { | |
public class BeerSongGenerator { | |
public string Verses(int begin, int end) { /*...*/ return string.Join("\n", VersesList(begin, end)); } | |
IEnumerable<string> VersesList(int begin, int end) { | |
for (int verse = begin; verse >= end; verse--) | |
yield return Verse(verse); } | |
string Verse(int verse) => new VerseGenerator(verse).Verse; } | |
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
def count_neighbours( | |
point | |
, living_cells | |
): |
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
public partial class SpecificationSpecificVermeulenNearWakeLengthCalculator | |
{ | |
// For the "Then" section, return the results to assert | |
internal IEnumerable<IVermeulenNearWakeLength> VermeulenNearWakeLengths { get; private set; } | |
// For the "When" section, exercising the system under test. | |
internal void Calculate() | |
{ | |
VermeulenNearWakeLengths = | |
new VermeulenNearWakeLengthCalculator( |
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
public partial class SpecificationSpecificClassWithCustomProperty | |
{ | |
internal SpecificationSpecificClassWithCustomProperty CustomInt_of(int customInt) | |
{ | |
// The framework requires you to do this | |
AddValueProperty(GetCurrentMethod(), customInt); | |
// And then you can do some custom thing with `value` here | |
// classWithCustomProperty.Setup(m => m.Name).Returns(customInt.ToString()); |
NewerOlder