Skip to content

Instantly share code, notes, and snippets.

View xinbinhuang's full-sized avatar
🍣
Sushi fan

Xinbin Huang xinbinhuang

🍣
Sushi fan
View GitHub Profile
@xinbinhuang
xinbinhuang / emoji.md
Last active May 29, 2020 01:25 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup
@xinbinhuang
xinbinhuang / Raymond Hettinger - Beyond PEP 8 -- Best practices for beautiful intelligible code - PyCon 2015.md Raymond Hettinger - Beyond PEP 8 -- Best practices for beautiful intelligible code - PyCon 2015. Distillation of knowledge gained from a decade of Python consulting, Python training, code reviews, and serving as a core developer. (https://www.youtube.com/watch?v=wf-BqAjZb8M)

Raymond Hettinger's professional at doing code review and architecture review

P vs. NP. Pythonic vs. Non-Pythonic.

How to make use of PEP 8

  1. Golden rule of PEP-8: PEP-8 onto yourself. PEP 8 is style guide, not a law book.
  2. Care about intelligibility, not simply visually better
  3. Transforming (Java) API to pythonic ones

Why not PEP 8

@xinbinhuang
xinbinhuang / gist:a456df10268319ea2b034d07c53dfd71
Created January 22, 2020 19:07 — forked from chiragchamoli/gist:3754597
Example of 1NF, 2NF and 3NF in plain english?

1NF is the most basic of normal forms - each cell in a table must contain only one piece of information, and there can be no duplicate rows.

2NF and 3NF are all about being dependent on the primary key. Recall that a primary key can be made up of multiple columns. As Chris said in his response:

The data depends on the key [1NF], the whole key [2NF] and nothing but the key [3NF] (so help me [Codd][1]).

2NF

Say you have a table containing courses that are taken in a certain semester, and you have the following data:

@xinbinhuang
xinbinhuang / Load-Multiple-R-Packages.R
Created January 28, 2019 04:22 — forked from RobertMyles/Load-Multiple-R-Packages.R
Load multiple packages at the same time in R
# library() or require() only load one package at a time
# but...
Packages <- c("dplyr", "ggplot2", "rstan", "readr")
lapply(Packages, library, character.only = TRUE)
# this loads as many as you put in 'Packages'. They need to be installed first, of course.
@xinbinhuang
xinbinhuang / shell-learning-helpers.md
Created January 28, 2019 01:59 — forked from jennybc/shell-learning-helpers.md
shell learning helpers