This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using numl.Model; | |
using numl.Unsupervised; | |
namespace KmeansError | |
{ | |
class Program | |
{ | |
class DataPoint | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
В одном проекте и даже одном файле может быть объявлено несколько приложений (или точек входа). | |
Запуск нужного производится следующей командой: | |
$ sbt "run-main <полное имя объекта>" | |
Пример: | |
$ sbt "run-main Integers" | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Назовем набор кортежей целых чисел кластером | |
Входные данные алгоритма: один кластер | |
Выходные данные: разбиение входного кластера на непересекающиеся подкластеры | |
*/ | |
abstract class Clusterer { | |
type V = Vector[Double] | |
type Cluster = Seq[V] | |
def clusterize(input: Cluster): Set[Cluster] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <set> | |
using namespace std; | |
struct Cell { | |
const long x, y; | |
Cell(long sx, long sy) : x(sx), y(sy) { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object FBSampleApp extends App { | |
// sample implementations | |
def nearbyChars(c: Char): Set[Char] = Set(c + 0, c + 1).map(_.toChar) | |
def isWord(s: String): Boolean = true | |
def distSoFar(a: String, b: String) = a.zip(b).count(ab => ab._1 != ab._2) | |
def nearbyWords(input: String, maxDist: Int = 1): Set[String] = | |
input.foldLeft(Set("")) { (words, char) => | |
for { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Parsers where | |
import Prelude hiding (fail, return, (>>=)) | |
type Parser a = String -> [(a, String)] | |
item :: Parser Char | |
item [] = [] | |
item (c:cs) = [(c, cs)] | |
fail :: Parser a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait Node[+T] { | |
val index: Int | |
val left: Node[T] | |
val right: Node[T] | |
val len: Int | |
def apply(index: Int): T = ??? | |
def update[X >: T](index: Int, value: X): Node[X] = ??? | |
} | |
case object NullNode extends Node[Nothing] { |
OlderNewer