Skip to content

Instantly share code, notes, and snippets.

@Agnishom
Agnishom / chirps.csv
Created June 24, 2016 17:17
Cricket Chirp Data
Chirps Temperature
20 88.59999847
16 71.59999847
19.79999924 93.30000305
18.39999962 84.30000305
17.10000038 80.59999847
15.5 75.19999695
14.69999981 69.69999695
17.10000038 82
15.39999962 69.40000153
@Agnishom
Agnishom / castelNum.md
Created November 5, 2016 03:31
Castel Numbers

Castel - A whole new set of numbers that humans can't actually understand it's existence. Here well see what is a 'Castel' number and 'Casteline' numbers, how are they different from each other and what makes them unique from other set of numbers (ie, Real numbers, Imaginary numbers, Complex numbers).

[[heading|Introduction]]

Before dealing with this refer Natural, Whole, Integer, Rational, Irrational, Real, Imaginary and Complex numbers.

[[heading|Casteline Numbers]]

A Casteline number is denoted by (\mathbb{L}). Set of all Casteline number is infinite, unlike Castel numbers. If you grab a look at Real and Complex numbers you will get an

@Agnishom
Agnishom / ries.c
Created December 28, 2016 03:56
RIES Source
/* ries.c
RIES -- Find Algebraic Equations, Given Their Solution
Copyright (C) 2000-2016 Robert P. Munafo
This is the 2016 Oct 08 version of "ries.c"
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
@Agnishom
Agnishom / medianOfMedians.hs
Last active September 15, 2017 09:21
Median Of Medians
import Data.List
median :: (Show a, Ord a) => [a] -> a
median xs = select ((length xs) `div` 2) xs
select :: (Show a, Ord a) => Int -> [a] -> a
select i xs
| n <= 5 = (sort xs) !! i
| lengthLower == i = medianOfMedians
| lengthLower < i = select (i - lengthLower - 1) upperPartition
@Agnishom
Agnishom / kosaraju.py
Last active March 31, 2017 06:33
Strongly Connected Components
def kosaraju(outList):
n = len(outList) # n is 1 more than the number of vertices, for convenience
visited = [False]*n
components = [None]*n
L = []
def visit(u):
if not visited[u]:
visited[u] = True
for v in inList[u]:
@Agnishom
Agnishom / dijkstra.py
Created March 30, 2017 06:11
Dijkstra's Algorithm
from fibHeap import FibonacciHeap
def dijkstra(adjList, source, sink = None):
n = len(adjList) #intentionally 1 more than the number of vertices, keep the 0th entry free for convenience
visited = [False]*n
distance = [float('inf')]*n
heapNodes = [None]*n
heap = FibonacciHeap()
for i in range(1, n):
@Agnishom
Agnishom / prims.py
Created March 30, 2017 13:07
Minimum Spanning Tree
from fibHeap import FibonacciHeap #https://github.com/Agnishom/fibonacci-heap-python/
def prims(adjList, source = 1):
n = len(adjList) #intentionally 1 more than the number of vertices, keep the 0th entry free for convenience
visited = [False]*n
parent = [None]*n
cost = [float('inf')]*n
heapNodes = [None]*n
heap = FibonacciHeap()
@Agnishom
Agnishom / randomDiGraph.py
Created April 3, 2017 06:26
Random Graphs
import random
def randomDAG(minHeight, maxHeight, minFat, maxFat, p):
'''
create levels, and draw edges across levels
from http://stackoverflow.com/questions/12790337/generating-a-random-dag
'''
height = random.randint(minHeight, maxHeight)
nodes = 0
@Agnishom
Agnishom / reccomendations2.txt
Last active May 30, 2017 03:55
Song and Album recommendations
# from Kushpreet Singh
Albums (Almost every song in the album is good)
Pink Floyd - Meddle, The Division Bell (Progressive Rock)
Beach House - Depression Cherry (Dream Pop)
Coldplay - Parachutes, Ghost Stories (Alternative rock)
Songs
Archive - Again, Bullets
@Agnishom
Agnishom / afl-fuzz.c
Created June 2, 2017 02:06
American Fuzzy Lop Extensions
/*
american fuzzy lop - fuzzer code
--------------------------------
Written and maintained by Michal Zalewski <lcamtuf@google.com>
Forkserver design by Jann Horn <jannhorn@googlemail.com>
Copyright 2013, 2014, 2015, 2016 Google Inc. All rights reserved.