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
NIST name | |
1600 Department of Labor | |
7529 National Institutes of Health | |
7500 Department of Health and Human Services | |
7000 Department of Homeland Security | |
1500 Department of Justice | |
1100 Executive Office of the President | |
1524 Drug Enforcement Administration | |
1560 Bureau of Alcohol, Tobacco, Firearms and Explosives | |
2400 Office of Personnel Management |
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
<bills> | |
<bill id="113hr51ih"> | |
<agency id="1600" count="6" name="Department of Labor"/> | |
</bill> | |
<bill id="113hr80ih"> | |
<agency id="7529" count="4" name="National Institutes of Health"/> | |
<agency id="7500" count="3" name="Department of Health and Human Services"/> | |
</bill> | |
<bill id="113hr57ih"/> | |
<bill id="113hr72ih"> |
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 re | |
# regular expressions for chars in an NCName | |
rCHARS = { | |
'startchar': u"_a-zA-Z" | |
u"\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-" | |
u"\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-" | |
u"\uFFFD\u10000-\uEFFFF", | |
'char': u"0-9\u00B7\u0300-\u036F\u203F-\u2040.-", | |
} |
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
<?php | |
function flatten_for($arr) { | |
$c = count($arr); | |
$newarr = array(); | |
for ($i = 0; $i < $c; $i++) { | |
$newarr[] = $arr[$i][0]; | |
} | |
return $newarr; | |
} |
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
class MultiIndex { | |
protected $array; | |
protected $indexes = array(); | |
protected $indexdefs = array(); | |
function __construct($array, $indexdefs) | |
{ | |
$this->array = $array; | |
$this->indexdefs = $indexdefs; |
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
# Francis Avila 2009-07-04 | |
# See http://www.evanmiller.org/how-not-to-sort-by-average-rating.html | |
# These functions calculate "Lower bound of Wilson score confidence interval for a Bernoulli parameter" | |
# Two stored functions: | |
# CI_LOWER_BOUND(pos, trials, confidence) calculate a wilson score given POS positive votes in TRIALS number of trials | |
# PNORM(qn) calculate P(qn) (inverse normal distribution); needed by CI_LOWER_BOUND | |
delimiter ;; | |
CREATE DEFINER=`root`@`localhost` FUNCTION `ci_lower_bound`(pos INTEGER, trials INTEGER, confidence DOUBLE) RETURNS double | |
NO SQL |
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 java.io.*; | |
import java.util.*; | |
// for imageio metadata | |
import javax.imageio.*; | |
import javax.imageio.stream.*; | |
import javax.imageio.metadata.*; | |
// for xml handling | |
import org.w3c.dom.*; |
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
(ns b64longs | |
"Encode and Decode java.lang.Long as a web-safe, identically-sortable Base64 string. | |
I.e., the Long and the string will both sort exactly the same way, and none of | |
the characters of the string ever need to be escaped in a web context (e.g. in html, | |
in xml, in any part of a url). | |
Requires net.iharder.Base64 class which is Public Domain. | |
See http://iharder.sourceforge.net/current/java/base64/ | |
Add this as a leinigen dependency. |
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
(ns subclass | |
(:require [clojure.string :as string])) | |
;;TODO: definterface | |
; :closure/const | |
; :const | |
; :closure/constructor | |
; :closure/depreciated |
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
(ns parallel-chan-map | |
(:require-macros [cljs.core.async.macros :refer (go alt!)]) | |
(:require [cljs.core.async :refer (>! close! put! chan )])) | |
(defn parallel-chan-map | |
"Read in-chan and put result of `(apply f in-chan-value args)` on out-chan, | |
potentially running items in parallel and yielding results out-of-order. | |
Function f must return something takeable (e.g. a go-block, channel, promise), | |
in essence spawning a \"subprocess\" which this function manages as a pool |
OlderNewer