Skip to content

Instantly share code, notes, and snippets.

@tomasherman
tomasherman / keybase.md
Last active January 20, 2021 10:59
keybase.md

Keybase proof

I hereby claim:

  • I am tomasherman on github.
  • I am tomasherman (https://keybase.io/tomasherman) on keybase.
  • I have a public key ASAZyziR-Ex8X0kdHztFnDjYBIDJJR5Foi0j-njqevn55wo

To claim this, I am signing this object:

@tomasherman
tomasherman / run.scala
Last active November 19, 2018 16:25
paralellism cats
import java.util.concurrent.Executors
import cats.effect.{Effect, IO}
import monix.eval.Task
import scala.concurrent.Await
import scala.concurrent.duration._
import scala.language.{higherKinds, postfixOps}
object Paralellism extends App {
@tomasherman
tomasherman / keybase.md
Created August 28, 2018 12:44
keybase.md

Keybase proof

I hereby claim:

  • I am tomasherman on github.
  • I am tomasherman (https://keybase.io/tomasherman) on keybase.
  • I have a public key ASDEgOsqfuKc4jt87CJNjRgLtYWlabUCILVrMCaGNDRgMwo

To claim this, I am signing this object:

ORDER {'status': 'New', 'clientOrderId': 'f3a8a55f-9bb2-4743-bcc8-3332ee6ecc3e', 'origClientOrderId': '<null>', 'lastPrice': 'Optional.empty', 'totalQuantity': '1', 'instrument': 'cme_M6EM5', 'side': 'Buy'}
ER {'clientOrderId': 'f3a8a55f-9bb2-4743-bcc8-3332ee6ecc3e', 'origClientOrderId': '<null>', 'lastPrice': 'Optional.empty', 'totalQuantity': '1', 'orderStatus': 'New', 'side': 'Buy'}
ER {'clientOrderId': 'f3a8a55f-9bb2-4743-bcc8-3332ee6ecc3e', 'origClientOrderId': '<null>', 'lastPrice': 'Optional[1.1104]', 'text': 'Fill', 'totalQuantity': '1', 'orderStatus': 'Filled', 'side': 'Buy'}
ORDER {'status': 'New', 'clientOrderId': '58f023ac-3dc0-448d-836b-562a78b8fd3c', 'origClientOrderId': '<null>', 'lastPrice': 'Optional.empty', 'totalQuantity': '1', 'instrument': 'cnx_EURUSD', 'side': 'Sell'}
ER {'clientOrderId': '58f023ac-3dc0-448d-836b-562a78b8fd3c', 'origClientOrderId': '58f023ac-3dc0-448d-836b-562a78b8fd3c', 'lastPrice': 'Optional.empty', 'totalQuantity': '1.00000', 'orderStatus': 'New', 'side': 'Sell'}
O

Keybase proof

I hereby claim:

  • I am tomasherman on github.
  • I am tomasherman (https://keybase.io/tomasherman) on keybase.
  • I have a public key whose fingerprint is F834 1B85 DD5D DFAC 1758 9DB7 A3A9 2C3D BA75 C23F

To claim this, I am signing this object:

import org.eclipse.jetty.server.Server
import org.eclipse.jetty.webapp.WebAppContext
import org.eclipse.jetty.server.nio._
object RunWebApp extends App {
val server = new Server
val scc = new SelectChannelConnector
scc.setPort(8080)
server.setConnectors(Array(scc))
//E 3.3.4
def init[A](l: List[A]): List[A] = {
l match {
case Nil => Nil
case Cons(x,Nil) => Nil
case Cons(x,xs) => Cons(x,init(xs))
}
}
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package auiproject.alg;
import auiproject.AbstractOptAlgInstance;
import auiproject.DoubleVectorIndividual;
import auiproject.util.RandomNumber;
@tomasherman
tomasherman / gist:1730782
Created February 3, 2012 15:39
Got 99 problems, but unit testing ain't one of them!
package net.tomasherman.replayvault.server.util
import org.scalacheck._
import Gen._
import Prop._
import cc.spray.json._
import com.mongodb.casbah.Imports._
import mongo._
trait JsonGen extends DefaultJsonProtocol{
@tomasherman
tomasherman / gist:1596598
Created January 11, 2012 20:28
sumofdigits
def sumOfDigits(x: BigInt, sum: BigInt):BigInt = { //funkce se menuje sumOfDigits, bere dva argumenty, x kterej ma typ BigInt a sum, taky BigInt a vraci BigInt
x match { //tohle rika ze se ma porovnavat x s nasledujicim:
case xx if xx == 0 => sum //pokud x, ktery prejmenuju na xx == 0, tak to znamena ze sme vsechno secetli a v promenny sum je suma vsech cisel
case xx => sumOfDigits(xx / 10, sum + (xx % 10)) //pokud to neni 0, tak tam jeste nejaky cislice zbyvaj...zavolame znova sumOfDigits, ale s upravenejma parametrama tak, ze z x zahodime posledni cislo a k sume to posledni cislo pricteme
}
}