Skip to content

Instantly share code, notes, and snippets.

View angelialau's full-sized avatar

Angelia Lau angelialau

View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>DV - HW3</title>
<script src="https://d3js.org/d3.v5.js"></script>
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<script src='https://api.mapbox.com/mapbox-gl-js/v1.11.0/mapbox-gl.js'></script>
<link href='https://api.mapbox.com/mapbox-gl-js/v1.11.0/mapbox-gl.css' rel='stylesheet' />
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>DV - HW2</title>
<script src="https://d3js.org/d3.v5.js"></script>
<script src="https://serv.cusp.nyu.edu/~hvo/files/us-refugees.js" type="text/javascript"></script>
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<style id="jsbin-css">
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>DV - HW2</title>
<script src="https://d3js.org/d3.v5.js"></script>
<script src="https://serv.cusp.nyu.edu/~hvo/files/us-refugees.js" type="text/javascript"></script>
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<style id="jsbin-css">
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>DV3 - Lab</title>
<script src="https://d3js.org/d3.v5.min.js"></script>
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<style id="jsbin-css">
#plotTitle {
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>HW1</title>
<script src="https://d3js.org/d3.v5.min.js"></script>
<style id="jsbin-css">
.bar {
fill: LightGray;
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>HW1</title>
<script src="https://d3js.org/d3.v5.min.js"></script>
<style id="jsbin-css">
.bar {
fill: LightGray;
from pyspark import SparkContext
from pyspark.sql import SparkSession
from pyspark.sql import functions as F
from pyspark.sql.types import FloatType
import sys
# constants
VIOLATIONS_FILEPATH = 'hdfs:///tmp/bdm/nyc_parking_violation/*'
CSCL_FILEPATH = 'hdfs:///tmp/bdm/nyc_cscl.csv'
YEARS = list(range(2015, 2020))
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>DV2 - Lab</title>
<script src="https://d3js.org/d3.v5.min.js"></script>
<style id="jsbin-css">
#plotTitle {
font-family: Helvetica;
@angelialau
angelialau / summary.md
Last active August 4, 2023 02:16
(Summary) The Art of Readable Code

A summary of The Art of Readable Code by Dustin Boswell and Trevor Foucher

  • Overall metric for readability: code should be written to minimise the time it would take someone else to fully understand it (able to modify the code and spot bugs) Ways to improve readability (ranked from easiest change to most time intensive)
  1. Naming of variables and functions:
    • Use specific, descriptive, succinct names that say the entity's value or purpose
    • Use concrete names instead of abstract names e.g. canListenOnPort > serverCanStart
    • Add important attributes e.g. units or state e.g. unsafeUrl, safeUrl > url
    • Can use shorter variable names for smaller scope