This file contains hidden or 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
const posPrefix = ["", "k", "M", "G", "T", "P"] | |
const negPrefix = ["", "m", "μ", "n", "p", "a"] | |
/** | |
* Convert a number to a metric string in engineering/SI notation. For example, | |
* toMetric(1.2345678e8, "Wh", 4) returns "123.5MWh". | |
* @param value The number to convert to a string. | |
* @param unit A string representing the unit to use e.g. kW, C, V expected | |
* @param The total number of digits to return | |
*/ |
This file contains hidden or 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
[tool.poetry] | |
name = "stream-manager" | |
version = "0.0.147" | |
description = "" | |
authors = ["David Weber <[email protected]>", "Janto Dreijer [email protected]"] | |
license = "Proprietary" | |
packages = [ | |
{ include = "server" } | |
] |
This file contains hidden or 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
/** | |
* Copyright © 2016 8eo Inc. | |
*/ | |
package ws | |
import akka.actor.ActorSystem | |
import akka.http.scaladsl.Http | |
import akka.http.scaladsl.client.RequestBuilding._ | |
import akka.http.scaladsl.model.{HttpRequest, StatusCodes} | |
import akka.http.scaladsl.server.Directives._ |
This file contains hidden or 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 co.horn.streaming | |
import akka.actor.ActorSystem | |
import akka.http.ConnectionPoolSettings | |
import akka.http.scaladsl.Http | |
import akka.http.scaladsl.model.{HttpResponse, HttpRequest} | |
import akka.stream.ActorMaterializer | |
import akka.stream.scaladsl.{Sink, Source} | |
import scala.collection.immutable.SortedMap |
This file contains hidden or 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 co.horn.services | |
import spire.math._ | |
import spire.implicits._ | |
/** | |
* Not the fastest FFT in the world, but we use it just for testing. Based on code from | |
* http://rosettacode.org/wiki/Fast_Fourier_transform#Scala | |
*/ | |
object FFT extends App { |
This file contains hidden or 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 test | |
import spray.routing.Directives._ | |
import org.scalatest.{Matchers, FunSpec} | |
import spray.testkit.ScalatestRouteTest | |
/** | |
* Routes that we can compose into our overall ReST API. The current plan | |
* is to have route completion in a separate compilation unit to keep the | |
* API layout easy to reason about. |
This file contains hidden or 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 pickleme | |
trait Zero | |
case class One(a:Int) extends Zero | |
case class Two(s:String) extends Zero | |
object Test extends App { | |
import scala.pickling._ | |
import json._ |
This file contains hidden or 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 org.scalatest.{Matchers, FunSpec} | |
import spray.http.HttpEntity | |
import spray.http.MediaTypes._ | |
import spray.httpx.unmarshalling._ | |
import spray.routing.HttpService._ | |
import spray.testkit.ScalatestRouteTest | |
import spray.json._ | |
import spray.httpx.SprayJsonSupport._ | |
import spray.routing.directives._ |
This file contains hidden or 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 za.co.monadic.kumquat | |
import spray.testkit.ScalatestRouteTest | |
import org.scalatest.{FunSpec, Matchers} | |
import spray.json.DefaultJsonProtocol | |
import spray.routing.Directives._ | |
import spray.httpx.marshalling.Marshaller | |
import spray.http.MediaTypes._ |
This file contains hidden or 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 org.scalatest.{FunSpec, Matchers} | |
import spray.http.HttpHeaders.Accept | |
import spray.http.HttpEntity | |
import spray.http.MediaTypes._ | |
import spray.httpx.marshalling._ | |
import spray.routing.Directives._ | |
import spray.routing.HttpService.sealRoute | |
import spray.testkit.ScalatestRouteTest | |
import spray.json._ | |
import spray.httpx.SprayJsonSupport._ |
NewerOlder