I hereby claim:
- I am zeitan on github.
- I am antonbas (https://keybase.io/antonbas) on keybase.
- I have a public key ASDtKle7YRfnAxZ3jZ3J4rc6t_OXQfUVMKMjRPE4vNo7qAo
To claim this, I am signing this object:
private static String buildProducts(String parts) { | |
int acumA = 0; | |
int acumB = 0; | |
int acumC = 0; | |
int acumD = 0; | |
int acumE = 0; | |
for (int i = 0; i < parts.length(); i++) { | |
switch (parts.charAt(i)) { | |
case 'a' : ++acumA; |
I hereby claim:
To claim this, I am signing this object:
# https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes | |
class Sieve | |
def initialize(number) | |
@limit = number | |
end | |
def primes | |
prime_numbers = [] | |
return prime_numbers if @limit == 1 | |
data = (2..@limit).to_a |
function multiples3And5(number) { | |
var count = 0 | |
for ( var i = 1; i < number; i++) { | |
if (i % 3 == 0 || i % 5 == 0) { | |
console.log("multiple:" + i) | |
count += i | |
} | |
} | |
console.log("sum_multiiples:" + count) | |
} |
module Foo | |
[:debug, :info, :warn, :error, :fatal].each do |level| | |
define_method level do |msg| | |
p 'dummy 1' | |
end | |
end | |
module_function :debug, :info, :warn, :error, :fatal | |
private |
{"show_id":80379,"season":"7","episode":"19","date":"2014-05-13T01:21:27.201Z","_id":"1evn2fjYPPMIexLt"} | |
{"show_id":"267815","season":"1","episode":"13","type":"episode","date":"2014-06-21T15:08:19.353Z","_id":"4rEmCMlL0UKTWbnD"} | |
{"show_id":"277462","season":"1","episode":"1","type":"episode","date":"2014-06-22T16:41:14.304Z","_id":"92JV8y0wXexvXA2m"} | |
{"show_id":"260315","season":"2","episode":"5","type":"episode","date":"2014-05-25T14:25:17.513Z","_id":"HC8P3MnImMCPxcHD"} | |
{"show_id":"267815","season":"1","episode":"14","type":"episode","date":"2014-06-21T15:55:57.315Z","_id":"HUIl75qntDGCneZR"} | |
{"show_id":"267815","season":"1","episode":"12","type":"episode","date":"2014-06-21T05:06:59.662Z","_id":"IdUMwvGTCh9M6L3q"} | |
{"show_id":80379,"season":"7","episode":"17","date":"2014-05-12T02:46:14.937Z","_id":"J79Rfv4OMmfPJWea"} | |
{"show_id":80379,"season":"7","episode":"10","date":"2014-05-12T00:03:35.750Z","_id":"JXSj4tXd8Z7Zd6Ql"} | |
{"show_id":"265766","season":"1","episode":"2","type":"episode","date":"2014-06-20T02: |
def fetch_data_from_uri(date) | |
tms = Time.now.utc.strftime('%Y%m%d%H%M%S') | |
sig = generate_sig(authentication_config['partner_id'], tms, authentication_config['secret_key']) | |
body = { | |
method: @uri.path.split("/").last, | |
params: { | |
partner_id: authentication_config['partner_id'], | |
tms: tms, |
FactoryGirl.define do | |
factory :client, :class => OAuth2::Model::Client do | |
client_id { OAuth2.random_string } | |
client_secret { OAuth2.random_string } | |
sequence(:name) {|n| "Client #{n}" } | |
redirect_uri 'https://client.example.com/cb' | |
end | |
factory :authorization, :class => OAuth2::Model::Authorization do |
class Humano < Jugador | |
attr_accessor :puntaje | |
def initialize(id) | |
@tipo = TipoJugador::HUMANO | |
@puntaje = 0 | |
@id = id | |
end | |
#Chequea que la jugada realizada por el humano este dentro del tablero o sea en una columna que no este llena. |
private | |
def calcula_jugada(tablero) | |
cols_ganadora = Array.new(7) | |
fila = tablero.column(index).to_a.rindex(0) | |
cols_ganadora.each_with_index{|value,index| cols_ganadora[index]] = ganar_horizontal(tablero,index, fila) + ganar_vertical(tablero,index,fila) + ganar_cruzado(tablero,index,fila)} | |
end | |
def ganar_horizontal(tablero,col,fila) | |
fila_checar = tablero.row(fila) | |
izq = der = 0 |