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
import mesosphere.mesos.util.FrameworkInfo | |
import org.apache.mesos.MesosSchedulerDriver | |
/** | |
* @author Tobi Knaup | |
*/ | |
object Main extends App { |
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
/** 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] |
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
// Demo of automatic memory management in C++ using smart pointers. | |
#include <iostream> | |
#include <sstream> | |
using namespace std; | |
#define SpFoo shared_ptr<Foo> | |
class Foo { |
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
# 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 |
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
# 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') |
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.
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
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.
OlderNewer