Skip to content

Instantly share code, notes, and snippets.

@yuemingl
yuemingl / TextFileStream.scala
Last active June 6, 2018 17:54
Spark streaming minimum example with updateStateByKey and mapWithState
import org.apache.log4j.{Level, LogManager}
import org.apache.spark.{HashPartitioner, SparkConf}
import org.apache.spark.rdd.RDD
import org.apache.spark.streaming._
/**
* This is a minimum example for word count using Spark streaming.
* The input stream is simply just one word per line from a folder
* which may contains multiple files and new files may be added to
* the folder as the updated data as a stream source
@yuemingl
yuemingl / LaplaceGlobalAssemble.java
Created February 18, 2017 05:59
Solving a Partial Differential Equation (PDE) using Finite Element Method (FEM) in FuturEye_JIT
package edu.uta.futureye.tutorial;
import static edu.uta.futureye.function.FMath.C0;
import static edu.uta.futureye.function.FMath.grad;
import static edu.uta.futureye.function.FMath.x;
import static edu.uta.futureye.function.FMath.y;
import java.util.HashMap;
import edu.uta.futureye.algebra.intf.Matrix;