Skip to content

Instantly share code, notes, and snippets.

@LCamel
LCamel / AAA.java
Last active June 5, 2020 09:35
sftp / jsch
import com.jcraft.jsch.ChannelSftp;
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.Session;
import java.util.Vector;
class JSCHLogger implements com.jcraft.jsch.Logger {
public JSCHLogger() {
}
@LCamel
LCamel / AA.java
Last active May 9, 2020 02:59
5 balls
package lcamel;
import java.util.LinkedHashSet;
import java.util.Set;
public class AA {
static final int L = 1;
static final int H = 100;
// all possible weight combinations
static int[][] wss = new int[][] {
@LCamel
LCamel / schema.json
Created April 23, 2020 01:49
parquet
{
"type": "record",
"name": "DumpData",
"namespace": "com.oath.affiliate.data_collector",
"fields": [
{
"name": "level1Categories",
"type": [
"null",
{
@LCamel
LCamel / a.cpp
Created December 12, 2016 18:55
Print with error messages
// https://www.ptt.cc/bbs/Programming/M.1481568735.A.6D7.html
// g++ -std=c++0x -ftemplate-depth=1001 a.cpp 2>&1 | grep -oP '(?<=Print<)\d+'
template <int i> struct Print { enum : int {
v = (void) i // die!
};};
template <int i, bool b> struct Test { enum : int {
v = 42
};};
template <int i > struct Test<i, false> { enum : int {
var async = require('async');
(function () {
var tmp;
async.series(
[
(cb) => { console.log("1"); tmp = "foo"; cb(null, "result1"); },
(cb) => { console.log("2"); cb(null, tmp + " result2"); },
],
(err, results) => { console.log("result: " + results); }
@LCamel
LCamel / a.js
Last active June 22, 2016 05:39
typeof null
function f() { return typeof null === "object"; }
console.log(f());
// for (var i = 0; i < 10000; i++) f();
%OptimizeFunctionOnNextCall(f);
console.log(f());
console.log(process.versions.v8)
@LCamel
LCamel / AA.java
Created June 2, 2016 16:06
inner class
import java.lang.reflect.Constructor;
public class AA {
public static void main(String[] args) throws InterruptedException {
f1();
}
private static void f1() {
int i = 3;
String s = "foo";
Runnable r = new Runnable() {
@LCamel
LCamel / 3d.html
Last active August 31, 2015 01:48
3d
<html>
<head>
</head>
<body id="body" bgcolor="black">
<div class="wrap" style="left: 500px; top: 100px">
<div class="cube">
<div class="front">🙊</div>
<div class="back" style="background: #44ff44; font-size: 400%"></div>
M a -> (a -> M b) -> M b
# This is the default .slate file.
# If no ~/.slate file exists this is the file that will be used.
config defaultToCurrentScreen true
config nudgePercentOf screenSize
config resizePercentOf screenSize
# Resize Bindings
#bind right:alt resize +10% +0
#bind left:alt resize -10% +0