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
mkset :: Ord a => [a] -> M.Map a () | |
mkset = M.fromList . map (\x->(x,())) | |
gc :: Ord k => M.Map k v -> [k] -> (v -> [k]) -> M.Map k v | |
gc pvals proots ptrs = M.unions $ follow pvals proots | |
where | |
follow _ [] = [] | |
follow vals roots = | |
let rootset = mkset roots |
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
{- | |
foldc - "fold centre" | |
Perfoms a fold of a list, given an associative operation, in a binary-tree pattern. | |
For example, folding the numbers 1 through 10 with the operation * looks like this: | |
foldl1: (((((((((1 * 2) * 3) * 4) * 5) * 6) * 7) * 8) * 9) * 10) | |
foldr1: (1 * (2 * (3 * (4 * (5 * (6 * (7 * (8 * (9 * 10))))))))) |
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
#!/bin/bash | |
dir="$1" | |
if pidof compiz > /dev/null; then | |
current=on | |
else | |
current=off | |
fi | |
if [ -z "$dir" ]; then |
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
#!/bin/bash | |
unshared () { | |
grep '^[0-9]\+$' "$1" > /dev/null | |
} | |
for cpu in $(ls -d /sys/devices/system/cpu/cpu[0-9]* | sort -t u -k 3 -n); do | |
echo "${cpu##*/}: [Package #$(cat $cpu/topology/physical_package_id), Core #$(cat $cpu/topology/core_id)]" | |
if ! unshared $cpu/topology/core_siblings_list; then | |
echo " same package as $(cat $cpu/topology/core_siblings_list)" |
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
#include <time.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <string.h> | |
static __inline__ unsigned long long rdtsc(void) | |
{ | |
unsigned hi, lo; |
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 _GNU_SOURCE | |
#include <pthread.h> | |
#include <sys/types.h> | |
#include <stdio.h> | |
#include <sched.h> | |
#include <assert.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <math.h> | |
struct { |
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
(require 'uniquify) | |
(custom-set-variables | |
;; custom-set-variables was added by Custom. | |
;; If you edit it by hand, you could mess it up, so be careful. | |
;; Your init file should contain only one such instance. | |
;; If there is more than one, they won't work right. | |
'(dabbrev-case-fold-search nil) | |
'(doc-view-resolution 100) | |
'(ecb-options-version "2.32") | |
'(indent-tabs-mode nil) |
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
(require 'uniquify) | |
(custom-set-variables | |
;; custom-set-variables was added by Custom. | |
;; If you edit it by hand, you could mess it up, so be careful. | |
;; Your init file should contain only one such instance. | |
;; If there is more than one, they won't work right. | |
'(dabbrev-case-fold-search nil) | |
'(doc-view-resolution 100) | |
'(ecb-options-version "2.32") | |
'(indent-tabs-mode nil) |
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
diff --git a/parser.y b/parser.y | |
index 0effe07..ed05534 100644 | |
--- a/parser.y | |
+++ b/parser.y | |
@@ -2,6 +2,8 @@ | |
#include <stdio.h> | |
#include <string.h> | |
#include "compile.h" | |
+ | |
+struct lexer_param; |
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
#!/bin/bash | |
die () { | |
echo "$0: $@" > /dev/stderr | |
exit 1 | |
} | |
usage () { | |
echo "Usage: $0 <branchname> <directory>" > /dev/stderr | |
exit 1 |
OlderNewer