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
/* tree_build.c 2020-02-12 */ | |
/* Copyright 2008-2020 Emmanuel Paradis, 2017 Klaus Schliep */ | |
/* This file is part of the R-package `ape'. */ | |
/* See the file ../COPYING for licensing issues. */ | |
//#include <R.h> | |
//#include <Rinternals.h> | |
#include <cmath> |
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 Bio import Phylo | |
from io import StringIO | |
import sys | |
treedata = sys.argv[1] | |
handle = StringIO(treedata) | |
tree = Phylo.read(handle, "newick") | |
out = StringIO() |
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
import requests | |
from lxml import html | |
courseids=[62454,62508,62446,62557,62448,62513,62549,62511,62451,62558,62477] | |
# music 62531, | |
def grade(r): | |
try: | |
return float(r[2][0])/float(r[2][1]) | |
except ValueError: |
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
import sys | |
sys.path.append("/path/to/GIT/waferslim/src") | |
import waferslim.server | |
import logging | |
#sys.argv = ['programname', '-iq', '-q', directory] | |
def start_server(): |
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 script reads a GIT directory and prints out the contents | |
# appropriately to be incorporated into a Google Visualization Treemap | |
# https://code.google.com/apis/ajax/playground/?type=visualization#tree_map | |
import os | |
rootdir = "E:\\Git" | |
result = {} | |
for path, dirs, files in os.walk(rootdir): | |
key = os.path.basename(path) |
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
import urllib2 | |
import base64 | |
import re | |
request = urllib2.Request("http://192.168.1.1/DHCPTable.asp") | |
base64string = base64.encodestring('%s:%s' % (USER, PASSWORD)).replace('\n', '') | |
request.add_header("Authorization", "Basic %s" % base64string) | |
lines = (re.findall(r"'(.*?)'", x, re.DOTALL) for x in urllib2.urlopen(request) if 'new AAA' in x) | |
q = dict((vv[0], vv[1]) for vv in lines if vv) |
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
require 'win32ole' | |
class MediaPlayer | |
def initialize | |
@player = WIN32OLE.new('WMPlayer.OCX') | |
end | |
def songs | |
s = @player.mediacollection.getByAttribute("MediaType","Audio") |
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
require 'httparty' | |
response = HTTParty.get('https://1.ravenhq.com/docs') | |
response = HTTParty.get(response.headers['oauth-source'], :headers => { "Api-Key" => ApiKey }) | |
auth = "Bearer " + response.body | |
response = HTTParty.get('https://1.ravenhq.com/databases/benfulton-SourcedTriples/docs/?start=0&pageSize=10', :headers => { "Authorization" => auth }) | |
puts response.body, response.code, response.message, response.headers.inspect |
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
require "icalendar" | |
require "Mechanize" | |
include Icalendar | |
class Libry | |
def initialize | |
@agent = Mechanize.new | |
end |