This is my programming languages rankings. I created three different categories:
- Mastery: How much I know about the language
- Tasty: How much I like to use the language
- Respect: How much I respect the language
class Obj: | |
def _validate(self): | |
raise NotImplemented("The object %s has not an implemented validation function." % self) | |
def dump(self): | |
return {} #some valid dictionary | |
@classmethod | |
def load1(cls, dct): |
""" | |
tOSM - tinny object to structure modeller | |
example of use | |
""" | |
import tosm as t | |
class Contacts(t.Obj): | |
persons = t.ObjListProperty(obj=Person) |
import random | |
my_numbers = set(random.sample(xrange(1,61),6)) | |
if __name__ == '__main__': | |
count = 1 | |
while my_numbers != set(random.sample(xrange(1,61),6)): | |
count += 1 | |
print count |
/* | |
NOTE: Partially translated from portuguese to english | |
Menu: | |
Sandwich Code Price | |
Hot Dog 100 1,20 | |
Bauru 101 1,30 | |
Bauru with egg 102 1,50 | |
Hamburger 103 1,20 | |
Cheeseburguer 104 1,30 |
For a while, I have felt that the following is the correct way to improve the mass assignment problem without increasing the burden on new users. Now that the problem with the Rails default has been brought up again, it's a good time to revisit it.
When creating a form with form_for
, include a signed token including all of the fields that were created at form creation time. Only these fields are allowed.
To allow new known fields to be added via JS, we could add:
Some of you shall ask yourselves: "How does a spirograph work?". But I'm sure that most of you would ask me: "What the wacko is an spirograph?"
An spirograph is a toy used to draw "weird spirals" using two circles (one inside other). For whom doesn't remember, the toy is these one:
The way that this toy works is simples: One gear spins inside a big circle (also with gears!). The pen is placed in a hole of the gear. When you spin the gear through the major circle, the pen follows tho different movements: An circle movement made by the gear around the center of the great circle (let's call this point as O) and a movement made by the pen around the center of the gear (let's call the center of the gear as C and the point where the pen is placed as P). As the center of the gear is moving, the result position of the point P is the sum of these two movements: P over C
Alguns de vocês devem se perguntar: "Como os espirógrafos funcionam?". Mas a maioria de vocês perguntaria antes "espiro-o-que??".
Bem, espirógrafo é aquele brinquedo que muitos de nós usamos quando pequenos para fazer umas "espirais malucas" desenhadas no papel. O brinquedo é esse aí:
Alguns de vocês devem se perguntar: "Como os espirógrafos funcionam?". Mas a maioria de vocês perguntaria antes "espiro-o-que??".
Bem, espirógrafo é aquele brinquedo que muitos de nós usamos quando pequenos para fazer umas "espirais malucas" desenhadas no papel. O brinquedo é esse aí:
A mecânica do brinquedo é bem simples: uma roda dentada gira dentro de um círculo (também dentado). Sua caneta, que está presa em um orifíco da roda dentada acompanha dois movimentos distintos que são somados: o movimento circular em torno do ponto central do grande cículo (vamos chamar este ponto de O) e um movimento circular em torno do centro da roda dentada (vamos chamar o centro da roda dentada de C). Este centro, por sua vez, está em movimento. É a soma destes dois movimentos que faz surgir aqueles "desenhos muito doidos de São Tomé".
#I'm using python 2.7.2 | |
>>> def a(b=[]): | |
... b.append('end') | |
... return b | |
... | |
>>> a() | |
['end'] | |
>>> a() | |
['end', 'end'] |