Skip to content

Instantly share code, notes, and snippets.

Atsuhiko Yamanaka ymnk

Block or report user

Report or block ymnk

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 gist:a5f823a0ef30bef0c38b
Verifying that +ymnk is my openname (Bitcoin username).
// The following code is from .
import java.math.BigInteger;
import javax.crypto.KeyAgreement;
public class ECCKeyAgreement {
public static void main(String[] args) throws Exception {
KeyPairGenerator kpg;
kpg = KeyPairGenerator.getInstance("EC","SunEC");
class Interval {
private Point upper;
private Point lower;
private Interval(Point lower, Point upper) {
if (lower != infinite && upper != infinite
&& !inclusive(lower.p).greater(upper.p))
throw new IllegalArgumentException(lower + " " + upper);
this.lower = lower;
View geolocation.html
<script type="text/javascript">
// Geolocation API[1] を使って、
// 開始地点と現在地の緯度・経度、及び両者の差を表示するためのプログラム
// [1]
// 開始地点の緯度・経度を保持する変数
var start_latitude;
/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
import com.jcraft.jsch.*;
import java.awt.*;
import javax.swing.*;
public class Shell{
public static void main(String[] arg){
ymnk /
Last active Apr 29, 2019
JSch examples
/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
* This program will demonstrate how to use "aes128-cbc".
import com.jcraft.jsch.*;
import java.awt.*;
import javax.swing.*;
public class AES{
View gist:1432802
$ scala
Welcome to Scala version (Java HotSpot(TM) Client VM, Java 1.6.0_16).
Type in expressions to have them evaluated.
Type :help for more information.
scala> :paste
// Entering paste mode (ctrl-D to finish)
trait X {
val a = ""
ymnk / gist:1341022
Created Nov 5, 2011
OOME on jruby caused by zlib's leaked resources.
View gist:1341022
ymnk@ubuntu:~/tmp/jruby-1.6.5$ ./bin/jruby -v -e "require 'zlib'; while true;; end"
jruby 1.6.5 (ruby-1.8.7-p330) (2011-10-25 9dcd388) (Java HotSpot(TM) Client VM 1.6.0_29) [linux-i386-java]
ymnk@ubuntu:~/tmp/jruby-1.6.5$ ../jruby/bin/jruby -v -e "require 'zlib'; while true;; end"
jruby (ruby-1.8.7-p330) (2011-11-04 fbeb240) (Java HotSpot(TM) Client VM 1.6.0_29) [linux-i386-java]
View gist:1186724
require 'zlib'
dict = "hello"
str = "hello, hello!"
d =
comp_str = d.deflate(str)
comp_str << d.finish
You can’t perform that action at this time.