Stacoscimus Blog

!$

Published Sun 20 July 2014

There are plenty of posts around describing things that can be done at the command line with Bash history, but the first step into a smörgåsbord of functionality is almost always through a single convenient doorway. This doorway is !$, which Bash expands to the last argument of the previous issued command.

How often do you edit a file and commit changes?

$ vi data/science/project.py
# Make some changes
$ git add !$
$ git commit -m 'What a nice change that was!'

Or how about moving a file before editing it?

$ mv some/long/path/to/a/file.mdown some/long/path/to/a/file.md
$ vi !$

Though it looks weird onscreen, !$ is actually kinda enjoyable to type as well; it just feels good to fork the '1' and '4' keys while holding shift with the right pinkie. It's a straightforward and memorable gesture that the strange '!$' combination belies.

TL;DR: 10/10, would use again.

CSS from the ground up

Published Sun 20 July 2014

CSS is a wild and wooly world to dive into --- it seems that the lion's share of CSS floating around the web is not particularly well-written. After all, the visual paradigm it addresses can really encourage a "tweak-till-it's-right" kind of approach.

Starting from the ground up, on the other hand, is really the only way to fully understand what it is your site is doing. Luckily, the Pelican static site generator does a fantastic job providing a straightforward set of html templates known as the 'simple' theme. Over the course of two days it was straightforward to assemble a dynamic one-or-two-column layout, inspired greatly by Giulio Fidente's work.

One important thing I've learned about CSS is to avoid w3schools as a resource! There are so many inaccuracies, and poor advice. Better to use the Mozilla CSS docs, or better yet, go to the W3C horse's mouth directly. CSS-Tricks is also a fantastic resource.

Other lessons learned:

  • Avoid 'absolute' positioning and favor blocks and floats when possible.
  • Relative (ie., percentage-based) and absolute measures for layout elements don't really play nicely together. I used percentage-based widths at the body-level <nav>, <main>, and <footer> CSS stylings, and then drew things such as one-pixel borders and set pixel-based padding to <div> elements nested immediately within.
  • Use the @media queries provided by CSS to construct dynamic layouts!

Posting code in WordPress

Published Sat 18 January 2014

Looks like I'll be using this blagoblog as a platform for messing around a bit with code. Particularly, I suspect I'll try to start sharing a few things here or there that I learn as I try to hack into NES chips, and demonstrate what's going on with the synthesizers inside.

This is what a Github Gist looks like when embedded, simply by pasting the script tag directly in:

Another option would be to use HTML code and pre tags as formatted using the Crayon plugin. Here's the result of "pre" tags, after removing all of the overzealous eye candy that Crayon comes in with.

Or pre tags:

import derp

print derp.blat()

Yup, it looks like using code and pre will be the best option! Three cheers for editing in raw text mode! Now all that remains is to figure out how to get the Wordpress editor to ignore hard line breaks when I put them in paragraph tags. Ooof!

UPDATE: Adding remove_filter( 'the_content', 'wpautop' ); to the functions.php file for a theme will take care of the auto-insertion of br and p tags. Huzzah!

Nomi!

Published Fri 18 October 2013

Nomi

I'm happy to say that my customer engagement startup, Nomi, has secured Series A funding! Here's looking forward to ever-improving products and fascinating analytics.

Crowd-sourcing or Expert-sourcing?

Published Sat 02 March 2013

Crowd-sourcing is sometimes pitched, deliberately or not, as a sort of cure-all artificial intelligence, when in fact it is essentially averaging. The problem is, of course, that averaging eliminates individual differences and homogenizes instead of specifying. Naive "crowdsourcing" would lead every single shoe to be size 9.

As always, useful/interesting inference comes from intelligently specifying sources of variance.

Machine Learning or Statistical Learning?

Published Thu 28 February 2013

After spending plenty of time jumping back and forth between "machine learning" folks and statisticians, I finally am learning how to translate between these two communities, who do essentially identical things.

Machine Learning is a specialty of engineers, and an outgrowth of artificial intelligence research. People with machine learning expertise talk about prediction and learning using "features." This learning can be supervised or unsupervised. Machine learning folks tend to find brute-force solutions to problems with effective algorithmic optimizations. Even when Monte Carlo techniques are the enlightened machine learner's best friend, sampling methodologies don't often enter into the equation.

