This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The following code is from http://www.academicpub.org/PaperInfo.aspx?PaperID=14496 . | |
import java.math.BigInteger; | |
import java.security.*; | |
import java.security.spec.*; | |
import javax.crypto.KeyAgreement; | |
public class ECCKeyAgreement { | |
public static void main(String[] args) throws Exception { | |
KeyPairGenerator kpg; | |
kpg = KeyPairGenerator.getInstance("EC","SunEC"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* -*-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{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.xml._ | |
import scala.collection.mutable.{Map, HashMap} | |
/** | |
* The XML2JSON object will transform the XML data in scala.xml.Node to | |
* the string in JSON format. | |
*/ | |
object XML2JSON { | |
sealed trait JSONObject |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ | |
import com.jcraft.jsch.*; | |
import java.awt.*; | |
import javax.swing.*; | |
import java.net.*; | |
public class StreamForwarding{ | |
public static void main(String[] arg){ | |
int port; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.xml._ | |
import scala.util.parsing.json.JSON | |
/** | |
* The XML2JSON object will transform a string in json format to | |
* a NodeSeq object. | |
*/ | |
object JSON2XML { | |
def apply(input:String):NodeSeq = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ | |
import com.jcraft.jsch.*; | |
import java.awt.*; | |
import javax.swing.*; | |
import java.io.*; | |
import java.util.zip.GZIPInputStream; | |
public class Shell{ | |
public static void main(String[] arg){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.math.{BigDecimal => BD, MathContext} | |
import BD.{ZERO, ONE} | |
/** | |
* This program will calculate Pi with John Machin[1]'s formula[2]. | |
* This is just a translation from Mr. Kishida's Java implementation[3] to | |
* Scala one. | |
* | |
* [1] http://en.wikipedia.org/wiki/John_Machin | |
* [2] http://upload.wikimedia.org/math/f/1/5/f15dc3d39c473c4bd718e3a98145da0d.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://devtesting.jp/tddbc/?TDDBC%E4%BB%99%E5%8F%B003/%E8%AA%B2%E9%A1%8C |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script type="text/javascript"> | |
<!-- | |
// Geolocation API[1] を使って、 | |
// 開始地点と現在地の緯度・経度、及び両者の差を表示するためのプログラム | |
// [1] http://en.wikipedia.org/wiki/W3C_Geolocation_API | |
// 開始地点の緯度・経度を保持する変数 | |
var start_latitude; |
NewerOlder