Skip to content

Instantly share code, notes, and snippets.

Zhenning Yu Testispuncher

  • Medical University of South Carolina
  • Charleston, SC
Block or report user

Report or block Testispuncher

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Testispuncher
Testispuncher / Simon'sTwoStageDesign.R
Last active Apr 10, 2017
Simon's two stage design considering minmax and optimal design
View Simon'sTwoStageDesign.R
########## Simon Two Stage Design #########
# Step 1: Search r1 over 0 to n1, for each r1, determine the maximum value
# of r that statisfied the type II error constraint.
# Step 2: Examine whether the set of parameters (n, n1, r1, r) satisfied the
# type I error constraint. Calculate expected sample size and find r1 that minimize
# the expected sample size
# Step 3: Search over the range of n1 to find the optimal two-stage design for the
# sample size n.
###########################################
######### Parameters ######################
@Testispuncher
Testispuncher / DiscogsAlbum.py
Created Mar 10, 2017
Use urllib3 to fetch album information from discogs and insert into MongoDB
View DiscogsAlbum.py
import urllib3
from bs4 import BeautifulSoup
import re
from pymongo import MongoClient
import time
# Link to the MongoDB
client = MongoClient('localhost', 27017)
# Database
db = client.discogs
@Testispuncher
Testispuncher / LastFMSimilar.py
Last active Mar 9, 2017
Get similar artists for a given band from Last.fm
View LastFMSimilar.py
# This is a code snippt trying the retreive data from Last.fm
# Import the library
import urllib.request as urllib2
import json
# API Key
API_KEY = 'xxxxxxx'
@Testispuncher
Testispuncher / CheckAllInputs.js
Last active Feb 17, 2017
JQuery Code for 'Select All' Checkbox
View CheckAllInputs.js
// Javascript Code
$(document).ready(function(){
// If the all select is checked, check all checkboxes and trigger the change event
$('.result-check-all').click(function(){
if ($(this).is(':checked')) {
// If the 'Select All' is checked, check all children checkboxes;
$('.result-check').prop('checked', true).change();
} else {
// If uncheck 'Select All', uncheck all selected children checkboxes;
You can’t perform that action at this time.