- You can store a price in a floating point variable.
- All currencies are subdivided in 1/100th units (like US dollar/cents, euro/eurocents etc.).
- All currencies are subdivided in decimal units (like dinar/fils)
- All currencies currently in circulation are subdivided in decimal units. (to exclude shillings, pennies) (counter-example: MGA)
- All currencies are subdivided. (counter-examples: KRW, COP, JPY... Or subdivisions can be deprecated.)
- Prices can't have more precision than the smaller sub-unit of the currency. (e.g. gas prices)
- For any currency you can have a price of 1. (ZWL)
- Every country has its own currency. (EUR is the best example, but also Franc CFA, etc.)
import math | |
def karatsuba(x, y): | |
if x < 10 and y < 10: | |
return x * y | |
n = max(len(str(x)), len(str(y))) | |
m = int(math.ceil(float(n) / 2)) |
import ctypes | |
class Array(object): | |
""" | |
array implementation class | |
""" | |
def __init__(self): | |
self.item_count = 0 |
# A single node of a singly linked list | |
class Node: | |
# constructor | |
def __init__(self, data = None, next=None): | |
self.data = data | |
self.next = next | |
# A Linked List class with a single head node | |
class LinkedList: | |
def __init__(self): |
# Capacity for internal array | |
INITIAL_CAPACITY = 50 | |
# Node data structure - essentially a LinkedList node | |
class Node: | |
def __init__(self, key, value): | |
self.key = key | |
self.value = value | |
self.next = None | |
def __str__(self): |
class Node: | |
def __init__(self, data): | |
self.left = None | |
self.right = None | |
self.data = data | |
# Insert method to create nodes | |
def insert(self, data): |
class Queue: | |
def __init__(self): | |
self.items = [] | |
def isEmpty(self): | |
return self.items == [] | |
def enqueue(self, item): | |
self.items.insert(0,item) |
class Stack: | |
def __init__(self): | |
self.elements = [] | |
def push(self, data): | |
self.elements.append(data) | |
return data | |
def pop(self): | |
return self.elements.pop() |
People have exactly one canonical full name.
People have exactly one full name which they go by.
People have, at this point in time, exactly one canonical full name.
People have, at this point in time, one full name which they go by.
People have exactly N names, for any value of N.
On [Date and Time], our fintech platform experienced an incident where some users were debited twice for a single transaction. This led to customer dissatisfaction and concerns about the reliability of our services. This postmortem document aims to provide a detailed analysis of the incident, its root causes, and recommended actions to prevent similar incidents in the future.
[Timestamp]: Incident was first reported by customers experiencing double debits.
[Timestamp]: Technical team received alerts and initiated investigation.
[Timestamp]: Issue identified as a software glitch affecting a specific payment gateway.