Skip to content

Instantly share code, notes, and snippets.

View nanxstats's full-sized avatar

Nan Xiao nanxstats

View GitHub Profile
#!/usr/bin/python
import sys, os, re, time
from subprocess import Popen, PIPE
import json
import requests
__license__ = "MIT"
__doc__ = """
This script is meant as an example of Seven Bridges Genomics IGOR API usage.
Running it will annotate all files in specified directory, upload these files, process them using the specified pipeline and download the results.
@nanxstats
nanxstats / Rcpp-which.R
Last active December 7, 2018 20:41 — forked from zjf/c_which.R
library("Rcpp")
cppFunction("std::vector<int> c_which(NumericVector x, Function f, List args) {
std::vector<int> ind = as< std::vector<int> >(f(x, args));
std::vector<int> out(ind);
std::vector<int>::iterator it;
int j = 0;
it = std::find(ind.begin(), ind.end(), 1);
while(it++ != ind.end()){
out[j++] = it - ind.begin();

Twitter公式クライアントのコンシューマキー

Twitter for iPhone

Consumer key: IQKbtAYlXLripLGPWd0HUA
Consumer secret: GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU

Twitter for Android

Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for Google TV

Consumer key: iAtYJ4HpUVfIUoNnif1DA

@nanxstats
nanxstats / ord.R
Created October 24, 2012 12:24
R function to convert a string into a vector of its ASCII numbers
ord <- function(x) {
s <- x[1]
intbits <- .Machine$sizeof.long * 4
bits <- raw(nchar(s) * intbits)
r <- charToRaw(x)
idx <- if (.Platform$endian == "little") 1:8 else 25:32
for (i in 1:nchar(s)) {
bits[idx + ((i - 1) * intbits)] <- rawToBits(r[i])