Skip to content

Instantly share code, notes, and snippets.

View komamitsu's full-sized avatar

Mitsunori Komatsu komamitsu

View GitHub Profile
package com.mygdx.game;
import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input;
import com.badlogic.gdx.graphics.Camera;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
@komamitsu
komamitsu / myecho.ml
Created November 13, 2011 14:14
a Lwt echo server for practice
(* ocamlfind c -w A -linkpkg -package lwt,lwt.unix,lwt.syntax -syntax camlp4o,lwt.syntax myecho.ml -o myecho *)
(* This code refers to https://github.com/avsm/ocaml-cohttpserver/blob/master/server/http_tcp_server.ml *)
open Lwt
let server_port = 12345
let so_timeout = Some 20
let backlog = 10
let try_close chan =
catch (fun () -> Lwt_io.close chan)
import org.rocksdb.EnvOptions;
import org.rocksdb.FlushOptions;
import org.rocksdb.IngestExternalFileOptions;
import org.rocksdb.Options;
import org.rocksdb.OptionsUtil;
import org.rocksdb.RocksDB;
import org.rocksdb.SstFileWriter;
public class RocksDBTest
{
@komamitsu
komamitsu / gist:baa92b5dbd270f21938e55c97f00c350
Last active April 27, 2018 00:33
io.digdag.core.workflow.WorkflowExecutorTest#retryOnGroupingTask at jackson-2_8_11 branch
io.digdag.core.agent.OperatorManager#runWithWorkspace
Config localConfig = config.getFactory().create();
for (String localKey : request.getLocalConfig().getKeys()) {
>>> localConfig.set(localKey, config.getOptional(localKey, JsonNode.class).transform(JsonNode::deepCopy).orNull());
}
ex = {java.lang.ClassCastException@5548} "java.lang.ClassCastException: java.lang.String cannot be cast to com.fasterxml.jackson.databind.JsonNode"
detailMessage = "java.lang.String cannot be cast to com.fasterxml.jackson.databind.JsonNode"
cause = {java.lang.ClassCastException@5548} "java.lang.ClassCastException: java.lang.String cannot be cast to com.fasterxml.jackson.databind.JsonNode"
@komamitsu
komamitsu / gist:0d67813f20904bd05dc93cf036cd5ab5
Last active March 25, 2018 16:28
Performance and memory footprint comparison for set collections
package org.komamitsu.test;
import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet;
import it.unimi.dsi.fastutil.objects.ObjectSets;
import org.eclipse.collections.api.factory.set.MutableSetFactory;
import org.eclipse.collections.api.set.MutableSet;
import org.eclipse.collections.impl.set.mutable.UnifiedSet;
import org.trie4j.doublearray.DoubleArray;
import org.trie4j.patricia.PatriciaTrie;
@komamitsu
komamitsu / JavaLambdaTest.java
Last active October 15, 2017 15:26
Lambda comparison between Java and Kotlin
public class JavaLambdaTest
{
public int i;
public void runTask(Runnable f)
{
f.run();
}
public void run()
package org.komamitsu.test;
import org.codehaus.commons.compiler.CompilerFactoryFactory;
import org.codehaus.commons.compiler.IClassBodyEvaluator;
import java.lang.reflect.Method;
public class JaninoExample
{
public int add(int a, int b)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MeScript : MonoBehaviour {
void Update() {
transform.Rotate(0, Input.GetAxis("Horizontal") * 60 * Time.deltaTime, 0);
transform.Translate(Vector3.forward * Input.GetAxis("Vertical") * 0.2f, Space.Self);
}

LSNs

  • VCL

    • Volume Complete LSN
    • Guarantee availability of all prior log records
    • During storage recovery, every log record with an LSN larger than the VCL must be truncated
  • VDL

    • Volume Durable LSN
  • Consistency Point LSNs

2.7.1
[info] Test org.msgpack.jackson.dataformat.benchmark.MessagePackDataformatHugeDataBenchmarkTest.testBenchmark started
serialize(huge) with JSON:
mean : 28.948
min : 28.728
max : 29.139
stdev: 0.180
serialize(huge) with MessagePack:
mean : 31.686