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
# Fortran-like array with arbitrary starting indices | |
# | |
# usage: | |
# | |
# julia> include("FArray.jl") | |
# size (generic function with 51 methods) | |
# | |
# julia> y = FArray(Float64, -1:1, -7:7, -128:512, -5:5, -1:1, -3:3, -2:2, -1:1); | |
# | |
# julia> y[-1,-7,-128,-5,-1,-3,-2,-1] = 14 |
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
// takes arguments and produces an array of functions that accept context | |
function handle_args() { | |
var args = Array.prototype.slice.call(arguments); | |
return args.map(function(arg) { | |
if(arg instanceof Function) return arg; // Presumably already a contex-accepting function. | |
if(arg instanceof Array) return and.apply(this, arg); // make arrays behave as and. | |
// Presuming a string, build a function to check. | |
var my_regex = new RegExp(arg.toString(), 'i'); | |
return function(context) { | |
return context.search(my_regex) > -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
function query() { | |
var | |
total = 0, shown = 0, | |
// HN is done with very unsemantic classes. | |
job_list = Array.prototype.slice.call(document.querySelectorAll('.c5a,.cae,.c00,.c9c,.cdd,.c73,.c88')), | |
query_list = Array.prototype.slice.call(arguments); | |
// This traverses up the dom stack trying to find a match of a specific class | |
function up_to(node, klass) { | |
if (node.className === klass) { |
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
@doc doc""" | |
Takes a 2d array where each column is a pattern which maps to a row in | |
the resulting dataframe. Each pattern index is its own column in | |
the dataframe. | |
""" -> | |
function DataFrame(data::Array{Float64, 2}) | |
m = data' | |
result = DataFrame() | |
for i in 1:size(data, 1) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# http://dlo.me/archives/2014/09/08/pythonrc/ | |
# vim: set ft=python : | |
from __future__ import print_function | |
import json | |
import sys | |
import datetime | |
from redis import StrictRedis as Redis |
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 os | |
import logging | |
from collections import Counter | |
import gffutils | |
from gffutils.create import logger | |
logger.setLevel(logging.INFO) | |
usage = """ |
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
.ipynb_checkpoints |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.