自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

清风笑

与君子交,如入芝兰之室,久而不闻其香!

  • 博客(134)
  • 资源 (1)
  • 收藏
  • 关注

原创 Ubuntu Docker 搭建Hadoop分布式集群

Ubuntu Docker 搭建Hadoop分布式集群确保您拥有 root 权限 , 凡是{} 包含的内容, 都是您需要更改的apt install dockerdocker pull ubuntu:16.04下载你需要的JDK版本(YourJdkVersion), 存放在(YourHome :such as /home/lizhi)/share中下载你需要的Had...

2018-09-20 10:24:28 1108 1

原创 Leetcode-存在重复

给定一个整数数组,判断是否存在重复元素。如果任何值在数组中出现至少两次,函数返回 true。如果数组中每个元素都不相同,则返回 false。示例 1:输入: [1,2,3,1]输出: true示例 2:输入: [1,2,3,4]输出: false示例 3:输入: [1,1,1,3,3,4,3,2,4,2]输出: trueclass Solution { public boolean ...

2018-06-01 14:09:11 500

原创 移动零

给定一个数组 nums,编写一个函数将所有 0 移动到数组的末尾,同时保持非零元素的相对顺序。示例:输入: [0,1,0,3,12]输出: [1,3,12,0,0]说明:必须在原数组上操作,不能拷贝额外的数组。尽量减少操作次数。class Solution { public void moveZeroes(int[] nums) { int pos = 0; ...

2018-06-01 14:06:31 247

原创 LeetCode 加一

<div class="question-wrapper"><div class="content-title"><span><i title="编程题" class="fa fa-file-code-o content-icon" aria-hidden="true"></i&amp

2018-05-29 16:35:28 327

原创 小C语言--词法分析程序

小C语言文法 1. →(){}2. →||3. →;4. →,|5. →|6. →||||7. →()|()8. →()9. →(;;)10. →{}11. →;12. →=|13. → |14. →>|=|15. →+|-|16. →*|/|17. →||()18. →||19. →|20. →a|b|…|z|A

2017-11-28 09:59:07 423

原创 Ubuntu 16.04 定制自己系统镜像

Ubuntu 16.04 已安装系统备份/分发。  在Linux环境下工作时, 总是有些时候一不小心将系统整GG了,修复同时也无法解决,无奈只能重装系统,但是。。。最重要的是(提起开发环境重新搭建就想吃。。。)    福利!!! 福利!!!  您可以将您已安装系统打包为镜像,就算系统崩了,项目复制出来,重装也就2,3分钟的事。    坑! 坑! 坑! 坑! 坑!    将大型应用...

2017-10-15 16:50:59 13123 11

原创 Ubuntu 16.04 安装QQ, TIM

注: winehq 3.0 stable 发布,您可以尝试下载源码编译安装 或者 添加源安装1 : wget -nc https://dl.winehq.org/wine-builds/Release.keysudo apt-key add Release.keysudo apt-add-repository https://dl.winehq.org/wine-builds/ubuntu...

2017-09-30 21:07:58 5807 1

原创 由YouCompleteMe安装引起一系列问题

由YouCompleteMe安装引起一系列问题不知道为什么编译安装YouCompleteMe插件后,引发一系列问题,导致系统崩溃 最后找到问题所在,.ycm_extra_conf.py 配置文件时将系统有些默认文件给更改啦.ycm_extra_conf.py配置文件import osimport ycm_corefrom clang_helpers import PrepareClangF

2017-09-23 20:02:30 1673

原创 Linux Socket tcpdump/wireshark 只能捕获三次挥手

由于监听本地回环,速度太快, 导致服务器收到FIN以后, 调用close的时候, 清除了socket缓存里ACK应答,.所以导致现在出现的情况解决方法:    只要服务器收到FIN后,休眠一点时间再调用close,那么就能通过tcpdump/wireshark看到完整的四次挥手消息./*********************************************

2017-08-15 11:25:18 718

原创 Ubuntu: inotify递归监控文件系统状态

参考:用 inotify 监控 Linux 文件系统事件inotify只能监控单层目录变化,不能监控子目录中的变化情况。所以只能遍历目录,将所有子目录添加入监控列表当所监控目录超过8192时,导致too many open files, 两种解决方案:1:   需要更改下列文件数值大小:      /proc/sys/fs/inotify/max_user_

2017-08-11 10:55:03 2462

原创 Ubuntu 14.04 php7.0 php7.0-fpm nginx 环境搭建备注

1: 查看/etc/php/7.0/php-fpm/pool.d/www.conf 配置文件中listen 监听的值 2: nginx/site-enable/default 中将fastcgi_pass 更改为(1)中的值(假若是php5 将文件中fastcgi_pass unix:/var/run/php5-fpm.sock注释取消即可)

2017-04-05 20:57:07 414

原创 ubuntu16.04引导加密

ubuntu16.04引导加密由于机房实际需求,联想硬盘保护系统版本太低,无法解决ubuntu开机自动还原功能,同时为解决统一系统配置问题,所以只能将grub引导加密1: grub-mkpasswd-pbkdf22: cd /etc/grub.d/3: vim 00_header:在最后添加如下代码:cat << EOFset superusers="username"...

2017-01-14 09:44:46 2345

原创 Python socket实现多对多全双工通信

服务器:#!/usr/bin/env python#-*-coding:utf-8-*-import sysimport struct#将字符串打包为二进制流进行网络传输import select#import signal#用于捕获中断信号import cPickle#将python对象进行序列化:dumps将python对象序列化保存为字符串,loads与之相反from sock

2016-12-05 22:14:03 8173 6

原创 关于CentOs7 u盘安装出现dracut:/#解决方案

dracut:/# cd devdracut:/# ls找到sdbx,x为一个数字,是你u盘所在dracut:/# reboot  重启之后,修改vmlinuz initrd=initrd.img inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 quiet为  vmlinuz initrd=initrd.img inst.stage

2016-11-25 21:26:00 32098 3

原创 Integer Inquiry

Problem Description One of the first users of BIT's new supercomputer was Chip Diller. He extended his exploration of powers of 3 to go from 0 to 333 and he explored taking various sums of those n

2016-11-10 10:14:38 721

原创 简单n!

点击打开链接import java.math.BigInteger;import java.util.Scanner;public class Main { private static Scanner cin = new Scanner(System.in); public static void main(String[] args) { int n; while(cin

2016-11-09 20:57:06 288

原创 SDUT 3347 数据结构实验之数组三:快速转置

#include #define Max 100#define OK 1using namespace std;typedef int Elemtype;typedef int Status;typedef struct{ int i, j; Elemtype e;}Triple;typedef struct{ Triple data[Max+1]

2016-11-01 17:00:58 432

原创 顺序表应用4-2:元素位置互换之逆置算法(数据改进)

#include #include #include using namespace std;#define LISTINCREASMENT 100#define LISTSIZE 1000001#define OVERLFLOW -1#define OK 1typedef int ElemType;typedef struct{

2016-09-22 09:33:53 1306

原创 顺序表应用8:最大子段和之动态规划法

#include using namespace std;#define LISTINCREASMENT 100#define LISTSIZE 10010#define OVERLFLOW -1#define OK 1typedef int ElemType;typedef struct{ ElemType *elem; int length;

2016-09-19 20:51:48 633

原创 顺序表应用3:元素位置互换之移位算法

#include using namespace std;#define LISTINCREASMENT 100#define LISTSIZE 10010#define OVERLFLOW -1#define OK 1typedef int ElemType;typedef struct{ ElemType *elem; int length;

2016-09-19 19:36:25 442

原创 SDUT 2498 AOE网上的关键路径

点击打开题目链接表示交了好多WA,逆序建图,逆序建图,逆序建图,说了三遍,目测应该够了,悲哀啊,顺序建就是不好存路径,悲哀啊!!!!#include #define INF 0x3f3f3f3f#define N 10010using namespace std;struct Arcnode{ int to; int weight; Arcnode

2016-08-15 10:21:38 488

原创 HDU 1285 确定比赛名次

点击打开题目链接//暴力#include using namespace std;int Edge[510][510];int Indegree[510];int vis[510];int main(){ int n, m; while(cin >> n >> m) { memset(Edge, 0, sizeof(Edge));

2016-08-12 11:22:27 269

原创 SDUT 3468 广度优先搜索练习之神奇的电梯

点击打开题目链接#include using namespace std;struct edge{ int num; int step;};int n, m, q, pos;bool Edge[210][210];bool vis[210];int BFS(int st, int pos);int main(){ while(cin >>

2016-08-11 21:16:14 644

原创 SDUT 2805 大家快来A水题

点击打开题目链接#include using namespace std;int pre[2010];int Find(int x);int join(int x, int y);int main(){ int n, m; while(cin >> n >> m) { for(int i = 1; i <= n; i++)

2016-08-11 15:27:57 344

原创 SDUT 1488 数据结构实验:连通分量个数

点击打开题目链接#include using namespace std;int pre[1010];int Find(int x);int join(int x, int y);int main(){ int n, m, k; cin >> k; while(k --) { cin >> n >> m; for

2016-08-11 15:22:03 366

原创 HDU 1232 畅通工程

点击打开题目链接#include using namespace std;int pre[1010];int Find(int x);int join(int x, int y);int main(){ int n, m; while(cin >> n, n) { for(int i = 1; i <= n; i++) {

2016-08-11 15:13:35 223

原创 SDUT 2804 求二叉树的深度

点击打开题目链接#include using namespace std;struct node{ char data; node *right, *left;};int len, k;char str1[60], str2[60], str3[60];node *creat();int high(node *root);//二叉树高度node *bu

2016-08-09 11:55:46 215

原创 SDUT 3374 数据结构实验之查找二:平衡二叉树

点击打开题目链接#include using namespace std;struct Treenode{ int data; int height; Treenode *leftchild, *rightchild;};int GetHeight(Treenode *p);//树高void Preorder(Treenode *p);//前序遍历Tr

2016-08-08 17:38:31 468

原创 SDUT 3467 图的基本存储的基本方式四

点击打开题目链接duang duang duang,题意看错,一直交,一直wa, 悲哀!#include #include using namespace std;struct node{ int data; node *next;};node *head[5020];void creat(int n){ for(int i = 0; i <

2016-08-07 17:13:53 537

原创 SDUT 3377 数据结构实验之查找五:平方之哈希表

点击打开题目链接#include using namespace std;int Hash[1010];int n, m;int main(){ while(~scanf("%d %d", &n, &m)) { queueQ; memset(Hash, 0, sizeof(Hash)); for(int i = 1;

2016-08-07 15:59:55 592

原创 SDUT 3379 数据结构实验之查找七:线性之哈希表

点击打开题目链接#include using namespace std;int Hash[1010];int n, m;int main(){ while(~scanf("%d %d", &n, &m)) { queueQ; memset(Hash, 0, sizeof(Hash)); for(int i = 1;

2016-08-06 19:34:08 795 2

原创 SDUT 3404 数据结构实验之排序七:选课名单

点击打开题目链接#include using namespace std;struct node{ char name[15];} pp[2010][35002];int Hash[2010];//统计当前课程选课情况int cmp(node a, node b){ return strcmp(a.name,b.name) < 0;}int main()

2016-08-06 14:56:32 759

原创 SDUT 3400 数据结构实验之排序三:bucket sort

点击打开题目链接感觉就好像哈希存了一下,悲哀#include using namespace std;int bucket[120];int main(){ int n; memset(bucket, 0, sizeof(bucket)); cin >> n; for(int i = 0; i < n; i++) {

2016-08-06 10:34:51 427

原创 SDUT 3403 数据结构实验之排序六:希尔排序

点击打开题目链接#include using namespace std;int pp[10010];int main(){ int n; while(cin >> n) { int i; for( i = 0; i < n; i++) { scanf("%d", &pp[i]);

2016-08-06 09:59:20 354

原创 SDUT 3402 数据结构实验之排序五:归并求逆序数

点击打开题目链接坑坑坑,超时,过,傻傻分不清#include using namespace std;int n;long long num;int pp[100010], tmp[100010];void Msort(int l, int r);void Merge( int l, int e,int m, int r);int main(){ num = 0

2016-08-05 21:33:56 330

原创 SUDT 2144 图结构练习——最小生成树

点击打开题目链接#include #define INF 0x3f3f3f3fusing namespace std;int Graph[10010][10010];bool vis[10010];int dis[10010];void Prim();int n, m;int main(){ while(cin >> n >> m) {

2016-08-05 15:25:42 285

原创 SDUT 2129 树结构练习——判断给定森林中有多少棵树

点击打开题目链接#include using namespace std;bool Graph[100][100];bool vis[100];void DFS(int s);int n, m;int num;int main(){ while(cin >> n >> m) { num = 0; int flag = 1; memset(vis,

2016-08-05 11:46:52 306

原创 SDUT 3345 数据结构实验之二叉树六:哈夫曼编码

点击打开题目链接就是不明白给啥gets就是不对,后台读数据又问题,嗯,一定是#include using namespace std;int pp[140];char str[140];int main(){ while(~scanf("%s",str)) { getchar(); memset(pp, 0, sizeof(

2016-08-04 20:58:37 1007

原创 SDUT 2140 图结构练习——判断给定图是否存在合法拓扑序列

点击打开题目链接判断是否存在环,每一次找到入度为0的点,将其相关联的点的入度--,如果还存在入度不为0的点,则原图一定存在环#include using namespace std;bool Graph[15][15];int Indu[15];bool vis[15];int main(){ int n, m; while(cin >> n >> m)

2016-08-04 20:14:46 338

原创 SDUT 3401 数据结构实验之排序四:寻找大富翁

点击打开题目链接感觉再也不敢用#include了, 交了好多发MLE#include int n, m;int data[12];//建立最小堆void HeapAdjust(int data[], int s, int len){ int x = data[s]; for(int j = 2*s; j <= len; j*=2) { if(

2016-08-04 15:22:52 1641 1

简单c语言子集的一个编译器实现(编译原理课程项目)

编译原理期末课程设计, 一个基于AT&T x86汇编的小型编译器。

2018-02-28

空空如也

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

TA关注的人

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