Skip to content

Instantly share code, notes, and snippets.

View ymnk's full-sized avatar

Atsuhiko Yamanaka ymnk

View GitHub Profile
Verifying that +ymnk is my openname (Bitcoin username). https://onename.io/ymnk
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 {
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]){
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
import swing._
import swing.event._
import scala.concurrent.ops.spawn
object TakahashiMethodInScalaSwing extends SimpleGUIApplication {
def top = new MainFrame {
title = "TakahashiMethodInScalaSwing"
/**
* MainFrame has already defined
package jp.takeda_soft.examples
/**
世界のナベアツに挑戦
テーマ:implicitによるScalaAPIの拡張
*/
object Nabeatsu extends Application {
//Intがバカになるメソッド"!"を追加
implicit def bakanize(n: Int) = new Bakanizer(n)
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.
*
import java.net.{Authenticator, PasswordAuthentication}
import java.net.{URL, HttpURLConnection}
import scala.xml.{XML, Node}
import scala.collection.mutable.Map
class FriendOrFollow (screen_name:String) {
private val friends_url = "http://twitter.com/statuses/friends/%s.xml"
lazy val friends:Map[String, Node] =
getMap(friends_url.replace("%s", screen_name))
import scala.xml.Node
import scala.collection.immutable.Set
import scala.util.Sorting
/**
* This program will demonstrate how to use scala.util.Sorting.
*/
object SortingDemo {
def main(arg:Array[String])={
/*
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