from app import db # db == MongoEngine(app)
class Day(db.Document):
week_day = db.IntField()
# another attribute
# ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 (~firebird@117.192.191.140) 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| >>> 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 (<) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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)) |
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:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //SENSORES | |
| potenciometro = A0 | |
| sensor_de_luz = A1 | |
| //LEDs do display de 7 segmentos | |
| //superior esquerda | |
| int superior_esquerda = 13; | |
| // superior base(teto) |
To the guys that are learning a language and ever ask about a problem to solve or an idea to a project.
- http://projecteuler.net/
- http://exercism.io/
- http://cryptopals.com/
- http://www.ic.unicamp.br/~meidanis/courses/mc336/problemas-lisp/L-99_Ninety-Nine_Lisp_Problems.html
- https://www.codingame.com/cg/
Enjoy it
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 0879 C96E 7041 A74F 0794 9AB0 4B3C 15E4 F5CF B314
To claim this, I am signing this object: