Tag Archives: List

Implementing a Stack in python

To implement a Stack in python, we simply need to extend the existing list class! class Stack(list): def push(self, data): self.append(data) def tos(self): if self: return self[-1] def peek(self, index): if self and 0 <= index < len(self): return self[index] def __iter__(self): if self: ptr = len(self) – 1 while ptr >= 0: yield self[ptr] […]

0  

Multi-select Flex List Control

Well, I had a requirement to use a multi-select Flex List control. I wanted to avoid the CTRL-button-down process altogether and devised a custom component. Upon clicking the item for the first time, the item is added to an ArrayCollection and is selected as well. If you click again on the same item/record, the item […]

1