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 oot.lab5.group1.jacket; | |
public class Cloth { | |
private String name; | |
private Pocket leftPocket; | |
private Pocket rightPocket; | |
public void setLeftPocket(Pocket value) { | |
this.leftPocket = value; |
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
# checkout prev (older) revision | |
git_prev() { | |
git checkout HEAD~ | |
} | |
# checkout next (newer) commit | |
git_next() { | |
BRANCH=`git show-ref | grep $(git show-ref -s -- HEAD) | sed 's|.*/\(.*\)|\1|' | grep -v HEAD | sort | uniq` | |
HASH=`git rev-parse $BRANCH` | |
PREV=`git rev-list --topo-order HEAD..$HASH | tail -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
name := "sparkgrep" | |
version := "1.0" | |
scalaVersion := "2.10.5" | |
libraryDependencies ++= Seq ( | |
"org.apache.spark" % "spark-core_2.10" % "1.4.1", | |
"org.apache.spark" % "spark-sql_2.10" % "1.4.1", | |
"org.apache.spark" % "spark-streaming_2.10" % "1.4.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
Logger.getLogger("org.apache.hadoop").setLevel(Level.OFF) | |
Logger.getLogger("org.apache.spark").setLevel(Level.OFF) | |
Logger.getLogger("org.eclipse.jetty.server").setLevel(Level.OFF) |
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
Sys.setenv(SPARK_HOME="c:/spark") | |
SPARK_HOME <- Sys.getenv("SPARK_HOME") | |
SPARKR_LIB <- file.path(SPARK_HOME, "R", "lib") | |
.libPaths(c(SPARKR_LIB, .libPaths())) | |
library(SparkR) |
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 spark.example | |
import org.apache.log4j.{Level, Logger} | |
import org.apache.spark.SparkConf | |
import org.apache.spark.storage.StorageLevel | |
import org.apache.spark.streaming.{Seconds, StreamingContext} | |
object N12_Streaming { | |
def main(args: Array[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
name := "streaming-demo" | |
version := "1.0" | |
scalaVersion := "2.10.5" | |
libraryDependencies ++= Seq ( | |
"org.apache.spark" % "spark-core_2.10" % "1.4.1" % "provided", | |
"org.apache.spark" % "spark-sql_2.10" % "1.4.1" % "provided", | |
"org.apache.spark" % "spark-streaming_2.10" % "1.4.1" % "provided", |
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 spark.example | |
import org.apache.log4j.{Level, Logger} | |
import org.apache.spark.SparkConf | |
import org.apache.spark.storage.StorageLevel | |
import org.apache.spark.streaming.kafka.KafkaUtils | |
import org.apache.spark.streaming.{Seconds, StreamingContext} | |
object N13_KafkaStreaming { |
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
// | |
// ใช้ TreeMap เพื่อให้ key เรียงกันอัตโนมัติ | |
// | |
def result=new TreeMap() | |
// | |
// File.eachLine เป็น method ใน GDK, อ่านข้อมูลจากไฟล์เข้ามาทีละบรรทัด | |
// แล้ว bind ให้ it | |
// | |
new File("input.txt").eachLine { |
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
SEVERE: [1239889065640000] javax.servlet.ServletContext log: Unhandled exception | |
occurred whilst decorating page | |
org.codehaus.groovy.grails.web.mapping.exceptions.UrlMappingException: Error map | |
ping onto view [/index]: Error processing GroovyPageView: access denied (groovy. | |
security.GroovyCodeSourcePermission /groovy/script) | |
at org.codehaus.groovy.grails.web.mapping.filter.UrlMappingsFilter.rende | |
rViewForUrlMappingInfo(UrlMappingsFilter.java:253) | |
at org.codehaus.groovy.grails.web.mapping.filter.UrlMappingsFilter.doFil | |
terInternal(UrlMappingsFilter.java:188) | |
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerR |
OlderNewer