docker搭建mysql环境

1
2
3
docker pull mysql
docker run -itd --name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=123456 mysql
docker exec -it mysql bash

阅读全文

【转】Flask-SQLAlchemy使用方法

Flask-SQLAlchemy

阅读全文

Python 使用requests发送Http Get请求

1
2
3
4
5
6
7
8
import json
import requests

url = "http://localhost:5000/objecttrajactory/lastnminutes/2"
r = requests.get(url)
print(r.status_code)
dataJson = r.json()
print(dataJson)

阅读全文

no-title

1
2
3
4
5
6
7
SELECT
object_id,
ST_AsEWKT ( gps_line ),
ST_M(ST_EndPoint(gps_line)),
to_char(to_timestamp(ST_M(ST_EndPoint(gps_line))), 'YYYY-MM-DD HH24:MI:SS')
FROM
PUBLIC.objecttrajactory

阅读全文

Centos7 离线安装Docker

简单二进制安装

阅读全文

Win7安装Docker

win7系统下,一开始下载了docker desktop,发现安装失败:
在这里插入图片描述
因为docker desktop要求win10系统,老版本的只能安装docker toolbox。

阅读全文

scala try-Catch

scala Try-Catch

阅读全文

Spark操作hdfs

遍历hdfs目录

阅读全文

Spark DataFrame操作

Spark DataFrame

阅读全文

Spark WordCount代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/**
* Hello world!
*
*/
import org.apache.spark.SparkContext
import org.apache.spark.SparkConf

object WordCount {
def main(args: Array[String]) {
val inputFile = "file:///E://test.txt"
val conf = new SparkConf().setAppName("WordCount").setMaster("local")
val sc = new SparkContext(conf)
val textFile = sc.textFile(inputFile)
val wordCount = textFile.flatMap(line => line.split(" ")).map(word => (word, 1)).reduceByKey((a, b) => a + b)
wordCount.foreach(println)
}
}

阅读全文