Skip to content

Instantly share code, notes, and snippets.

View groz's full-sized avatar

Tagir Magomedov groz

  • Amsterdam, NL
  • 20:32 (UTC +02:00)
View GitHub Profile
@groz
groz / gameoflife.scala
Last active September 23, 2015 22:39
Conway's Game of Life in Scala
package gameoflife
final case class Cell(x: Long, y: Long)
// Actual solution
object Life {
def proximity(c: Cell): Set[Cell] =
(for {
x <- -1 to 1
import info.fotm.crawler.ObservableStream
val sink = new ObservableStream[Int] {
def put(x: Int) = super.publish(x)
}
val othersink = new ObservableStream[Int] {
def put(x: Int) = super.publish(x)
}
/*
Назовем набор кортежей целых чисел кластером
Входные данные алгоритма: один кластер
Выходные данные: разбиение входного кластера на непересекающиеся подкластеры
*/
abstract class Clusterer {
type V = Vector[Double]
type Cluster = Seq[V]
def clusterize(input: Cluster): Set[Cluster]
@groz
groz / gist:ad8f962de5e35923339a
Last active August 29, 2015 14:22
Scala cheat sheet (ru)
/*
В одном проекте и даже одном файле может быть объявлено несколько приложений (или точек входа).
Запуск нужного производится следующей командой:
$ sbt "run-main <полное имя объекта>"
Пример:
$ sbt "run-main Integers"
*/
@groz
groz / fotmjs-todo-list
Last active August 29, 2015 14:10
ToDo list for fotmjs project.
Main
- [ ] Implement Monitor's dependencies for Google cloud VM backend
- [ ] Storage
- [ ] Pub/sub
- [ ] Analytics
- [ ] Implement brain
Architecture
- [ ] Move modules to separate folders (monitor/ brain/ etc)
- [ ] Create tests for each module
- [ ] Track code coverage
@groz
groz / numl_kmeans_error
Created March 15, 2014 01:28
Demonstrates error (or my misunderstanding) of KMeans algorithm in numl.
using System;
using numl.Model;
using numl.Unsupervised;
namespace KmeansError
{
class Program
{
class DataPoint
{