Skip to content

Instantly share code, notes, and snippets.

View eob's full-sized avatar

Ted Benson eob

View GitHub Profile
p (char *) [data bytes]
<body>
<table width="100%">
<tr>
<td colspan=3>
</td>
</tr>
<tr valign="top">
<td width="15%"> <div ex:role="facet" ex:expression=".venue" ex:facetLabel="Venue"></div>
def initializeToCrfPotentials = {
for (tweetIdx <- 0 until _Y.size) {
for (tokenIdx <- 0 until _Y(tweetIdx).size) {
for (labelIdx <- 0 until _Y(tweetIdx)(tokenIdx).size) {
// Note: the +1 in token index is because of the <S> token at the beginning
// of the CRF potentials.
logger.info(tweetIdx + " " + tokenIdx + " " + labelIdx)
_Y(tweetIdx)(tokenIdx)(labelIdx) = _crfPotentials(tweetIdx)(tokenIdx + 1)(labelIdx)
}
}
def initializeToCrfPosteriors = {
_Y = emptyY // Initialize to all 0s
require (_Y.size == _crfPotentials.size) // Santiy check: both are over tweets
for (tweet <- 0 until _crfPotentials.size) {
_forwardBackward.setInput(_crfPotentials(tweet))
val nodeMarginals = _forwardBackward.getNodeMarginals()
val nonBorderMarginals = nodeMarginals.slice(1, nodeMarginals.size - 1)
@eob
eob / gist:718298
Created November 27, 2010 21:35
Alignment Update
/**
* log q(Z_i = k) less than or equal to
* log P(Z_i=k) (the prior)
* + log E_ { q(y_i),q(T_k) } Theta^T_REW f_REW(x_i,y_i,T_k)
* - log E_ { q(T_k) } Z_ { x_i } (Theta, T_k)
*/
def update(td: TaggingDistribution, rd: RecordDistribution) = {
// Initialize to all -Infinity
_Z = logEmptyZ()
@eob
eob / gist:718300
Created November 27, 2010 21:38
Record Update
def update(td: TaggingDistribution, ad: AlignmentDistribution) = {
/*
* Setup: Create an empty set of records
*/
var TPrime = List[Record]()
for (i <- 0 until _T.size) {
val r = new Record(i, _schema)
r.setThetaRewrite(_T(i).thetaRewrite)
TPrime = TPrime :+ r
}
@eob
eob / gist:731611
Created December 7, 2010 09:23
Why Scala Syntax is Scary
object ListCase {
def matcher(l:List[Int]) {
l match {
case List(1,3,5,7) => println("Primes")
case List(_,_,_,3,_) => println("3 on 3")
case 1::rest => println("List starting with 1")
case List(_*) => println("Other list")
}
}
}
List: openbsd-tech
Subject: Allegations regarding OpenBSD IPSEC
From: Theo de Raadt <deraadt () cvs ! openbsd ! org>
Date: 2010-12-14 22:24:39
Message-ID: 201012142224.oBEMOdWM031222 () cvs ! openbsd ! org
[Download message RAW]
I have received a mail regarding the early development of the OpenBSD
IPSEC stack. It is alleged that some ex-developers (and the company
they worked for) accepted US government money to put backdoors into
@eob
eob / people.html
Last active October 13, 2015 23:07
HTML for the People page of the CSAIL BD Site
<div class="insert-exhibit">
<link href="http://bigdata.csail.mit.edu/datapress/user/role/principal%20investigators/json" rel="exhibit/data" type="application/json">
<style>
/*
* These get rid of the extra bits that Exhibit takes the liberty of adding.
* ------------------------------------------------------------------------------
*/
@eob
eob / research.html
Last active October 13, 2015 23:08
HTML for Research Exhibit on CSAIL BD Site
<div class="insert-exhibit">
<link href="http://bigdata.csail.mit.edu/datapress/node/type/research/json" rel="exhibit/data" type="application/json">
<style>
/*
* These get rid of the extra bits that Exhibit takes the liberty of adding.
* ------------------------------------------------------------------------------
*/