摘要: SparkContext 和 SparkConf 任何Spark程序都是SparkContext开始的,SparkContext的初始化需要一个SparkConf对象,SparkConf包含了Spark集群配置的各种参数。 初始化后,就可以使用SparkContext对象所包含的各种方法来创建和操作 阅读全文
posted @ 2017-08-12 19:32 Forever-Road 阅读(43230) 评论(0) 推荐(3) 编辑
摘要: windows用户首先得安装git客户端,这个网上有很多,就不赘述了,安装完后会出现GitBash: 打开GitBash终端,输入: git config --global user.name "账号"git config --global user.email "邮箱" 然后进入到项目件夹下 gi 阅读全文
posted @ 2017-08-12 18:01 Forever-Road 阅读(181) 评论(0) 推荐(0) 编辑
摘要: ElasticSearch 的检索没有Solr那么多类别,ElasicSearch默认是模糊查询,通过使用余弦相似度量算法来判断keyword和检索值的相似度,然后取出相似度最高的数据作为返回。 阅读全文
posted @ 2017-08-05 11:16 Forever-Road 阅读(1078) 评论(0) 推荐(0) 编辑
摘要: ElasticSearch 一般用于检索百万级别以上的数据,因此建立索引都是批量建立的,当然也支持单量索引。 ElasticSearch 以json数据格式作为数据插入格式,而Solr是以文档形式作为基本格式,因此在建立索引之前,首先得把数据封装成我们需要的格式: 可以用字符串,然后转成json: 阅读全文
posted @ 2017-08-05 10:55 Forever-Road 阅读(2859) 评论(0) 推荐(0) 编辑
摘要: ElasticSearch是一个基于Lucene的搜索服务器。它提供了一个分布式多用户能力的全文搜索引擎,基于RESTful web接口。Elasticsearch是用Java开发的,作为当前流行的企业级搜索引擎,用于云计算中,能够达到实时搜索,并且具有稳定,可靠,快速安装,使用方便等多种优点,得到 阅读全文
posted @ 2017-08-05 10:18 Forever-Road 阅读(9965) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #include using namespace std; struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode(int x) : val(x), left(NULL), right... 阅读全文
posted @ 2017-06-16 10:37 Forever-Road 阅读(281) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, find the maximum path sum. The path may start and end at any node in the tree. For exmple:Given the below binary tree, Return6. 翻 阅读全文
posted @ 2017-06-10 10:57 Forever-Road 阅读(254) 评论(0) 推荐(0) 编辑
摘要: Say you have an array for which the i th element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may compl 阅读全文
posted @ 2017-06-10 10:47 Forever-Road 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 栈(stack) stack是一种先进后出(First In Last Out,FILO)的数据结构,它只有一个口,平常在我们写深度优先遍历算法时,,就会用到栈,stack允许我们增加,移除,取得最顶端元素。但是除了最顶端元素之外,没有任何其他方法可以存取stack的其它元素,因此stack不允许有 阅读全文
posted @ 2017-05-24 09:59 Forever-Road 阅读(510) 评论(0) 推荐(0) 编辑
摘要: STL 所有容器应用到了空间配置器,当然 deque 在 _Deque_base 中设置了 两个空间配置器,一个负责缓冲区元素的空间配置,一个负责中控器map的指针空间配置: 当然可以追溯下元素空间配置用的配置器是啥: 咱们看看 _Base::get_allocator() 在哪里 可以知道,其实  阅读全文
posted @ 2017-05-10 21:24 Forever-Road 阅读(1101) 评论(0) 推荐(0) 编辑