Skip to content

Instantly share code, notes, and snippets.

View penland365's full-sized avatar

Jeffrey N. Davis penland365

View GitHub Profile
@penland365
penland365 / decode.scala
Created August 6, 2015 14:12
Argonaut decoding alternating JSON type
//In this case, we are decoding a type `Teams` from a third party service
//If `Teams` has any elements, the presented JSON is an Array of `Team`
//If `Teams` is empty, is is suppoed to be Optional. However, sometimes when `Teams` is empty the service returns an empty JSON object
import argonaut._, Argonaut._
case class Team(id: Int, name: String)
object Team {
implicit val decodeTeamJson: DecodeJson[Team] = { DecodeJson(h => for {
@penland365
penland365 / ServerDispatcher.scala
Last active December 8, 2015 20:26
Potential Finagle ServerDispatcher Annotations solution
package com.twitter.finagle.dispatch
import com.twitter.finagle.context.Contexts
import com.twitter.finagle.tracing.{Annotation, Trace}
import com.twitter.finagle.transport.Transport
import com.twitter.finagle.{Service, NoStacktrace, CancelledRequestException}
import com.twitter.util._
import java.util.concurrent.atomic.AtomicReference
import scala.collection.mutable.ListBuffer
@penland365
penland365 / taste.scala
Created December 8, 2017 15:38
Scala Programming Taste
// Which of these is a better style? Is there much of a difference?
def createMicrosoftAudio0(utterance: Utterance, svc: MsSynthSvc = MicrosoftSpeech.Synthesize): Future[SynthesizedSpeech] = {
if(!utterance.text.isDefined) return Future.exception(new UtteranceTextNotFound(utterance))
val req = SynthesizeRequest(utterance.convo.id, utterance.text.get)
for {
resp <- svc(req)
} yield SynthesizedSpeed(resp._1, resp._2)
}
@penland365
penland365 / StreamingRecognitionConfig.java
Created February 9, 2018 21:58
StreamingRecognitionConfig.java
private RecognitionConfig buildRecogintionConfig {
return com.google.cloud.speech.v1.RecognitionConfig.newBuilder()
.setEncoding(LINEAR16)
.setLanguageCode("en-US")
.setSampleRateHertz(16000)
.addSpeechContexts(speechContexts) // attached
.build();
}
private StreamingRecognitionConfig buildStreamingRecognitionConfig {
@penland365
penland365 / EngineState.scala
Last active July 18, 2018 16:45
Discussion w/ Delila
// so you have something like this?
def respond(state: EngineState): Future[EngineState] = {
}
def respond(state: EngineState): Future[EngineState] = {
state.transaction match {
case Throw(_) =>
val transaction = Transaction(state.request.conversation, UnrecognisedCommand, Vector.empty)
val request = ResponseRequest(state.request.conversation, transaction)
@penland365
penland365 / graphq-meetup.md
Last active January 28, 2019 21:37
(cons (clojure graphql))

(cons (clojure graphql))

Graphqls' declarative schemas and stringified strong typing cons* together perfectly with Clojure's dynamic typing, homoiconicity**, and easy concurrency.

We will take our first steps into the Clojure ecosystem and how it can work closely with Graphql. We will show how to create a simple Clojure app, how to read a LISP, how to understand de-structuring, and how to read an EDN, extensible data notation, file.

@penland365
penland365 / short.tsv
Last active March 2, 2019 02:34
tsv test
date high low
20101001 59.5 57.0
20101002 59.5 53.4
20101003 59.0 53.4
20101004 59.4 54.7
20101005 58.3 52.7
20101006 62.1 54.5
20101007 60.8 53.4
20101008 61.0 52.5
20101009 62.4 52.9

Louisiana Tech Bulldogs 2020 Staff and Offense Scouting Report

Prepared by: penland365 Finalized: 09/07/2020

Table of Contents

  • Staff Overview
  • Roster Overview
  • Offense