This file contains hidden or 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
public static void main(String[] args) { | |
SparkConf sparkConf = new SparkConf() | |
.setMaster("local[*]") | |
.setAppName("Example01"); | |
JavaSparkContext sc = new JavaSparkContext(sparkConf); | |
sc.parallelize(IntStream.range(1, 100).boxed().collect(Collectors.toList())).map(x -> { | |
return (x % 15 == 0) ? "FizzBuzz" | |
: (x % 5 == 0) ? "Fizz" | |
: (x % 3 == 0) ? "Buzz" | |
: x.toString(); |
This file contains hidden or 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
下記のエラーが発生 | |
Successfully built 5a6d26f6b991 | |
SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories. | |
The push refers to a repository [registry.heroku.com/secret-fjord-96615/web] | |
03c19e4bdde5: Preparing | |
5c331e8bd692: Preparing | |
d9bec0efee77: Preparing | |
d55a8cc45244: Preparing | |
52207ae120e6: Preparing |
This file contains hidden or 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
$ docker run marvambass/oracle-java9 java -version | |
java version "9-ea" | |
Java(TM) SE Runtime Environment (build 9-ea+130) | |
Java HotSpot(TM) 64-Bit Server VM (build 9-ea+130, mixed mode) |
This file contains hidden or 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
$ sudo apt-get install zsh |
This file contains hidden or 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
$(function(){ | |
var host = "ws://localhost:8888/"; | |
var socket = new WebSocket(host); | |
socket.onmessage = function(message){ | |
console.log(socket.readyState + " " + message.data); | |
} | |
$("#sendBtn").on("click",function(){ | |
message = $("#message").val() |
This file contains hidden or 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
while(true){ | |
if(events.isNotEmpty()){ | |
callback(events.pop()) | |
} | |
} |
This file contains hidden or 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
#!/usr/local/bin/perl | |
print "Content-type: text/html\n"; | |
print "\n"; | |
print "<html>\n"; | |
print "<head>\n"; | |
print "<title>Hello World</title>\n"; | |
print "</head>\n"; | |
print "<body>\n"; | |
print "Hello World.\n"; |
This file contains hidden or 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>cn.orz.pascal.sandbox</groupId> | |
<artifactId>sandbox2</artifactId> | |
<version>1.0-SNAPSHOT</version> | |
<packaging>jar</packaging> | |
<properties> | |
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | |
<maven.compiler.source>1.8</maven.compiler.source> |
This file contains hidden or 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
Tuple2<String, Integer> x = new Tuple2<>("A", 10); | |
Tuple2<Integer, String> y = $(1, "B"); | |
Map<Integer, String> xs = map($(1, "A"), $(2, "B"), $(3, "C")); |
This file contains hidden or 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
def saveAsTextFile(path: String): Unit = withScope { | |
// https://issues.apache.org/jira/browse/SPARK-2075 | |
// | |
// NullWritable is a `Comparable` in Hadoop 1.+, so the compiler cannot find an implicit | |
// Ordering for it and will use the default `null`. However, it's a `Comparable[NullWritable]` | |
// in Hadoop 2.+, so the compiler will call the implicit `Ordering.ordered` method to create an | |
// Ordering for `NullWritable`. That's why the compiler will generate different anonymous | |
// classes for `saveAsTextFile` in Hadoop 1.+ and Hadoop 2.+. | |
// | |
// Therefore, here we provide an explicit Ordering `null` to make sure the compiler generate |