Skip to content

Instantly share code, notes, and snippets.


Sean Jensen-Grey seanjensengrey

View GitHub Profile
class StackModule:
def __init__(self):
self.items = []
def __repr__(self):
return repr(self.items)
def push(self, value):
seanjensengrey /
Created Sep 11, 2021
computation advances faster than heuristics


The Bitter Lesson

Rich Sutton

March 13, 2019

The biggest lesson that can be read from 70 years of AI research is that general methods that leverage computation are ultimately the most effective, and by a large margin. The ultimate reason for this is Moore's law, or rather its generalization of continued exponentially falling cost per unit of computation. Most AI research has been conducted as if the computation available to the agent were constant (in which case leveraging human knowledge would be one of the only ways to improve performance) but, over a slightly longer time than a typical research project, massively more computation inevitably becomes available. Seeking an improvement that makes a difference in the shorter term, researchers seek to leverage their human knowledge of the domain, but the only thing that matters in the long run is the leveraging of computation. These two need n

apt-get remove docker docker-engine containerd runc
apt-get install \
  apt-transport-https \
  ca-certificates \
  curl \
  gnupg \

Instance level metadata urls

Both AWS and GCP, probably Azure as well, offer the ability to query instance level metadata from within the guest (and container)

Both cloud use the same IP address ( internally to handle the request.

tl;dr, do a get request against the metadata url and look at the response headers.

from collections import Counter
import random
a = ['r'] * 99 + ['w']
b = ['w'] * 99 + ['r']
t = [a,b]
seanjensengrey /
Created Feb 16, 2020
throttling mdworker on osx
#! /bin/bash
# from
# Description:
# If you want to decrease the CPU demands for an application
# you can use this very simple and ugly "hack".
# I use it when I convert videos on my MacBook Pro
# to prevent it from getting to warm. Even if the CPU is IDLE this hack
# will prevent the application to use the CPU during Sleep Time
# (in contrast to renice/nice commands which will take all IDLE time).
In [17]: (a, (b)) = (1, (2,3, ([4,5,6])))                                                                                                                     

In [18]: b                                                                                                                                                    
Out[18]: (2, 3, [4, 5, 6])

In [19]: (a, (b,e,(f))) = (1, (2,3, ([4,5,6])))                                                                                                               

In [20]: a                                                                                                                                                    
Out[20]: 1

$java -XX:+PrintFlagsFinal -version

[Global flags]
ccstrlist AOTLibrary                               =                                          {product} {default}
      int ActiveProcessorCount                     = -1                                       {product} {default}
    uintx AdaptiveSizeDecrementScaleFactor         = 4                                        {product} {default}
    uintx AdaptiveSizeMajorGCDecayTimeScale        = 10                                       {product} {default}
    uintx AdaptiveSizePolicyCollectionCostMargin   = 50                                       {product} {default}
 uintx AdaptiveSizePolicyInitializingSteps = 20 {product} {default}