Statisticians are applied mathematicians, and many are methodological philosophers. Statisticians see the world in terms of central tendency and dispersion instead of hits and misses, and we use variables instead of features. We infer and predict, using regression, estimation (supervised) or clustering. While using the same basic techniques and technologies as Machine Learners, we live at the population level instead of the unit level. That's why sampling methods are so important to us, why we allocate variance, and why we lean on mathematical theorems.

The frequentist/Bayesian distinction is trivial compared to the statistician/engineer divide, at least in terms of tradition. But in the end, the tools and techniques overlap hugely. Learning both perspectives is always the best.

iRb Corpus Released

Published Fri 01 February 2013

After a solid year of conversion, editing, and tagging, the iRb corpus is available in **jazz format at the Cognitive and Systematic Musicology Laboratory website. This corpus represents some 1186 individual songs, each encoded into **jazz, a new Humdrum-like specification.

Using tools from Craig Sapp's Humdrum extras as well as the bundled jazzparser.sh script, you can convert individual song files to the following sort of flat representation:

**jazz    **kern  **exten **solfa **mint  **quals **dur
*thru     *thru   *thru   *thru   *thru   *thru   *thru
*M4/4     *M4/4   *M4/4   *M4/4   *M4/4   *M4     *M4/4
*D-:      *D-:    *D-:    *D-:    *D-:    *D-:    *D-:
2E-:min7  E-      min7    re      [E-]    min7    2.0000
2B-7b13   B-      7b13    la      P5      dom     2.0000
=         =       =       =       =       =       =
2E-:min7  E-      min7    re      P4      min7    2.0000
2A-7      A-      7       so      P4      dom     2.0000
=         =       =       =       =       =       =
2D-:maj7  D-      maj7    do      P4      maj     2.0000
2G-7      G-      7       fa      P4      dom     2.0000
=         =       =       =       =       =       =
*-        *-      *-      *-      *-      *-      *-

Because date information is available, large diachronic studies are possible. For a taste, here is a plot of changes in jazz chord usage over time:

Plot of ii-V-I and other jazz chord progression usage over time

A complete writeup will soon be available in Music Perception.

Panksepp's Affective Neuroscience

Published Thu 21 June 2012

Jaak Panksepp's most excellent book was a stunningly thorough explication of a particular view of emotions---that they originate in evolutionarily ancient neural pathways which are profitably studied using animal models.  The conclusion is immediate: animals such as dogs, cats, rats, and apes most likely do experience emotional states, and moreover homologous systems mediate human emotions.

The systems Panksepp details in fine neurochemical, neuroanatomical, and behavioral detail are SEEKING, RAGE, FEAR, LUST, CARE, PANIC, and PLAY, capitalized to distinguish the theoretical construct from the common use of these terms.  Uniting experimental results from animal research with common psychopathologies, Panksepp self-consciously makes the necessary conceptual steps to paint a fascinating picture of the neurobiological basis of human affect.

Panksepp's Figure 3.5, "The Major Emotional Systems."

Best read in a long time; very highly recommended.  More here.

MS Statistics Complete

Published Sun 10 June 2012

As of today, I've earned my Master of Science in Statistics.  It's been a fantastic journey these last two years---I couldn't have forseen how much statistics would speak to me.  My advisor, David Huron, had merely suggested I take some statistics courses.  Wanting to learn the theory underlying the practice, I enrolled in the first graduate statistical theory course without even knowing what a cdf was.  Special thanks to the excellent instructors I've had the pleasure of working with and learning from: Steve MacEachern, Noel Cressie, Mario Peruggia, Michael Fligner, Douglas Critchlow, Chris Hans.

Statistics isn't only a broadly-applicable toolkit for solving problems, it's also a way of looking at the world, and choosing which joints should be sharply carved and which must remain fuzzy.  I'm eager to begin applying this technology to important and interesting problems!

ABD in Music Theory

Published Wed 06 June 2012

I've now passed my candidacy exam for my doctoral studies in Music Theory, making me officially All-But-Dissertation (ABD)!  This means I'll be able to spend my fellowship year working on a dissertation and shore up several papers for publication.  Special thanks to David Huron, Gregory Proctor, David Clampitt, and Robert Ward for sitting on my committee and wading through 150 pages of Yuri-style purple prose!

Newer Entries Older Entries