Skip to content

Instantly share code, notes, and snippets.

View andypetrella's full-sized avatar

Andy Petrella andypetrella

View GitHub Profile
@andypetrella
andypetrella / LCLU dans un système distribué.md
Last active August 29, 2015 14:01
Sujets de mémoire; ULg, montéfiore.

Utilisation des systèmes distribués pour l'analyse géospatiale et sociale du changement de territoire.

Le but du travail sera d'implémenter des techniques d'apprentissage et de prédiction de l'évolution d'un territoire en se basant sur un historique d'images satellitaires et envisager l'intégration des informations présentent dans un réseau social.

L'analyse géospatiale de la couverture et de l'utilisation du territoire est un des principaux sujets de recherche en géomatique et télédétection. Cela fait intervenir plusieurs techniques provenant de domaines divers, entre autres on peut citer les système de règles avec contraintes, les automates cellulaires, les réseaux probabilistes (ainsi que leurs combinaisons).

Le perfectionnement de ces techniques est indéniable mais il souffrira à terme de problèmes de performance et de "scalabilité". Cette apréhension se base sur le constat du pourcentage grandissant

trait CRDD[S<:Space] {
def continuum:S
def break:S#SpacePoint => (S#SpacePoint, S#SpacePoint)
// the rest follow more or less the DStream definition
}
@andypetrella
andypetrella / README.md
Last active August 29, 2015 14:08
Zip won't work? → "Honi soit qui mal y pense"

This gist is extracting the problem I'm facing from the Spark-Notebook (see here) to deal with a dynamic form that generates new Spark SQL.

It is in a transient status, meaning that it still contain a lot of legacy constructions that I'd like to get rid:

  • Connection
  • Observable
  • Observer But one thing at a time :-D.

The result of this thing will visually be like the image below (or above :-D)

@andypetrella
andypetrella / Test MLlib.snb
Last active August 29, 2015 14:15
import mllib and netlib in notebook
{"content":{"metadata":{"name":"Test MLlib","user_save_timestamp":"1970-01-01T01:00:00.000Z","auto_save_timestamp":"1970-01-01T01:00:00.000Z","language_info":{"name":"scala","file_extension":"scala","codemirror_mode":"text/x-scala"},"trusted":true},"cells":[{"metadata":{"trusted":true,"collapsed":false},"cell_type":"code","source":":local-repo /tmp/spark-notebook","outputs":[{"name":"stdout","output_type":"stream","text":"res1: String = Repo changed to /tmp/spark-notebook!\n"},{"metadata":{},"data":{"text/html":"Repo changed to /tmp/spark-notebook!"},"output_type":"execute_result","execution_count":1}]},{"metadata":{"trusted":true,"collapsed":false},"cell_type":"code","source":":dp org.apache.spark % spark-mllib_2.10 % 1.2.0\n- org.apache.spark % spark-core_2.10 % _\n- org.apache.hadoop % _ % _\ncom.github.fommil.netlib % all % 1.1.2 % pom","outputs":[{"name":"stdout","output_type":"stream","text":"jars: Array[String] = [Ljava.lang.String;@4639adb7\nres1: scala.xml.Elem = \n<pre onclick=\"this.style.display=(
@andypetrella
andypetrella / Build.scala
Created February 6, 2012 23:40
Play20 RC1 : sbt-idea
import sbt._
import Keys._
import PlayProject._
object ApplicationBuild extends Build {
val appName = "playbasket"
val appVersion = "1.0"
val sbtIdeaRepo = "sbt-idea-repo" at "http://mpeltonen.github.com/maven/"
@andypetrella
andypetrella / json
Created February 19, 2012 21:06
Test Play REPL
scala> val o:JsObject = JsObject(Seq("a" -> JsNumber(1), "2" -> JsString("two")))
o: play.api.libs.json.JsObject = {"a":1.0,"2":"two"}
scala> o \ "a" //return the value as a JsValue
res26: play.api.libs.json.JsValue = 1.0
scala> val o2:JsObject = JsObject(Seq("a" -> JsNumber(1), "2" -> JsObject(Seq("deep" -> JsBoolean(true)))))
o2: play.api.libs.json.JsObject = {"a":1.0,"2":{"deep":true}}
scala> o \\ "a" // find at first level and return in a list
@andypetrella
andypetrella / Format.scala
Created February 19, 2012 21:16
Play Json
trait Format[T] extends Writes[T] with Reads[T]
/**
* Default Json formatters.
*/
object Format extends DefaultFormat
url(urlString)
>\ "ISO-8859-1" //set the charset
<:< (Map("Accept-Language" -> "fr-BE" )) //set some headers
gzip //encode the response in archived gzip is accepted
@andypetrella
andypetrella / Build.scala
Created February 20, 2012 22:47
Neo4J using Play and Dispatch
import sbt._
import Keys._
import PlayProject._
object ApplicationBuild extends Build {
val appName = "Play20WithNeo4J"
val appVersion = "1.0"
val sbtIdeaRepo = "sbt-idea-repo" at "http://mpeltonen.github.com/maven/"
@andypetrella
andypetrella / GraphService.scala
Created February 24, 2012 21:40
Neo4J Play and DAO
//A trait defining some high level operation on graph, hasn't been cleaned but illustrates well what it might be meant for
trait GraphService[Node] {
//entry point of the graph
def root: Node
//get a Node based on its id
def getNode[T <: Node](id: Int): Option[T]
//return all nodes in the graph as a list