完全能代替splay的完美算法! 核心操作:merge int merge(int x,int y) { if(!x||!y) return x|y; if(rnd[x]<rnd[y]) { down(x); rs[x]=merge(rs[x],y); up(x); return x; } else ...
分类:
其他好文 时间:
2020-07-02 21:21:28
阅读次数:
51
// 实验存档 问题描述 有如下LL(1)文法 (1)E->TG (2)G->+TG|-TG (3)G->ε (4)T->FS (5)S->*FS|/FS (6)S->ε (7)F->(E) (8)F->i E为开始符号,实现一个非递归的预测分析器。 解决思路 1、根据以上文法,可知: 非终结符有E ...
分类:
其他好文 时间:
2020-07-02 20:10:09
阅读次数:
66
1. 安装RUST环境 # 参见网址 https://www.rust-lang.org/tools/installcurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh选择1 默认安装即可 2. 修改cargo的config文件 ...
分类:
系统相关 时间:
2020-07-02 18:37:37
阅读次数:
104
var url = require("url"), fs = require("fs"), http = require("http"), path = require("path"); var port = 8080 // 默认检测80端口 if (process.argv[2] '-p') { ...
分类:
其他好文 时间:
2020-07-02 18:25:45
阅读次数:
62
方法一: ksql -At xxx -c "select datname from sys_database"|grep -v -E 'TEST|TEMPLATE1|TEMPLATE0|SAMPLES|TEMPLATE2'|awk '{sum=sum","$1} END {print sum}' 方 ...
分类:
其他好文 时间:
2020-07-02 18:13:38
阅读次数:
115
#include<cstdio> const int maxn=100005; int p; typedef long long int ll; int n,q,m; ll a[maxn]; struct Node { ll tag1,tag2,v; int l,r; Node *ls,*rs; i ...
分类:
其他好文 时间:
2020-07-01 16:01:57
阅读次数:
53
最近遇到导入的csv文件首行为日期,但需要将日期作为列导入到数据库中,直接使用ctl文件好像无法实现,了解到awk这个强大的命令。 导入的CSV文件除了首行为日期,其他的都是格式相同的。需要将首行单独读取出来,获取日期。 首行的格式为:数据日期:2020-06-30 实现方法:var=`(awk ' ...
分类:
其他好文 时间:
2020-07-01 14:09:39
阅读次数:
48
调用JSON.parseArray(json, xxx.class);出错! 这个错误是因为你的json是数组,但解析的时候没有加上[]括号,比如 {"name":"fs",“age”:“12”} 才报这个错误。 在json参数加上[]就好了,这样是没问题的: [{"name":"fs",“age” ...
分类:
Web程序 时间:
2020-07-01 13:00:03
阅读次数:
334
(一)查看副本集状态要查看副本集状态及每个成员的状态,可以连接到主节点,使用 rs.status() 命令查看: rstest:PRIMARY> rs.status() { "set" : "rstest", "date" : ISODate("2020-06-30T15:06:44.586Z"), ...
分类:
数据库 时间:
2020-06-30 21:00:28
阅读次数:
79
string path = "test.txt"; FileStream fs = new FileStream(path, FileMode.Open); StreamReader sr = new StreamReader(fs); char[] separator = new char[] { ...