colored manual page

本文介绍如何通过编写和编译一个脚本文件来实现终端中手册页的彩色显示效果。包括创建必要的目录、脚本文件的内容及编译步骤,并提供了一个shell别名用于启用此功能。

colored manual page

彩色化 manual page

step 0 prepare

$ mkdir ~/.terminfo/ && cd ~/.terminfo

step 1 create script file

$ touch most.txt


file: most.txt

#   Reconstructed via infocmp from file: /usr/share/terminfo/x/xterm-pcolor
mostlike|manpages with color looking like most,
    am, hs, km, mir, msgr, xenl,
    cols#80, it#8, lines#24, wsl#40,
    acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
    bel=^G, bold=\E[1m\E[31m, clear=\E[H\E[2J, cr=^M,
    csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
    cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C,
    cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
    dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, dl1=\E[M,
    dsl=\E]0;\007, ed=\E[J, el=\E[K, enacs=\E)0, fsl=^G,
    home=\E[H, ht=^I, hts=\EH, il=\E[%p1%dL, il1=\E[L, ind=^J,
    is2=\E7\E[r\E[m\E[?7h\E[?1;3;4;6l\E[4l\E8\E>, kbs=^H,
    kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
    kdch1=\E[3~, kf1=\E[11~, kf10=\E[21~, kf11=\E[23~,
    kf12=\E[24~, kf13=\E[25~, kf14=\E[26~, kf15=\E[28~,
    kf16=\E[29~, kf17=\E[31~, kf18=\E[32~, kf19=\E[33~,
    kf2=\E[12~, kf20=\E[34~, kf3=\E[13~, kf4=\E[14~,
    kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~,
    kfnd=\E[1~, kich1=\E[2~, kmous=\E[M, knp=\E[6~, kpp=\E[5~,
    kslt=\E[4~, rc=\E8, rev=\E[7m\E[34m, ri=\EM, rmacs=^O,
    rmcup=\E[2J\E[?47l\E8, rmir=\E[4l, rmkx=\E[?1l\E>,
    rmso=\E[m, rmul=\E[m,
    rs2=\E7\E[r\E8\E[m\E[?7h\E[?1;3;4;6l\E[4l\E>, sc=\E7,
    sgr0=\E[m, smacs=^N, smcup=\E7\E[?47h, smir=\E[4h,
    smkx=\E[?1h\E=, smso=\E[1;30m\E[47m, smul=\E[32m,
    tbc=\E[3g, tsl=\E]0;, u6=\E[%i%d;%dR, u7=\E[6n,
    u8=\E[?1;2c, u9=\E[c,

step 2 compile the script file

$ tic most.txt

step 3 append an alias to shell config file

$ vi ~/.bashrc


snippet: alias

alias man="TERMINFO=~/.terminfo/ LESS=C TERM=mostlike PAGER=less man"

Sources:
* http://nion.modprobe.de/blog/archives/569-colored-manpages.html
* http://blog.youkuaiyun.com/rainysia/article/details/8673199

matt@V3SUB2204:~/v3s/thirdparty/v4l-utils-1.26.0$ meson configure build-armhf Core properties: Source dir /home/matt/v3s/thirdparty/v4l-utils-1.26.0 Build dir /home/matt/v3s/thirdparty/v4l-utils-1.26.0/build-armhf Main project options: Core options Current Value Possible Values Description ------------ ------------- --------------- ----------- auto_features auto [enabled, disabled, auto] Override value of all 'auto' features backend ninja [ninja, vs, vs2010, vs2012, vs2013, Backend to use vs2015, vs2017, vs2019, vs2022, xcode] buildtype debugoptimized [plain, debug, debugoptimized, Build type to use release, minsize, custom] cmake_prefix_path [] List of additional prefixes for cmake to search debug true [true, false] Debug default_library shared [shared, static, both] Default library type force_fallback_for [] Force fallback for those subprojects install_umask 0022 [preserve, 0000-0777] Default umask to apply on permissions of installed files layout mirror [mirror, flat] Build directory layout optimization 2 [0, g, 1, 2, 3, s] Optimization level pkg_config_path [] List of additional paths for pkg-config to search strip false [true, false] Strip targets on install unity off [on, off, subprojects] Unity build unity_size 4 >=2 Unity block size warning_level 1 [0, 1, 2, 3] Compiler warning level to use werror false [true, false] Treat warnings as errors wrap_mode default [default, nofallback, nodownload, Wrap mode forcefallback, nopromote] build.cmake_prefix_path [] List of additional prefixes for cmake to search build.pkg_config_path [] List of additional paths for pkg-config to search Backend options Current Value Possible Values Description --------------- ------------- --------------- ----------- backend_max_links 0 >=0 Maximum number of linker processes to run or 0 for no limit Base options Current Value Possible Values Description ------------ ------------- --------------- ----------- b_asneeded true [true, false] Use -Wl,--as-needed when linking b_colorout always [auto, always, never] Use colored output b_coverage false [true, false] Enable coverage tracking. b_lto false [true, false] Use link time optimization b_lto_threads 0 Use multiple threads for Link Time Optimization b_lundef true [true, false] Use -Wl,--no-undefined when linking b_ndebug false [true, false, if-release] Disable asserts b_pch true [true, false] Use precompiled headers b_pgo off [off, generate, use] Use profile guided optimization b_pie false [true, false] Build executables as position independent b_sanitize none [none, address, thread, undefined, Code sanitizer to use memory, address,undefined] b_staticpic true [true, false] Build static libraries as position independent Compiler options Current Value Possible Values Description ---------------- ------------- --------------- ----------- c_args [] Extra arguments passed to the c compiler c_link_args [] Extra arguments passed to the c linker c_std gnu99 [none, c89, c99, c11, gnu89, gnu99, C language standard to use gnu11] cpp_args [] Extra arguments passed to the cpp compiler cpp_debugstl false [true, false] STL debug mode cpp_eh default [none, default, a, s, sc] C++ exception handling type. cpp_link_args [] Extra arguments passed to the cpp linker cpp_rtti true [true, false] Enable RTTI cpp_std gnu++11 [none, c++98, c++03, c++11, c++14, C++ language standard to use c++17, c++1z, c++2a, c++20, gnu++03, gnu++11, gnu++14, gnu++17, gnu++1z, gnu++2a, gnu++20] build.c_args [] Extra arguments passed to the c compiler build.c_link_args [] Extra arguments passed to the c linker build.c_std none [none, c89, c99, c11, c17, c18, c2x, C language standard to use gnu89, gnu99, gnu11, gnu17, gnu18, gnu2x] build.cpp_args [] Extra arguments passed to the cpp compiler build.cpp_debugstl false [true, false] STL debug mode build.cpp_eh default [none, default, a, s, sc] C++ exception handling type. build.cpp_link_args [] Extra arguments passed to the cpp linker build.cpp_rtti true [true, false] Enable RTTI build.cpp_std none [none, c++98, c++03, c++11, c++14, C++ language standard to use c++17, c++1z, c++2a, c++20, gnu++03, gnu++11, gnu++14, gnu++17, gnu++1z, gnu++2a, gnu++20] Directories Current Value Possible Values Description ----------- ------------- --------------- ----------- bindir bin Executable directory datadir share Data file directory includedir include Header file directory infodir share/info Info page directory libdir lib Library directory libexecdir libexec Library executable directory localedir share/locale Locale data directory localstatedir /var Localstate data directory mandir share/man Manual page directory prefix /usr Installation prefix sbindir sbin System executable directory sharedstatedir /var/lib Architecture-independent data directory sysconfdir /etc Sysconf data directory Testing options Current Value Possible Values Description --------------- ------------- --------------- ----------- errorlogs true [true, false] Whether to print the logs from failing tests stdsplit true [true, false] Split stdout and stderr in test logs Project options Current Value Possible Values Description --------------- ------------- --------------- ----------- bpf auto [enabled, disabled, auto] Enable IR BPF decoders doxygen-doc disabled [enabled, disabled, auto] Generate doxygen project documentation doxygen-html true [true, false] Generate doxygen plain HTML documentation doxygen-man false [true, false] Generate doxygen manual pages gconv auto [enabled, disabled, auto] Enable compilation of gconv modules gconvsysdir Set system gconv directory (default is to autodetect) jpeg disabled [enabled, disabled, auto] jpeg libdvbv5 disabled [enabled, disabled, auto] Enable libdvbv5 compilation libv4l1subdir libv4l Set libv4l1 library subdir libv4l2subdir libv4l Set libv4l2 library subdir libv4lconvertsubdir libv4l Set libv4lconvert library subdir qv4l2 auto [enabled, disabled, auto] Enable qv4l2 compilation qvidcap auto [enabled, disabled, auto] Enable qvidcap compilation systemdsystemunitdir Set systemd system unit directory udevdir Set udev directory v4l-plugins true [true, false] V4L plugin support v4l-utils true [true, false] Enable v4l-utils compilation v4l-wrappers true [true, false] V4L wrappers support v4l2-compliance-32 false [true, false] Enable v4l2-compliance-32 compilation (for debugging purposes only) v4l2-compliance-libv4l true [true, false] Enable use of libv4l in v4l2-compliance v4l2-ctl-32 false [true, false] Enable v4l2-ctl-32 compilation (for debugging purposes only) v4l2-ctl-libv4l true [true, false] Enable use of libv4l in v4l2-ctl v4l2-ctl-stream-to true [true, false] Enable use of --stream-to in v4l2-ctl v4l2-tracer auto [enabled, disabled, auto] Enable v4l2-tracer compilation
07-04
内容概要:本文介绍了基于贝叶斯优化的CNN-LSTM混合神经网络在时间序列预测中的应用,并提供了完整的Matlab代码实现。该模型结合了卷积神经网络(CNN)在特征提取方面的优势与长短期记忆网络(LSTM)在处理时序依赖问题上的强大能力,形成一种高效的混合预测架构。通过贝叶斯优化算法自动调参,提升了模型的预测精度与泛化能力,适用于风电、光伏、负荷、交通流等多种复杂非线性系统的预测任务。文中还展示了模型训练流程、参数优化机制及实际预测效果分析,突出其在科研与工程应用中的实用性。; 适合人群:具备一定机器学习基基于贝叶斯优化CNN-LSTM混合神经网络预测(Matlab代码实现)础和Matlab编程经验的高校研究生、科研人员及从事预测建模的工程技术人员,尤其适合关注深度学习与智能优化算法结合应用的研究者。; 使用场景及目标:①解决各类时间序列预测问题,如能源出力预测、电力负荷预测、环境数据预测等;②学习如何将CNN-LSTM模型与贝叶斯优化相结合,提升模型性能;③掌握Matlab环境下深度学习模型搭建与超参数自动优化的技术路线。; 阅读建议:建议读者结合提供的Matlab代码进行实践操作,重点关注贝叶斯优化模块与混合神经网络结构的设计逻辑,通过调整数据集和参数加深对模型工作机制的理解,同时可将其框架迁移至其他预测场景中验证效果。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值