{{ message }}

Instantly share code, notes, and snippets.

🤖
Too much to do, too little time.

# Gaurav Menghani reddragon

🤖
Too much to do, too little time.
Created Apr 21, 2017
List of Possible Pet Projects
View pet-projects.md
1. embeddings.js: word2vec in Javascript
Created Apr 5, 2017
Linear Regression in Python
View linear_regression.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 ''' Linear Regression From First Principles Author: Gaurav Menghani (gaurav.menghani@gmail.com) ''' import numpy as np import matplotlib.pyplot as plt def linear_sum(X, W, b): return X.dot(W) + b
Created Mar 16, 2017
View reverse-nodes.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 #include using namespace std; struct Node { int val; Node *next; }; void print(Node* n) {
Created Dec 22, 2016
Hash Function for unordered_map
View unordered_map.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 struct Slope { int n, d; Slope(int nn, int dd) { int g = gcd(abs(nn), abs(dd)); // cout << "gcd of " << nn << ", " << dd << " is: " << g << endl; n = (g > 0 ? nn/g : nn); d = (g > 0 ? dd/g : dd); } };
Created Dec 8, 2016
A util file for misc algo problems
View util.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 #pragma once #include #include #include #include #include #include #include #include
Created Dec 8, 2016
First node in a cycle in a Linked List
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 #include #include #include #include #include #include #include #include #include #include
Created Dec 8, 2016
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 #include #include #include #include #include #include #include #include #include #include
Created Dec 30, 2014
O(|V||E|) Djikstra
View djikstra-slow.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 #include #include #include using namespace std; struct Edge { int src, dst; int w; };
Last active Jun 11, 2021
A demo for libevent usage
View libevent-demo.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 #include #include #include #include #include #include #include #include #include #include
Last active Aug 29, 2015
Interesting Companies
View gist:bca9be25e50a475044a7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 Delivery/Logistics: Instacart Munchery Lyft Sidecar Uber Thumbtack DoorDash Grubhub Seamless