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
int32_t f(int32_t x) { | |
return x + 0x7fffffff; | |
} |
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
-- Build a sorted word frequency list from a file, trimmed to a given quantile. | |
-- | |
-- Usage: WordStats <book.txt> <quantile> | |
-- | |
-- `quantile` is a number between 0 and 1. | |
-- | |
-- Example: | |
-- ./WordStats "Don Quijote.txt" 0.85 > "Don Quijote.words.85" | |
import Control.Applicative |
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
(gdb) info threads | |
6 0x987ff0ee in __workq_kernreturn () | |
5 "import_thread" 0x987ff9ae in kevent () | |
4 "SamplerThread" 0x987fc80e in semaphore_wait_trap () | |
3 "Chrome_ChildIOThread" 0x987ff9ae in kevent () | |
2 "com.apple.libdispatch-manager" 0x987ff9ae in kevent () | |
* 1 "CrUtilityMain" 0x987fe8e2 in __psynch_cvwait () | |
(gdb) thread apply all bt | |
Thread 6 (process 89623): |
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
template <class T> | |
struct Loop { | |
Loop<T *> operator->(); | |
}; | |
int main() { | |
Loop<int> i, j = i->hooray; | |
} |
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
/* What does this program print and why? */ | |
#include <stdio.h> | |
int main(void) { | |
int n = sizeof(0)["abcdefghij"]; | |
printf("%d\n", n); | |
return 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
.PHONY: all clean test | |
DATA_REPEATS?=1000 | |
DATA_FILE?=/usr/share/dict/words | |
GHC_OPTS?=-fspec-constr-count=64 -funfolding-use-threshold=64 | |
all: wce wci | |
clean: | |
rm -f wce wci *.hi *.o |