#!/bin/bash | |
# Written by demofly for Pg 9.4 | |
# | |
# WARNING: if you ran pg_stat_reset() last month, don't use this script !!! | |
# | |
# Get unused indexes and kill it with fire! | |
DB=postgres |
State machines are everywhere in interactive systems, but they're rarely defined clearly and explicitly. Given some big blob of code including implicit state machines, which transitions are possible and under what conditions? What effects take place on what transitions?
There are existing design patterns for state machines, but all the patterns I've seen complect side effects with the structure of the state machine itself. Instances of these patterns are difficult to test without mocking, and they end up with more dependencies. Worse, the classic patterns compose poorly: hierarchical state machines are typically not straightforward extensions. The functional programming world has solutions, but they don't transpose neatly enough to be broadly usable in mainstream languages.
Here I present a composable pattern for pure state machiness with effects,
NOTE (2022-07-09): Xcode finally added this functionality in Xcode 14, please see release notes here:
New Features in Xcode 14 Beta 3
When editing code, the Edit > Duplicate menu item and its corresponding keyboard shortcut now duplicate the selected text — or the line that currently contains the insertion point, if no text is selected. (8614499) (FB5618491)
#import <Foundation/Foundation.h> | |
#import <CoreData/CoreData.h> | |
@interface AZModel : NSObject | |
+ (AZModel *)sharedModel; | |
- (__strong NSManagedObjectContext *)managedObjectContextForCurrentThread; | |
- (__autoreleasing NSManagedObjectContext *)newManagedObjectContextForCurrentThread; | |
@end |
/* | |
* InDesign Interactive Console | |
* @nbqx made the original of this script. | |
* http://d.hatena.ne.jp/nbqx69/20100617#p1 | |
*/ | |
#target Indesign | |
#targetengine nbqx | |
//ユーティリティ |