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 | |
# For general environment | |
from twisted.internet import reactor | |
from twisted.internet.task import LoopingCall, Cooperator | |
from twisted.protocols.basic import LineReceiver | |
from twisted.internet.protocol import Factory | |
import json |
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
#!/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
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
<html xmlnx="http://wwww.w3.org/1999/xhtml"> | |
<head> | |
<title>Killa Lipstick</title> | |
<link rel="stylesheet" href="style.css" type="text/css"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |
</head> | |
<body> | |
<div id="wrapper"> | |
<div id="header"> |
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
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
# | |
# 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
#!/usr/bin/env python | |
from twisted.internet import reactor | |
from twisted.internet.task import LoopingCall, Cooperator | |
import pygame | |
import pygame.font | |
pygame.display.init() | |
pygame.font.init() |
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
cumhist <- function(x, data=NULL, ...) { | |
terms<-as.character(x) | |
rhs<-terms[length(terms)] | |
splt<-strsplit(rhs,split="|", fixed=T)[[1]] | |
var<-splt[1] | |
grp<-splt[2] | |
lhs<-paste("ecdf(",var,")(",var,")", sep="") | |
ff<-paste(lhs, var, sep="~") | |
if(!is.na(grp)) { | |
ff<-paste(ff,grp,sep="|") |