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
use ggez::graphics::{self, Color, DrawMode, DrawParam, FillOptions, Mesh, Rect}; | |
use ggez::{Context, ContextBuilder, GameError, GameResult}; | |
use ggez::mint; | |
use ggez::event::{self, EventHandler}; | |
use ggez::input::keyboard::{self, KeyCode}; | |
use rand::prelude::*; | |
use std::ops::Neg; |
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
final case class Ctx[T <: Ctx.Key[_]] private (private val map: Map[Ctx.Key[_], Any]) | |
object Ctx { | |
trait Key[T] { type Value = T; override def toString: String = getClass.getTypeName.replace("$", "") } | |
implicit final class CtxExtension[Self <: Ctx[_]](private val self: Self) extends AnyVal { | |
def put[K <: Key[_]](key: K)(value: key.Value): Self with Ctx[K] = | |
Ctx(self.map + (key -> value)).asInstanceOf[Self with Ctx[K]] | |
def get[K <: Key[_]](key: K)(implicit ev: Self <:< Ctx[K]): key.Value = self.map.get(key) match { |
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 scala.concurrent.{Await, ExecutionContext, Future} | |
import scala.concurrent.duration.Duration | |
import scala.util.{Failure, Success, Try} | |
object app extends App { | |
import effect.Effect | |
import context._ | |
import scala.concurrent.duration._ | |
import scala.concurrent.ExecutionContext.Implicits.global |
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 net.thumbtack.flower.spring.example.Authenticator | |
import net.thumbtack.flower.spring.example.LoggingMiddleware | |
import net.thumbtack.flower.spring.example.Receiver | |
import net.thumbtack.flower.spring.example.User | |
import net.thumbtack.flower.spring.example.email.EmailAuthorizer | |
import net.thumbtack.flower.spring.example.email.EmailRequestValidator | |
import net.thumbtack.flower.spring.example.email.EmailSender | |
import net.thumbtack.flower.spring.example.sms.SmsAuthorizer | |
import net.thumbtack.flower.spring.example.sms.SmsRequestValidator | |
import net.thumbtack.flower.spring.example.sms.SmsSender |
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 net.thumtack.flower.spring; | |
import net.thumbtack.flower.AsFunction; | |
import net.thumbtack.flower.Namespaced; | |
import net.thumbtack.flower.Action; | |
import net.thumbtack.flower.Middleware; | |
import net.thumbtack.flower.utils.MapApi; | |
import net.thumbtack.flower.impl.DefaultAction; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; |
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
{-# LANGUAGE OverloadedStrings #-} | |
module Main where | |
import Data.ByteString.Lazy.Char8 hiding (putStrLn) | |
import Network.HTTP.Types.Status | |
import Network.Wai | |
import Network.Wai.Handler.Warp (run) | |
import System.IO | |
import System.Exit | |
import Control.Concurrent |
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 Main (main) where | |
import System.Environment (getArgs) | |
import System.Directory (getDirectoryContents, doesFileExist, copyFile) | |
import Control.Monad (filterM, mapM) | |
import Data.List | |
-- Line separator | |
lineSeparator = "\n" |
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
-- file Integration.Simpson.hs xdCrafts 06.11.2012 | |
module | |
Integration.Simpson ( | |
integrate, | |
integrateFromN, | |
integrateWithAccuracy | |
) | |
where | |
-- function that splits tuple by odd and even components |
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 Quasar.Main where | |
import Control.Monad | |
import Data.Char | |
import System.IO | |
import Network | |
import Data.Time.LocalTime | |
data RequestType = GET | POST deriving (Show) |
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
-- file Slae.GaussSeidel xdCrafts 27.09.2012 | |
module | |
Slae.GaussSeidel ( | |
solveWithAccuracy, | |
solveWithAccuracy1 | |
) | |
where | |
-- http://en.wikipedia.org/wiki/Gauss%E2%80%93Seidel_method | |
-- function that represents Xi(k+1) |