Skip to content

Instantly share code, notes, and snippets.

View terrycojones's full-sized avatar

Terry Jones terrycojones

View GitHub Profile
queryStartInSubject queryEndInSubject
| |
| |
| subjectBinStart |subjectBinEnd
| | ||
| | ||
Subject: .................SSS..SSSS.....SSSS.................
Query: .....QQQ..QQQQ...QQQQ
| |
import platform
pypy = platform.python_implementation() == 'PyPy'
from scipy.stats import dirichlet
>>> dirichlet.logpdf([0.4] + [(1.0 - 0.4) / 19] * 19, alpha=[0.05] * 20)
3.8604182571761925
>>> dirichlet.logpdf([0.6] + [(1.0 - 0.6) / 19] * 19, alpha=[0.05] * 20)
10.793871605825785
>>> dirichlet.logpdf([0.9] + [(1.0 - 0.9) / 19] * 19, alpha=[0.05] * 20)
35.431292971337086
>>> dirichlet.logpdf([0.95] + [(1.0 - 0.95) / 19] * 19, alpha=[0.05] * 20)
47.89123572023729
from math import floor, pow
In [13]: def scale(d):
....: return int(floor(pow(d, 0.725)))
....:
In [14]: for i in range(30):
....: print('%2d %2d' % (i, scale(i)))
....:
0 0
def bestBin(histogram, significantBins, significance):
"""
Calculate the overall match score ...
@param: A sorted (by score) list of significant bins.
"""
return significantBins[0]['score']
From [email protected] Fri Feb 17 15:25:04 1995
Return-Path: <[email protected]>
Received: from mimbres.cs.unm.edu by sfi.santafe.edu (4.1/SMI-4.1)
id AA17663; Fri, 17 Feb 95 15:25:03 MST
Received: from mendel.cs.unm.edu by mimbres.cs.unm.edu (5.65/033093) with SMTP
id <[email protected]>; Fri, 17 Feb 95 15:27:29 -0700
Received: from mendel.cs.unm.edu by mendel.cs.unm.edu (5.65/011293)
id AA00566; Fri, 17 Feb 1995 15:23:36 -0700
Date: Fri, 17 Feb 1995 15:23:36 -0700
From: [email protected]
$ l src/gor4/
total 136
-rw-r--r-- 1 terry staff 2074 Dec 7 20:56 README.md
-rw-r--r-- 1 terry staff 4589 Dec 7 20:56 api.c
-rw-r--r-- 1 terry staff 711 Dec 7 20:56 build.py
-rw-r--r-- 1 terry staff 419 Dec 7 20:56 defines.h
-rw-r--r-- 1 terry staff 26173 Dec 7 20:56 gor4-base.c
-rw-r--r-- 1 terry staff 366 Dec 7 20:56 gor4-base.h
-rw-r--r-- 1 terry staff 10768 May 1 2015 nrutil.c
-rw-r--r-- 1 terry staff 3716 May 1 2015 nrutil.h
$ trial /Users/terry/dark-matter/dark-matter/test
fetching http://www.pythontest.net/unicode/gb-18030-2000.xml ...
Traceback (most recent call last):
File "/Users/terry/dark-matter/dark-matter/.tox/py27/bin/trial", line 22, in <module>
run()
File "/Users/terry/dark-matter/dark-matter/.tox/py27/lib/python2.7/site-packages/twisted/scripts/trial.py", line 612, in run
suite = _getSuite(config)
File "/Users/terry/dark-matter/dark-matter/.tox/py27/lib/python2.7/site-packages/twisted/scripts/trial.py", line 500, in _getSuite
return loader.loadByNames(config['tests'], recurse=recurse)
File "/Users/terry/dark-matter/dark-matter/.tox/py27/lib/python2.7/site-packages/twisted/trial/runner.py", line 609, in loadByNames
Debugger entered--Lisp error: (wrong-type-argument integerp nil)
yas--populate-template([cl-struct-yas--template nil nil nil nil nil nil nil nil nil nil nil nil] :table [cl-struct-yas--table "python-mode" #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8 data ( ...)) #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8 data ( ...)) nil (keymap)] :key "super" :content "super`(elpy-snippet-super-form)`(${1:`(elpy-snippet-super-arguments)`})\n$0" :name "super()" :group ("Definitions") :condition nil :expand-env nil :file "/Users/terry/.emacs.d/elpa/elpy-1.10.0/snippets/python-mode/super" :keybinding nil :uuid "super()")
yas-define-snippets-1(("super" "super`(elpy-snippet-super-form)`(${1:`(elpy-snippet-super-arguments)`})\n$0" "super()" nil ("Definitions") nil "/Users/terry/.emacs.d/elpa/elpy-1.10.0/snippets/python-mode/super" nil nil) [cl-struct-yas--table "python-mode" #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8 data ( ...)) #s(hash-table size
Debugger entered--Lisp error: (wrong-type-argument integerp nil)
yas--populate-template([cl-struct-yas--template nil nil nil nil nil nil nil nil nil nil nil nil] :table [cl-struct-yas--table "python-mode" #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8 data ( ...)) #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8 data ( ...)) nil (keymap)] :key "while" :content "while ${condition}:\n $0" :name "while ... : ..." :group nil :condition nil :expand-env nil :file "/Users/terry/.emacs.d/elpa/yasnippet-0.8.0/snippets/python-mode/while" :keybinding nil :uuid "while ... : ...")
yas-define-snippets-1(("while" "while ${condition}:\n $0" "while ... : ..." nil nil nil "/Users/terry/.emacs.d/elpa/yasnippet-0.8.0/snippets/python-mode/while" nil nil) [cl-struct-yas--table "python-mode" #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8 data ( ...)) #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8 data ( ...)) nil (keymap)])
yas-def