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 -x | |
filename=sinx | |
epsfile=${filename}.eps | |
tex_master=main.tex | |
tex_cmd=pdflatex | |
color=white # color which you want to change to. | |
gnuplot <<EOF | |
set terminal postscript eps enhanced color 30 |
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 -x | |
cat << EOF > foo.cc | |
#define BOOST_TEST_MODULE foo | |
#include <boost/test/unit_test.hpp> | |
BOOST_AUTO_TEST_CASE(foo_test) { | |
int a = 0; | |
BOOST_CHECK_EQUAL(0, a); | |
} |
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
// An example of type assertions for empty interface (i.e., interface{}) | |
package main | |
import ( | |
"container/list" | |
"fmt" | |
) | |
type Node struct { |
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
// duck typing | |
package main | |
import "fmt" | |
// Virtual duck | |
type Duck interface { | |
Quack() string | |
} |
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
// A simple cat(1) implementation in Go. | |
// | |
// Build Instructions: | |
// | |
// $ go build -o cat | |
// | |
// Usage: | |
// | |
// Basically, the usage is same as cat(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
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns | |
Compress 1K bytes with Zippy 3,000 ns | |
Send 2K bytes over 1 Gbps network 20,000 ns | |
Read 1 MB sequentially from memory 250,000 ns | |
Round trip within same datacenter 500,000 ns | |
Disk seek 10,000,000 ns |
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
// simulates "ls -l" | |
package main | |
import ( | |
"flag" | |
"fmt" | |
"io/ioutil" | |
"log" | |
) |
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
// Copyright 2012 Tetsuo Kiso. | |
// | |
// Licensed under the Apache License, Version 2.0 (the "License"); | |
// you may not use this file except in compliance with the License. | |
// You may obtain a copy of the License at | |
// | |
// http://www.apache.org/licenses/LICENSE-2.0 | |
// | |
// Unless required by applicable law or agreed to in writing, software | |
// distributed under the License is distributed on an "AS IS" BASIS, |
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/sh -x | |
# Build script for Rampion (Gimpel & Smith, NAACL 2012). | |
# | |
# Tested rampion v0.1 on Mac OS X 10.7 and Linux. | |
src=rampion-v0.1.tar.gz | |
url=http://www.ark.cs.cmu.edu/MT/$src | |
# detect os, and set the number of jobs to run make. | |
ncpu= | |
downloader= |
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/sh -x | |
num_cpu=32 | |
path_to_moses=`pwd` | |
path_to_srilm=$HOME/local/src/srilm | |
test_num=10 | |
path_to_regtest=$path_to_moses/regression-testing/moses-reg-test-data-$test_num | |
./bjam -j$num_cpu toolset=gcc \ | |
--with-boost=/usr/include \ | |
--with-srilm=$path_to_srilm \ |