Skip to content

Instantly share code, notes, and snippets.

View DLu's full-sized avatar
🤓
Pretending this is a real social network

David V. Lu!! DLu

🤓
Pretending this is a real social network
View GitHub Profile

A puzzling MathJax x Github bug

Markdown in question

A $B$ C $(D)$

renders as

A $B$ C $(D)$

Variations

@DLu
DLu / morbid_stats.csv
Last active January 3, 2021 03:30
Celebrity Death Data
We can't make this file beautiful and searchable because it's too large.
Name,Year,Length,Edits,Fame
'Abd al-Majid Nimer Zaghmout,2000,1939,51,0.46025
'Jock' Tradd,2000,2487,13,0.35125
A. (Abraham) William Hajjar,2000,7090,18,0.39654
A. D. Hope,2000,13486,165,0.58983
A. E. Ellis (author),2000,2631,15,0.36571
A. E. van Vogt,2000,51746,746,0.72478
A. H. J. Prins,2000,10800,125,0.56498
A. Jeyaratnam Wilson,2000,8087,26,0.43308
A. K. Grant,2000,1719,36,0.43205
@DLu
DLu / top_report.txt
Created April 10, 2020 01:41
Top ROS Packages (Full List)
---- ------------------------------------------------ -------
0 tf2-ros 3325544
1 tf 3259208
2 rviz 3231705
3 tf2-py 3145816
4 actionlib 3123089
5 tf2-msgs 3080931
6 tf2 3071916
7 sensor-msgs 3047194
8 robot-state-publisher 3034778
@DLu
DLu / GrowthCurve.js
Last active January 1, 2019 18:23
WHO Growth Curve Calculation
/**
* Data from https://www.cdc.gov/growthcharts/who/boys_length_weight.htm
* and https://www.cdc.gov/growthcharts/who/girls_length_weight.htm
* Calculation from https://www.cdc.gov/nchs/data/nhsr/nhsr063.pdf
*
* Parameters:
* an age in months (floating point) in the range [0, 24),
* a weight in kg (floating point), and
* a sex (the string 'F' for female or something else for male)
*
# Blank
@DLu
DLu / xkcd1412.py
Last active May 22, 2016 01:05
XKCD 1412 - Wikipedia Article Title Stress Matcher
#!/usr/bin/python
import argparse
import sys
import nltk
import progressbar
# Replicating https://xkcd.com/1412/
# Special thanks to
# http://stackoverflow.com/questions/19015590/discovering-poetic-form-with-nltk-and-cmu-dict
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu trusty main" > /etc/apt/sources.list.d/ros-latest.list'
wget https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -O - | sudo apt-key add -
sudo apt-get update
sudo apt-get -y install build-essential emacs git ros-indigo-ros-base
sudo rosdep init
rosdep update
mkdir -p Catkin/src
source /opt/ros/indigo/setup.bash
cd Catkin/src
catkin_init_workspace
@DLu
DLu / graphicsDisplay.py
Created October 21, 2014 16:52
Berkeley AI - Mrs. Pacman Mod
# graphicsDisplay.py
# ------------------
# Licensing Information: Please do not distribute or publish solutions to this
# project. You are free to use and extend these projects for educational
# purposes. The Pacman AI projects were developed at UC Berkeley, primarily by
# John DeNero (denero@cs.berkeley.edu) and Dan Klein (klein@cs.berkeley.edu).
# For more info, see http://inst.eecs.berkeley.edu/~cs188/sp09/pacman.html
from graphicsUtils import *
import math, time
@DLu
DLu / ROS Maintainer Script
Created July 19, 2014 22:02
Looks at downloaded versions of build status pages (e.g. http://www.ros.org/debbuild/hydro.html)
import sys
import collections
def split(s):
i = s.index('"')
j = s.index('"', i+1)
k = s.index('<', j)
return s[i+1:j], s[j+2:k]
D = collections.defaultdict(dict)