Skip to content

Instantly share code, notes, and snippets.


Simon Massey simbo1905

View GitHub Profile
package com.github.simbo1905.chronicle;
import java.util.ArrayList;
import java.util.List;
import com.higherfrequencytrading.chronicle.Chronicle;
import com.higherfrequencytrading.chronicle.datamodel.DataStore;
import com.higherfrequencytrading.chronicle.datamodel.ListWrapper;
import com.higherfrequencytrading.chronicle.datamodel.ModelMode;
import com.higherfrequencytrading.chronicle.impl.IndexedChronicle;
View gist:11349189
package dumbconsumer;
import java.util.List;
import java.util.Map;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
simbo1905 / SessionDemo.scala
Last active Aug 29, 2015
minor fix to code from Session state in Scala,1. Immutable Session State at
View SessionDemo.scala
object SessionDemo {
def main(args: Array[String]) {
import scala.concurrent.duration._
val timeoutSeconds = 10
def usage() {
System.out.println(s"|timoutSeconds: ${timeoutSeconds}")
System.out.println(s"|+ <key> <value> // add a value under a key")
public class Runner01 {
static class Array1 {
private Object delegate;
private Object allocate(Object delegate, int[] is, int pos) {
if (pos < is.length) {
delegate = new Object[is[pos]];
simbo1905 /
Last active Oct 10, 2019
JPA Converter which encrypts a column in the db
import java.util.Properties;
import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;
import javax.persistence.AttributeConverter;
import javax.persistence.Converter;
import org.slf4j.Logger;
simbo1905 / picklingissues.scala
Created Apr 23, 2015
scala.pickling.PicklingException: Tag scala.Some not recognized, looking for one of: scala.None.type, scala.Some[com.github.simbo1905.trex.internals.Accept]
View picklingissues.scala
// test case
import scala.pickling.Defaults._
import scala.pickling.shareNothing._
import scala.pickling.binary._
val p = PrepareAck(Identifier(1, ProposalNumber(2, 3), 4L), 5, Progress(ProposalNumber(6,7),Identifier(8,ProposalNumber(9,10),11L)), 12, 13, None)
val b = p.pickle.value
val pp = b.unpickle[PrepareAck]
simbo1905 / Pickling.scala
Created Apr 23, 2015
org.scala-lang.modules:scala-pickling_2.11:0.10.0.jar crashes Oracle Java OSX 1.8.0_45
View Pickling.scala
package com.github.simbo1905.trex.internals
import java.nio.ByteBuffer
import akka.util.ByteString
object Pickle {
import scala.pickling.Defaults._
protected void configure(HttpSecurity http) throws Exception {
.antMatchers("/", "/favicon.ico", "/resources/**", "/signup",
"/register", "/public")
simbo1905 /
Last active Mar 15, 2017
docked cassandra cluster
View perms-of-letters.scala
def perms(positions: List[Int]) = {
val x: Set[List[Int]] =
val y = x filter {
case a :: b :: Nil =>
(a, b) match {
case (a: Int, b: Int) if a < b => true
case _ => false
case _ => false
You can’t perform that action at this time.