Skip to content

Instantly share code, notes, and snippets.

View jnorthrup's full-sized avatar

Jim Northrup jnorthrup

View GitHub Profile
@jnorthrup
jnorthrup / ReflectXmlType.java
Created September 26, 2012 23:02
generator bad
package sample.app;
import com.google.gwt.core.ext.Generator;
import com.google.gwt.core.ext.GeneratorContext;
import com.google.gwt.core.ext.TreeLogger;
import com.google.gwt.core.ext.UnableToCompleteException;
import com.google.gwt.core.ext.typeinfo.*;
import com.google.gwt.editor.rebind.model.ModelUtils;
import com.google.gwt.user.rebind.ClassSourceFileComposerFactory;
package com.fnreport.org.bereft
import com.binance.api.client.BinanceApiClientFactory
import vec.util.logDebug
import java.io.FileWriter
import java.util.*
/**
* maybe this is two classes? or maybe it's just a rarely used loop filter thing that needs no more attention.
*/
@jnorthrup
jnorthrup / shell res
Created April 20, 2020 16:48
kotlinc vs python3
jim@OJFQCCK22EVHS7YKLYN6LXTEZ2JR4HAZ:~/work/columnar/superannuate$ export JAVA_HOME=/opt/jdk-15/ JAVA_OPTS=-Xmx512m ;export PATH=/opt/jdk-15//bin/:$PATH;time kotlinc-jvm -jvm-target 13 -Xnew-inference -cp $(find ../cursor/target/ -name '*jar'|xargs -n999 echo|tr ' ' :) -script histogram.kts
OpenJDK 64-Bit Server VM warning: Options -Xverify:none and -noverify were deprecated in JDK 13 and will likely be removed in a future release.
1
emulating
import pandas as pd;
/*
* StringParser.java
*
* Copyright (C) 2008 Pei Wang
*
* This file is part of Open-NARS.
*
* Open-NARS is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
@jnorthrup
jnorthrup / pom.xml
Last active November 2, 2019 13:44
simplest possible grammar
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.fnreport</groupId>
<artifactId>lownal</artifactId>
<version>1.0-SNAPSHOT</version>
<repositories>
java.lang.IllegalArgumentException: The tokens list should not be empty
at com.github.h0tk3y.betterParse.lexer.DefaultTokenizer.<init>(DefaultTokenizer.kt:9)
at com.github.h0tk3y.betterParse.grammar.Grammar$tokenizer$2.invoke(Grammar.kt:31)
at com.github.h0tk3y.betterParse.grammar.Grammar$tokenizer$2.invoke(Grammar.kt:17)
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
at com.github.h0tk3y.betterParse.grammar.Grammar.getTokenizer(Grammar.kt)
at com.github.h0tk3y.betterParse.grammar.GrammarKt.tryParseToEnd(Grammar.kt:63)
at com.fnreport.sentenceTest$1.invoke(sentenceTest.kt:28)
@jnorthrup
jnorthrup / Narsive.java
Created June 14, 2015 02:25
conceptual narsese grammar
package hacks;
import bbcursive.Cursive;
import bbcursive.std;
import java.nio.ByteBuffer;
import java.nio.IntBuffer;
import java.util.ArrayList;
import java.util.concurrent.atomic.AtomicInteger;
@jnorthrup
jnorthrup / gdns
Last active September 25, 2019 05:43
Indonesian reddit DNS script
#use google dns webservice
#as root
for i in $@
do
eval echo $(
curl -s 'https://dns.google.com/resolve?name='${i[@]}'&type=A'|
jq -S '.Answer[-1].data'
) $i |
/usr/lib/jvm/java-12-openjdk-amd64/bin/java -ea -Didea.test.cyclic.buffer.size=1048576 -javaagent:/home/jim/.local/share/JetBrains/Toolbox/apps/IDEA-JDK11/ch-0/191.7479.19/lib/idea_rt.jar=35803:/home/jim/.local/share/JetBrains/Toolbox/apps/IDEA-JDK11/ch-0/191.7479.19/bin -Dfile.encoding=UTF-8 -classpath /home/jim/.local/share/JetBrains/Toolbox/apps/IDEA-JDK11/ch-0/191.7479.19/lib/idea_rt.jar:/home/jim/.local/share/JetBrains/Toolbox/apps/IDEA-JDK11/ch-0/191.7479.19/plugins/junit/lib/junit-rt.jar:/home/jim/.local/share/JetBrains/Toolbox/apps/IDEA-JDK11/ch-0/191.7479.19/plugins/junit/lib/junit5-rt.jar:/home/jim/work/json-lazy-autobean/target/test-classes:/home/jim/work/json-lazy-autobean/target/classes:/home/jim/.m2/repository/com/google/gwt/gwt-dev/2.6.0/gwt-dev-2.6.0.jar:/home/jim/.m2/repository/org/json/json/20090211/json-20090211.jar:/home/jim/.m2/repository/com/google/gwt/gwt-user/2.6.0/gwt-user-2.6.0.jar:/home/jim/.m2/repository/javax/validation/validation-api/1.0.0.GA/validation-api-1.0.0.GA.jar:/home/jim
plugins {
id 'kotlin-multiplatform' version '1.3.31'
}
repositories {
jcenter()
mavenCentral()
}
group 'com.example'
version '0.0.1'