last

使用 MTR 诊断网络问题

隐身守侯 提交于 2019-11-29 15:39:47
使用 MTR 诊断网络问题 每日一贴 • 2015年5月26日 • 3 条评论 MTR 是一款强大的网络诊断工具,网络管理员使用 MTR 可以诊断和隔离网络问题,并且为上游 ISP 提供有用的网络状态报告。 MTR 是传统 traceroute 命令的进化版,并且可以提供强大的数据样本,因为他集合了 traceroute 和 ping 这两个命令的精华。本文带您深入了解 MTR ,从数据如何生成,到如果正确理解报告样本并得出相应的结论。 关于网络诊断技术的基本理论请参考 network diagnostics .如果您怀疑您的 Linux 系统有其他问题,请参考 system diagnostics 。最后,我们假定您已经掌握了 getting started guide (入门指南) 。 网络诊断相关的背景知识 网络诊断工具 例如 ping traceroute mtr 都使用的 “ICMP” 包来测试 Internet 两点之间的网络连接状况。当用户使用 ping 命令 ping 网络上的主机后, ICMP 包将会发送到目的主机,然后在目的主机返回响应。这样,就可以得知本机到目的主机 ICMP 包传输所使用的往返时间。 相对于其他命令仅仅收集传输路径或响应时间,MTR 工具会收集更多的信息,比如 连接状态,连接可用性,以及传输路径中主机的响应性。由于这些额外的信息

Day-05-二叉树与图 Leetcode-113, 236, 113, 199, 207

夙愿已清 提交于 2019-11-29 15:11:06
目录 例一:LeetCode113 例二:LeetCode236 例三:LeetCode114 例四:LeetCode199 例五:LeetCode207 //预备知识:二叉树的构造 #include <stdio.h> struct TreeNode { int val; TreeNode* left; TreeNode* right; TreeNode(int x) : val(x), left(NULL), right(NULL) {} }; void preorder_print(TreeNode* node, int layer) { if (!node) { return; } for (int i = 0; i < layer; i++) { printf("------");//根据层数打印------ } printf("[%d]\n", node->val); preorder_print(node->left, layer + 1); preorder_print(node->right, layer + 1); } void traversal(TreeNode* node) { if (!node) { return; } //前序遍历 printf("[%d]\n", node->val); traversal(node->left);

Uncaught TypeError: object is not a function

这一生的挚爱 提交于 2019-11-29 13:34:11
Created by Jerry Wang, last modified on Aug 24, 2014 在Chrome里使用BSP page遇到如下error: 错误指向onclick property: 然而其指向的my_upload function在script file里已经正确地被实现: 根据link http://blog.sina.com.cn/s/blog_70c2f37801011x3j.html,该问题是由于html page里有和my_upload同名的控件出现: 将名字更改后错误即消失。 要获取更多Jerry的原创文章,请关注公众号"汪子熙": 来源: https://blog.csdn.net/i042416/article/details/100824421

LC.1180. Count Substrings with Only One Distinct Letter

痴心易碎 提交于 2019-11-29 12:09:13
class Solution : def countLetters ( self , S : str ) - > int : """ 统计连续相同字符出现的次数即可 对于长度为n 的相同字符的字符串,他有 1+2+..n个子串 """ def sum_n ( n ) : return ( n + 1 ) * n // 2 last_char , result , count , S = "$" , 0 , 0 , S + "$" for char in S : if char == last_char : count += 1 else : result += sum_n ( count ) count = 1 last_char = char return result 来源: https://blog.csdn.net/dpengwang/article/details/100808049

主席树

笑着哭i 提交于 2019-11-29 11:53:54
https://blog.csdn.net/qq_39653331/article/details/78816987 https://www.cnblogs.com/zyf0163/p/4749042.html 感觉都写的好好,但是还是没有完全弄懂,目前只是懂了一点点QAQ,还是太菜了 然后贴上最近刷的几道题的代码吧 hdu 4417 Super Mario 1 #include<cstdio> 2 #include<cstring> 3 #include<cmath> 4 #include<iostream> 5 #include<algorithm> 6 using namespace std; 7 #define N 100005 8 9 int root[N];//root[i]表示第i课线段树 10 int size[N*25],lchild[N*25],rchild[N*25]; 11 int tot; 12 13 void insert(int last,int cur,int L,int R,int k) //单点更新 14 { 15 size[cur]=size[last]+1;//将前一个树的信息复制过来 16 lchild[cur]=lchild[last]; 17 rchild[cur]=rchild[last]; 18 if(L==R)return ;

LeetCode 27

