自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

走走停停的专栏

来时有路。莫问前程。

  • 博客(71)
  • 资源 (3)
  • 收藏
  • 关注

原创 hadoop - 配置完全分布式模式并运行WordCount程序

1. Hadoop三种模式便捷切换以及让命令行提示符显式完整路径(1)Hadoop三种模式便捷切换首先执行如下命令: [yylin@big etc]$ cp -r hadoop local [yylin@big etc]$ cp -r hadoop pseudo [yylin@big etc]$ cp -r hadoop full [yylin@big etc]$ rm -rf...

2019-09-27 11:00:11 1088

原创 hadoop - 环境搭建(安装JDK+安装hadoop+配置本地模式)

安装JDKa) 下载jdk-8u65-linux-x64.tar.gzb)上传并tar开$ cd ~$ mkdir downloadsc)利用FileZilla把jdk-8u65-linux-x64.tar.gz上传到~/downloads/目录下$ cd ~/downloads/$ cd ls$ tar -zxvf jdk-8u65-linux-x64.tar.gzd...

2019-05-08 11:57:46 2848

原创 单例模式

1. 定义**单例模式:**确保一个类只有一个实例,并提供一个全局访问点。按照定义来看,也可以设置一个全局变量,同样能实现要求,但是全局变量却存在问题,如果将对象赋值给一个全局变量,那么必须在程序一开始就创建好对象,万一这个对象非常耗费资源,而程序在这次的执行过程中又一直没有用到它,就形成浪费了。2. 用处有一些对象只需要一个,例如配置文件,工具类,线程池,缓存,日志对象等等。单例模式...

2020-03-06 20:49:28 204

原创 Win10下kafka简单安装及使用测试

注:kafka依赖于zookeeper,官网下载的kafka内置了zookeeper依赖。1. 下载Kafka,网址:http://kafka.apache.org/解压缩:2. 修改配置文件进入到config目录,修改service.properties:3. 进行单机实例测试简单使用(1) 启动kafka内置的zookeeper运行cmd命令:.\bin\windows...

2020-02-11 16:45:57 1009 1

原创 连接Mysql8报错:Client does not support authentication protocol requested by server; consider upgrading M

代码:package edu.nwpu.ad.service;import com.github.shyiko.mysql.binlog.BinaryLogClient;import com.github.shyiko.mysql.binlog.event.DeleteRowsEventData;import com.github.shyiko.mysql.binlog.event.Ev...

2019-11-08 22:00:44 571 1

原创 hadoop - 常用命令

启动NameNodehadoop-daemon.sh start namenodehdfs --daemon start namenode关闭NameNodehadoop-daemon.sh stop namenodehdfs --daemon stop namenode启动DataNodehadoop-daemons.sh start datanodehdfs --worker...

2019-09-27 21:29:48 194

原创 hadoop - 单独配置辅助名称节点(SecondaryNameNode)

1. 修改hdfs-site.xml执行命令:vi /software/hadoop/etc/hadoop/hdfs-site.xml在hdfs-site.xml中添加: <property> <name>dfs.namenode.secondary.http-address</name> <value>s138:9868...

2019-09-27 21:28:57 893

原创 hadoop - NameNode和SecondaryNameNode工作机制讲解

