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
var rfc = RfcBuilder.ForNaturalPerson() | |
.WithName("Miguel Angel") | |
.WithFirstLastName("Salazar") | |
.WithSecondLastName("Test") | |
.WithDate(1987, 04, 15) | |
.Build(); |
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 class Rfc { | |
//properties... | |
private Rfc(string tenDigitsCode, string homoclave, string verificationDigit) { | |
this.TenDigitsCode = tenDigitsCode; | |
this.Homoclave = homoclave; | |
this.VerificationDigit = verificationDigit; | |
} | |
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
private Rfc Build() { | |
Person person = new Person(this.Name, this.FirstLastName, this.SecondLastName, this.Year, this.Month, this.Day); | |
string tenDigitsCode = TenDigitsCalculator(); | |
string homoclave = HomoclaveCalculator(); | |
string verificationDigit = VerificationDigitCalculator(); | |
return Rfc.Build(tenDigitsCode, homoclave, verificationDigit); | |
} |
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 class RfcBuilder { | |
private string Name; | |
private string FirstLastName; | |
//more properties | |
public RfcBuilder WithName(string name) { | |
this.Name = name; | |
return this; | |
} |
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
Rfc rfc = new Rfc({ | |
Name = "Mig", | |
FirstLastName = "Salazar", | |
SecondLastName = "Test", | |
Date = new DateTime(1987, 4, 15) | |
}); |
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
Rfc rfc = new Rfc("Test", "Salazar", "Miguel" , new DateTime(1987, 4, 15)); | |
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
Rfc rfc = new Rfc("Miguel", "Salazar", "S", new DateTime(1987, 4, 15)); | |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
</head> | |
<body> | |
<div> | |
<canvas id="canvas" height="300px" width="500px"> | |
Your browser doesn't support canvas | |
</canvas> |
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
var xExists = [0, 2*Math.PI], | |
f = function(x) { | |
return 3*Math.sin(x) * Math.cos(x)/2; | |
}; | |
plot(f, xExists); |
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
context.beginPath(); | |
for (var x = xstart; x < width; x++) { | |
xreal = (x / (xorigin)) - x0, | |
yreal = height - ((f(xreal) - y0) * _yscale); | |
context.lineTo(xreal, yreal); | |
} |
NewerOlder