Skip to content

Instantly share code, notes, and snippets.

View ikkebr's full-sized avatar

Henrique Pereira ikkebr

View GitHub Profile
@ikkebr
ikkebr / fib.py
Created October 2, 2011 03:23
Simple Recursive Fibonacci
fibs = {0: 0, 1: 1}
def fib(n):
if n in fibs: return fibs[n]
if n % 2 == 0:
fibs[n] = ((2 * fib((n / 2) - 1)) + fib(n / 2)) * fib(n / 2)
else:
fibs[n] = (fib((n - 1) / 2) ** 2) + (fib((n + 1) / 2) ** 2)
return fibs[n]
fib(10000000)
@ikkebr
ikkebr / robot.js
Created December 10, 2012 19:55
Crapie
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(Math.random(100)*100);
@ikkebr
ikkebr / robot.js
Created December 10, 2012 20:00
Zolmeister2
var robots = new Array();
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.start = function( ev ){
@ikkebr
ikkebr / robot.js
Created December 11, 2012 13:19
Simplebot212
function Robot(robot) {}
var direcao = 1;
var distancia = 2050;
var rotate_angulo = 360;
var encontrou = 0;
var target = 1;
// well, we need to do something...
// whenever our robot is idle, this method gets called.
@ikkebr
ikkebr / robot.js
Created December 12, 2012 17:05 — forked from samelinux/robot.js
Multiple Wall Killer
var Robot = function(robot) {
robot.clone();
};
Robot.prototype.onIdle = function(ev) {
ev.robot.back(30);
robot.rotateCannon(180);
};
@ikkebr
ikkebr / robot.js
Created December 12, 2012 17:17
Cheater101
var x_target = -1;
var y_target = -1;
var target_valid = false;
var idle_counter = 0;
var time_frame = 0;
var last_reverse = -10000;
var last_turn = -10000;
var at_wall = false;
var clockwise = true;
@ikkebr
ikkebr / designer.html
Created June 27, 2014 15:29
designer
<link rel="import" href="../components/polymer/polymer.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
Data;D1;D2;D3;D4;D5;D6;Arrecadacao_Total;Sena;Rateio_Sena;Quina;Rateio_Quina;Quadra;Rateio_Quadra;Acumulado;Valor_Acumulado
11/03/1996;4;5;30;33;41;52;0;0;0;17;39158.92;2016;330.21;SIM;1714650.23
18/03/1996;9;37;39;41;43;49;0;1;2307162.23;65;14424.02;4488;208.91;NÃO;0
25/03/1996;10;11;29;30;36;47;0;2;391192.51;62;10515.93;4261;153.01;NÃO;0
01/04/1996;1;5;6;27;42;59;0;0;0;39;15322.24;3311;180.48;SIM;717080.75
08/04/1996;1;2;6;16;19;46;0;0;0;98;5318.10;5399;96.53;SIM;1342488.85
15/04/1996;7;13;19;22;40;47;0;0;0;109;7214.66;7147;110.03;SIM;2286166.33
22/04/1996;3;5;20;21;38;56;0;0;0;100;8746.05;5736;152.48;SIM;3335692.28
29/04/1996;4;17;37;38;47;53;0;0;0;60;16084.11;5262;183.4;SIM;4493748.19
06/05/1996;8;43;54;55;56;60;0;0;0;17;60043.79;2175;469.31;SIM;5718641.49
from sklearn import svm
X = mega_results[['D1','D2','D3','D4','D5','D6']]
y = mega_results['Sena']
clf = svm.SVC()
clf.fit(X, y)
import random