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
# ---- Multiple dispatch functions ----- | |
multi_dispatch <- function(gen_name) { | |
calling_env <- parent.frame() | |
parent_call <- sys.call(sys.parent()) | |
calling_fun <- sys.function(sys.parent()) | |
arg1 <- eval(parent_call[[2]], calling_env) | |
arg2 <- eval(parent_call[[3]], calling_env) |
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
function encodeURI(str) | |
if (str) then | |
str = string.gsub (str, "\n", "\r\n") | |
str = string.gsub (str, "([^%w ])", | |
function (c) return string.format ("%%%02X", string.byte(c)) end) | |
str = string.gsub (str, " ", "+") | |
end | |
return str | |
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 perl | |
use strict; | |
use warnings; | |
use Path::Class; | |
use FindBin; | |
my $output_dir = dir($FindBin::Bin,"data"); | |
$output_dir->is_dir or die "[ERROR] $output_dir is not a directory."; |
NewerOlder