This file contains 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
# | |
# From Hmisc, pasted here so as to not need any deps for this demo | |
# | |
Cbind <- function (...) | |
{ | |
dotlist <- list(...) | |
if (is.matrix(dotlist[[1]])) { | |
y <- dotlist[[1]] | |
ynam <- dimnames(y)[[2]] | |
if (!length(ynam)) |
This file contains 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
from panglery import Pangler | |
class Dispatcher(Pangler): | |
def listen(self, event): | |
def decorator(target): | |
@self.subscribe(e=event) | |
def wrapper(*args, **kwargs): | |
return target(*args, **kwargs) | |
return wrapper |
This file contains 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
changes <- function(x) { | |
r <- rle(x)$lengths | |
c(0,cumsum(r[1:length(r)-1]))+1 | |
} |
This file contains 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
bars <- function(temp, psi) { | |
(psi+14.695)*(0.01821+0.090115*exp(-(temp-32)/43.11))-0.003342 | |
} | |
psi <- function(bars, temp) { | |
((bars+0.003342)/(0.01821+0.090115*exp(-(temp-32)/43.11)))-14.695 | |
} | |
temp <- function(bars, psi) { | |
-log(((bars+0.003342)/(psi+14.695)-0.01821)/0.090115)*43.11+32 |
This file contains 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 python | |
import sys, os | |
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)),"pyviewx.client")) | |
sys.path.insert(1, os.path.join(os.path.dirname(os.path.realpath(__file__)),"pyviewx.pygame")) | |
from pyviewx.client import iViewXClient, Dispatcher | |
from pyviewx.pygame import Calibrator | |
from twisted.internet import reactor |
This file contains 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 python | |
import sys, os | |
import argparse | |
from PySide.QtCore import * | |
from PySide.QtGui import * | |
from PySide.QtWebKit import * | |
class ValidateURL(argparse.Action): | |
def __call__(self, parser, args, values, option_string=None): |
This file contains 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 "Rcpp.h" | |
using namespace std; | |
using namespace Rcpp; | |
NumericMatrix lowPass6xDecX(NumericMatrix src) | |
{ | |
const int ws = src.ncol(), h = src.nrow(); | |
const int h2 = h * 2, h3 = h * 3, h4 = h * 4, h5 = h * 5; | |
int wr = ws / 2; |
This file contains 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 "Rcpp.h" | |
using namespace std; | |
using namespace Rcpp; | |
/* | |
inline unsigned char saturate( float x ) | |
{ | |
return x > 255.0f ? 255 | |
: x < 0.0f ? 0 |
This file contains 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
// This file was generated by Rcpp::compileAttributes | |
// Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 | |
#include <Rcpp.h> | |
using namespace Rcpp; | |
// GaussianSubsample | |
NumericMatrix GaussianSubsample(NumericMatrix img); | |
RcppExport SEXP gazetools_GaussianSubsample(SEXP imgSEXP) { |
This file contains 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 "Rcpp.h" | |
using namespace std; | |
using namespace Rcpp; | |
/* | |
inline unsigned char saturate( float x ) | |
{ | |
return x > 255.0f ? 255 | |
: x < 0.0f ? 0 |