12 2015 档案
摘要:启动controlleripcontroller -- ip = ipaddress设置ssh免登陆因为需要分发文件,采用ssh通信,所以需要配置ssh免登陆分发配置文件scp controller.host:.ipython/profile_default/security/ipcontroller-engine.json ./使用配置文件开启engine ipengine --p...
阅读全文
摘要:ipyparallel 之中,可以利用多个engine同时运行一个任务来加快处理的速度。在ipyparallel之中,集群被抽象为view,包括direct_view和balanced_view。其中,direct_view是所有的engine的抽象,当然也可以自行指定由哪些engine构成,而...
阅读全文
摘要:Given a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacent cell, where "adjace...
阅读全文
摘要:So easy! Only one step. 注册时选择 License server ,填 http://idea.lanyus.com 对于Clion等同样适用。
阅读全文
摘要:这个实例中有一个KafkaSpout,一个KafkaBolt,一个自定义Bolt QueryBolt。数据流程是KafkaSpout从topic为recommend的消息队列中取出String类型的消息,发送给QueryBolt。QueryBolt不做任何处理,直接转发给KafkaBolt,...
阅读全文
摘要:为什么会有TCP/IP协议在世界上各地,各种各样的电脑运行着各自不同的操作系统为大家服务,这些电脑在表达同一种信息的时候所使用的方法是千差万别。就好像圣经中上帝打乱了各地人的口音,让他们无法合作一样。计算机使用者意识到,计算机只是单兵作战并不会发挥太大的作用。只有把它们联合起来,电脑才会发挥出它最大...
阅读全文
摘要:数据链路层的功能: 为网络层提供服务,良好的服务接口;保证数据传输的有效、可靠;调节数据流,保证慢速的接收方不会被快速的发送方淹没。 数据链路层的协议还是很多的,有我们最常用的以太网(就是平时我们用的网卡)协议,也有不太常见的令牌环,还有FDDI,当然,还有国内现在相当普及的PPP协议(就是...
阅读全文
摘要:1.IP协议IP协议是TCP/IP协议的核心,所有的TCP,UDP,IMCP,IGCP的数据都以IP数据格式传输。要注意的是,IP不是可靠的协议,这是说,IP协议没有提供一种数据未传达以后的处理机制--这被认为是上层协议--TCP或UDP要做的事情。所以这也就出现了TCP是一个可靠的协议,而UDP就...
阅读全文
摘要:1.C/S体系结构 --客户端/服务器结构 C/S是Client/Server的缩写,即客户端、服务器结构。在这种结构中,服务器通常采用高性能的PC机或者工作站,并采用大型数据库系统,客户端则需要安装专用的客户端组件。这种结构可以充分利用两端硬件环境的优势,将任务合理分配到客户端和服务器,从而降低了系统通信的开销。2.B/S体系结构--浏览器/服务器结构 B/S是Brower/Serv...
阅读全文
摘要:Follow up for N-Queens problem.Now, instead outputting board configurations, return the total number of distinct solutions.解题思路:回溯法。可以用一个大小为n的一维数组来表示皇...
阅读全文
摘要:1 、 "关键字" 表示绝对匹配关键字2、A+B 表示搜索结果中要同时包含A、B两个关键词3、A-B 表示搜索结果中包含关键词A,但是不包含关键词B,用于搜索结果的筛选。4、related:url 表示搜索与url对应网页有相似内容的网页5. define:A A的网络定义6. A file...
阅读全文
摘要:KNN(K Nearest Neighbors,K近邻 )算法是机器学习所有算法中理论最简单,最好理解的。KNN是一种基于实例的学习,通过计算新数据与训练数据特征值之间的距离,然后选取K(K>=1)个距离最近的邻居进行分类判断(投票法)或者回归。如果K=1,那么新数据被简单分配给其近邻的类。KNN算法算是监督学习还是无监督学习呢?首先来看一下监督学习和无监督学习的定义。对于监督学习...
阅读全文
摘要:1.贝叶斯定理 设X是数据元组。在贝叶斯的术语中,X看做是证据。通常,X用n个属性集的测量值描述。令H为某种假设,如数据元组X属于某个特定类C。对于分类问题,希望确定给定证据或者观测数据元组X,假设H成立的概率为P(H|X)。换言之,给定X的属性描述,找出元组X属于类C的概率。 P(H|X)是后验概率,或在条件X下,H的后验概率。例如,设数据元组限于分别由属性age和income描述的...
阅读全文
摘要:Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephon...
阅读全文
摘要:Given a binary tree, return thezigzag level ordertraversal of its nodes' values. (ie, from left to right, then right to left for the next level and al...
阅读全文
摘要:Given a stringSand a stringT, count the number of distinct subsequences ofTinS.A subsequence of a string is a new string which is formed from the orig...
阅读全文
摘要:Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximu...
阅读全文
摘要:Given a binary tree, find the maximum path sum.For this problem, a path is defined as any sequence of nodes from some starting node to any node in the...
阅读全文
摘要:Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.For example:Given the below binary tree andsum =...
阅读全文
摘要:Given an arraySofnintegers, find three integers inSsuch that the sum is closest to a given number, target. Return the sum of the three integers. You m...
阅读全文
摘要:Givennballoons, indexed from0ton-1. Each balloon is painted with a number on it represented by arraynums. You are asked to burst all the balloons. If ...
阅读全文
摘要:Given inorder and postorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.Subscribeto se...
阅读全文
摘要:Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree.According to thedefinition of LCA on Wikipedia: “The lowest ...
阅读全文
摘要:Write a program to find the nthsuper ugly number.Super ugly numbers are positive numbers whose all prime factors are in the given prime listprimesof s...
阅读全文
摘要:Given a range [m, n] where 0 >=1; n>>=1; offset++; } return m<<offset; }};
阅读全文
摘要:Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be in the ord...
阅读全文
摘要:1.添加依赖hadoop和mongodb的连接器 org.mongodb.mongo-hadoop mongo-hadoop-core 1.4.2java连接mongodb连接器 org.mongodb mongo-java-driver 2.13.02.使用示例import com.mongodb.hadoop.MongoOutputFormat;import...
阅读全文
摘要:一、普通java项目(1)添加项目jar包File -> Project Structure Libarries 添加jar包jna-4.0.0.jar(2)将Data文件夹复制到ICTCLAS2015文件夹下(3)声明调用分词器的接口,如下://定义接口Clibrary,继承自com.sun.jna.Librarypublic interface CLibrary extends Libr...
阅读全文
摘要:1.scala和maven如何整合 网上有一堆教程讲idea如何new module或new project一步一步来创建scala工程,在这里我不推荐这个。原因是现在主流的开发环境,大多数是采用maven来构建项目的,所以建议大家用maven+plugin的方式来构建scala应用,另外,就象VB...
阅读全文
摘要:1.PairRDD介绍 Spark为包含键值对类型的RDD提供了一些专有的操作。这些RDD被称为PairRDD。PairRDD提供了并行操作各个键或跨节点重新进行数据分组的操作接口。例如,PairRDD提供了reduceByKey()方法,可以分别规约每个键对应的数据,还有join()方法,可以把两个RDD中键相同的元素组合在一起,合并为一个RDD。2.创建Pair RDD 程序示例:...
阅读全文
摘要:Remove the minimum number of invalid parentheses in order to make the input string valid. Return all possible results.Note: The input string may conta...
阅读全文
摘要:Given a linked list and a valuex, partition it such that all nodes less thanxcome before nodes greater than or equal tox.You should preserve the origi...
阅读全文
摘要:1.RDD介绍: RDD,弹性分布式数据集,即分布式的元素集合。在spark中,对所有数据的操作不外乎是创建RDD、转化已有的RDD以及调用RDD操作进行求值。在这一切的背后,Spark会自动将RDD中的数据分发到集群中,并将操作并行化。 Spark中的RDD就是一个不可变的分布式对象集合。每个RDD都被分为多个分区,这些分区运行在集群中的不同节点上。RDD可以包含Python,Jav...
阅读全文
摘要:Follow up for "Unique Paths":Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle 障碍 and empty spac...
阅读全文
摘要:Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the fol...
阅读全文