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 <iostream> | |
void print(char const *str) { std::cout << str; } | |
void print(short num) { std::cout << num; } | |
int main() { | |
print("abc"); | |
print(0); | |
print('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
type base = A | C | G | T | ROOT ;; | |
let base_to_s b = match b with | |
| A -> "A" | |
| C -> "C" | |
| G -> "G" | |
| T -> "T" | |
| _ -> "ROOT";; | |
let char_to_base c = match c with | |
| 'a' | 'A' -> 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
(* SEE: http://mirror.ocamlcore.org/wiki.cocan.org/tips_for_using_the_ocaml_toplevel.html *) | |
$ ocaml | |
# #use "topfind" ;; | |
Findlib has been successfully loaded. Additional directives: | |
#require "package";; to load a package | |
#list;; to list the available packages | |
#camlp4o;; to load camlp4 (standard syntax) | |
#camlp4r;; to load camlp4 (revised syntax) | |
#predicates "p,q,...";; to set these predicates |
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
require 'rubygems' | |
require 'json' | |
require 'pp' | |
require 'rake' | |
class MAS | |
attr_reader :scripts, :parallel_tasks | |
def initialize | |
@scripts = JSON.parse(File.read("mas.json")) | |
@to_run = [] |
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" : | |
{ | |
"path": "", | |
"args": "", | |
"depends": [] | |
}, | |
"B" : | |
{ | |
"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
type node = { cmd: string; | |
deps: node list } | |
let nodeA = { cmd = "A"; | |
deps = [] } | |
let nodeB = { cmd = "B"; | |
deps = [] } |
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
//To compile: | |
//g++ -I /usr/include/boost -o op_parser op_parser.cpp /usr/lib64/libboost_program_options-mt.a | |
#include <iostream> | |
#include "boost/program_options.hpp" | |
namespace po = boost::program_options; | |
using namespace std; | |
int main(int argc, char** argv){ | |
string list_file; |
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
//compile with: | |
//g++ -std=c++11 -o test test.cpp | |
#include <iostream> | |
#include <map> | |
#include <vector> | |
typedef std::vector<std::string> StrVec; | |
typedef std::map<std::string, StrVec > MapStr2Vec; | |
MapStr2Vec mmap; |
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
(* Inspired by this puzzle from NPR: | |
http://www.npr.org/2012/01/29/146034893/this-puzzle-is-the-pits | |
(see the 'Next Weeks' challenge section there): | |
"Next Week's Challenge from listener Ed Pegg Jr.: Write the digits from | |
1 to 9 in a line. If you put times signs after the 2 and 4, a plus | |
sign after the 5, and a minus sign after the 7, you have | |
12 x 34 x 5 + 67 - 89, which equals 2018. | |
That's six years off from our current year 2012. This example uses | |
four arithmetic symbols. The object is to use just three of the | |
following arithmetic operations: addition, subtraction, multiplication |
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
(* POSET probably works better than RING here *) | |
module type RING = | |
sig | |
type t | |
val max : t | |
val min : t | |
val succ : t -> t | |
val val_to_s : t -> string | |
end |