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 escript | |
%%% This script converts an arbitrary binary file to an Erlang module with a | |
%%% single exported 'bin/0' function that returns the original binary. | |
%%% | |
%%% See the end of the file for how I figured out the correct terms. | |
main(["+debug_info" | Files]) -> | |
io:format("Embedding binaries with debug_info...\n"), | |
lists:foreach(fun(X) -> embed_file_in_beam(X, [debug_info]) end, Files); |
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
######################################################### | |
## Intro to Simulation - R/Stats Intro Series | |
## Designed by: Corey Chivers, 2013 | |
## Department of Biology, McGill University | |
######################################################### | |
##@ 0.1 @## | |
rm(list=ls()) # Housekeeping | |
#setwd('<my working directory>') # set working dir |
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
julia> require("Calendar") | |
julia> using Calendar | |
julia> require("DataFrames") | |
julia> using DataFrames | |
julia> require("Thyme") | |
julia> using Thyme | |
julia> spx = read_stock("spx.csv"); | |
julia> check = falses(nrow(spx)); | |
julia> for i in 1:nrow(spx) | |
check[i] = dayofweek(spx[i,1]) == 6 |
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
-- PostgreSQL 9.2 beta (for the new JSON datatype) | |
-- You can actually use an earlier version and a TEXT type too | |
-- PL/V8 http://code.google.com/p/plv8js/wiki/PLV8 | |
-- Inspired by | |
-- http://people.planetpostgresql.org/andrew/index.php?/archives/249-Using-PLV8-to-index-JSON.html | |
-- http://ssql-pgaustin.herokuapp.com/#1 | |
-- JSON Types need to be mapped into corresponding PG types | |
-- |
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
package de.uwefleischer.statemachines; | |
import java.util.Set; | |
import java.util.TreeSet; | |
public class Sql { | |
private static Set<String> tables; | |
%%{ |
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 escript | |
%% -*- erlang -*- | |
%% Find unused exports in a given module | |
%% Example: deadcode mod_foo deps/foo/ebin deps/bar/ebin | |
%% Assumes this script is in a file named deadcode | |
main([Module0|Dirs]) -> | |
Module = list_to_atom(Module0), | |
{ok, _Pid} = xref:start(foo), |
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 | |
exedir="/usr/local/Cellar/ghc/7.0.4/lib/ghc-7.0.4" | |
exeprog="ghc-stage2" | |
executablename="$exedir/$exeprog" | |
datadir="/usr/local/Cellar/ghc/7.0.4/share" | |
bindir="/usr/local/Cellar/ghc/7.0.4/bin" | |
topdir="/usr/local/Cellar/ghc/7.0.4/lib/ghc-7.0.4" | |
pgmgcc="/usr/bin/llvm-gcc" | |
extraopts=-optl"-Wl,-read_only_relocs,suppress" | |
executablename="$exedir/ghc" |
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
(ns type-level-tagger | |
{:doc "Implements State-of-the-art Unsupervised Part-of-speech Tagger | |
from \"Simple Type-Level Unsuperivsed POS Tagging\" | |
by Yoong-Keok Lee, Aria Haghighi and Regina Barzilay | |
(http://www.cs.berkeley.edu/~aria42/pubs/typetagging.pdf) | |
blog post: http://wp.me/pcW6S-x" | |
:author "Aria Haghighi ([email protected])"} | |
(:use [clojure.java.io :only [reader]] | |
[clojure.contrib.duck-streams :only [with-out-writer]] | |
[clojure.contrib.seq-utils :only [indexed]] |
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 'eventmachine' | |
class SmtpSink < EM::Protocols::SmtpServer | |
def receive_data_chunk( data ) | |
buffer.concat data | |
end | |
def receive_message | |
puts |
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
-module(date_util). | |
-compile(export_all). | |
epoch() -> | |
now_to_seconds(now()) | |
. | |
epoch_hires() -> | |
now_to_seconds_hires(now()) | |
. |
NewerOlder