Skip to content

Instantly share code, notes, and snippets.

View jxnl's full-sized avatar

Jason Liu jxnl

View GitHub Profile
@blakethepatton
blakethepatton / upgrade-script.md
Last active April 13, 2023 13:18
Upgrading ubuntu 15.04 to 15.10 and to 16.04
sudo sed -i -re 's/([a-z]{2}\.)?archive.ubuntu.com|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list
sudo apt-get update && sudo apt-get dist-upgrade

mkdir wily && cd wily
wget http://old-releases.ubuntu.com/ubuntu/dists/wily-updates/main/dist-upgrader-all/current/wily.tar.gz
tar -xzf wily.tar.gz

sed -i -re 's/([a-z]{2}\.)?archive.ubuntu.com|security.ubuntu.com/old-releases.ubuntu.com/g' Ubuntu.info
sed -i -re 's/([a-z]{2}\.)?archive.ubuntu.com|security.ubuntu.com/old-releases.ubuntu.com/g' Ubuntu.mirrors
@jxnl
jxnl / Three_Point_Newton–Cotes_formula.py
Last active August 29, 2015 14:00
A staple of scientific data analysis and engineering this is my implementation of Simpson's Rule as the sum on a list comprehension. It takes advantage of compositing Midpoint and Trapezoid rules.
def simpson(a, b, f, N):
return (1.0 / 3.0) * (2 * (((b - a) / N) * \
sum(f(v) for v in [i * ((b - a) / (2. * N))\
for i in range(2 * N + 1)][1:2 * N + 1:2]))\
+ (((b - a) / N) * ((f(a) + f(b)) / 2.0 + sum\
(f(v * ((b - a) / N) + a) for v in xrange(1, N
)))))
# int_0^1 x^2 + 2 + 2 = 1/3
print simpson(0,1,lambda x:x**2+x*2+2, 100)
@debasishg
debasishg / gist:8172796
Last active August 24, 2024 13:55
A collection of links for streaming algorithms and data structures

General Background and Overview

  1. Probabilistic Data Structures for Web Analytics and Data Mining : A great overview of the space of probabilistic data structures and how they are used in approximation algorithm implementation.
  2. Models and Issues in Data Stream Systems
  3. Philippe Flajolet’s contribution to streaming algorithms : A presentation by Jérémie Lumbroso that visits some of the hostorical perspectives and how it all began with Flajolet
  4. Approximate Frequency Counts over Data Streams by Gurmeet Singh Manku & Rajeev Motwani : One of the early papers on the subject.
  5. [Methods for Finding Frequent Items in Data Streams](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.187.9800&rep=rep1&t
@huyng
huyng / matplotlibrc
Created February 8, 2011 15:50
my default matplotlib settings
### MATPLOTLIBRC FORMAT
# This is a sample matplotlib configuration file - you can find a copy
# of it on your system in
# site-packages/matplotlib/mpl-data/matplotlibrc. If you edit it
# there, please note that it will be overridden in your next install.
# If you want to keep a permanent local copy that will not be
# over-written, place it in HOME/.matplotlib/matplotlibrc (unix/linux
# like systems) and C:\Documents and Settings\yourname\.matplotlib
# (win32 systems).