Skip to content

Instantly share code, notes, and snippets.

View fedesilva's full-sized avatar
👁️‍🗨️

federico silva fedesilva

👁️‍🗨️
View GitHub Profile
@fedesilva
fedesilva / interop-implicits.scala
Created February 12, 2015 20:13
Java 8 Interop
package com.batanga.eng.interop
import java.util.function.{BiFunction, BiPredicate, Function => JFunction, Predicate => JPredicate}
import java.util.stream.{Stream => JStream}
import scala.collection.JavaConverters._
/** Interoperability with java functional interfaces and stream api.
* Created by f on 10/30/14.
*/
@fedesilva
fedesilva / controls.txt
Created December 30, 2014 17:36
Puppygames Ultratron controls configuration
#Contoller configuration
#Mon Dec 29 22:50:54 UYST 2014
# ~/Library/Application Support/.ultratron_3.03/controls.txt
controller2.button.7=start
controller2.button.6=back
controller2.button.5=action
controller2.button.4=firebutton
controller2.axis.4=fireaxis
controller2.axis.3=aimX
controller2.axis.2=aimY
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
@fedesilva
fedesilva / 1-Qos-2014-11-21T22-55UYT.txt
Last active August 29, 2015 14:10
QoS Anteldata Vera 80/10
f@Motoko:~$ ping google.com
PING google.com (200.40.0.90): 56 data bytes
Request timeout for icmp_seq 0
64 bytes from 200.40.0.90: icmp_seq=0 ttl=57 time=1632.718 ms
64 bytes from 200.40.0.90: icmp_seq=1 ttl=57 time=1169.396 ms
64 bytes from 200.40.0.90: icmp_seq=2 ttl=57 time=165.587 ms
64 bytes from 200.40.0.90: icmp_seq=3 ttl=57 time=157.983 ms
64 bytes from 200.40.0.90: icmp_seq=4 ttl=57 time=81.226 ms
64 bytes from 200.40.0.90: icmp_seq=5 ttl=57 time=1147.733 ms
64 bytes from 200.40.0.90: icmp_seq=6 ttl=57 time=473.100 ms
@fedesilva
fedesilva / tests.scala
Created November 13, 2014 00:40
los tests
import util.{Solutions, ScalaMeetupSpec}
/** Tests to validate your implementation
*
*/
class FinancialReaderTest extends ScalaMeetupSpec with Solutions {
import FinancialReader._
"Financial" should "for get correct files for a list symbols " in {
package scalax.collection
import scala.collection.mutable.ListBuffer
/** FoldTransformers and the views based on them are a Scala
* adaptation, and to some degree an extension, of Rich Hickey's
* transducers for Clojure. They show that the concepts can be
* implemented in a type-safe way, and that the implementation is
* quite beautiful.
*/
object FoldingViews {
@fedesilva
fedesilva / users-by-time.json
Created October 23, 2014 18:48
usuarios por fecha
POST /logstash-batanga-*/_search?search_type=count
{
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"and": {
"filters": [
@fedesilva
fedesilva / aggs-1.json
Created October 23, 2014 18:20
aggregations
POST /logstash-batanga-*/_search?search_type=count
{
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"exists": {
"field": "btng.elapsedtime"
@fedesilva
fedesilva / es-starter.json
Created October 23, 2014 17:50
es starter query
POST _search
{
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {}
}
}
import spark.SparkContext
import SparkContext._
/**
* A port of [[http://blog.echen.me/2012/02/09/movie-recommendations-and-more-via-mapreduce-and-scalding/]]
* to Spark.
* Uses movie ratings data from MovieLens 100k dataset found at [[http://www.grouplens.org/node/73]]
*/
object MovieSimilarities {