Skip to content

Instantly share code, notes, and snippets.

View juanplopes's full-sized avatar
🌲
Is that a Segment Tree problem?

Juan Lopes juanplopes

🌲
Is that a Segment Tree problem?
View GitHub Profile

Discussão iniciada no grupo tdd-no-mundo-real

Pessoal, desculpe a resposta longa mas esse assunto é muito interessante. Quem hoje em dia, pode acompanhar uma discussão entre grandes pioneiros de sua área que com certeza entrarão para a história da Engenharia de Software nos séculos seguintes? Somos muito afortunados quanto a isso.

Tenho acompanhado essas discussões pelos blogs do DHH e do Uncle Bob.

Achei que deveriam ter incluído o Uncle Bob no hangout. Como disseram que fariam outros episódios, creio que ele deve participar no próximo.

Resumindo o que tirei das opiniões deles:

@juanplopes
juanplopes / robot.js
Created December 6, 2012 19:04 — forked from jaskolek/robot.js
jaskolek
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 ){
@juanplopes
juanplopes / robot.js
Created December 6, 2012 17:22
[qx3] HAL-9000
//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.clone();
@juanplopes
juanplopes / robot.js
Created December 6, 2012 17:20
[qx3] HAL-9000
//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.clone();
@juanplopes
juanplopes / robot.js
Created December 5, 2012 03:04 — forked from fabiopimentel/robot.js
[CAELUM TEAM]Megatron
//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.clone();
//11512
//GATTACA
//Misc;String Matching;Suffix Array;Longest Common Prefix
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <sstream>
#include <cmath>
#include <set>
@juanplopes
juanplopes / License.cs
Created June 8, 2012 20:32 — forked from brenoferreira/License.cs
Private methods
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
namespace License
{
public class LicenseServiceImpl
{
@juanplopes
juanplopes / base_62.rb
Created March 26, 2012 21:11 — forked from gleicon/base_62.rb
base 62 encoding in ruby (versão devops)
# monkey patch to have base62 encoding over Integers and Strings
class Integer
def to_base62()
char = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"[self%62,1]
return char if self < 62
return (self/62).to_base62 + char
end
end
@juanplopes
juanplopes / base_62.rb
Created March 26, 2012 20:54 — forked from gleicon/base_62.rb
base 62 encoding in ruby (versão funcional)
ALPHABET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
def base62_encode(num, alphabet=ALPHABET)
base = alphabet.size
char = ALPHABET[num%base,1]
return char if num < base
return char + base62_encode(num/base, alphabet)
end
def base62_decode(string, alphabet=ALPHABET)
@juanplopes
juanplopes / gist:2003306
Created March 8, 2012 20:41 — forked from moreirayokoyama/gist:2002607
Mod 10 (declarative fashion)
function mod10(numbers) {
var M = [2,1];
var result = numbers.split('').reverse().map(function(v, i) {
return parseInt(v)*multipliers[i % M.length];
}).reduce(function(a,b){return a+b});
return (10 - result % 10) % 10;
}