≡放荡痞女 提交于 2019-11-29 11:10:17
void swap(int *nums, int first, int last) { int k; k = *(nums + first); *(nums + first) = *(nums + last); *(nums + last) = k; } int removeElement(int* nums, int numsSize, int val) { int first, last, num = 0; if (!nums || !numsSize) return 0; first = 0; last = numsSize - 1; do { while (first != numsSize && *(nums + first) != val) first++; while (last != -1 && *(nums + last) == val) { last--; num++; } if (first < last) { swap(nums, first, last); first++; last--; num++; } } while (first <= last); return numsSize - num; } 来源: https://blog.csdn.net/scarecrow_byr/article/details/100795445

二叉搜索树的后序遍历序列

三世轮回 提交于 2019-11-29 08:56:05
输入一个整数数组,判断该数组是不是某二叉搜索树的后序遍历的结果。假设输入的数组的任意两个数字都互不相同。 例如,下图是后序遍历序列 1,3,2 所对应的二叉搜索树。 使用递归的方式,先判断数组的左子树和右子树的位置 然后再判断左子树和右子树是不是二叉搜索树。 public boolean VerifySquenceOfBST(int[] sequence) { if (sequence == null || sequence.length == 0) return false; return verify(sequence, 0, sequence.length - 1); } private boolean verify(int[] sequence, int first, int last) { if (last - first <= 1) return true; int rootVal = sequence[last]; int cutIndex = first; while (cutIndex < last && sequence[cutIndex] <= rootVal) cutIndex++; for (int i = cutIndex; i < last; i++) if (sequence[i] < rootVal) return false; return

6-2 顺序表操作集 (20 分)

好久不见. 提交于 2019-11-29 05:57:02
题目地址: https://pintia.cn/problem-sets/15 /problems/725 顺序表基本操作 注意初始化空表的时候 List L = (List)malloc(sizeof(List)) 会导致答案错误,但是本地编译并不会报错 正确写法应该是 List L = (List)malloc(sizeof(struct LNode)) List MakeEmpty() { List L = (List)malloc(sizeof(struct LNode));//sizeof(list)会导致答案错误--++ L->Last = -1; return L; } Position Find(List L, ElementType X) { for(int i = 0; i <= L->Last; ++i) { if(L->Data[i] == X) return i; } return ERROR; } bool Insert(List L, ElementType X, Position P) { if(L->Last+1 == MAXSIZE) { printf("FULL"); return false; } if(P > L->Last+1 || P < 0) { printf("ILLEGAL POSITION"); return false; }

【算法课】最大间隙问题

我只是一个虾纸丫 提交于 2019-11-29 05:03:31
题目描述 给定 n 个实数,求这n个实数在数轴上相邻2个数之间的最大差值,设计解最大间隙问题的线性时间算法(时间复杂度为O(n))。 输入 第一行一个正整数n(2<=n<=2×1e7) 第二行n个实数,数据保证这些实数只有一位小数。 输出 一个实数,保留1位小数。 样例输入 5 2.3 3.1 7.5 1.5 6.3 样例输出 3.2 【参考博客】https://blog.csdn.net/llwwlql/article/details/52434280 【题解】   百思不得其解,为什么会用到鸽笼原理,后来老师讲解后,发现还真的是鸽笼原理。   核心思想是:   n个点,其中两个点作为左右边界。剩下n-2个点,在n-1个格子必定有一个为空。   比如:1,2,3,4。   那么利用1,4作为左右边界,然后剩下两个数字,我们把[1,4]这个区间等分划分成n-1个区间。   那么就会出现 [ 1 , 2 ] [ 2 , 3 ] [ 3 , 4 ] 这三个区间,剩下两个数字进行投球测试,必定有一个区间是空的。   最大的间隙必定会在这个空隙与左右区间的点结合后组成最大的间隙。   1、扫描  找出所有点的最大值和最小值。   2、划分区间  区间的长度为: len = ( Max - Min ) / ( n - 2 ) .   3、处理每一个区间       a

MySQL查询——select

主宰稳场 提交于 2019-11-29 04:57:47
SELECT   select的完整语法: select col1, col2,... # 业务查询的字段 from table_name # 选取的哪张表 [where single_conditions] # single_conditions条件表达式,个体约束(条件) [[group by column_name1] # column_name1以哪个字段名分组 [having group_conditions]] # group_conditionds条件表达式,分组约束 [order by column_name2] # column_name2以哪个字段进行排序 [limit N,M] # 执行完之后,跳过N条记录,选取M条记录   上述如果都有:执行顺序from->where->group by->having->order by->limit->select   列的结果显示       1、去掉重复的数据:distinct(针对于记录而言,不是针对于列的数据而言) # 查看员工的职位 select title from s_emp; select distinct title from s_emp; # 每个部门下有哪些职位 select dept_id,title from s_emp; select distinct dept_id,title from s