ICode9

精准搜索请尝试: 精确搜索
  • 通过反射实例化与当前类所在的同一个包中的所有类、包扫描实现原理2022-09-11 23:34:21

    实例化与当前类Test2在同一个包中的所有类 思路: 1:首先定位Test2的字节码文件所在的目录(main方法里第一行代码) 2:通过该目录获取里面所有的.class文件 3:由于字节码文件名与类名一致(JAVA语法要求),因此可以通过文件名确定类名 4:使用Class.forName()加载对应的类并实例化 上述

  • 在 SSH 中使用 Socks 代理连接远程服务器2022-09-10 23:02:24

    假设我们的代理服务器是 127.0.0.1:7890 ,用户名为 test,密码为 123456,我们要连接的远程服务器为 192.168.0.233:2022,用户名为 test2 首先需要安装 ncat 工具,在 macOS 中安装:brew install nmap 第一种方法: 直接连接 ssh -p 2022 -o ProxyCommand='ncat --proxy-type socks5 --proxy

  • 极狐gitlab数据手动导出导入测试2022-08-31 17:02:44

    极狐gitlab数据手动导出导入测试 本文主要测试从源极狐gitlab实例手动迁移数据到目标极狐gitlab实例的可行性。 1. 源极狐gitlab 实例 版本:极狐gitlab v14.10.0 1.1 用户信息 其中 test1 用户属于组 usergroup 1.2 组信息 1.3 组 leffss 信息 1.3.1 组成员信息 包含用户 test2

  • 字典操作2022-08-26 23:30:29

    Golang // map删除 m := map[string]int{"test": 1, "test2": 2} delete(m, "test") // map合并 func mapMege(list ...map[string]int) map[string]int { n := make(map[string]int) for _, m := range list { for k, v := range m { n[k]

  • python 中如何将列表中的数值转换为字符串2022-08-18 09:02:07

      001、 >>> test1 = ["aaa", 100, 200] >>> test1 ['aaa', 100, 200] >>> test2 = [str(k) for k in test1] ## 将列表test1中的数值转换为字符串 >>> test2 ['aaa', '100', '200']   002、

  • linux 中sed命令的保护模式b选项2022-08-17 01:33:10

      001、 (base) root@PC1:/home/test2# cat a.txt ## 测试数据 1 2 3 k 4 5 6 7 k 8 9 10 (base) root@PC1:/home/test2# sed '/k/{n;d}' a.txt ## 删除匹配k之后的一行 1 2 3 k 5 6 7 k 9 10 (base) root@PC1:/home/test2# cat a.txt 1 2 3 k 4 5 6

  • linux中sed命令删除匹配特定字符之间的数据2022-08-17 01:31:15

      001、 (base) root@PC1:/home/test2# ls a.txt (base) root@PC1:/home/test2# cat a.txt ## 测试数据 01 02 AAA 03 04 05 BBB 06 07 08 CCC 09 10 (base) root@PC1:/home/test2# sed '/AAA/,/BBB/d' a.txt ## 删除匹配AAA和BBB之间的数据 01 02 06

  • linux 中 sed N选项将两行合并为一行处理2022-08-17 01:30:20

      001、 (base) root@PC1:/home/test2# ls a.txt (base) root@PC1:/home/test2# cat a.txt 1 2 3 4 5 6 7 8 9 10 (base) root@PC1:/home/test2# cat a.txt | sed 'N; s/\n/\t/' ## 以两行为单位,将换行符替换为制表符 1 2 3 4 5 6 7 8 9 10

  • linux 中sed命令删除匹配字符之后的若干行2022-08-17 01:00:21

      001、 (base) root@PC1:/home/test2# cat a.txt ## 测试数据 1 2 3 k 4 5 6 7 k 8 9 10 (base) root@PC1:/home/test2# sed '/k/, +2{/k/b; d}' a.txt ## 删除匹配k之后的两行 1 2 3 k 6 7 k 10 (base) root@PC1:/home/test2# sed '/k/, +1{

  • linux 中sed命令如何同时将多个字符替换为指定字符2022-08-16 21:31:11

      001、 (base) root@PC1:/home/test2# cat a.txt ## 测试数据 e f k s g d a c m s e g (base) root@PC1:/home/test2# sed 's/m/Q/g' a.txt ## 将m替换为Q e f k s g d a c Q s e g (base) root@PC1:/home/test2# sed 's/m\|k/Q/g&

  • cat命令使用2022-08-14 19:34:53

    linux中的13个基本Cat命令示例 原创 入门小站 入门小站 2022-08-05 22:00 发表于湖北 收录于合集#Linux478个 1. 显示文件内容 在下面的例子中,它将显示内容/etc/passwd文件。 # cat /etc/passwd     root:x:0:0:root:/root:/bin/bashbin:x:1:1:bin:/bin:/sbin/no

  • python中实现依据序列名称排序并输出2022-08-13 23:03:45

      001、 (base) root@PC1:/home/test2# ls a.fasta test.py (base) root@PC1:/home/test2# cat a.fasta ## 测试fasta文件 >gene2 myc AGCTGCCTAAGC GGCATAGCTAATCG >gene1 jun ACCGAATCGGAGCGATG GGCATTAAAGATCTAGCT >gene4 malat1 AGGCTAGCGAG GCGC

  • python中提取原始序列名字第一个空格前的名字作为的序列名字,输出到屏幕2022-08-13 18:33:26

      001、 (base) root@PC1:/home/test2# ls a.fasta test.py (base) root@PC1:/home/test2# cat a.fasta ## 测试fasta文件 >gene1 myc AGCTGCCTAAGC GGCATAGCTAATCG >gene2 jun ACCGAATCGGAGCGATG GGCATTAAAGATCTAGCT >gene3 malat1 AGGCTAGCGAG GCGCGAG GATT

  • 实习12022-08-13 11:00:08

    需求: 表A:含有字段:,数据28152条  表B含有字段:问题账号,数据124条 目的是筛选出问题账号所包含的系统名称,地市,账号,姓名,身份证,是否实名。   方法一:excel vlookup函数解决 (1)找到关联信息 将账号信息A放在sheet1表A,B,C,D,E,F列,问题账号放置sheet2 A列  #N/A表示结果为空,即账号lujd15

  • linux 中输出当前目录下所有目录中的所有文件(每个目录中文件各占一行)2022-08-11 16:03:58

      001、 (base) root@PC1:/home/test2# ls ## 当前目录下三个文件夹 test1 test2 test3 (base) root@PC1:/home/test2# tree ## 使用tree命令查看 . ├── test1 │   ├── 1.txt │   ├── 2.txt │   └── 3.txt ├── test2 │   ├── 1.c

  • linux 中 if条件判断符 [ -s file ]选项2022-08-11 14:03:26

      001、 [ -s file ]:文件存在且不为0是为真。 (base) root@PC1:/home/test2# ls a.txt b.txt (base) root@PC1:/home/test2# ll -h ## 列出a.txt和b.txt文件的大小 total 12K drwxr-xr-x 2 root root 4.0K 8月 11 13:42 ./ drwxr-xr-x 10 root root 4.0K 8

  • Vue封装文件ajax请求,整合el-upload2022-08-04 15:31:48

    前端 <el-upload :multiple="false"          //不可上传多个文件 action=""              //必要参数,使用ref方式提交时的url :on-change="setAvatarFile"    //文件列表变化时的钩子,用来获取当前的文件

  • R语言中 separate函数将一列拆分为多列2022-08-03 07:32:01

      001、 root@PC1:/home/test2# cat test.txt 1_55910>snp1 0.05591 1_85204>snp2 0.085204 1_122948>snp3 0.122948 1_203750>snp4 0.20375 1_312707>snp5 0.312707   library(tidyverse) dat <- read.table("test.txt") dat dat1

  • linux 中删除除第一次匹配特定字符串所在行之外的所有行2022-08-03 06:32:03

      001、shell实现 root@PC1:/home/test2# ls test.txt root@PC1:/home/test2# cat test.txt ## 测试数据, 删除第一次匹配xpehh以外的所有匹配xpehh的行 01 ee ff 02 ee de 03 dd ee 04 jj xpehh 05 jj kk 06 ee de 07 mm xpehh 08 ff ww 09 jj kk 10 mm xpehh 11 dd ee root@P

  • linux 中 awk print > 选项实现 按照特定列拆分数据2022-08-03 01:00:51

      001、 root@PC1:/home/test2# ls test.map root@PC1:/home/test2# cat test.map ## 用一个map文件进行测试,按照染色体打乱顺序 6 snp16 0 312984 1 snp2 0 85204 5 snp15 0 204629 6 snp17 0 380470 8 snp

  • linux 中 gz文件压缩保留源文件、解压缩保留源文件2022-08-03 00:32:19

      001、压缩保留源文件 root@PC1:/home/test2# ls outcome.map root@PC1:/home/test2# gzip -c outcome.map > new.map.gz ## 压缩为gz文件,并保留源文件 root@PC1:/home/test2# ls new.map.gz outcome.map   002、解压缩保留源文件 root@PC1:/home/test2# ls outcome.map

  • linux 系统中输出文本开头至匹配特定字符的行2022-08-02 23:34:14

      001、 root@PC1:/home/test2# ls a.txt root@PC1:/home/test2# cat a.txt aa dd ss dd ff xv ef 33 cc xx ee ww df ff zc xx xx ff er ed ww xx xx ee er uy vv root@PC1:/home/test2# sed -n '1,/xx/p' a.txt ## 输出开头至匹配xx的行 aa dd ss dd ff xv ef 33 cc x

  • linux 系统中输出匹配特定字符至末尾的行2022-08-02 23:31:42

      001、 root@PC1:/home/test2# ls a.txt root@PC1:/home/test2# cat a.txt aa dd ss dd ff xv ef 33 cc xx ee ww df ff zc xx xx ff er ed ww xx xx ee er uy vv root@PC1:/home/test2# sed -n '/xx/,$p' a.txt ## 输出匹配xx至末尾的行 xx ee ww df ff zc xx xx ff er

  • linux 中 tar.lzma 文件的解压2022-08-01 12:36:31

      001、解压 .tar.lzma文件 root@PC1:/home/test2/test# ls test_chr22.tar.lzma ## 增加 -k 参数 保留源文件 unlzma -k test_chr22.tar.lzma root@PC1:/home/test2/test# unlzma test_chr22.tar.lzma ## 解压缩, 或者:lzma -d test_chr22.tar.lzma root@PC1:/home

  • linux 中如何匹配非空字符2022-07-29 01:05:03

      001、\S:大写S root@PC1:/home/test2# ls a.txt root@PC1:/home/test2# cat a.txt 33-16 CC CC GG TT GG TT GG TT CC 38-11 CC GG GG TT GG TT CC TT CC 4226 CC CC GG

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有