摘要: 原文地址:http://mzorro.me/post/55c85d06e40daa9d022f3cbdWordCount可以说是分布式数据处理框架的”Hello World”,我们可以以它为例来剖析一个Spark Job的执行全过程。我们要执行的代码为:sc.textFile("hdfs://...... 阅读全文
posted @ 2015-08-10 20:31 mzorro 阅读(334) 评论(0) 推荐(0) 编辑
摘要: 1038. Recover the Smallest Number (30) 时间限制 400 ms 内存限制 32000 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Given a collection of number segments, you are supposed to recover the smallest number from t... 阅读全文
posted @ 2013-08-30 00:03 mzorro 阅读(636) 评论(0) 推荐(0) 编辑
摘要: 1026. Table Tennis (30) 时间限制 400 ms 内存限制 32000 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue A table tennis club has N tables available to the public. The tables are numbered from 1 to N. For any pair ... 阅读全文
posted @ 2013-08-25 00:53 mzorro 阅读(599) 评论(0) 推荐(0) 编辑
摘要: 续: C++ Iostreams 用法详解(一)整体把握 C++ Iostreams 用法详解(二)标准入输出 C++ Iostreams 用法详解(三)状态标志位 期中考试终于告一段落,再来继续写咯。 在前面说到过每一个iostream对象都有一个缓冲区,我们称之为流缓冲区,那个这个所谓的流缓冲区是怎么存在的呢?iostreams中将该流缓冲区抽象为一个类,即streambuf类。 ... 阅读全文
posted @ 2013-05-28 10:32 mzorro 阅读(1700) 评论(0) 推荐(1) 编辑
摘要: 续:C++ Iostreams 用法详解(一)整体把握C++ Iostreams 用法详解(二)标准入输出iostreams中共有四个状态标志位定义在ios_base中,具体如下:namespace std { class ios_base { public: typedef implementation-defined-bitmask-type iostate; static const iostate badbit; static const iostate eofbit; static const iostate failbit; ... 阅读全文
posted @ 2013-05-17 00:25 mzorro 阅读(2356) 评论(0) 推荐(0) 编辑
摘要: 续:C++ Iostreams 用法详解(一)整体把握首先说我们最常用的两个全局对象cin和cout,以下摘自MSDN:You can then extract values from cin or wcin to read the standard input. The rules for doing so are outlined in the description of the class basic_istream Class. You can also insert values to cout or wcout to write the standard output. The 阅读全文
posted @ 2013-05-11 00:41 mzorro 阅读(1501) 评论(4) 推荐(0) 编辑
摘要: 个人觉得C++的iostream用起来是非常方便的,只需要使用简单的<<和>>运算符就可以方便的进行各种类型的数据的格式化输入输出。而且C++中的iostream在编译阶段完成输入输出的格式化解析的,比C中的printf()和scanf()在运行时格式化解析要更加安全和强大。在这个系列中我就来详细的介绍一下C++中各种输入输出流的用法。首先来大致了解一下C++中的iostreams,我们用到的所有的相关的内容都会定义在下面的这些头文件里:<fstream> <iomanip> <ios> <iosfwd> <iost 阅读全文
posted @ 2013-05-09 20:11 mzorro 阅读(1751) 评论(0) 推荐(1) 编辑
摘要: /*********************************************** 将k个已经完成排序的链表合并为一个排序链表* 本例从文件test.txt输入所有行,链表用vector来模拟* 对共有n个数据的k个已排序链表排序,时间为O(n*lgk)***********************************************/#include <iostream>#include <fstream>#include <sstream>#include <vector>#include <queue> 阅读全文
posted @ 2013-05-05 20:56 mzorro 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 比较排序 是否基于分治 是否原地 最好情况运行时间 最坏情况运行时间 平均情况运行时间 ... 阅读全文
posted @ 2013-05-05 00:38 mzorro 阅读(577) 评论(2) 推荐(0) 编辑
摘要: 例:tcpdump host 172.16.29.40 and port 4600 -X -s 500tcpdump采用命令行方式,它的命令格式为: tcpdump[ -adeflnNOpqStvx ] [ -c 数量][ -F 文件名] [-i 网络接口][ -r 文件名][ -s snaplen ] [-T 类型][ -w 文件名][表达式]1.tcpdump的选项介绍 -a 将网络地址和广播地址转变成名字; -d 将匹配信息包的代码以人们能够理解的汇编格式给出; -dd 将匹配信息包的代码以c语言程序段的格式给出; -dd... 阅读全文
posted @ 2013-05-02 13:37 mzorro 阅读(316) 评论(0) 推荐(0) 编辑