awk中的'数组'

awk中的’数组‘是一种关联数组,又称作maps、字典,他的索引不需要连续, 可以使用字符串、数字做为索引, 此外,不需要事先声明数组的大小 - 数组可以在运行时扩展/收缩。 ...

2019-08-31 · 3 min · 1354 words · Garlic Space

FTP ASCII上传下载

近期在进行AIX到Linux迁移,发现从windows终端ftp时,客户端设置ASCII传输模式, 服务端并不能自动转换换行符号,脚本出现^M,需要手工删除。 Linux环境为RedHat7.3+vsftpd3.0.2,vsftpd.conf中ascii_download_enable/ascii_upload_enable 注释

2019-08-31 · 4 min · 1881 words · Garlic Space

LeetCode – Binary Tree Inorder Traversal

题目: Given a binary tree, return the inorder traversal of its nodes\’ values. Example: Input: 1 2 3 4 5 6 [1,null,2,3] 1 \ 2 / 3 Output: 1 [1,3,2] Follow up: Recursive solution is trivial, could you do it iteratively? 解题: 树的中序遍历: 如果当前节点的左孩子为空,则输出当前节点并将其右孩子作为当前节点。 如果当前节点的左孩子不为空,在当前节点的左子树中找到当前节点在中序遍历下的前驱节点。 a) 如果前驱节点的右孩子为空,将它的右孩子设置为当前节点。当前节点更新为当前节点的左孩子。 b) 如果前驱节点的右孩子为当前节点,将它的右孩子重新设为空(恢复树的形状)。输出当前节点。当前节点更新为当前节点的右孩子。 重复以上1、2直到当前节点为空。 实现: 递归方式: 对左子结点调用递归函数,根节点访问值,右子节点再调用递归函数 ...

2019-08-31 · 2 min · 609 words · Garlic Space

linux kernel documentation-CFS Scheduler

这篇文章 CFS Scheduler是Linux Kernel文档

2019-08-29 · 8 min · 3837 words · Garlic Space

LeetCode – Target Sum

题目: You are given a list of non-negative integers, a1, a2, …, an, and a target, S. Now you have 2 symbols + and -. For each integer, you should choose one from + and - as its new symbol. Find out how many ways to assign symbols to make sum of integers equal to target S. Example 1: 1 2 3 4 5 6 7 8 9 10 11 Input: nums is [1, 1, 1, 1, 1], S is 3. Output: 5 Explanation: -1+1+1+1+1 = 3 +1-1+1+1+1 = 3 +1+1-1+1+1 = 3 +1+1+1-1+1 = 3 +1+1+1+1-1 = 3 There are 5 ways to assign symbols to make the sum of nums be target 3. Note: ...

2019-08-20 · 2 min · 595 words · Garlic Space

LeetCode – Clone Graph

Given a reference of a node in a connected Connected_graph undirected graph, return a deep copy

2019-08-09 · 2 min · 916 words · Garlic Space

linux-sides-Timers and time management-Introduction

这篇文章 Timers and time management in the Linux kernel. Part 1. 是出自 linux-insides

2019-08-07 · 15 min · 7274 words · Garlic Space

sysctl-查询修改Linux内核参数

sysctl命令可以_实时_(runtime)查看和修改linux 内核参数。这个命令可以在大多数发行版本找到, 另外内核参数,也可以通过procfs 文件系统,在 /proc/sys/kernel下 进行查看和修改。

2019-08-06 · 2 min · 753 words · Garlic Space

LeetCode – Evaluate Reverse Polish Notation

题目: Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, -, *, /. Each operand may be an integer or another expression. Note: Division between two integers should truncate toward zero. The given RPN expression is always valid. That means the expression would always evaluate to a result and there won’t be any divide by zero operation. Example 1: Input: 1 ["2", "1", "+", "3", "*"] Output: ...

2019-08-04 · 2 min · 652 words · Garlic Space

汇编文件中的CFI指令

这篇文章CFI directives in assembly file (18 Jan 2017), 是出自google 工程师Adam Langley 问题提出: 函数调用栈 1 2 3 4 5 6 7 8 : : | caller's stack | +----------------+ <----$rsp value before CALL | return address | +----------------+ <----$rsp at function entry | caller's rbp | +----------------+ <----$rbp always points here | callee's stack | 函数调用中 调用call指令时将call指令的下一条指令 return address 入栈, 其中return address存放在RIP寄存器中也就是将 RIP入栈,之后进入子函数后会将父函数的栈基地址入栈,其中父函数的栈基地保存在RBP寄存器中。 ...

2019-07-09 · 2 min · 738 words · Garlic Space