Perfect Forwarding in C++ Universal ReferenceThere is only two reference: lvalue reference rvalue reference. The Universal Reference is not a type of reference. It just exists in the “Template”. 1234567891011121314151617181920 2023-08-29 #tech
Static & Inline in C Static & Inline in C static global variable static function inline function Static global variableJust a variable whose lifetime thoughout the whole program. 1static int count = 0; Static functi 2022-12-31 #tech
Perspective Projection Derivation part.2 Perspective Part.2There are hosts of references that use fov, aspect, far, near to discribe the Perspective Projection Matrix. The four parameters represent respectively: fov: field of view aspect: 2022-11-04 #graphics
Perspective Projection Derivation part.1 PerspectiveYou should have known the homogeneous coordinates Here we just provide a simple affine projection matrix, first: 3D affine transformations \begin{bmatrix} 1 & 0 & 0 & 0\\ 0 & 1 & 0 & 0\\ 2022-11-02 #graphics
Rasterization: Barycentric coordinate system RasterizationOld-school method: Line sweeping12345678910111213141516void triangle(Vec2i t0, Vec2i t1, Vec2i t2, TGAImage &image, TGAColor color) { // sort the vertices, t0, t1, t2 lower− 2022-10-30 #tech
Plugins in Rust Rust pluginsThis document ia a guide for setting the Rust applicationup with Rust plugins that can be loaded dynamicallyat runtime. Additionally, these plugins can make calls to theapplication’s publ 2022-10-18 #tech
Change Default Applications Default ApplicationsUsing CLI Utils12xdg-mime query filetype /path/to/filexdg-mime default <application> <mimetype(s)> We can get the file’s mime-type through xdg-mime query filetype /pat 2022-10-06 #tech
为什么我喜欢阴雨天? 为什么喜欢阴雨天?烈日当空,马路被晒出让人难受的气味。公园里树下乘凉的环卫工人慵懒地摇着扇子。我曾经还是挺喜欢晴天的,但是也许是从高中开始,我开始喜欢上了阴雨天 ,最开始我也不知道原因,只是觉得阴天让我感到非常轻松、舒服。 那天,我放假回家,和高中同学出去骑车(共享单车)乱逛,到一座桥上时,下起雨来。雨逐渐变大,但我一点也不担心,而且非常放松。转眼间,河面升起白雾,视线变得模糊。在滂沱大雨中我开 2022-10-06 #essays
Windows 11 in QEMU The Windows 11 needs to check TPM. There are two methods for resolving the problems. Use ‘swtpm’ to emulate a Trusted Platform Module(TPM): https://wiki.archlinux.org/title/QEMU#Trusted_Platform_Mo 2022-09-21 #tech
From init.vim to init.lua (1) From init.vim to init.luaPrefaceThe nvim supported lua script since Nvim 0.5. And lua is faster than vimscript. Even so, Neovim is not deprecating Vimscript. Will Neovim deprecate Vimscript? No. Lua 2022-06-25 #tech