william

Keep Calm and Markdown.

g++ 获取编译时间

gcc/g++ 提供编译日期,可以通过获取日期,进行相关判断。

1
2
const char *months[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug",
                        "Sep", "Oct", "Nov", "Dec"};

c++ inline浅析

gcc 提供关键词 inline,允许我们标注函数需要在编译时展开,这样可以避免函数调用,减低函数栈开销,从而达到优化程序的目地。然而,天下并没有免费的午餐,在引入 inline 的同时,我们也需要注意其带来的程序体积变大、cache locality 减少的风险。

Pros of inlining:

  • Removes function call overhead (yay!)
  • May reveal additional optimization opportunities (sometimes yay!)

Cons of inlining:

  • Increases program size (boo!)
  • May reduce cache locality (sometimes boo!)
  • May increase build times (boo!)

nvim tokyonight 修改高亮颜色

如果遇到在终端显示问题,可以修改高亮颜色: ~/.config/nvim/lua/plugins/tokyonight.lua 1 2 3 4 5 6 7 8 on_highlights = function(hl, colors) hl.LineNr = { fg = "#fffb7b", } hl.CursorLineNr = { fg = "#709db2", } end,

nvim 报错: lua language server

今天升级 lazy.nvim 遇到一个错误:

1
Spawning language server with cmd: `lua-language-server` failed. The language server is either not installed, missing from PATH, or not executable.
0%