Skip to content

Instantly share code, notes, and snippets.

Mitsunori Komatsu komamitsu

Block or report user

Report or block komamitsu

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Commands.txt
function wrap_jth {
grep 'daemon prio=' $1 | ruby -rcsv -ne 'puts CSV.parse($_,{:col_sep => "\s"}).first.first.gsub(/\d/, "0")' | sort | uniq -c
}
@komamitsu
komamitsu / ArithmeticCodeEvaluator.java
Created Jun 9, 2019
Small S-exp like arithmetic code interpreter in Java
View ArithmeticCodeEvaluator.java
package org.komamitsu.test;
import java.util.StringTokenizer;
public class ArithmeticCodeEvaluator
{
private static int eval(StringTokenizer tokenizer)
{
String first = tokenizer.nextToken();
if (first.equals("+")) {
@komamitsu
komamitsu / Command.txt
Created Nov 12, 2018
Calling Fluency from C using GraalVM:SubstrateVM
View Command.txt
$ javac -cp fluency-1.9.0-SNAPSHOT-shadow.jar org/komamitsu/fluencycaller/FluencyCaller.java
$ native-image --class-path fluency-1.9.0-SNAPSHOT-shadow.jar:. --shared -H:Name=libfluency --verbose
$ cc -Wall -I. -L. -lfluency main.c
$ ./a.out
View MyGdxGame.java
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 / komamitsu.json
Last active Feb 27, 2019
Karabiner-Elements Config
View komamitsu.json
{
"title": "Komamitsu's configuration",
"rules": [
{
"description": "Internal US keyboard (1452/632): Post option if left_control is pressed.",
"manipulators": [
{
"type": "basic",
"conditions": [
{
View RocksDBTest.java
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 Apr 27, 2018
io.digdag.core.workflow.WorkflowExecutorTest#retryOnGroupingTask at jackson-2_8_11 branch
View gist:baa92b5dbd270f21938e55c97f00c350
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 Mar 25, 2018
Performance and memory footprint comparison for set collections
View gist:0d67813f20904bd05dc93cf036cd5ab5
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 Oct 15, 2017
Lambda comparison between Java and Kotlin
View JavaLambdaTest.java
public class JavaLambdaTest
{
public int i;
public void runTask(Runnable f)
{
f.run();
}
public void run()
View JaninoExample.java
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)
You can’t perform that action at this time.