Skip to content

Instantly share code, notes, and snippets.

View mkolod's full-sized avatar

Marek Kolodziej mkolod

  • San Francisco Bay Area, CA
View GitHub Profile
@mkolod
mkolod / Main.scala
Last active August 29, 2015 14:16 — forked from guenter/Main.scala
import mesosphere.mesos.util.FrameworkInfo
import org.apache.mesos.MesosSchedulerDriver
/**
* @author Tobi Knaup
*/
object Main extends App {
@mkolod
mkolod / OptimizedSparkInnerJoin.scala
Created July 6, 2015 18:11
Optimized Inner Join in Spark
/** Hive/Pig/Cascading/Scalding-style inner join which will perform a map-side/replicated/broadcast
* join if the "small" relation has fewer than maxNumRows, and a reduce-side join otherwise.
* @param big the large relation
* @param small the small relation
* @maxNumRows the maximum number of rows that the small relation can have to be a
* candidate for a map-side/replicated/broadcast join
* @return a joined RDD with a common key and a tuple of values from the two
* relations (the big relation value first, followed by the small one)
*/
private def optimizedInnerJoin[A : ClassTag, B : ClassTag, C : ClassTag]
// Demo of automatic memory management in C++ using smart pointers.
#include <iostream>
#include <sstream>
using namespace std;
#define SpFoo shared_ptr<Foo>
class Foo {
# import forecast library
library(tseries)
library(forecast)
########## Data loading and exploratory analysis
# NYC birth data
births <- scan("http://robjhyndman.com/tsdldata/data/nybirths.dat")
# convert to time series object - monthly data, starts in January 1946
# sine wave in time domain
x <- seq(0, 20*pi, 0.01)
y <- sin(x)
plot(x, y, type='l')
# inverted time domain after 2 FFT applications
invertedY <- fft(fft(y)) / length(y)
plot(x, invertedY, type='l')
@mkolod
mkolod / Prepare_TIMIT.ipynb
Created January 26, 2016 17:56 — forked from Qwlouse/Prepare_TIMIT.ipynb
This notebook preprocesses the TIMIT dataset using MFCCs in the same way that the paper "LSTM: A Search Space Odyssey" used it.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mkolod
mkolod / lstm_reference.ipynb
Created January 26, 2016 17:57 — forked from Qwlouse/lstm_reference.ipynb
LSTM Reference Implementation in Python
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
object DiffieHellmanMerkle {
import java.math.BigInteger
import scala.language.implicitConversions
import scala.util.Random
def main(args: Array[String]): Unit =
println(
diffieHellmanMerkle(generator = 3, modulus = 17, alicePrivateKey = 54, bobPrivateKey = 24)
)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.