So far, all the properties we have written have tested stateless code. Stateless code is made up of pure functions and is inherently easier to test than stateful code with side effects. The chief problem with testing stateful code is that the input to output mapping depends on the current state of the program. Previous operations can cause the same function to return different output given the same input. Therefore, in order to test stateful code, our tests must maintain some state of their own. This state is known as the model state and is updated as part of the testing process.
This file contains hidden or 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
| Table of Contents | |
| UNITED STATES | |
| SECURITIES AND EXCHANGE COMMISSION | |
| Washington, D.C. 20549 | |
| ____________________________________________________________________________________________ | |
| FORM 10-K | |
| ☒ ANNUAL REPORT PURSUANT TO SECTION 13 OR 15(d) OF THE SECURITIES EXCHANGE ACT OF 1934 | |
| For the fiscal year ended January 28, 2024 | |
| OR | |
| ☐ TRANSITION REPORT PURSUANT TO SECTION 13 OR 15(d) OF THE SECURITIES EXCHANGE ACT OF 1934 |
This file contains hidden or 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
| public class Main { | |
| public static void main(String[] args) { | |
| Histogram histogram = new Histogram(); | |
| histogram.sample(0); | |
| histogram.sample(10.0); | |
| } | |
| } |
This file contains hidden or 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
| module Example where | |
| data Possible a = None | Some a | |
| -- Possible is the type, None and Some are the values associated with it | |
| binder :: Possible a -> (a -> Possible b) -> Possible b | |
| binder None _ = None | |
| binder (Some a) f = f a | |
| instance (Show a) => Show (Possible a) where | |
| show (None) = "None" |
This file contains hidden or 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
| import uuid | |
| import datetime as dt | |
| from functools import reduce | |
| class Datagram(object): | |
| def __init__(self, val=0): | |
| self.val = val | |
| def op(self, other): | |
| return Datagram(self.val+other.val) |
This file contains hidden or 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
| { | |
| "profiles": [ | |
| { | |
| "name": "Default profile", | |
| "selected": true, | |
| "simple_modifications": { | |
| "caps_lock": "escape", | |
| "f1": "mute", | |
| "f2": "volume_down", | |
| "f3": "volume_up", |
This file contains hidden or 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 map(intValue): | |
| store = {} | |
| store[computeBin(intValue)] += 1 | |
| print _, store | |
| def reduce(_, *stores): | |
| _store = {} | |
| for store in stores: | |
| for k, v in store: | |
| _store[k] += v |
This file contains hidden or 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 map(intValue): | |
| print intValue, 1 | |
| def reduce(*args): | |
| store = {} | |
| for intValue, count in args: | |
| store[computeBin(intValue)] += count |
This file contains hidden or 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
| from collections import defaultdict | |
| class Monoid(): | |
| def __init__(self, zero, foldOp, liftFunctor=None): | |
| self.store = defaultdict(zero) | |
| self.liftFunctor = liftFunctor | |
| self.foldOp = foldOp | |
| self.zero = zero | |
| def fold(self, key, vals): |
- General Background and Overview
- Probabilistic Data Structures for Web Analytics and Data Mining : A great overview of the space of probabilistic data structures and how they are used in approximation algorithm implementation.
- Models and Issues in Data Stream Systems
- Philippe Flajolet’s contribution to streaming algorithms : A presentation by Jérémie Lumbroso that visits some of the hostorical perspectives and how it all began with Flajolet
- Approximate Frequency Counts over Data Streams by Gurmeet Singh Manku & Rajeev Motwani : One of the early papers on the subject.
- [Methods for Finding Frequent Items in Data Streams](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.187.9800&rep
NewerOlder