def init(self): """ Save the initial values of the drop counters. Needs to be called after creation of a row. """ for fct in self.grammatical_functions: for rsn in self.reasons: # Initiate a counter. encrypted_counter = hec.new() # Save some disk space. enc_counter_compressed = int2db(encrypted_counter) setattr(self, "_".join([fct, rsn]), enc_counter_compressed) self.save()
import hec n = 42698584543886360061486842200382003313624169085301946559663494615494833625919 g = 913326067085406944159077752059680922182858227942518126068162286667180140466107648842572565613813229372396932441628644186755601564075513741425077638718840 l = 21349292271943180030743421100191001656603342573794468515864801413886865646400 u = 17288039927630418853048986923739837980030231648803406440389082766106280079017 hec.init (str(n), str(g)) v = hec.new() print v for i in range(123): v = hec.inc (v, 1) for i in range(56): v = hec.inc (v, 0) hec.quit() count = hec.get (v, str(n), str(l), str(u)) print count