2017年9月23日

read the file(scala)

摘要: two approaches{io.source / try-finally} scala.io.Source 1 . In Scala shell scripts, where the JVM is started and stopped in a relatively short period 阅读全文

posted @ 2017-09-23 15:45 satyrs 阅读(146) 评论(0) 推荐(0) 编辑

OS-101

摘要: 从什么角度看os。--定义 从什么角度看os。--定义 用户角度操作界面操作方式,用户环境。开发者,虚拟机,给予的资源和函数调用方式。资源管理者。作业组织者。 目标,方便性,高效性。资源稀缺。 发展 发展 单批处理:内存中一个任务(作业) 监控系统--人工取代 问题:slow performance 阅读全文

posted @ 2017-09-23 09:23 satyrs 阅读(136) 评论(0) 推荐(0) 编辑

for(scala)

摘要: i从1到n变化,对每一个i进行flatMap操作: 从1到i,对每一个j进行filter操作: 如果i+j为prime则选择此j,并对j进行map操作得到(i,j) map: def map[U](f:T=>U): List[U] =this match { case x::xs => f(x):: 阅读全文

posted @ 2017-09-23 06:33 satyrs 阅读(115) 评论(0) 推荐(0) 编辑

knn in scala

摘要: nearest neighbor algorithm -- greedy 1开始的点A(不同则答案不同) 2选择cost最小的点D 重复 3最后回到A,加总 knn in scala --intuition /** @author wyq * @version 1.0 * @date Sun Sep 阅读全文

posted @ 2017-09-23 05:46 satyrs 阅读(363) 评论(0) 推荐(0) 编辑

dual-tree algorithm

摘要: dual-tree algorithm = space tree+pruning dual-tree traversal+BaseCase() Score() Range search BaseCase(pi, pj): 如果两点间距离在range内,将reference point加入到query 阅读全文

posted @ 2017-09-23 05:04 satyrs 阅读(225) 评论(0) 推荐(0) 编辑

KMeans and optimization

摘要: random sheme or say naive input: k, set of n points place k centroids at random locations 随机选 repeat the follow operations until convergence 重复到收敛 --f 阅读全文

posted @ 2017-09-23 04:50 satyrs 阅读(251) 评论(1) 推荐(0) 编辑

collections

摘要: hierarchy of collection classes Iterate-> Seq, Set ,Map Seq->IndexedSeq, LinealSeq Set-> Map-> IndexedSeq ...>Array , String(from java) ->Vector Linea 阅读全文

posted @ 2017-09-23 00:34 satyrs 阅读(125) 评论(0) 推荐(0) 编辑

2017年9月22日

code snippet-01

摘要: more https://github.com/yuqingwang15/scala-coding 01break 用法 02 Symbol定义 03多行输出 04 case 05单例 06loop 阅读全文

posted @ 2017-09-22 23:52 satyrs 阅读(117) 评论(0) 推荐(0) 编辑

MRUNIT- unittest(hadoop)

摘要: keyword: JUnit4.x Mock MRprogramming 为了使用MRUnit,我们需要将hadoop-version-mrunit.jar和Junit4.x使用的jar包:junit.jar都添加到我们开发Hadoop程序项目的classpath中。 1. 测试Map,我们可以使用 阅读全文

posted @ 2017-09-22 23:52 satyrs 阅读(113) 评论(0) 推荐(0) 编辑

log4j

摘要: concept;features;limits about logging Logging是一个调试程序最基本的方法。被当作一个审计工具。 1 Debugger在多线程和分布式的环境中并不总是可用的。2 Debugger的信息是临时的,而Logging记录下来的信息是永久的。 1 Logging会影 阅读全文

posted @ 2017-09-22 23:33 satyrs 阅读(116) 评论(0) 推荐(0) 编辑

导航