Skip to content

Instantly share code, notes, and snippets.


Sam Bessalah samklr

Block or report user

Report or block samklr

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
samklr /
Created Aug 5, 2012 — forked from loicdescotte/
How to push 2 mixed searches from twitter with Scala, Play2, Iteratee and Comet


We will see how to mix 2 twitter searches and push the results to the browser in real time.

First, checkout this mini project

To try it, you need to install Play 2.0


samklr / ExtremeStartup.scala
Created Sep 7, 2012 — forked from mikkelbd/ExtremeStartup.scala
BEKK kodekveld - Extreme Startup - refac
View ExtremeStartup.scala
import util.matching.Regex
object ExtremeStartup {
def answer(q: String): Any = {
if (q.contains("what is your name"))
return "Mikkel"
if (q.contains("which city is the Eiffel tower in"))
return "Paris"
View MovieSimilarities.scala
import spark.SparkContext
import SparkContext._
* A port of [[]]
* to Spark.
* Uses movie ratings data from MovieLens 100k dataset found at [[]]
object MovieSimilarities {
View ProductRecommendationJob.scala
package com.mansur.scalding
import com.twitter.scalding._
import org.apache.mahout.common.distance.TanimotoDistanceMeasure
import org.apache.mahout.math.DenseVector
import org.apache.commons.math.util.MathUtils
View product_catalog.csv
women jeans Levi's 512 512 Perfectly Slimming Bootcut, Midnight Star Wash jeans 54.00 39.00
women jeans Tommy Hilfiger Jeans Hope Boot Cut, Caroline Original Wash jeans 69.50 54.00
women jeans Lauren Jeans Co. Jeans Slimming Bootcut, Rinse Wash jeans 80.00 65.00
women jeans INC International Concepts Jeans Curvy-Fit Skinny Ankle-Length jeans 69.00 48.99
women jeans MICHAEL Michael Kors Jeans Skinny Colored Denim jeans 89.50 69.99
women tops Karen Scott Top Short-Sleeve Boat-Neck top 29.00 12.99
women tops Cable & Gauge Top Three-Quarter-Sleeve Solid Twist Front top 24.98 19.99
women tops Style&co. Top Long-Sleeve Striped Button-Down Shirt top 39.98 29.99
women tops Style&co. Top Bell-Sleeve Printed Tunic top 49.98 35.99
women tops INC International Concepts Top Short-Sleeve Ruched Tee top 29.50 24.99
public synchronized int read() throws IOException {
int result =;
if (result != -1) {
return result;
View EMR log
bash-3.2$ elastic-mapreduce --create --name "Sample Recommender" \
> --jar s3n:// \
> --arg s3n:// \
> --arg s3n:// \
> --arg s3n:// \
> --arg s3n://
Created job flow j-2HA2BVCBJGMVX
bash-3.2$ elastic-mapreduce --list
j-2HA2BVCBJGMVX STARTING Sample Recommender
PENDING Example Jar Step
View Dojo-ml.fs
// This F# dojo is directly inspired by the Digit Recognizer
// competition from
// The datasets below are simply shorter versions of
// the training dataset from Kaggle.
// 0. Load data files from the following location:
View exercises.scala
This is how we create an inclusive/exclusive range of Ints:
val ie = 0 until 500
//1. Fill in the missing item to create a range of Ints from 1 to 100 inclusive
val ints = 1 ??? 100
//2. Find the sum of the integers in this range
View lens-example-tradingday.scala
object TradingDays extends App {
import scalaz._
import Scalaz._
case class Trade(sym: String, trader: String, qty: Int)
case class TradingDay(symbols: Map[String, SymDay] = Map.empty)
object TradingDay {
You can’t perform that action at this time.