Skip to content

Instantly share code, notes, and snippets.

sealed abstract class Expression
case class X() extends Expression
case class Const(value : Int) extends Expression
case class Add(left : Expression, right : Expression) extends Expression
case class Mult(left : Expression, right : Expression) extends Expression
case class Neg(expr : Expression) extends Expression
def eval(e : Expression, x : Int) : Int = e match {
case X() => x
case Const(c) => c
case point
pattern (x, y): ... # 2d point
pattern (x, y, z): ... # 3d point
pattern (x, y, z, w): ... # quaternion
# etc.
Pandora: [X....X -->
Spotify: [X..X.. -->
Rhapsody: [X....X -->
Rdio: [X...X. -->
* song at index 0 is on all 4 services
* song at index 3 is only on Spotify
* song at index 4 is only on Rdio
* song at index 5 is on Pandora and Rhapsody but not Spotify or Rdio
* songs at indices 1, 2 are on no services
@fj
fj / observations.csv
Last active August 29, 2015 14:19
ARIMA issues

We're noticing two major things:

  • Occasionally, the prediction service returns illegal NaN values. This should never happen. If there's some problem with the input data it should fail immediately and raise an exception, but it shouldn't return bogus data. This series will generate a NaN:
242.0 267.0 756.0 1101.0 1211.0 1181.0 929.0 271.0 381.0 1212.0 1277.0 1265.0 1207.0 955.0 233.0 268.0 1020.0 1049.0 1140.0 1185.0 925.0 251.0 286.0 1020.0 1187.0 1094.0 1082.0 863.0 214.0 305.0 972.0 1014.0 1046.0 1046.0 929.0 213.0 285.0 1119.0 1224.0 1140.0 1062.0 862.0 234.0 273.0 1099.0
  • It's still a little too slow. Previously we had discussed not trying every possible combination of ARIMA parameters and instead just picking a few that would be representative and trying those. What is your assessment of this strategy as a tactic for speeding things up? What datasets do you need to perform this analysis and make this happen?

Keybase proof

I hereby claim:

  • I am fj on github.
  • I am jxf (https://keybase.io/jxf) on keybase.
  • I have a public key whose fingerprint is 7ABF 8675 8B7B C923 C9B6 897C FD58 7CB2 6A5D 8BEC

To claim this, I am signing this object:

From - Fri Mar 06 14:44:01 2009
X-Mozilla-Status: 0001
X-Mozilla-Status2: 00800000
X-Mozilla-Keys:
Message-ID: <49B17CF4.9070509@lists.distilledb.com>
Date: Fri, 06 Mar 2009 14:43:48 -0500
From: johnf.git@lists.distilledb.com
Reply-To: johnf.git@lists.distilledb.com
User-Agent: Thunderbird 2.0.0.19 (X11/20090105)
MIME-Version: 1.0
# Removes all Unicode BOMs from files and converts Windows CRLF to Unix LF.
find . -type f | \
while read line; \
do \
hd "$line" | grep -q 'ef bb bf' && echo "$line"; \
done | \
while read line; \
do \
echo [[[ $line; \
[johnf@genesis][2009/10/19|09:54:27]
[/tmp/tmp-dev]> git fetch
[johnf@genesis][2009/10/19|09:54:40]
[/tmp/tmp-dev]> git config --add remote.origin.fetch refs/apple/banana
# ('apple' is a user I collaborate with who's got several branches, one of which is 'banana'.)
[johnf@genesis][2009/10/19|09:55:36]
[/tmp/tmp-dev]> git fetch
From git@67.23.22.87:fruitbasket.git
* branch refs/apple/banana -> FETCH_HEAD
@fj
fj / hint.rb
Created November 25, 2009 04:40
Phone riddle for Karl Leswing. See karl.rb for more details.
;&Bh&A&&AAHBMM#HABBM##BH#Airr;::::;Xr:,,..:::;rriSi:.,:,,,,,,,,,::;::;;;rrsrriS29h;rr:r;:,r@@@@@@@#MM##MMMMB
:S@BX&GhMBHABMMAAHHAAA&2i32sr;:::::ir,.,,.;ss;,,:;S;,,:,,,,,,,,:::::;;;rrrsiisS23hr,.,,:,r@@@@@@#MBBMMBHHHHA
r;@@X2h92Ssii5isssssssir,;95r;;;::,:Xr::;;is;;r;:rr:,,:::,,,.,,:::::rs;;rrsiisS2Xhr.,,..i@@@@@@MhG&&&AG&hhAA
r:H@s;iirrrSS5SS52XXX9&i,,s3s;:::,,,r22XXsr;rrSSir;;::::::,,.,,,:;;;rrrrriSissSSXG; ,i@@@#@@@HG33hhhh&AAGA&
r:i@#&A&&AB#HABBHAHAAHMi,,:XSr;::::;r5A#&r:;rssiissrr;;;;::,.,,::;;;rrrrrsiisi223&hA&@@@@@##A9X993h339GG&G&&
r:;#@B&ABHHBAAHHAAHHAAB5::,sXs;;;;s2h&G5r;;r;;rsiiSiiisrr;:,,,,:;;;;rrrsrrsrsi52hA#@@@@@#@@@BGGAAHBHBBBBMMMH
r:;A@B33322X332553hX52Gh;;,,22r;;i9h3s;::;r;,,,,:::::;rrrr:,,,,:;;rrrssrrsiii55ShAA@@##@#M#@@GGGG&G&AAHHAAHH
r:;9@Aisi;;ih5sssSSisi2hS;,.:3Sri32s;;;;;:::;;;;:::,,,,::r;:,,;rriiisr;;rrssS5S5&GX@@@@Mhi.s@@####@@@@@@@@@#
r;;9@MSrisiAHiiSissssii92;:,.;9s25r;rS2GG3X933hhXX33SSS;:;;::;ri33XSr;rrrrssssS2H2S@@#&,.. r@@@@@@@@@@@@@##
r;;A@BrriSABH33hhhG&M#AS5;:,..rXirr53XXX252
# Merry Christmas!
open("/dev/dsp","wb"){|h|s=%q{d=["-KQW[UZbgu*HNT+]TNOOOTZ+cZTUUUUUZbagmssUZbagm
ss+wmpgja+KQW[dfnu","-KEKOINV[W*HBH+QHBCCCHN+WNHIIIIINVU[aUUINVU[aUU+YOR[^I+KEK
OXZbW","-W[acg vsc*TZ`+eaaaaa--vucavuca+eadsvs+W[dgvrtc","-K991LIL77777dIIIII--
LKKILKKI+Mad[ ^U+K991LHJK"].map{|l|l.unpack("C*").map{|c|[(c/6-4)*12/7-8,"012
35b"[c%6,1]. hex]}*4};y=32.chr;l="@"+[(m="Jnx4sn3sgd1")+"vnqkc!6sgd2Lnqc4gz
r4bnld;6/Ld s2dzqsg6qd2@bdhud6gdq2Khmf;77/Lds2du4@dqx4gdzqs6oqd2@ozqd4ghl
4qnnl,+Amc 2gdz++2 @udm 4z mc 2gdz 4@+u dm 2zm
c2mz+@stqd+r hmf",m+"E zq sg !6sgd2Sz u4@h nt q4qd hfm r; 6/Ld