Skip to content

Instantly share code, notes, and snippets.

@xydrolase
xydrolase / rabit_demo.py
Created September 28, 2016 02:38
rabit_demo.py with tracker dependency removed.
#!/usr/bin/env python
"""
This is the demo submission script of rabit for submitting jobs in local machine
"""
import argparse
import sys
import os
import subprocess
from threading import Thread
if os.name == 'nt':
@xydrolase
xydrolase / installCaffe.sh
Last active September 11, 2018 04:51 — forked from qcabel/installCaffe.sh
Install Caffe on NVIDIA Jetson TK1 LT4 21.2 - CUDA 6.5
#!/bin/sh
# Install and compile Caffe on NVIDIA Jetson TK1 Development Kit
sudo add-apt-repository universe
sudo apt-get update
sudo apt-get install libprotobuf-dev protobuf-compiler gfortran \
libboost-dev cmake libleveldb-dev libsnappy-dev \
libboost-thread-dev libboost-system-dev \
libboost-filesystem-dev \
libatlas-base-dev libhdf5-serial-dev libgflags-dev \
libgoogle-glog-dev liblmdb-dev -y
@xydrolase
xydrolase / mbta_apt_guides.js
Created December 6, 2015 05:39
Overlay MBTA Routes to ApartmentGuide
// ==UserScript==
// @name MBTA Routes Renderer
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match http://www.apartmentguide.com/map*
// @grant GM_xmlhttpRequest
// @require http://code.jquery.com/jquery-latest.js
// ==/UserScript==
@xydrolase
xydrolase / LingoBingTTS.user.js
Last active August 29, 2015 14:05
Use Bing Translator as the TTS engine for Duolingo. To install, click on the **Raw** button below (for `LingoBingTTS.user.js`). Scroll down for more details.
// ==UserScript==
// @name LingoBingTTS
// @namespace http://xydrolase.me
// @version 0.1
// @description Technical demo
// @match https://www.duolingo.com/*
// ==/UserScript==
//
@xydrolase
xydrolase / condDisabledPanel.R
Last active August 29, 2015 14:05
Shiny: conditionalDisabledPanel
#' Conditional Disabled Panel
#'
#' Creates a panel whose child input elements are disabled or not,
#' depending on the value of a Javascript expression.
#'
#' See ?shiny:::conditionalPanel for the Javascript expression usage.
#'
#' @param condition A JavaScript expression that will be evaluated repeatedly to
#' determine whether the child input elements should be disabled.
#' @param ... Elements to include in the panel.
@xydrolase
xydrolase / Duo-MiniDict.user.js
Last active May 28, 2016 00:54
Duo-MiniDict with "/" hotkey removed
// ==UserScript==
// @name Duolingo-MiniDict
// @namespace http://github.com/killkeeper/duolingo-minidict
// @version 0.15
// @description A built-in dictionary for Duolingo
// @updateURL https://raw.githubusercontent.com/killkeeper/duolingo-minidict/master/Duolingo-MiniDict.user.js
// @match *://www.duolingo.com/*
// @grant none
// ==/UserScript==
//
inline kmer_pair_t *compute_delta(DOUBLE *ptr_ups_alpha, DOUBLE *norm_trans_p,
DOUBLE emit_dens, DOUBLE *delta, kmer_pair_t *kpair)
{
#ifdef __AVX__
/* yay! */
#endif
#ifdef __SSE3__
DOUBLE idx_argmax;
/* transition prob */
#!/usr/bin/env python
import math
## SETTINGS BELOW ##
# how many radiation lines to generate
DEGREE_STEP = 10
# this detemines if the glass pattern is sparse or dense
POINTS_ON_RADIATION = 20
# how much would the radiation line be twisted
@xydrolase
xydrolase / mixedcg.py
Created April 6, 2011 22:16
A PyMOL extension script for building mixed coarse-grained model PDB files
#!/usr/bin/env python
""" mixedcg.py
A PyMOL extension script for building mixed coarse grained model.
Author: Xin Yin <xinyin at iastate dot edu>
Biopython dependencies:
This script requires Biopython module for communicating with NCBI
server. You should first install Biopython onto your computer, and then
@xydrolase
xydrolase / cyrides-utils.py
Created December 16, 2010 06:09
Sample code for retrieving all bus stops using Google's webservice. Theoretically, one could extract all venues within proximity of a given location.
#!/usr/bin/env python
import json
import re
import urllib
import random
import itertools
import time
import sys
class GMapsBusQuery: