Skip to content

Instantly share code, notes, and snippets.

Rodrigo Vidal rodrigovidal

View GitHub Profile
View gist:cff2b9bfc6f578708274
[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;
View gist:5891488
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/
@rodrigovidal
rodrigovidal / gist:3893973
Created Oct 15, 2012
Oracle manda lembranças
View gist:3893973
////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..
View gist:3516066
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
@rodrigovidal
rodrigovidal / gist:2913207
Created Jun 11, 2012
Steepest Descent Method
View gist:2913207
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;
View euler1.fs
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
View gist:1363351
public int SumNumbers(int from, int to)
{
return from > to ? 0 : (SumNumbers(from + 1, to) + from) ;
}
View gist:1363274
private int SumNumbers(int from, int to)
{
if (from > to) return 0;
int sumRest = SumNumbers(from + 1, to);
return from + sumRest;
}
View gist:1363269
private int SumNumbers(int from, int to)
{
int res = 0;
for (int i = from; i <= to; i++)
res = res + 1;
return res;
}
View gist:1349695
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
You can’t perform that action at this time.