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.tools.nsc.{Interpreter, Settings, Global} | |
import scala.tools.nsc.util.{Position,NoPosition, ShowPickled} | |
import scala.reflect.generic.{PickleFormat, PickleBuffer} | |
import scala.tools.nsc.symtab.classfile.{ClassfileParser} | |
import scala.tools.nsc.io.AbstractFile | |
import java.io.{OutputStream, PrintStream, ByteArrayOutputStream} | |
object DumpGenericsSignature { | |
class MyParser extends ClassfileParser{ | |
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
/* | |
Copyright (c) 2008 ymnk, JCraft,Inc. All rights reserved. | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions are met: | |
1. Redistributions of source code must retain the above copyright notice, | |
this list of conditions and the following disclaimer. | |
2. Redistributions in binary form must reproduce the above copyright |
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
package pdr; | |
import javax.swing._; | |
import java.awt._ | |
import java.awt.geom._; | |
import java.awt.image._ | |
import java.io._ | |
import scala.collection.mutable.ArrayBuffer | |
import scala.collection.mutable.HashMap |
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
/* | |
* ftdop2.scala | |
* Functional Top Down Operator Precedence | |
*/ | |
package ftdop2 | |
import scala.util.matching.Regex | |
import scala.collection.mutable.HashMap | |
object main { | |
def main(argv:Array[String]) { |
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 ARCFour{ | |
private var x:Int = _ | |
private var y:Int = _ | |
private val state = new Array[Int](256) | |
def decrypt(src:Array[Byte], off:Int, length:Int):Array[Byte]={ | |
encrypt(src, off, length) | |
} | |
def decrypt(src:Array[Byte], soff:Int, |
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.net.{InetAddress, Socket, InetSocketAddress} | |
import java.io._ | |
import scala.collection.mutable._ | |
import scala.io.Source | |
import scala.concurrent.ops.spawn | |
/** | |
* This program expects to be comipled with ARCFour.scala[1] . | |
* [1] http://gist.github.com/28462 | |
*/ |
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
/* | |
Copyright (c) 2008 ymnk, JCraft,Inc. All rights reserved. | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions are met: | |
1. Redistributions of source code must retain the above copyright notice, | |
this list of conditions and the following disclaimer. | |
2. Redistributions in binary form must reproduce the above copyright |
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
/* | |
Copyright (c) 2008 ymnk, JCraft,Inc. All rights reserved. | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions are met: | |
1. Redistributions of source code must retain the above copyright notice, | |
this list of conditions and the following disclaimer. | |
2. Redistributions in binary form must reproduce the above copyright |
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 swing._ | |
import swing.event._ | |
/** | |
* http://d.hatena.ne.jp/xibbar/20081203#1228294818 | |
*/ | |
object SimpleGui1B extends SimpleGUIApplication { | |
def top = new MainFrame { | |
title = "SimpleGui1B" | |
contents = new Button { |