Skip to content

Instantly share code, notes, and snippets.

@rgardner
rgardner / swaption_vec.py
Created July 8, 2014 14:49
Bermudan Swaptions
# Leif Andersen - A simple Approach to the pricing of Bermudan swaptions
# in the multifactor LIBOR market model - 1999 - Journal of computational finance.
# Replication of Table 1 p. 16 - European Payer Swaptions.
import util
B = util.Benchmark()
if B.bohrium:
import bohrium as np
else:
import numpy as np
@rgardner
rgardner / pearson.md
Created May 30, 2014 05:31
Pearson Blog Post

Bob Gardner

Pearson Blog Post

Hello! Last month, Tech@NYU collaborated with Pearson for our final HackNight of the academic year. For the unfamiliar, Tech@NYU is the largest student-run technology organization in NYC. We are hackers (in the original, positive sense of the word), builders, and creators with a passion for education and ideas.

What's a HackNight? Twice a month, college students from all over NYC get together to work on personal and academic projects at cool companies / start ups / coffee shops / libraries around the city.

@rgardner
rgardner / static-typing.md
Last active August 29, 2015 14:00
Strong vs. Weak; Static vs. Dynamic Typing

The following description is from Bruce Tate's excellent: Seven Languages in Seven Weeks by Bruce A. Tate in his chapter on Scala (p123). The coercion property of strongly typed languages confused me when I first learned about these language designs in my Introduction to Computer Science course. Hope this passage helps someone else too.

My Inner Battle with Static Typing

Strong vs. Weak

Strong Typing

The lanugage detects when two types are compatible, throwing an error or coercing the types if they are not. Examples: Java and Ruby

Weak Typing

the compiler doesn't necessarily care whether the data in a memory location is an integer, a string, or just data.

SO: How to get the git commit count?

Update: If all you need is a commit count, and you're running a newer version of git, you can use the following command:

git rev-list HEAD --count

Thanks ctrueden for pointing this out.

Original answer:

Bob Gardner

Back in Fall 2013, I read The Cathedral & The Bazaar. "The Hacker Attitude" is quoted directly from the Appendix, but I paraphrased "Do you want to become a hacker." I changed (2) to say "Linux" instead of "an open source distribution of Unix" and (3) to say "Internet" instead of "World Wide Web." I don't think (3) needs a clarification, but (2) does. Linux has become very popular among students and researchers. While I have used Solaris at NYU (another Unix variant), Linux has become the standard among many of my peers.

The goal of the following paragraphs is to excite people with esr's words as much as they excited me the first time I read them. People generalize the first three attitudes of a hacker to be "programmers are lazy," but I prefer the

@rgardner
rgardner / index.html
Created April 2, 2014 23:49
HTML Structure
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
</body>
</html>
@rgardner
rgardner / google_interview.txt
Created March 16, 2014 03:56
Google Interview Materials
Books to assist you in preparing for your interview:
"The Algorithm Design Manual"
Author: Steven S. Skiena
"Introduction to Algorithms"
Authors: Cormen, Leiserson, Rivest & Stein
[Also known as the “CLR” textbook]
“Programming Interviews Exposed: Secrets to Landing Your Next Job"
@rgardner
rgardner / study_guide1.md
Last active August 25, 2024 23:26
Political Economy Study Guide

3/4/14 #Texts & Ideas: Political Economy Midterm 1

##Part I: The Civic and Christian Tradition of Political Economy ###Assumptions of Liberalism

  • humans are rational
  • individual is unit of analysis
  • individuals should have freedom to make own decision
  • commerce seen in positive light
  • the state is separate and distinct from the Market

Political Economy #Refining Classic Liberalism: J.S. Mill and Managing Inequality

  • current events in Ukraine
  • no reading for Tuesday
  • plan for today
    • appearance of double-sided capitalism (+productivity, -inequality)
    • regular, fairly cyclical crises causing concern

##Mill

  • writes about contexts outside of Political Economy too
@rgardner
rgardner / bootstrap_template.html
Created January 5, 2014 08:56
HTML Bootstrap Template
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" media="screen">
</head>
<body>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>