π
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
#!/bin/bash | |
cat > Makefile <<EOF | |
APPNAME=test_struct_different_decl | |
CFLAGS=-g2 -O0 -Wall -Wextra -Wpedantic | |
CC=clang | |
all: | |
\$(CC) \$(CFLAGS) -c -o mod1.o mod1.c | |
\$(CC) \$(CFLAGS) -c -o mod2.o mod2.c |
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
.globl mcount | |
mcount: | |
push %eax | |
push %ebx | |
push %ecx | |
mov %esp,%eax | |
add $0x10,%eax //retval + rax + rbx + rcx | |
mov %ebp,%ebx |
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
avg [] curr n = curr | |
avg (x:xs) curr n = | |
let c' = (x + (curr * n)) / (n + 1) | |
in avg xs c' (n + 1) | |
avg' lst = avg lst 0 0 | |
main = | |
print $ avg' ([1, 2, 3, 4, 5] :: [Double]) |
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
#!/bin/bash | |
set -e | |
set -u | |
BOOKMARKS_TXT="bookmarks.txt" | |
if [[ -z "$1" ]]; then | |
echo "Usage: $0 $BOOKMARKS_TXT" | |
exit -1 |
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
#!/usr/bin/env ruby2.1 | |
#@bin_dir="/home/me/bin/foo" | |
@bin_dir = "" | |
# context = { | |
# :exports => { | |
# "foo" => [ | |
# "file2.ois", | |
# "file3.ois", |
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
#!/bin/bash | |
set -e | |
set -u | |
export SRC_LLVM="https://github.com/llvm-mirror/llvm.git" | |
export SRC_COMPILER_RT="https://github.com/llvm-mirror/compiler-rt.git" | |
export SRC_CLANG="https://github.com/llvm-mirror/clang.git" | |
export SRC_CLANG_EXTRA="https://github.com/llvm-mirror/clang-tools-extra.git" | |
export SRC_LIBCXX="https://github.com/llvm-mirror/libcxx.git" |
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
#!/usr/bin/env ruby | |
require 'Digest' | |
require 'set' | |
if 0 == ARGV.length then | |
puts "Usage: $0 dir" | |
exit -1 | |
end |
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
#!/usr/bin/env ruby | |
require 'Digest' | |
if 2 != ARGV.length then | |
puts "Usage: $0 dir [good_dir]" | |
exit -1 | |
end | |
def probe_file(path, good_path) |
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
#include <assert.h> | |
#include <ctype.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <math.h> | |
#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0])) | |
enum token_type { |
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
let rec revZipWithDefault accum dval lsta lstb = | |
match lsta with | |
| ha :: ta -> | |
(match lstb with | |
| hb :: tb -> zipWithDefault ((ha, hb) :: accum) dval ta tb | |
| _ -> zipWithDefault ((ha, dval) :: accum) dval ta []) | |
| _ -> | |
(match lstb with | |
| hd :: tl -> zipWithDefault ((dval, hd) :: accum) dval [] tl | |
| _ -> accum);; |