Skip to content

Instantly share code, notes, and snippets.

View Fabszn's full-sized avatar
🏠
Home coder

Fabrice Sznajderman Fabszn

🏠
Home coder
View GitHub Profile

Keybase proof

I hereby claim:

  • I am fabszn on github.
  • I am fsznajderman (https://keybase.io/fsznajderman) on keybase.
  • I have a public key whose fingerprint is E70E ECB5 38ED 3C38 785B 556B 42C1 C63C A549 CED8

To claim this, I am signing this object:

object Main extends App {
import java.io.File
implicit def convert(l: List[File]): Array[File] = l.toArray
def print(f: File): Option[String] = {
val name = f.getName
if (!f.isDirectory && name.startsWith("Test")) {
Some(name)
@Fabszn
Fabszn / OtherCase.java
Created November 28, 2014 17:04
Un exemple à partir de l'Optional de Guava
import com.google.common.base.Optional;
import model.Contact;
/**
* Created by fsznajderman on 28/11/2014.
*/
public class OtherCase {
package utils
import rapture.io._
import org.jsoup.Jsoup
import akka.actor.Actor
import scala.language.implicitConversions
import java.net.MalformedURLException
/**
* User: fsznajderman
@Fabszn
Fabszn / main.scala
Created April 18, 2014 17:19
Analyse of file from data.gouv.fr
import scala.io.Source
import scala.util.parsing.json.{JSONObject, JSONFormat, JSONArray}
/**
* Created by fsznajderman on 16/04/2014.
*/
object main {
case class Accident(lum: Int, agg: Int, int: Int, atm: Int, col: Int, catr: Int, grav: Float)
@Fabszn
Fabszn / PaserXML_Scala
Last active December 21, 2015 04:58
L'idée du bout de code est de parser un ensemble de fichier XML. Pour chaque fichier on récupère l'ensemble des balises 'value'. Pour chaque balise value on regarde si l'attribut 'name' est égale à un chaine, dans l'exemple : returnType. Si on trouve une égalité alors on affiche le nom du fichier avec le contenu de la balise sinon on ne fait rien.
object Parser {
def main(args: Array[String]) {
new File(/*[DIRECTORY_PATH"*/).listFiles() foreach (f => {
val xml = XML.loadFile(f.getPath)
(xml \\ "value") foreach (v =>
(v \ "@name").text match {
case "returnType" => println( f.getName.split('.')(0) + " , " + v.text)
case _ =>
}
)
package codeStory2013;
import java.util.*;
/**
* .
*
* @author fsznajderman
* date : 03/02/13
*/
package javapuzzle;
import com.google.common.base.Joiner;
import com.google.common.base.Predicate;
import com.google.common.collect.Collections2;
import com.google.common.collect.Lists;
import java.util.Collection;
import java.util.List;
@Fabszn
Fabszn / index.html
Created November 5, 2012 20:08
Sample of use of Jquery.position()
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="http://code.jquery.com/ui/1.9.0/themes/base/jquery-ui.css">
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.9.0/jquery-ui.js"></script>
final Benchmark java = BenchmarkProxyManager.getProxiedClass(JavaBenchmark.class);
final Benchmark guava = BenchmarkProxyManager.getProxiedClass(GuavaBenchmark.class);
final Benchmark lambdaj = BenchmarkProxyManager.getProxiedClass(LambdaJBenchmark.class);
java.iterateSimpleList(lines);