Skip to content

Instantly share code, notes, and snippets.

View paoloo's full-sized avatar

Paolo Oliveira paoloo

View GitHub Profile
apiVersion: v1
kind: Pod
metadata:
name: ubuntu
labels:
app: ubuntu
spec:
containers:
- image: ubuntu
command:
@paoloo
paoloo / goto.py
Last active April 29, 2021 02:14
python3 version of the bizarre goto in python
import sys
def goto(lineno: int) -> None:
frame = sys._getframe().f_back
called_from = frame
def hook(frame, event, arg):
if event == 'line' and frame == called_from:
try:
frame.f_lineno = lineno

Keybase proof

I hereby claim:

  • I am paoloo on github.
  • I am paolooliveira (https://keybase.io/paolooliveira) on keybase.
  • I have a public key whose fingerprint is A0CE 2402 B756 0064 303F 5524 F95C 1A5D A519 9C2B

To claim this, I am signing this object:

; The official HD AI
; An Artificial Intelligence Script written by Archon and Promiskuitiv
; Get in contact with Promiskuitiv by sending a mail to neuernamae@web.de
; List of taunts it reacts to:
; Standard taunts.
; 33 - Stop slinging resources. If slinging is requested early and is immediately canceled it may mess up the strategy.
; 38 - Sling Resources. Human player only, stops any unit production except for civilian units.
@paoloo
paoloo / yeah.gif
Last active April 20, 2019 22:51
yes, I can see you
yeah.gif
COUNTRY A2 (ISO) A3 (UN) NUM (UN) DIALING CODE
Afghanistan AF AFG 4 93
Albania AL ALB 8 355
Algeria DZ DZA 12 213
American Samoa AS ASM 16 1-684
Andorra AD AND 20 376
Angola AO AGO 24 244
Anguilla AI AIA 660 1-264
Antarctica AQ ATA 10 672
Antigua and Barbuda AG ATG 28 1-268
# entre os datasets sugeridos pelo senhor, escolhi usar o bank.csv
# encontrado em: http://archive.ics.uci.edu/ml/datasets/Bank+Marketing
from math import log
class ID3(object):
def __init__(self):
self.root = None
def training(self, dataset, target, exclude=[]):
# -*- coding: utf-8 -*-
from heapq import heappush, heappop
from random import shuffle
import time
import sys
class Estado:
def __init__(self, valores, movimentos=0, parent=None):
self.valores = valores
self.movimentos = movimentos
# -*- coding: utf-8 -*-
class Estado():
def __init__(self, missionarios_esq, missionarios_dir, canibais_esq, canibais_dir, lado_rio):
self.missionarios_esq, self.missionarios_dir, self.canibais_esq, self.canibais_dir = missionarios_esq, missionarios_dir, canibais_esq, canibais_dir
self.lado_rio = lado_rio
self.m_previo_esq, self.m_previo_dir, self.c_previo_esq, self.c_previo_dir = missionarios_esq, missionarios_dir, canibais_esq, canibais_dir
self.pai = None
self.filhos = []
#!/usr/bin/python
# =============================================================================
# Pesquisa e Ordenacao - 2016.1
# =============================================================================
import random
import bisect
class _BTreeNode(object):
def __init__(self, values=None, children=None):
self.parent = None