Log in

David II
[Most Recent Entries] [Calendar View] [Friends]

Below are the 20 most recent journal entries recorded in util's LiveJournal:

[ << Previous 20 ]
Tuesday, October 23rd, 2012
3:05 am
I see the light of the screen on my knee. I see the lamp outside that'll be on all night through a crack in the shades. I hear them breathing sleeping. I hear it raining. Before that I heard the hiss of the sprinklers watering the wet grass.
Tuesday, February 7th, 2012
10:42 pm
I hear the light humming besides my head. I see its fluorescent form dimly through the fiber of the paper and the grid of wood. The bumps on the wall cast a halo of shadows around it. Beside me is my wife. In the corner is a crib.
Friday, February 3rd, 2012
8:18 am
frankthegoat, RIP
From Brad Fitzpatrick's Google Plus account:

No announcement here: http://brad.livejournal.com/


(I remember disliking emoticons. Now sometimes I'm not sure how to express an emotion non-weirdly in e-text without one.)
Tuesday, August 23rd, 2011
9:36 am
For the time being, I'm moving most of my activities over to Google Plus: https://plus.google.com/117808384777851490555/posts I guess four has already gotten to most of you, but if you'd like an invite, just let me know how to get it to you.

(I miss a lot of the formatting features from here as well as the community, but the recent service outage really annoyed me as do the ads.)

Guess you've seen this elsewhere, but this looks pretty slick, eh: http://www.codecademy.com/

Maybe I will try going here: http://www.uufs.org/home/Activities.php

Anyway, here are some words:
The hobbled had a habit of tying down the birds.
They'd wrap their wings in bubble gum and stuff their mouths with turds.
Then the birds were hobbled and the hobbled had some birds.

A woo, a roo, a kangaroo.
The daisy's got some dander.
The lazy've got a panda.
If they feed her, they expand her.
But they're lazy so she's a skinny not-a-bear.
Wednesday, July 13th, 2011
7:51 am
Grouped: How small groups of friends are the key to influence on the social web. A Brief Introduction to Graphical Models and Bayesian Networks. Edward Tufte’s “Slopegraphs".

Corruption Perceptions Index 2010. (Why would you use a background image for header text?) How well does perceived corruption correspond with real corruption? How fair are elections in Singapore? How much privilege does the family of the Lee Kuan Yew enjoy?
Saturday, July 9th, 2011
11:30 pm
Yesod Web Framework. The future of data analysis (1962) from Tukey. JavaScript AST trickery with burrito. U.S. life expectancy declines. British PM announces inquiry into tabloid scandal, calls for new press regulation system. England seems less attractive. What is the best governed country in the world as of now? (What is the best governed state within the US?) What do current trends point to? Congress Tries To Hide Massive Data Retention Law By Pretending It's An Anti-Child Porn Law.

Ask HN: Best Python Framework for Google App Engine?. Divide-and-Conquer Matrix Factorization. Bayes' rule in Haskell, or why drug tests don't work. (Also relevant to airport security.) A single paper everyone should read?.

漫画 = cartoon. Text as text: "今天我来给大家示范一下怎么样杀海象", "你这里有点脏哦", "哪里". (You can see I still haven't figured out how to type a few of the characters.) 给 (gei3) = to give. 示范 (shi4 fan4) = demonstration. 杀 (sha1) = to kill. 海象 (hai3 xiang4) = walrus. (海 = sea, as in 上海 (Shanghai), 象 = elephant.) 脏 (zang4) = dirty. (I kind of wonder if I'm missing some political or racial message behind this.)

"Frequentist statistics, as I understand the term, is an approach for evaluating statistical procedures conditional on some family of posited probability models." -- Andrew Gelman in a rejoinder to his mock anti-Bayes piece [PDF]. Would most "frequentists" agree with this? What about the definition of probability? Does that not enter? Or is that implicit somehow?

Cory Maye Freed After 10 Years In Prison: The Back Story. Oh Yes You Can Use Regexes to Parse HTML!.
Sunday, July 3rd, 2011
2:29 pm
Wednesday, June 29th, 2011
12:16 am
I guess this is compiled from CoffeeScript (but is still pretty nice and readable): http://disaster.mmx-dns.com/js/_/heatmap.js -- why does (CoffeeScript?) execute the wrapped code with .call(this) rather than just ()? Is that to make it easier to embed CoffeeScript inside of JavaScript, eg, function javaScriptFoo() { ~~ CoffeeScript blah blah this something ~~ }? Do they support mixing the languages like that? dynamic visualization LEGOs.

How much slower is Math.pow(d, 2) than d * d? Gonna guess a lot unless V8's smart enough to recognize the transform. figue.js. Looks like they could get away without the sqrt in a few places too? Have not tried submitting any patches yet.

The rise of interactive data visualization. (Congrats!)

Paper.js. (Too much stuff in global scope? Or saving keystrokes? Looks fun.) How to take advantage of Redis just adding it to your stack. Flask 0.7 Released (Python Web Framework). Flask. Neo4j 1.4 M05 - "Kiruna Stol" Midsummer Celebration.


Why Programming Languages? bayespolr: Bayesian Ordered Logistic or Probit Regression.
Tuesday, June 28th, 2011
8:49 am
"Why I'm leaving TechCrunch": "It was no longer enough just to cover other people's stories." (Right smart single quote = char code 8217.) Interrobang (?!) ‽. Pilcrow ¶ (paragraph mark). Asterism ⁂. Write your first MapReduce program in 20 minutes. Quantum computing for the determined. Everyday the questions are: "What have I learned today?" "What have I done today?" Pilcrow?! Pilcrow?! Pilcrow?!
Monday, June 27th, 2011
12:20 am
Solving CAPTCHAs using Probabilistic Programming. (Sounds neat.) Navia Systems: Further reading and Publications. (Look great.)

guider.js from Optimizely: Using the module pattern but using naming convention to keep stuff private? Global state, making it harder to have several instances living together in the same document? (Not sure why you would want to do that.) var omitHidingOverlay = myGuider.overlay ? true : false; Curious what would go wrong if they simply used myGuider.overlay here. Types are Anti-Modular.

Poll: What database does your company use? How to Become a Great Finisher. Computer vision (online book). ANALYTIC COMBINATORICS by Flajolet and Sedgewick. generatingfunctionology [PDF].

Why you should never go to the hospital in July. (Residencies start then.) Congressional Trading on Advance Info Not Illegal: SEC.
Wednesday, June 22nd, 2011
9:26 am
Thursday, June 16th, 2011
10:27 pm
Just opened up my old laptop after several months of letting it sit idle in order to rescue my Skype credit. (Bastards.) I see a battery with an X: "No batteries available". :-(

That BLUP is a Good Thing: The Estimation of Random Effects. This FTP site. CoffeeScript. Estimating Causal Effects from Large Data Sets Using Propensity Scores.


Wow: JavaScript MP3 player. JavaScript PDF reader. Video of Brendan Eich and Jeremy Ashkenas. The Little Book on CoffeeScript. Male "biological clock".

Two's complement of -1 = 1 1 ... 1 0 + 1 = 1 1 ... 1
~ 11 ... 1 = 0
So, !!~'abc.indexOf('d') === false. Fun.

CoffeeScript existential assignment operator: hash ?= {}. Love it.
Not quite as in love with { a, b } = someObject. For some reason, it makes me uncomfortable to (I guess) use the names of the new variables on the left hand side also for matching on the object on the right. For example, what happens if I have?:
[{a: {b}}, {a: {c}}] = x
Ah, from the translated source here, it looks like only the lowest level names get exposed as CoffeeScript variables. That seems the right thing to do. But then how about this case?
[{a}, {a}] = x
That is, try to get the 'a' field from the two objects in array x. I wonder if people would find the following syntax nice (if some alternative is not already there):
[{a1=a}, {a2=a}]
That is, imagine evaluating the assignment operation within the context described by the pattern.

Understanding V8


If you consume a diuretic (and I guess some commonly ingested items are to some degree), does that make pee color a less accurate indicator of whether you're dehydrated or not?

Is headache commonly correlated with having toxins in the blood that may be stressing your liver already? Does this suggest being careful about taking pain relievers for headache relief if they also stress the liver?

What happens if you give someone a caffeine/amphetamine drip while they're sleeping?
Wednesday, June 15th, 2011
10:24 pm
A Whole Bunch of Amazing Stuff Pseudo Elements Can Do. Whiley, a programming language with extended static checking. (Notice they mentioned JML.) Why developers should be force-fed state machines. asciiflow (Have wanted to create something like this for a while. Maybe I still will.) Scala: The Static Language that Feels Dynamic by Bruce Eckel. (Did you like "Thinking in Java"? I found it a little wordy and gave up, but I will try this.) Loren wants to work at AirBnB. (How hard would it be keep the feel of the title banner but use real text for it?) Principles of Uncertainty (free download!). TIME BIAS CORRECTED STATEWIDE-REGIONAL-NATIONAL TEMPERATURE-PRECIPITATION. Survey analysis in R. Using APL2 to Create an Object-Oriented Environment for Statistical Computation. Introduction To Machine Learning. Don’t get burned by heatmaps. Controversy over the Christakis-Fowler findings on the contagion of obesity. (Not so interested in the main content as in the references mentioned in passing.) "Incanter is a Clojure-based, R-like platform for statistical computing and graphics." A BRIEF OVERVIEW OF THE CLOJURE WEB STACK. Apache Lucy.

Rx Drug Shortages: Regulation Can Be Deadly.
Sunday, June 12th, 2011
10:45 am
This thread Ten things I didn’t know about MongoDB gives me a less positive impression of MongoDB. Rich Hickey: "I read relentlessly. I don’t do any programming not directed at making the computer do something useful, so I don’t do any exercises. I try to spend more time thinking about the problem than I do typing it in." (No exercises = no toy programs?) Clojure Bookshelf. Hal Abelson. (What do you think of the idea of encouraging students to think about finding interesting, worthwhile problems as part of the course?) Hadley Wickham. Advanced R development. Software for Data Analysis: Programming with R. Curry–Howard correspondence. Unboxed union types in Scala via the Curry-Howard isomorphism. HN. Evaluating Text Extraction Algorithms (Interesting. Small thing: seems if any largely non-ASCII docs, eg, Chinese, were included, this could add some bias (bump up everyone's score up) since the cleaning step would leave them basically empty, ie, pretty easy to get right. What do you think of the 3D bar charts?)

Two Dogmas of Empiricism. The Intelligent Investor (Out of date?) Python progression path - From apprentice to guru. APL FAQ. Nial Open Source Project (follows in the path of APL). Michael Friendly: Milestones in the History of Thematic Cartography, Statistical Graphics, and Data Visualization.

The Joy of Concatenative Languages Part 1. The Joy of Concatenative Languages Part 2: Innately Functional. The Joy of Concatenative Languages Part 3: Kindly Types. The Cat Programming Language. ADVANCED COMPUTER SCIENCE COURSES.
1:16 am
Hm, now that I think about, I often spend several hours a day programming (or debugging, planning, and researching in support of programming). I still want to do much more, but smarter. Creator of Calif.'s colorful "Phonehenge" convicted on 9 counts; jury to keep deliberating. (Whose safety was threatened by it?) Statistical Data Mining Tutorials. New patches to speed up R 2.13.0. Gazelle: a system for building fast, reusable parsers (Will there be a fork called "cheetah"?) Announcing: "hashtables", a new Haskell library for fast mutable hash tables. Workshop In Computer Construction - From Nand to Tetris. The Elements of Computing Systems: Building a Modern Computer from First Principles.

Relativistic quantum chemistry. (Relativity explains some atomic properties! Wild!)

JavaScript template language shootoff. Hello Backbone.js. _.bind.
Any major reason to prefer slicing the arguments array over constructing an array with obj?
Read more...Collapse ) Oh, yes. bind can do more than just bind this.

APL syntax and symbols. What's your favorite operation here? Is there any open source implementation of APL? partial CoffeeScript implementation.

Mysterious number 6174.
Saturday, June 11th, 2011
5:24 pm
Subsidize this
I get e-mailings from Senator Grassley occasionally. Today I got another. The following sections seemed somewhat at odds.
Keeping Integrity in the Farm Program
This week I introduced bipartisan legislation that would put a hard cap and other safeguards on payments farmers can receive from the federal farm program. The goal is to preserve the safety net that is so important for agriculture and, in turn, the abundant and affordable food supply the rest of us depend on.

Free Trade Should be Fair Trade
International trade opens new markets for U.S. products and supports good-paying jobs in the United States. Likewise, international trade presents goods and services to U.S. employers and consumers that fuel commerce and choice. I push for new trade agreements, like the pending agreements with Korea, Colombia, and Panama, to present new opportunities for U.S. farmers, manufacturers, and the services industry, including energy, financial and insurance firms. Trade is supposed to be a two-way street. But sometimes a U.S. company is harmed by the improper actions of trade partners under international rules. A company based in another country might flood the U.S. market with products that are unfairly subsidized by their governments.
(I think it's a lie that much of the US farm programs aim at making food more affordable and abundant, and I think Grassley knows that it's a lie. But ignoring that, is this not displaying either incredible hypocrisy or incredible lack of perspective?)


Out walking this morning, I saw grass still wet from the sprinklers the night before. The water in the pond with the ducks and geese was blue green as ever. A tulip tree flower lay on the ground. I picked it up and brought it home.
Sunday, June 5th, 2011
11:59 pm
Saw two snakes in Tilden Park, one coiled up not moving, the other slithering. Saw five large banana slugs and one small one. Saw two pill bugs locked together. Smelled a candy cap mushroom -- it does smell like maple syrup -- but didn't take any home to eat.

Awk arrays seem similar to JavaScript arrays in a few ways -- common ancestor?

Bayesian Inference for Categorical Data Analysis: A Survey [PDF] (Jeffreys prior for multinomial is Dirichlet with all alpha_i = 0.5. How do people generally view the use of Jeffreys priors today?)

Public safety officers watched as man drowned. Are you an asker or a guesser. Blunt and necessary review of programming language books. (Everyone likes K&R.) Perceptual hashing. Clack: Lisp Web framework. “$<-” and environments. (Use env[[name]] <- x.) Algorithms for Massive Data Sets.

Philosophy and the practice of Bayesian statistics in the social sciences [PDF]. Does bringing in "falsification" add enough to justify use of the term when you can think instead in terms of "adequacy"?

Notes on structured programming [PDF]. An axiomatic basis for computer programming (1969). The Next 700 Programming Languages [PDF]
10:33 am
Exploratory model analysis with R and GGobi [PDF]: "Firstly, the t scores for infant mortality are very similar over all models. This indicates that this variable is largely independent of the other explanatory variables." (What's a real world situation if any where you might expect this to be misleading?) Selecting Amongst Large Classes of Models [PDF]. (Makes me think of the cross validation article.)

Please don't delete your old stuff. An Executable Semantics For C Is Useful. c-semantics. Ask HN: Do Americans stand a chance on freelance sites?. (People say "yes".) Xavier Leroy.

Integration by integration under the integral sign. Integration by differentiation of parameter. (I finally encountered the latter in a grad school stat class.)

Reading Code From Top to Bottom by Tom Duff. (HN) (Avoid deep nesting for better readability.) Shareware Amateurs vs. Shareware Professionals.

esoteric R: introducing closures. Does function itself not create a closure?
f <- (function() {
  x <- 3
  return(function(y) x * y)
> do.call(f, list(y=1:10))
 [1]  3  6  9 12 15 18 21 24 27 30
Seems we can abstract out an "addMethod" function:
addMethod <- function(env, name, func) {
  # Since env is assumed to be an environment,
  # would it add anything to instead assign
  # as.environment(env)?
  environment(func) <- env
  env[[name]] <- func

queue <- function() {
  e <- new.env(hash=TRUE)
  e$.queue <- NULL
  addMethod(e, "push", function(x) {
    .queue <<- c(.queue, x)
  addMethod(e, "pop", function() {
    val <- .queue[1]
    .queue <<- .queue[-1]
(One problem with this: every queue instance gets its own copies of the functions.)
Saturday, June 4th, 2011
1:07 am
What are your favorite tools for manipulating data programmatically (ie, not through a spreadsheet or other GUI)? What is the best data-manipulation heavy code you've seen in JavaScript (or any language)?

Here are a few things I plan to return to in thinking about this:
d3.js and Sylvester.
R Language Definition
plyr and reshape from Hadley Wickham.
The GNU Awk User's Guide.
Matlab tutorials.
Kenneth E. Iverson.
Numpy and Scipy Documentation.
Friday, June 3rd, 2011
9:00 am
I've woken up early the past two mornings. Maybe it's because I ate too much the nights before. Our African violets are blooming now, pink and purple.

Plots of jQuery easing functions. Fun! Should $.each automatically add a counter variable telling you how many elements have been seen thus far or is that not generally useful enough to justify the overhead? (Noticed the author did this, and I think I may have done this at some point in my own code.) Is the code depending on the leniency of the HTML parser to get self-closing tags to work, eg, $('<div/>')? (Sounds like it is a jQuery thing: Some jQuery Shortcuts.) Trick for iterating over the range 0 to width - 1: $.each( new Array( width ), function( position ) { ... }). (Unnecessary 2nd test for "jswing"? Would it be better to redefine impl outside of the loop in case of "linear"? Then no need for testing and special-casing inside?)

Say you have X_i, i = 1 to n, iid Binomial(k, p). Two ways of estimating the variance of mean(X_i):
V = mean(X_i^2) - mean(X_i)^2
W = Phat * (1 - Phat) / (n * k) with Phat = sum(X_i) / (n * k)
How do their variances compare? Let's see:
Wikipedia reminds me that the mgf for Binomial(n, p) is (1 - p + p*exp(t))^n. Var(X_i^2) = E[X_i^4] - E[X_i^2]^2 = (d^4 / dt^4 mgf)(t=0) - (Var(X_i) + E[X_i]^2).
We can get the 4th derivative in R with the following:
Dn <- function(expr, name, n, args) {
  for (i in seq(length.out=n)) {
    expr <- D(expr, name)
  f <- function() {}
  formals(f) <- args
  body(f) <- expr
Eg, Dn(expression((1 - p + p*exp(t))^k), "t", 4, list(t=0, k=10, p=0.05))() yields 2.6465. (Especially since it doesn't do simplification, the corresponding expression is a huge mess. Not sure if R has tools for simplifying expressions built-in.) sum(X_i) is distributed as Binomial(n * k, p) so that Var(mean(X_i)^2) = Var(sum(X_i)^2 / n^2) = Var(Binomial(n * k, p)^2) / n^4, which you can approach the same way. So, I think the following function computes the variance for the first variance estimator:
bin4th <- Dn(expression((1 - p + p*exp(t))^k), "t", 4, list(t=0, k=NULL, p=NULL))
binSqVar <- function(k, p) bin4th(k=k, p=p) - (k * p * (1 - p) + (k * p)^2)^2
VarV <- function(n, k, p) {
  binSqVar(k=k, p=p) / n - binSqVar(k=n * k, p=p) / n^4
Check that this gives a reasonable answer:
> VarV(10, 5, 0.3)
[1] 0.398223
> V <- function(y) mean(y^2) - mean(y)^2
> var(replicate(10000, V(rbinom(10, 5, 0.3))))
[1] 0.1810281

Nope! I did something wrong. I'll come back to this sometime later.

// Hm:
> bin4th(k=5, p=0.3)
[1] 24.792
> mean(rbinom(100000, size=5, prob=0.3)^4)
[1] 24.92877
> binSqVar(k=5, p=0.3)
[1] 13.902
> var(rbinom(100000, size=5, prob=0.3)^2)
[1] 13.8865
> binSqVar(k=5, p=0.3) / 10
[1] 1.3902
> var(replicate(10000, mean(rbinom(10, size=5, prob=0.3)^2)))
[1] 1.385060
> binSqVar(k=10 * 5, p=0.3) / 10^4
[1] 0.991977
> var(replicate(10000, mean(rbinom(10, size=5, prob=0.3))^2))
[1] 0.9944227
> 1.3902 - 0.991977
[1] 0.398223
[ << Previous 20 ]
My Website   About LiveJournal.com