What do you want to save?
Add Code snippet
New code examples
-
Other 2021-09-27 17:39:03
Find duplicate rows in a 5x5 Matrix.
# A class representing a node: class Trie: # Constructor def __init__(self): self.character = [None] * 2 &nbs... Add solution -
Python 2021-09-27 12:29:03
object creation using class constructor
class Employee: def __init__(self, name): &nb... Add solution -
Python 2021-09-25 11:59:02
composition in python
# It's when a class has a (is made-of) another class. # Example class Thing(object): def func(self): print("Function ran from class Thing().") class OtherThing(object): # Note that I don't use inheritance to get the func() fun... Add solution -
Python 2021-09-25 05:52:02
pytorch lightning init not on cuda
# tensor created in __init__ wont be added to cuda # use self.register_buffer to register variables class LitModel(LightningModule): def __init__(self): ... self.register_buffer("sigma", torch.eye(3)) # you can now... Add solution -
Javascript 2021-09-25 04:12:04
Smart Contract, JS
1# SmartPy Code 2import smartpy as sp 3 4class StoreValue(sp.Contract): 5 def __init__(self, value): 6 self.init(storedValue = value) 7 8 @sp.entry_point 9 def replace(self, value): 10 self.data.storedValue = value 11 12 @sp.entry_point 13 ... Add solution
Best helpers
+5
+5
+5
+5
+5
+5
+5
+5