This file contains 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 per(n, print_steps=False): | |
steps = 0 | |
while n >= 10: | |
sum = 1 | |
while n > 0: | |
sum *= n % 10 | |
n //= 10 | |
n = sum | |
steps += 1 |
This file contains 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
# simple combo handling code | |
import collections | |
# priority is just a number used to decide | |
# what move was made when more than 1 | |
# move is validated by the same input. | |
PriorityLow = 99 | |
PriorityHigh = 1 | |
This file contains 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
@classmethod | |
def isPoolConnected(spUUID): | |
return spUUID in cls.pools | |
def _checkDomainPoolRelationship(self, domainInfo): | |
"""Performs sanity checks about dmoain<->pool relationship | |
Returns true if all checks succeeded or false if they didn't | |
""" | |
rolse = info['role'] |
This file contains 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
typedef int(*BuffOp)(char* buffer, void* ctx); | |
struct OpNode { | |
BuffOp op; | |
struct OpNode *next; | |
void* ctx; | |
}; | |
int call_chain(struct OpNode* node, char* buffer) { | |
int rv; |