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
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 | |
http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>hello</groupId> | |
<artifactId>hello</artifactId> |
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 included pom.xml expects wave-robot-api-20090916.jar is stored in the repository. | |
* Donwload that jar file from its donwload site[1], | |
* Install that file into your repository with following command, | |
mvn install:install-file \ | |
-Dfile=wave-robot-api-20090916.jar \ | |
-DgroupId=com.google.wave \ | |
-DartifactId=wave-robot-api \ | |
-Dversion=20090916 \ |
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
A simple Liftweb app: Clock with CometActor |
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._ | |
/** | |
* expr :: CREATE TABLE tbl_name ( create_definition,...) | |
* | |
* create_definition: | |
* col_name column_definition | |
* | |
* column_definition: | |
* data_type |
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
/** | |
* This program has come from http://gist.github.com/18268 . | |
*/ | |
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) { | |
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.actors._ | |
import scala.actors.Actor._ | |
object ActorInSingleThread { | |
class MyActor(n:Int, single:Boolean) extends Actor{ | |
override def scheduler: IScheduler = | |
if(single) new SingleThreadedScheduler else super.scheduler | |
def act = { |
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.io.{ByteArrayOutputStream, IOException, OutputStream, File} | |
import java.io.{File, FileInputStream, DataInputStream} | |
import java.net.{URL, URLConnection, HttpURLConnection} | |
import java.util.Random | |
abstract sealed class Param | |
case class FieldParam(key:String, value:String) extends Param | |
case class DataParam(key:String, filename:String, | |
data:Array[Byte], typ:Option[String]) extends Param | |
case class FileParam(key:String, file:File, typ:Option[String]) extends Param |
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
/** | |
* This trait is the Packrat parser[1] library based on kmizu[2]'s parser | |
* combinators[3] for PEG[4]. | |
* | |
* [1] http://pdos.csail.mit.edu/~baford/packrat/ | |
* [2] http://d.hatena.ne.jp/kmizushima/ | |
* [3] http://d.hatena.ne.jp/kmizushima/20090226/1235619468 | |
* [4] http://en.wikipedia.org/wiki/Parsing_expression_grammar | |
**/ | |
trait PackratParser[+A]{ |
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) 2009 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 |