- 博客(92)
- 收藏
- 关注
原创 python的类的一个简单例子
[crsusr@linux2 python_tidb]$ cat mypy01.py #!/usr/local/bin/python3import glob,sys,shelveclass person: def __init__(self,v_name,v_age,v_salary=0,v_job='none'): self.name=v_name ...
2019-05-31 06:13:01 920
原创 python的shelve示例
[crsusr@linux2 python_tidb]$ cat mypy01.py #!/usr/local/bin/python3import glob,sys,shelvefile_shelve = shelve.open('file_shelve')file_shelve['wangming']={'name':'wangming','sex':'male','age':44,...
2019-05-30 23:02:53 186
原创 perl和python的读写文件例子
[crsusr@linux2 python_tidb]$ cat mypy01.py#!/usr/local/bin/python3import glob,sysF = open('samp_python.txt','w')#sys.stdin = FF.write('first line\n')F.write('second line\n')F.write('third lin...
2019-05-30 22:40:11 243
原创 linux安装python3.7.3
从www.python.org下载源码包三步安装./configuremakemake installmake install碰到这个问题ModuleNotFoundError: No module named ‘_ctypes’需要安装依赖包yum -y groupinstall "Development tools"yum -y install zlib-devel b...
2019-05-30 22:19:30 1041
原创 python的print语句的分隔符和结束符
>>> print("zhong","guo","ren",sep=":::",end="!!\n");zhong:::guo:::ren!!
2019-05-29 16:45:56 10160
原创 perl和python的数据类型对比
perl的数据类型有1.标量(标量是包括数字、字符串、日期等,但perl没有细分这些字符串),标量声明的时候用$标识my $var_a = '3';2.数组,perl的数组是用@标识的,一个变量前面有@标识这是个数组my @array_1 = ('wang','tian','zhong',3);3.hash hash标识是用% my %hash_1 = ('wang','WANG','...
2019-05-29 10:56:25 310
原创 python的字典与perl的hash的对比
[crsusr@rws1270149 python_study]$ cat mypy.py#!/usr/bin/python3.7#字典实例 python的字典等同于perl的hashdict1 = dict(name='wang fang',age=42,salary=400000)#perl hash的下标用的是{},python的下标无论是列表还是字典都使用的是[]中括号pr...
2019-05-29 10:35:37 1166
原创 perl的进程间通信(信号)
[root@rwsoda203db1 perl_tidb]# cat p.pl#!/usr/bin/perluse strict "subs";use strict;use v5.16;use warnings;use Carp;$SIG{INT} = sub { die "\nReceive INT signal. \nQuit this perl script.$!\n";};...
2019-05-28 10:26:27 284
原创 perl的几种产生异常方式
[root@rwsoda203db1 perl_tidb]# cat p.pl#!/usr/bin/perluse strict "subs";use strict;use v5.16;use warnings;use Carp;carp "Can not open file AAA.TXT $!\n" unless open(F,"<","AAA.TXT");print ...
2019-05-28 09:57:28 626
原创 perl的引用
标量引用 \$ $$数组引用 \@ @$hash引用 \% %$子例程引用 \& &$\$ \@ \% \& 会返回相应对象类型的一个标量引用(应该是对象的地址)$$ @$ %$ &$会返回对象本身...
2019-05-26 10:22:00 432
原创 perl的函数原型例子
[root@rwsoda203db1 perl_tidb]# cat p.pl#!/usr/bin/perluse strict "subs";use strict;use v5.16;use warnings;my @a = (1,2,3,4,5);sub push_item(+$){ my $local_a = shift @_; my $local_item = shi...
2019-05-26 09:52:38 148
原创 perl正则表达式匹配后的各种变量
[root@rwsoda203db1 perl_tidb]# cat p.pl#!/usr/bin/perluse strict "subs";use strict;use v5.16;my $n = 3;my $str = "first . <EM>PARENT</EM> LAST";$str =~ m# (<.*?>)(.*?)(</....
2019-05-25 17:25:55 2237
原创 perl的”定义或“例子
[root@rwsoda203db1 perl_tidb]# cat p.pl#!/usr/bin/perluse strict "subs";use strict;use v5.16;#//定义或 如果$child_id已定义 则返回$child_id,如果$child_id undef,则执行diemy $child_id = fork() // die "cann't for...
2019-05-23 21:36:45 432
原创 perl中的特殊文件句柄
print "Readable \n" if -r _;下划线_ 是个特殊的文件句柄 special file handlehttps://stackoverflow.com/questions/46215052/what-is-single-underscore-in-perl-without-or参考一下
2019-05-23 16:35:20 326
原创 perl的qx用法
[root@rwsoda203db1 perl_tidb]# cat p.pl#!/usr/bin/perluse strict "subs";use strict;use v5.16;my $perl_info = qx(ps $$);my $shell_info = qx 'ps $$';print "perl_info $perl_info\n";print "shell...
2019-05-23 14:49:57 1798
原创 perl的上下文例子
[root@rwsoda203db1 perl_tidb]# cat p.pl#!/usr/bin/perluse strict "subs";use strict;use v5.16;my @files;$files[0]='a.txt';$files[1]='b.txt';$files[2]='c.txt';$files[3]='d.txt';print "@files...
2019-05-23 13:53:24 230
原创 perl的两个小于号用法
没想明白是为啥 [root@rwsoda203db1 perl_tidb]# cat p.pl#!/usr/bin/perluse strict "subs";use strict;use v5.16;print <<`EOC`;echo hi thereecho lo thereEOCprint <<EOCecho hi thereec...
2019-05-23 11:27:54 1455
原创 perl中的标签和next last语句练习
[root@rwsoda203db1 perl_tidb]# cat p.pl#!/usr/bin/perlmy $var_i =0;OUT: while ($var_i <8) { $var_i++; INN: for (my $var_h = 1;$var_h<5; $var_h++){ if($var_i == 3){ next OUT; } if(...
2019-05-23 10:07:08 403
原创 perl里一些数组 hash的测试操作
[root@rwsoda203db1 perl_tidb]# cat p.pl#!/usr/bin/perl#数组赋值给数组my @array1=("a","b","c");#hash赋值给hashmy %hash1 = ("a"=>"A","b"=>"B");#数组赋值给标量$array1[3]=["d","e"];#hash赋值给标量$array1[4]=...
2019-05-22 16:53:50 410
原创 正则表达式
[]里面的内容匹配一个字符[a-zA-Z_0-9]会匹配26个英文字符的大小写以及0到9数字还有下划线. 小数点匹配任何一个字符\s匹配单个空白符,是[\t\n\r\f ]的简写形式正则表达式的量词量词是用花括号括起来的{0,5}表示可以出现0到5次.{0,5} 表示任意字符可以出现0到5次量词+其实表示的意思是{1,}?等价于{0,1}*等价于{0,}...
2019-05-22 14:46:55 463
原创 如何查找一个perl module所在的文件
我们想去看看某个module的源代码,比如某个module的某个子例程,需要首先找到这个文件,就可以使用下面的方法[root@rwsoda203db1-vip perl_tidb]# perldoc -l IO::Select/usr/lib64/perl5/IO/Select.pm[root@rwsoda203db1-vip perl_tidb]# perldoc -l strict/u...
2019-05-21 16:51:11 536
转载 perl IO::Socket 简介
http://www.360doc.com/content/12/0423/14/116188_205880702.shtml对perl socket的各种方法做了一个讲解,感觉还算比较清楚
2019-05-21 10:23:29 466
原创 我的第一个perl dbi脚本
使用perl dbi连接mysql并插入一条数据[root@rws1270149 script_wgz]# cat mysql.pl#!/usr/bin/perluse DBI;my $host="127.0.0.1";my $port="3306";my $user="root";my $password="password";my $db_name="db100";my $s...
2019-05-20 23:15:38 299 1
转载 perl--DBI使用详解(二)
https://blog.csdn.net/herokoking/article/details/60123334参考一下,非常好
2019-05-20 23:13:27 577
原创 perl连接mysql
$dsn的详细用法my $dsn = "dbi:mysql:database=${db_name};hostname=${db_host};mysql_socket=${db_sock};port=${db_port};mysql_compression=1;mysql_read_default_file=$ENV{HOME}/.my.cnf;mysql_read_default_group=c...
2019-05-20 22:51:40 835
转载 perl进程间通信第一个程序
虽然大部分代码看不懂,虽然格式很烂,但是等当看到通讯成功时,还是很高兴的server端程序[root@rwsoda203db1-vip perl_tidb]# cat perl_tidbvip.pl#!/usr/bin/perluse IO::Socket;use IO::Select;%srv_info=("clt_ip"=>"10.210.80.8","clt_por...
2019-05-20 15:47:03 185
转载 tidb raft协议 保证数据一致性
https://www.cnblogs.com/sgphappy2007/p/8184452.html参考一下
2019-05-19 23:23:44 1902
原创 TiDB单次事务数据量大会报错
我将mysql的user表用mysqldump导出来,然后插入TiDB,多次调用insert into user select * from user;再几十万行的时候就报错了,报事务过大。mysql> insert into user select * from user;Query OK, 262144 rows affected (25.93 sec)Records: 2621...
2019-05-19 23:11:29 1659 1
原创 tidb安装及运行
启动pd-serverpd-server的配置文件[root@rwsoda203db1 conf]# pwd/usr/bin/tidb/conf[root@rwsoda203db1 conf]# lspd.toml[root@rwsoda203db1 conf]# cat pd.tomlname="tidb_pd"data-dir="/home/tidb/pd"client-u...
2019-05-19 17:29:45 4123
转载 PINGCAP-tidb入门到跑路
https://blog.csdn.net/weixin_36135773/article/details/78789612参考一下
2019-05-19 15:17:48 1097
转载 ORACLE 12C R2 RAC搭建
https://blog.csdn.net/lzw5210/article/details/68060246参考一下
2019-05-18 17:20:50 1641
转载 理解RHEL上安装oracle的配置参数 :/etc/security/limits.conf, /etc/profile, /etc/pam.d/login
参考一下http://www.cnblogs.com/hftian/p/6944133.html
2019-05-18 16:58:53 442
转载 修改 /etc/pam.d/login, linux 本地账号密码无法登陆,一直返回 登陆的login界面
参考一下https://www.cnblogs.com/qtong1992/p/5920177.html
2019-05-18 16:49:03 5130
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人