I hereby claim:
- I am mikehearn on github.
- I am hearn (https://keybase.io/hearn) on keybase.
- I have a public key ASAtBlfHGFrnjtqS-telpy4tveHymEWbfRtzMnMQYgKOMgo
To claim this, I am signing this object:
// A couple of inlined utility functions: the first is just a syntax convenience, the second lets us use | |
// Kotlin's string interpolation efficiently: the message is never calculated/concatenated together unless | |
// logging at that level is enabled. | |
inline fun <reified T : Any> loggerFor(): org.slf4j.Logger = LoggerFactory.getLogger(T::class.java) | |
inline fun org.slf4j.Logger.trace(msg: () -> String) { | |
if (isTraceEnabled) trace(msg()) | |
} | |
/** | |
* A Java logging formatter that writes more compact output than the default. |
I hereby claim:
To claim this, I am signing this object:
enum tinyram_opcode { | |
tinyram_opcode_AND = 0b00000, | |
tinyram_opcode_OR = 0b00001, | |
tinyram_opcode_XOR = 0b00010, | |
tinyram_opcode_NOT = 0b00011, | |
tinyram_opcode_ADD = 0b00100, | |
tinyram_opcode_SUB = 0b00101, | |
// Multiplications | |
tinyram_opcode_MULL = 0b00110, |
/Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home/bin/jlink --list-plugins | |
List of available plugins: | |
Plugin Name: class-for-name | |
Option: --class-for-name | |
Description: Class optimization: convert Class.forName calls to constant loads. | |
Plugin Name: compress | |
Option: --compress=<0|1|2>[:filter=<pattern-list>] |
enum SortBy { | |
Featured, | |
Relevance, | |
PriceLowToHigh, | |
PriceHighToLow, | |
Reviews | |
} | |
@PermazenType | |
class AmazonSearch( |
// Run like this: jjs -fx hello.js | |
load("fx:base.js"); | |
load("fx:controls.js"); | |
load("fx:graphics.js"); | |
// Set the title bar. | |
$STAGE.title = "Hello World!"; | |
// Create a button and place it in a layout that will center it. | |
var button = new Button(); | |
button.text = "Say 'Hello World'"; | |
button.onAction = function() print("Hello World!"); |
<html> | |
<head> | |
<title>Hello World!</title> | |
<style> | |
div.centered { | |
padding: 1em; | |
position: absolute; | |
top: 50%; | |
left: 50%; | |
margin-right: -50%; |
package net.corda.node.internal | |
import java.time.Clock | |
import java.time.Duration | |
import java.time.Instant | |
import java.time.ZoneId | |
import kotlin.properties.ReadWriteProperty | |
import kotlin.reflect.KProperty | |
/** |
typealias WSTR = CPointer<ShortVar> | |
private fun WSTR.toKString(): String = memScoped { | |
// Figure out how much memory we need after UTF-8 conversion. | |
val sz = WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, this@toKString, -1, null, 0, null, null) | |
// Now convert to UTF-8 and from there, a String. | |
val utf8 = allocArray<ByteVar>(sz) | |
val r = WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, this@toKString, -1, utf8, sz, null, null) | |
if (r == 0) throw RuntimeException("Could not convert to UTF-8") | |
utf8.toKString() |
import net.plan99.nodejs.NodeJS; | |
public class Demo { | |
public static void main(String[] args) { | |
int result = NodeJS.runJS(() -> | |
NodeJS.eval("return 2 + 3 + 4").asInt() | |
); | |
System.out.println(result); | |
} | |
} |