I hereby claim:
- I am jamesthompson on github.
- I am james_rth (https://keybase.io/james_rth) on keybase.
- I have a public key ASDoRfTsm8xenyyW3WnK2OabszUxiN4gGDNit_NJtwfUsgo
To claim this, I am signing this object:
| import javafx.scene.image.Image; | |
| import javax.imageio.ImageIO; | |
| import java.awt.image.*; | |
| import java.io.ByteArrayInputStream; | |
| import java.io.ByteArrayOutputStream; | |
| public Image getJavaFXImage(byte[] rawPixels, int width, int height) { | |
| ByteArrayOutputStream out = new ByteArrayOutputStream(); | |
| try { | |
| ImageIO.write((RenderedImage) createBufferedImage(rawPixels, width, height), "png", out); |
| #!/bin/sh | |
| set +ex | |
| # A script to install stack on Raspbian | |
| # Use stack installer script to install stack | |
| curl -sSL https://get.haskellstack.org/ | sh | |
| # Use apt-get to install llvm |
| {-# LANGUAGE AllowAmbiguousTypes #-} | |
| {-# LANGUAGE DataKinds #-} | |
| {-# LANGUAGE DerivingStrategies #-} | |
| {-# LANGUAGE FlexibleContexts #-} | |
| {-# LANGUAGE FlexibleInstances #-} | |
| {-# LANGUAGE GADTs #-} | |
| {-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
| {-# LANGUAGE InstanceSigs #-} | |
| {-# LANGUAGE KindSignatures #-} |
| using: "net.debasishg" %% "redisclient" % "2.11" | |
| // GetRedis.apply will print out all the keys and values in a csv list | |
| object GetRedis { | |
| import com.redis.{RedisClient, RedisClientPool} | |
| def apply = { | |
| val rcp = new RedisClientPool( | |
| sys.env.getOrElse("REDIS_HOST", "localhost"), | |
| 6379 | |
| ) |
| package CLEAN | |
| import scalala.tensor.dense.{DenseMatrix => Image} | |
| import collection.mutable.ArrayBuffer | |
| /** | |
| * Clean class implemented in Scala | |
| * Author: James R. Thompson, D.Phil | |
| * Date: 7/16/12 | |
| * Time: 9:31 AM |
I hereby claim:
To claim this, I am signing this object:
| { | |
| "cmd": ["/Users/James/Documents/Code/sbt/bin/sbt -no-colors compile run"], | |
| "file_regex": "^\\[error\\] ([.a-zA-Z0-9/-]+[.]scala):([0-9]+):", | |
| "selector": "source.scala", | |
| "working_dir": "${project_path:${folder}}", | |
| "shell": "true" | |
| } |
| {-# LANGUAGE DefaultSignatures #-} | |
| {-# LANGUAGE DeriveAnyClass #-} | |
| {-# LANGUAGE DeriveGeneric #-} | |
| {-# LANGUAGE FlexibleContexts #-} | |
| {-# LANGUAGE FlexibleInstances #-} | |
| {-# LANGUAGE MultiParamTypeClasses #-} | |
| {-# LANGUAGE TupleSections #-} | |
| {-# LANGUAGE TypeFamilies #-} | |
| {-# LANGUAGE TypeOperators #-} |
| import Data.List (intersperse) | |
| import Data.Monoid (mconcat) | |
| triangleIO :: IO () | |
| triangleIO = putStrLn triangle | |
| triangle :: String | |
| triangle = mconcat . intersperse "\n" . fmap (intersperse ' ') $ cycle ['0'] | |
| where cycle x = x : (cycle x >>= growOne) | |
| growOne (x:z) = [opp x:x:z] |
| import Control.Comonad (extract, (<<=), (=>>)) | |
| import Control.Monad (void) | |
| import Data.Functor (fmap) | |
| import Data.List (intersperse) | |
| import Data.List.NonEmpty (NonEmpty, toList, (<|)) | |
| import Data.Monoid (mconcat) | |
| import Data.Traversable (traverse) | |
| import Prelude (IO, Int, String, drop, id, mod, otherwise, | |
| putStrLn, take, undefined, ($), (.), (==)) |