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:
I hereby claim:
To claim this, I am signing this object:
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 { |
I hereby claim:
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; |
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{ |
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 | |
} | |
} |
package net.tomasherman.replayvault.client.gui | |
import swing._ | |
import event.{EditDone, ButtonClicked} | |
import net.miginfocom.swing.MigLayout | |
import javax.swing.BorderFactory | |
import java.awt.Color | |
import java.util.Arrays | |
import akka.actor.Actor |
/** | |
* Sorry about the mess in imports but i figured this in REPL and i didn't want to refactor it because i'm sure i would eff it up. | |
* First of all you need to import certificate into a keystore like so: | |
/opt/java/bin/keytool -import -alias ca -file ~/Desktop/www.ondrej.vostal.net -keystore cacerts | |
* This should create file castore. I'm not sure about the details of this but i'm sure it's fine ^_^ | |
* This code is basically a ripoff of the http://stackoverflow.com/questions/5206010/using-apache-httpclient-for-https | |
*/ | |
import dispatch._ | |
import java.security._ |