I hereby claim:
- I am alexandre on github.
- I am ubbersith (https://keybase.io/ubbersith) on keybase.
- I have a public key whose fingerprint is 126A A78E DB9F FA73 9154 7C53 2B77 21EE 04D9 7D87
To claim this, I am signing this object:
| //SENSORES | |
| potenciometro = A0 | |
| sensor_de_luz = A1 | |
| //LEDs do display de 7 segmentos | |
| //superior esquerda | |
| int superior_esquerda = 13; | |
| // superior base(teto) |
I hereby claim:
To claim this, I am signing this object:
| def factorial(number): | |
| """Return the factorial of the parameter 'number' | |
| :number: an int object. | |
| :returns: an int object. | |
| >>> factorial(5) | |
| 120 | |
| """ | |
| return ((number <= 1 and 1) or number * factorial(number - 1)) |
from app import db # db == MongoEngine(app)
class Day(db.Document):
week_day = db.IntField()
# another attribute
# ...| #!/usr/bin/python3 | |
| import itertools | |
| def gen_string(num, foo): | |
| return '{} - {}'.format(num, foo) | |
| def list_number_and_foo_sp(): #sp == situation problem | |
| foo = 'Something' |
| >>> import dis | |
| >>> | |
| >>> def foo_with_bool(foo): return foo < 1 or foo > 12 | |
| ... | |
| >>> def foo_with_range(foo): return foo in range(1,13) | |
| ... | |
| >>> dis.dis(foo_with_bool) | |
| 1 0 LOAD_FAST 0 (foo) | |
| 3 LOAD_CONST 1 (1) | |
| 6 COMPARE_OP 0 (<) |
| """ | |
| Lendo o livro Introdução a filosofia matemática...no capitulo que fala sobre a definição de ordem... | |
| """ | |
| def sim_assim_trans_con(x, y, z=None, A=[]): | |
| """Exemplo de um pseudo código com um exemplo para | |
| difenciar elementos simétricos, assimétricos, transitivos e conexos. | |
| Serve como exemplo de como substituir if/else por avaliação de expressões | |
| booleanas. |
| Hi guys/girls | |
| <ubbersith> I'm trying to repeat a python test with Haskell...can someone help me? https://gist.github.com/alexandre/442ec9dc189e222d3aae | |
| <ubbersith> I didn't understand why the interpreter don't just evaluates the first acess (it is trying evaluate everything?) | |
| <bitemyapp> ubbersith: you created an infinite list. | |
| * firebird1 ([email protected]) has joined #haskell-beginners | |
| <bitemyapp> ubbersith: actually, cyclic reference, sorry. | |
| <bitemyapp> > take 10 $ cycle [1, 2] | |
| <lambdabot> [1,2,1,2,1,2,1,2,1,2] | |
| <ubbersith> ok, but my bool test (==) should works, shouldn't? | |
| <bitemyapp> no. |
>>>x = [1, 2]
>>> x.append(x)
>>> x[2][2][2][2] ==x
Truelet x = [1, 2]
let x = x ++ x
x !! 2 == x| (comment | |
| Tentando onseguir o mesmo resultado em clojure: | |
| #Python3 | |
| >>> x = [1, 2, 3] | |
| >>> x.append(x) | |
| >>> x[3][3][3] == x | |
| True | |
| ) | |
| user=> (def x (list 1 2 3)) | |
| #'user/x |