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 javax.swing.{ImageIcon, JWindow, JLabel} | |
import java.net.URL | |
import scala.xml.XML | |
import scala.collection.mutable.Queue | |
import scala.actors.Actor | |
import scala.actors.Actor.loop | |
import scala.concurrent.ops.spawn | |
object ViewImagesInFeed extends Application { | |
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.{Authenticator, PasswordAuthentication} | |
import java.net.{URL, HttpURLConnection} | |
import scala.xml.XML | |
import java.text.SimpleDateFormat | |
import java.util.Locale | |
object TwitterTimeline { | |
def main(arg: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
import scala.tools.nsc.{Interpreter, Properties, Settings} | |
import scala.util.matching.Regex | |
import java.io.ByteArrayOutputStream | |
import Thread.currentThread; | |
/** | |
* This program demonstrates the dynamic compilation and loading to JVM. | |
* | |
* A string will be read from stdin, and compiled and loaded dynamically. | |
* If the result is the function of String => _, "Hello" will be applied to it. |
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, Properties, Settings} | |
import scala.tools.nsc.{InterpreterResults=>IR} | |
import java.io.ByteArrayOutputStream | |
import java.lang.reflect.Method | |
import Thread.currentThread; | |
import scala.util.matching.Regex | |
/** | |
* This program demonstrates the dynamic compilation and loading to JVM. | |
* |
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 jp.takeda_soft.examples.{Plotter, SButton} | |
import java.lang.Math._ | |
import javax.swing.JFrame | |
import java.awt.BorderLayout | |
import scala.concurrent.ops.spawn | |
import scala.tools.nsc.Properties | |
/** | |
* This program will read anonymous functions in Int=>Int from stdin. | |
* After compiling and loading them dynamically, the 2D graph will be |
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._ | |
import scala.concurrent.ops.spawn | |
object TakahashiMethodInScalaSwing extends SimpleGUIApplication { | |
def top = new MainFrame { | |
title = "TakahashiMethodInScalaSwing" | |
/** | |
* MainFrame has already defined |
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 jp.takeda_soft.examples | |
/** | |
世界のナベアツに挑戦 | |
テーマ:implicitによるScalaAPIの拡張 | |
*/ | |
object Nabeatsu extends Application { | |
//Intがバカになるメソッド"!"を追加 | |
implicit def bakanize(n: Int) = new Bakanizer(n) |
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
import scala.util.parsing.combinator.lexical.StdLexical | |
import scala.util.parsing.combinator.syntactical.StdTokenParsers | |
/** | |
* This program will parse the arithmetic expression defined as follows, | |
* <exp> ::= <term> | <exp> "+" <term> | <exp> "-" <term> | |
* <term> ::= <factor> | <term> "*" <factor> | <term> "/" <factor> | |
* <factor> ::= <n> | "(" <exp> ")" | |
* , where n is a nonterminal symbol for numbers. | |
* |
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 = { |
OlderNewer