Skip to content

Instantly share code, notes, and snippets.

View srinathgs's full-sized avatar

Srinath srinathgs

View GitHub Profile
@srinathgs
srinathgs / golang_job_queue.md
Created August 3, 2016 08:34 — forked from harlow/golang_job_queue.md
Job queues in Golang

Here is an essay version of my class notes from Class 1 of CS183: Startup. Errors and omissions are my own. Credit for good stuff is Peter’s entirely.

CS183: Startup—Notes Essay—The Challenge of the Future

Purpose and Preamble

## The quick-and-nasty CVE-2013-0156 Heroku inspector!
## Originally brought to you by @elliottkember with changes by @markpundsack @ Heroku
## Download and run using:
## ruby heroku-CVE-2013-0156.rb
`heroku list`.split("\n").each do |app|
app = app.strip
# Some "heroku apps" lines have === formatting for grouping. They're not apps.
next if app[0..2] == "==="
#include <iostream>
#include <vector>
using namespace std;
int main()
{
vector<int> digits;
int carry;
digits.push_back(1);
//Just Old School Multiplication.
//Project Euler Problem 14. Using Collatz's conjecture.
//http://projecteuler.net/problem=14
#include <iostream>
#include <map>
using namespace std;
map<long, long> table; //memoization
int seqLen(long num){
@srinathgs
srinathgs / Erdos.cc
Created July 6, 2012 18:57
Erdos Nummbers
#include <iostream>
#include <map>
#include <limits>
#include <set>
#include <vector>
#include <deque>
#include <algorithm>
using namespace std;
@srinathgs
srinathgs / CoveringCities.cc
Created June 15, 2012 19:24
Solution to the cities problem in Interviewstreet
#include <iostream>
#include <vector>
using namespace std;
void sort(vector<int> &arr);
int main()
{
int n,k;
cin>>n;
@srinathgs
srinathgs / sort.cc
Created June 15, 2012 19:18
All sorting algorithms
#include <iostream>
#include <vector>
#include <cstdlib>
#include <iterator>
#include <algorithm>
using namespace std;
template< typename comparable> void insertionSort(vector<comparable> &a);
template< typename comparable> void shellSort(vector<comparable> &a);
template <typename comparable> void mergeSort(vector<comparable> &a);
@srinathgs
srinathgs / JollyJumperSoln.cc
Created June 14, 2012 18:10
Solution to the Jolly Jumper problem
#include <iostream>
#include <vector>
#include <sstream>
using namespace std;
int main()
{
string buf;
int n;
@srinathgs
srinathgs / theTrip.cc
Created June 13, 2012 18:12
Solution to the trip problem
#include <iostream>
#include <vector>
#include <iomanip>
#include <cstdio>
using namespace std;
double average(vector<int>&tripFares){
double sum = 0;
for(vector<int>::iterator i = tripFares.begin();i!=tripFares.end();i++){
sum+= *i;
}