Skip to content

Instantly share code, notes, and snippets.

View mamonu's full-sized avatar
🎯
Focusing

Theodore M mamonu

🎯
Focusing
View GitHub Profile
@mamonu
mamonu / carcsv.py
Last active August 29, 2015 14:25 — forked from btashton/carcsv.py
pyspark csv
from pyspark import SparkContext
from pyspark.sql import SQLContext
from pyspark.sql.types import *
from IPython.display import display
sc = SparkContext(appName="CarCSV")
sqlContext = SQLContext(sc)
schema = StructType([StructField("year", IntegerType(), False),
StructField("make", StringType(), False),
@mamonu
mamonu / bloomfilter.py
Last active August 29, 2015 14:27 — forked from mburst/bloomfilter.py
Code for creating and testing a simple bloom filter - http://maxburstein.com/blog/creating-a-simple-bloom-filter/
from bitarray import bitarray
import mmh3
class BloomFilter:
def __init__(self, size, hash_count):
self.size = size
self.hash_count = hash_count
self.bit_array = bitarray(size)
self.bit_array.setall(0)
@mamonu
mamonu / GRAPHS FOR HR ANALYTICS
Last active September 17, 2015 11:56 — forked from rvanbruggen/GRAPHS FOR HR ANALYTICS
Graphs for HR Analytics
This gist explains how a graph database can help for HR analytics. There are two files included:
- load the data.cql: this file contains the cypher statements that load the data into neo4j
- query the data.cql: this file has some sample queries that serve to demonstrate some of the concepts.
Hope this is useful.
Rik
@mamonu
mamonu / README.md
Created February 2, 2016 13:48 — forked from hofmannsven/README.md
My simply Git Cheatsheet
@mamonu
mamonu / LDA_SparkDocs.scala
Last active February 23, 2016 22:51 — forked from jkbradley/LDA_SparkDocs
LDA Example: Modeling topics in the Spark documentation
/*
This example uses Scala. Please see the MLlib documentation for a Java example.
Try running this code in the Spark shell. It may produce different topics each time (since LDA includes some randomization), but it should give topics similar to those listed above.
This example is paired with a blog post on LDA in Spark: http://databricks.com/blog
Spark: http://spark.apache.org/
also use.....
https://github.com/databricks/spark-csv

Project Management

In my optimization class last semester we briefly talked about project management, where there is a set of activities with given durations and some activities need to be completed before other activities can begin. We were taught to explore the management of the project’s timeline in Excel, which was tedious and prone to errors due to its manual process.


@mamonu
mamonu / actor.scala
Created May 22, 2016 00:53
IntelliJ IDEA Live Template for an Akka actor
import akka.actor.{ Actor, Props }
object $NAME$ {
def props: Props = Props(new $NAME$)
}
class $NAME$ extends Actor {
override def receive = ???
}

Advanced Functional Programming with Scala - Notes

Copyright © 2017 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x
@mamonu
mamonu / cluster_example.py
Created October 21, 2016 22:36 — forked from xim/cluster_example.py
Clustering K-Means by euclidian distance, yay!
import sys
import numpy
from nltk.cluster import KMeansClusterer, GAAClusterer, euclidean_distance
import nltk.corpus
from nltk import decorators
import nltk.stem
stemmer_func = nltk.stem.EnglishStemmer().stem
stopwords = set(nltk.corpus.stopwords.words('english'))