##TUNING##
System: set file descriptors to 32K or 64K
vim /etc/security/limit.conf
http://www.cnblogs.com/yjmyzz/p/4694219.html | |
mvn clean scala:compile compile package | |
http://blog.csdn.net/kwu_ganymede/article/details/51832427 | |
https://blogs.oracle.com/arungupta/entry/scala_and_maven_getting_started | |
mvn scala:run | |
http://running8.blog.51cto.com/2687882/1603429 |
package main | |
/* | |
URL: https://github.com/mccoyst/myip/blob/master/myip.go | |
URL: http://changsijay.com/2013/07/28/golang-get-ip-address/ | |
*/ | |
import ( | |
"net" | |
"os" |
if _, err := os.Stat("/path/to/whatever"); os.IsNotExist(err) { | |
// path/to/whatever does not exist | |
} | |
if _, err := os.Stat("/path/to/whatever"); err == nil { | |
// path/to/whatever exists | |
} |
(1)方法一 | |
cmd := exec.Command("cmd", "args") | |
stdout, err := cmd.StdoutPipe() | |
cmd.Start() | |
r := bufio.NewReader(stdout) | |
for { | |
line, isPrefix, err := r.ReadLine() |
package com.test.flink | |
import java.util.Properties | |
import org.apache.flink.streaming.api.scala._ | |
import org.apache.flink.streaming.connectors.kafka.FlinkKafkaConsumer09 | |
import org.apache.flink.streaming.util.serialization.SimpleStringSchema | |
import org.apache.flink.streaming.api.windowing.time.Time | |
import org.json4s._ | |
import org.json4s.jackson.JsonMethods._ |
import org.json4s._ | |
import org.json4s.jackson.JsonMethods._ | |
object ScalaJson { | |
def main(args: Array[String]): Unit = { | |
implicit val formats = DefaultFormats | |
case class Model(hello: String, age: Int) |
import scala.reflect.runtime._ | |
import scala.tools.reflect.ToolBox | |
val cm = universe.runtimeMirror(getClass.getClassLoader) | |
val tb = cm.mkToolBox() | |
tb.parse("for(i <- List(1,2,3) ) {println(i)}") |
package main | |
import ( | |
"bufio" | |
"fmt" | |
"io" | |
"os" | |
"os/exec" | |
"strings" | |
) |
import scala.reflect.runtime.currentMirror | |
import scala.tools.reflect.ToolBox | |
object HelloQuasiquotes { | |
def main(args: Array[String]): Unit = { | |
val universe: scala.reflect.runtime.universe.type = scala.reflect.runtime.universe | |
import universe._ | |
val toolbox = currentMirror.mkToolBox() |