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
:power | |
import java.io._ | |
import scala.tools.nsc.io.AbstractFile | |
def save(af: AbstractFile, dir: File) { | |
val f = new File(dir, af.name) | |
if (af.isDirectory) { | |
f.mkdirs() | |
af.par.foreach(a => save(a, f)) |
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
// Hadoop0.23 WordCount | |
package sample; | |
import java.io.IOException; | |
import java.util.StringTokenizer; | |
import org.apache.hadoop.conf.Configuration; | |
import org.apache.hadoop.conf.Configured; | |
import org.apache.hadoop.fs.Path; | |
import org.apache.hadoop.io.IntWritable; |
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 sample1; | |
import java.net.InetSocketAddress; | |
import java.util.Map; | |
import org.apache.commons.logging.Log; | |
import org.apache.commons.logging.LogFactory; | |
import org.apache.hadoop.conf.Configuration; | |
import org.apache.hadoop.net.NetUtils; | |
import org.apache.hadoop.yarn.api.AMRMProtocol; |
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 sample.yarn; | |
import java.io.IOException; | |
import java.net.URL; | |
import java.net.URLDecoder; | |
import java.util.Enumeration; | |
/** | |
* クラスのユーティリティー. | |
* <p> |
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
//getOrElseUpdateを使ってみたバージョン | |
case class Data(code: String, name: String, var value: Int) | |
val input = Seq( | |
Data("A01", "hoge", 100), Data("A01", "piyo", 200), | |
Data("A02", "hoge", 300), | |
Data("A03", "hoge", 400), Data("A03", "piyo", 500) | |
) | |
def summary1(list: Seq[Data]): Seq[Data] = { |
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 dice | |
class Dice8(num: IndexedSeq[Int]) { | |
def this(n0: Int, n1: Int, n2: Int, n3: Int) = { | |
this(Array(n0, n1, n2, n3, 9 - n2, 9 - n3, 9 - n0, 9 - n1)) | |
} | |
private val 隣接 = Array( | |
Array(1, 3, 4), //0 | |
Array(0, 5, 2), //1 |
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
// 1から100までの和を表示するプログラムを作れ | |
// http://togetter.com/li/278731 | |
#include <stdio.h> | |
// 実行する際は引数を99個指定すること。 | |
// 例)./a.out $(seq 1 99); echo $? | |
// ただし、終了コードが8bitしかない環境では正確な値は得られないorz | |
int main(int x) | |
{ |
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 example; | |
import java.io.IOException; | |
import org.apache.hadoop.conf.Configured; | |
import org.apache.hadoop.fs.FileStatus; | |
import org.apache.hadoop.fs.FileSystem; | |
import org.apache.hadoop.fs.Path; | |
import org.apache.hadoop.fs.PathFilter; | |
import org.apache.hadoop.io.IntWritable; |
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 example; | |
import java.io.IOException; | |
import org.apache.hadoop.conf.Configured; | |
import org.apache.hadoop.fs.FileSystem; | |
import org.apache.hadoop.fs.Path; | |
import org.apache.hadoop.io.IntWritable; | |
import org.apache.hadoop.io.NullWritable; | |
import org.apache.hadoop.io.SequenceFile; |
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 example.webview | |
import javafx.application.Application | |
import javafx.event.EventHandler | |
import javafx.fxml.FXML | |
import javafx.fxml.FXMLLoader | |
import javafx.fxml.Initializable | |
import javafx.scene.Scene | |
import javafx.scene.Parent | |
import javafx.scene.layout.StackPane |
OlderNewer