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
[EntryPoint] | |
public static int main(string[] argv) | |
{ | |
ExtraTopLevelOperators.PrintFormatLine<Unit>((PrintfFormat<Unit, TextWriter, Unit, Unit>) new PrintfFormat<Unit, TextWriter, Unit, Unit, Unit>("2")); | |
int num = 0; | |
ExtraTopLevelOperators.PrintFormatLine<Unit>((PrintfFormat<Unit, TextWriter, Unit, Unit>) new PrintfFormat<Unit, TextWriter, Unit, Unit, Unit>("1")); | |
int a = 0; | |
ExtraTopLevelOperators.PrintFormatLine<Unit>((PrintfFormat<Unit, TextWriter, Unit, Unit>) new PrintfFormat<Unit, TextWriter, Unit, Unit, Unit>("3")); | |
int b = 0; | |
int c = num; |
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
http://sist.sysu.edu.cn/~isslxm/DSA/textbook/Skiena.-.TheAlgorithmDesignManual.pdf | |
https://github.com/felipecruz/cdats | |
http://www.amazon.com/Algorithms-Unlocked-Thomas-H-Cormen/dp/0262518805/ref=sr_1_2?ie=UTF8&qid=1372518782&sr=8-2&keywords=cormen | |
http://www.amazon.com/Introduction-Algorithms-Thomas-H-Cormen/dp/0262033844/ref=sr_1_1?ie=UTF8&qid=1372518782&sr=8-1&keywords=cormen | |
https://sites.google.com/site/stevenhalim/ |
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
////Isso funciona.. | |
var parametros = new[] | |
{ | |
new OracleParameter("P_CD_CLIENTE", OracleDbType.Int32) | |
{ Direction = ParameterDirection.Input, Value = null }, | |
new OracleParameter("C_CURSOR", OracleDbType.RefCursor) | |
{ Direction = ParameterDirection.Output } | |
}; | |
////Isso não funciona.. |
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 Ast = | |
type Node = | |
| Int of int option | |
| Float of float option | |
| BooleanNode of bool option | |
| StringNode of string option | |
| QuotedVariable of string | |
| Variable of string | |
| Addition of Node * Node |
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
function steepest | |
% Exemplo 6.2-2 do livro Optimal Control Theory de D.E.Kirk | |
% Steepest Descent Method | |
eps = 1e-3; | |
options = odeset('RelTol', 1e-4, 'AbsTol',[1e-4 1e-4]); %permite ajustar os parametros de integracao para os solvers de EDOs | |
t0 = 0; | |
tf = 0.78; | |
R = 0.1; | |
step = 0.4; |
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
let euler1 (limit : int64) = | |
let limit = bigint (limit-1L) | |
let sn a1 = | |
let a1 = bigint (int a1) | |
let an = (limit / a1 * a1) | |
let n = an / a1 | |
(an + a1) * n / 2I | |
sn 3 + sn 5 - sn 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
public int SumNumbers(int from, int to) | |
{ | |
return from > to ? 0 : (SumNumbers(from + 1, to) + from) ; | |
} |
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 int SumNumbers(int from, int to) | |
{ | |
if (from > to) return 0; | |
int sumRest = SumNumbers(from + 1, to); | |
return from + sumRest; | |
} |
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 int SumNumbers(int from, int to) | |
{ | |
int res = 0; | |
for (int i = from; i <= to; i++) | |
res = res + 1; | |
return res; | |
} |
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
let fibonacci = | |
(0, 1) | |
|> Seq.unfold(fun (current, next) -> Some(current, (next, current + next))) | |
|> Seq.takeWhile(fun x -> x <= 4000000) | |
|> Seq.filter(fun x -> x % 2 = 0) | |
|> Seq.sum |
NewerOlder