1. 流程图如下:2. FSImage和Editsnodenode是HDFS的大脑,它维护着整个文件系统的目录树,以及目录树里所有的文件和目录,这些信息以俩种文件存储在文件系统:一种是命名空间镜像(也称为文件系统镜像,File System Image,FSImage),即HDFS元数据的完整快照,每次NameNode启动的时候,默认会加载最新的命名空间镜像,另一种是命令空间镜像的编辑日志(...

2019-09-27 21:27:39 433

原创 hadoop - 节点的服役和退役(HDFS)

1. 首先需要克隆一台主机现在我这里已经有五台虚拟机,要克隆的目标主机为CentOS7-1810_04:启动集群后webUI如下:把要克隆的目标虚拟机关机,在VMware上选中目标主机 -> 右键 -> 管理 -> 克隆:然后下一步,选择克隆自:虚拟机中的当前状态:继续下一步,克隆方法选择:创建完整克隆:继续下一步,修改虚拟机名称和位置:然后选择完成...

2019-09-27 14:51:09 527

原创 Linux命令总结

1.ls [选项] [目录名 | 列出相关目录下的所有目录和文件-a 列出包括.a开头的隐藏文件的所有文件-A 通-a,但不列出"."和".."-l 列出文件的详细信息-c 根据ctime排序显示-t 根据文件修改时间排序---color[=WHEN] 用色彩辨别文件类型 WHEN 可以是'never'、'always'或'auto'其中之一 白色:表示普通文件 ...

2019-01-19 20:23:56 241

原创 clone graph(克隆一个图)

题目描述Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors.OJ’s undirected graph serialization:Nodes are labeled uniquely.We use #as a separator for each no...

2019-01-14 20:38:04 690

原创 binary tree level order traversal ii)(二叉树自下向上层序遍历)

题目描述Given a binary tree, return the bottom-up level order traversal of its nodes’ values. (ie, from left to right, level by level from leaf to root).For example:Given binary tree{3,9,20,#,#,15,7},...

2019-01-13 15:49:10 156

原创 pascals triangle ii(杨辉三角、帕斯卡三角)

题目描述Given an index k, return the k th row of the Pascal’s triangle.For example, given k = 3,Return[1,3,3,1].Note:Could you optimize your algorithm to use only O(k) extra space?题目大意给定一个索引值k,返回杨辉...

2019-01-12 12:26:14 188

原创 pascals triangle(杨辉三角、帕斯卡三角)

题目描述Given numRows, generate the first numRows of Pascal’s triangle.For example, given numRows = 5,Return:[[1],[1,1],[1,2,1],[1,3,3,1],[1,4,6,4,1]]题目大意杨辉三角给定一个非负整数 numRows,生成杨辉三角的前 numRo...

2019-01-11 17:26:59 482

原创 remove duplicates from sorted array ii(从重复数组中移除重复元素)

类似问题:remove duplicates from sorted list(移除有序链表中的重复元素)题目描述Follow up for “Remove Duplicates”:What if duplicates are allowed at most twice?For example,Given sorted array A =[1,1,1,2,2,3],Your fun...

2019-01-10 20:16:40 530

原创 plus-one(加一)

题目描述Given a number represented as an array of digits, plus one to the number.题目大意用一个数组表示一个数,把这个数做加一操作。思路不需要flag!从右向左,遇到9就变0,非9就加1,然后break;digits[0]如果等于0,说明长度增加了1,则新插入一个首位,首位为1,其他位为0。代码#includ...

2019-01-09 11:50:28 352

原创 merge-sorted-array(合并已排序的数组)

题目描述Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space to hold additional elements from B. The number of elements initialized in...

2019-01-08 15:58:24 1149

原创 count-and-say

题目描述The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, …1 is read off as&quot;one 1&quot;or11.1 1is read off as&quot;two 1s&quot;or21.2 1is read off as&quot;one 2, thenon...

2019-01-06 20:55:53 186

原创 swap nodes in pairs(成对的交换链表结点)

题目描述Given a linked list, swap every two adjacent nodes and return its head.For example,Given1-&gt;2-&gt;3-&gt;4, you should return the list as2-&gt;1-&gt;4-&gt;3.Your algorithm should use only con...

2019-01-05 16:50:39 168

原创 Symmetric Tree(对称树)

题目描述Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree is symmetric:But the following is not:Note:Bonus points if you co...

2019-01-05 12:57:18 308

原创 permutations(全排列)

题目描述Given a collection of numbers, return all possible permutations.For example,[1,2,3]have the following permutations:[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2], and[3,2,1].题目大意给定一个数组集合,返回所有可能的排列。...

2019-01-03 16:42:27 5906

原创 Path Sum(路径和)

题目描述Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.For example:Given the below binary tree andsu...

2019-01-02 19:31:45 172

原创 remove duplicates from sorted list(移除有序链表中的重复元素)

题目描述Given a sorted linked list, delete all duplicates such that each element appear only once.For example,Given1-&gt;1-&gt;2, return1-&gt;2.Given1-&gt;1-&gt;2-&gt;3-&gt;3, return1-&gt;2-&gt;3.题目大...

2019-01-01 15:52:36 322

原创 Binary Tree Level Order Traversal(二叉树层序遍历-保存并返回结果集)

题目描述Given a binary tree, return the level order traversal of its nodes’ values. (ie, from left to right, level by level).For example:Given binary tree{3,9,20,#,#,15,7},return its level order trav...

2018-12-30 17:27:41 223

原创 n queens ii(n皇后问题-只计数不保存)

n皇后问题(保存并返回所有的解决方案)题目描述Follow up for N-Queens problem.Now, instead outputting board configurations, return the total number of distinct solutions.题目大意著名n皇后问题。n个皇后摆放在N x N的棋盘格中,使得横、竖和两个对角线方向均不...

2018-12-29 23:49:43 348

原创 n-queens(n皇后问题)

问题描述The n queens puzzle is the problem of placing n queens on an N x Nchessboard such that no two queens attack each other.Given an integer n, return all distinct solutions to the n-queens puzzle....

2018-12-28 16:03:31 3134

原创 Set Matrix Zeroes(矩阵置0)

题目描述Set MatrixGiven a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place.Follow up:Did you use extra space?A straight forward solution using O(m n) space is pr...

2018-12-25 17:16:37 881

原创 Jump-Game

题目描述Jump GameGiven an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position....

2018-12-24 16:45:42 99

原创 寻找第一个丢失的正数

题目描述First Missing PositiveGiven an unsorted integer array, find the first missing positive integer.For example,Given[1,2,0]return3,and[3,4,-1,1]return2.Your algorithm should run in O(n) time a...

2018-12-23 17:07:20 154

原创 截留雨水

类似问题:容器最大容水量题目描述Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.For example,Given[0,1,0,2,1,...

2018-12-23 15:44:08 346

原创 荷兰国旗问题(颜色排序问题)

题目描述Sort ColorsGiven an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue.Here, we will u...

2018-12-21 21:44:31 2145

原创 从有序数组中移除相等的数值

题目描述Remove Duplicates From Sorted ArrayGiven a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space for anoth...

2018-12-19 23:05:41 202

原创 工厂模式02之工厂方法模式

参考:Head First设计模式概述简单工厂模式实现了生成产品类的代码与客户端代码分离,在工厂类中可以添加生成产品的逻辑代码。但是简单工厂模式不符合“开放-封闭”原则。例如要加一个 新产品类,就要修改 工厂类 生成产品的逻辑代码,增加if-else判断。对于这个问题,工厂方法模式可以解决。定义工厂方法模式 定义了一个创建对象的接口,但由子类决定要实例化的类是哪一个。工厂...

2018-12-18 14:11:23 177

原创 工厂模式01之简单工厂

概念简单工厂可以理解为,定义一个工厂类,根据传入的参数不同而返回不同的实例,这些实例通常有共同的父类。虽然简单工厂经常会被使用,但是并不能算作是一种设计模式,反而更像是一种编程习惯。提出问题当我们创建产品类对象时,会使用到new操作符,但是代码绑着具体类的实例会导致代码更脆弱,更缺乏弹性。实例化这个活动不应该总是公开的进行。否则一旦有变化或扩展,就必须重新打开这段代码进行检查和修改。...

2018-12-17 20:14:28 156

原创 合并两个顺序链表

题目描述Merge Two Sorted ListsMerge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.题目大意合并两个顺序排列的链表,并将新链表返回。新链表...

2018-12-17 16:14:47 1711

原创 二叉树遍历(前序)(递归+非递归)

题目Binary Tree Preorder TraversalGiven a binary tree, return the preorder traversal of its nodes’ values.For example:Given binary tree{1,#,2,3},return[1,2,3].Note: Recursive solution is trivia...

2018-12-16 14:39:20 220

原创 Java EE Web应用开发方法

主要内容B/S编程模式简介HTML和HTTP动态web编程初识Servlet &amp; JSPMVC设计模式初步讨论B/S编程模式简介Web服务器Web服务器接收客户端的请求并将结果返回客户端结果:HTML页面、图片、文件、……Web客户端Web客户端可以使用户向服务器提出请求,并向用户展现请求的结果浏览器知道如何与服务器通信,并能够解释HTML代码并展现...

2018-12-16 00:04:49 2723

原创 生成括号

题目Generate ParenthesesGiven n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is:“((()))”, “(()())”, “(())...

2018-12-15 23:06:43 219

原创 Java EE架构概述

主要内容分布式多层应用Java EE容器Web Service支持打包应用开发角色Java EE APIs引子Java Platform, Enterprise Edition(Java EE)为设计、开发、装配和部署企业应用程序提供了一个基于组件的方法Java EE平台提供了:一个多层分布式应用模型可复用组件模型一个统一的安全模型灵活的事务控制Web Serv...

2018-12-15 00:18:44 1419

原创 二叉树遍历(中序)(递归+非递归)

Binary Tree Inorder Traversal(二叉树中序遍历)Given a binary tree, return the inorder traversal of its nodes’ values.For example:Given binary tree{1,#,2,3},return[1,3,2].Note: Recursive solution is triv...

2018-12-14 23:06:00 319

arm-linux-gcc-4.4.3.rar

arm-linux-gcc交叉编译环境,可以编译arm架构下得到程序和操作系统等,亲测有效。

2019-05-31

LLVM5.0+Clang.rar

LLVM+Clang环境搭建(LLVM5.0

2019-05-11

JSP实现基本的注册功能

JSP方式实现了基本的注册功能,技术设计html+js+css,以及java的基本操作,JDBC,Servlet等等等等。

2018-09-15

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除