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.URL | |
import java.awt.image.BufferedImage | |
import javax.imageio.ImageIO | |
import java.io._ | |
import scala.xml._ | |
import scala.io.Source | |
object TumblrCrawler { | |
def main( args:Array[String] ):Unit= { |
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
object ScreennameToId { | |
import scala.xml._ | |
import scala.io.Source | |
def main(args:Array[String]) = { | |
val source = Source.fromURL("http://twitter.com/users/show.xml?screen_name=%s".format(args.first)) | |
val xml = XML.loadString( source.getLines.mkString ) | |
println( xml \\ "id" text) | |
} | |
} |
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 scala.Math._ | |
import scala.xml._ | |
import scala.io.Source | |
object TwitterListRecommender{ | |
val url ="http://twitter.com/%s/lists/memberships.xml" | |
// Usage : scala TwitterListRecommender <your_id> <your_password> |
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.io.Source | |
object Chu2Name{ | |
def main( args:Array[String] ){ | |
val url = "http://pha22.net/name2/c/%s".format( args.first ) | |
val r ="""「(.+)((.+))」""".r | |
Source.fromURL( url, "utf-8").getLines.foreach{ | |
s => r.findFirstMatchIn(s). |
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
trait MaxLenValidation { | |
val maxLen:Int | |
msg :String | |
override def validations = | |
valMaxLen( maxLen,msg )_ :: super.validations | |
} | |
class Memo extends LongKeyedMapper[Message] with IdPK { | |
def getSingleton = Message | |
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
//ガウス=ルジャンドルのアルゴリズム | |
// あとでBigDecimalになおす | |
def calcPI( ac:Int ):Double = { | |
def stop_?( d:Double ) = d.toString.length > ac + 2 | |
def calc( a:Double , b:Double, t:Double, p:Double ):Double = { | |
println("%f, %f, %f, %f".format( a, b, t, p ) ) | |
if( stop_?( a ) && stop_?( b ) ) Math.pow( a + b , 2) / (4 * t) | |
else{ | |
val x = ( a + b ) / 2 | |
val y = Math.sqrt( a * b ) |
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
( ゚ω゚ ) | |
ヒショヒショC□l丶l丶 秘書なら任せろ | |
/ ( ) | |
(ノ ̄と、 i やめて | |
しーJ |
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 static org.hamcrest.CoreMatchers.*; | |
import static org.junit.Assert.*; | |
import org.junit.Test; | |
public class JpTest { | |
@Test | |
public void asciiMethodNameTest(){ | |
assertThat(true, is( true)); |