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
/* Usage: write sparse image to block device, padded to the logical block size (BLKSSZGET). | |
TODO: Combine neighbor logical blocks into larger chunks, possibly taking advantage of BLKALIGNOFF BLKPBSZGET BLKIOOPT. | |
Rationale: | |
I created a LUKS crypto block device with integrity. I'd want to wipe | |
each sector (i.e. logical block) so the sector's integrity checks, | |
before I could read from the sector. Upon "luksFormat", cryptsetup(8) | |
offers to wipe all sectors by default. If I'd overwrite a sector, the | |
sector's integrity bits'd be overwritten, too, so I'd no need to care |
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
import qualified Control.Monad | |
import qualified Text.Printf | |
import qualified Text.Parsec.Token | |
import qualified Text.ParserCombinators.Parsec | |
import qualified Text.ParserCombinators.Parsec.Language | |
data E = Int_E Integer | Y String | Z | |
identifier = Text.Parsec.Token.identifier Text.ParserCombinators.Parsec.Language.haskell | |
integer = Text.Parsec.Token.integer Text.ParserCombinators.Parsec.Language.haskell |
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
#define g(x) int g##x(int n){int t=n; for (int i=1; i<n; i++) t=x(t); return t;} | |
int h(int n){return n+1;} | |
g(h) | |
g(gh) | |
g(ggh) | |
int f(int n){return gggh(n);} |