This file contains hidden or 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
| package thunder.streaming | |
| import org.apache.spark.{SparkConf, Logging} | |
| import org.apache.spark.rdd.RDD | |
| import org.apache.spark.SparkContext._ | |
| import org.apache.spark.streaming._ | |
| import org.apache.spark.streaming.dstream.DStream | |
| import org.apache.spark.mllib.clustering.KMeansModel | |
| import scala.util.Random.nextDouble |
This file contains hidden or 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
| function isAnimatedGif(src, cb) { | |
| var request = new XMLHttpRequest(); | |
| request.open('GET', src, true); | |
| request.responseType = 'arraybuffer'; | |
| request.addEventListener('load', function () { | |
| var arr = new Uint8Array(request.response), | |
| i, len, length = arr.length, frames = 0; | |
| // make sure it's a gif (GIF8) | |
| if (arr[0] !== 0x47 || arr[1] !== 0x49 || |