1.准备文本文件,从文件创建RDD lines=sc.textFile(),筛选出含某个单词的行 lines.filter(),lambda 参数:条件表达式 2.生成单词的列表,从列表创建RDD words=sc.parallelize(),筛选出长度大于2 的单词 words.filter() ...
分类:
其他好文 时间:
2021-03-29 12:30:29
阅读次数:
0
1. 准备文本文件从文件创建RDD lines=sc.textFile()筛选出含某个单词的行 lines.filter()lambda 参数:条件表达式 2. 生成单词的列表从列表创建RDD words=sc.parallelize()筛选出长度大于2 的单词 words.filter() ...
分类:
其他好文 时间:
2021-03-29 12:04:28
阅读次数:
0
描述 给定一个字符串 s 和一些长度相同的单词 words。找出 s 中恰好可以由 words 中所有单词串联形成的子串的起始位置。 注意子串要与 words 中的单词完全匹配,中间不能有其他字符,但不需要考虑 words 中单词串联的顺序。 示例 1: 输入: s = "barfoothefoob ...
分类:
编程语言 时间:
2021-02-24 13:19:03
阅读次数:
0
背景 Read the fucking source code! --By 鲁迅 A picture is worth a thousand words. --By 高尔基 说明: KVM版本:5.9.1 QEMU版本:5.0.0 工具:Source Insight 3.5, Visio 文章同步在 ...
分类:
系统相关 时间:
2021-02-16 12:27:04
阅读次数:
0
A 题面 对于一个仅含小写字母的字符串 \(a\) ,若 \(p\) 为 \(a\) 的前缀且 \(p\ne a\) ,那么我们称 \(p\) 为 \(a\) 的 \(proper\) 前缀。 规定字符串 \(Q\)(可以是空串)表示 \(a\) 的周期,当且仅当 \(Q\) 是 \(a\) 的 \ ...
分类:
其他好文 时间:
2021-02-15 12:07:24
阅读次数:
0
首先我们要清楚 private 、 protected 现阶段只是javascript中的保留字(Reserved words),而非关键字(Keywords )。因此TypeScript中的纯类型声明语句,编译后都会被擦除。 class Person { public name: string; ...
分类:
其他好文 时间:
2021-02-05 11:01:37
阅读次数:
0
不管是GMM,还是k-means,都面临一个问题,就是k的个数如何选取?比如在bag-of-words模型中,用k-means训练码书,那么应该选取多少个码字呢?为了不在这个参数的选取上花费太多时间,可以考虑层次聚类。 假设有N个待聚类的样本,对于层次聚类来说,基本步骤就是: 1、(初始化)把每个样 ...
分类:
其他好文 时间:
2021-01-20 11:55:49
阅读次数:
0
Word Ladder (H) 题目 Given two words beginWord and endWord, and a dictionary wordList, return the length of the shortest transformation sequence from be ...
分类:
其他好文 时间:
2021-01-12 10:54:49
阅读次数:
0
好久没写博客了 这次准备在 cnblogs 和 我的博客 上同步更新~ # 题面 一个 \(n\) 个点 \(m\) 条边的 DAG,有若干个特殊点,边有权值。 一个单词定义为从点 \(1\) 出发到达一个特殊点的路径上,边权按访问顺序构成的一个序列。 \(Q\) 次询问,每次给出 \(k\),求所 ...
分类:
其他好文 时间:
2021-01-08 11:32:53
阅读次数:
0
背景 Read the fucking source code! --By 鲁迅 A picture is worth a thousand words. --By 高尔基 说明: Kernel版本:4.14 ARM64处理器 使用工具:Source Insight 3.5, Visio 1. 概述 ...
分类:
系统相关 时间:
2020-12-25 12:25:50
阅读次数:
0