CentOS设置系统环境变量 1)第一次尝试的天真做法:以注册golang环境变量为例:cd /etc/profile.dls -rtltouch custom.sh # or any file name you like to create a new filels -rtlecho "export PATH=\${PATH}:/usr/local/go/bin" > custom.sh && ...
正则表达式周二挑战赛 第一周 匹配连续出现的重复单词(不限次数):/(\b\S+\b) (\b\1\b( \b\1\b)*)/giReplaced with:$1 <strong>$2</strong>https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions...
正则表达式匹配n个以上连续的数字(包含空白字符的情况) func filterOutNumbers(src string) string { re, _ := regexp.Compile("(?:(?:[0-9]|零|一|二|三|四|五|六|七|八|九|〇|壹|贰|叁|肆|伍|陆|柒|捌|玖)[[:space:]]*){4,}") return re.ReplaceAllString(src, "")}https://github.com/go...
golang 一行代码 把array/slice转成逗号分隔的字符串 strings.Replace(strings.Trim(fmt.Sprint(array_or_slice), "[]"), " ", ",", -1)[a] -> a -> a[a b c] -> a b c -> a,b,c
无法点击”我信任此应用“ Android 想从Google Play上安装Packet Capture抓包工具,可是打开代理APP却一直无法点击”我信任此应用“。解决:关掉护眼类的APP,就可以了。比如我用的“薄暮微光”。原因:据网上查到的,这类软件会开启省电优化,阻止VPN链接。同样地,运行Packet Capture的时候也要暂时关掉“薄暮微光”。...
How I solved a problem about usage of pscp by requesting more information pscp -i key.ppk t.txt server_ip:/usr/readmeServer refused our keyFatal: Disconnected: No supported authentication methods available (server sent: publickey,gssapi-keyex,gssapi-with-mic)pscp
Windows上重定向到剪贴板的小技巧 ipconfig /all | clip 把 ipconfig /all 的输出复制到剪贴板此外, 按F7可以显示前几次输入的命令 From: https://www.hanselman.com/blog/ForgottenButAwesomeWindowsCommandPromptFeatures.aspx
C++日志库_spdlog 日志库?我需要这个干什么?除了可以记录产品的错误信息, 以供反馈debug之用; 还不失为一种更方便的文件IO库. 而且像spdlog, 可以同时向文件及Windows Debugger输出信息.Windows Debugger 是指 Visual Studio 的 Output 窗口, 或者可以用工具 Dbgview 查看, 其使用的Windows API是OutputDebugSt
Convert Between char* string to wchar_t* string code snippet:inline std::unique_ptr to_wchar_ts(const char * orig){ // newsize describes the length of the // wchar_t string called wcstring in terms of the number // of wide ch
求补码就是先找到倒数第一个1 N = x ... x x 1 0 ... 0按位取反,N' = x' ... x' x' 0 1 ... 1末位+1,-N ( N的补码 ) = x' ... x' x' 1 0 ... 0相当于 从低位到高位找到第一个 1, 1 和 1之低位的0 都不变, 1 之高位的都按位取反.N & -N == 0 .. 0 0 1 0 ... 0
Visual Studio 设置追踪点 有时候, 我们不想设断点让程序的执行暂停下来, 而是把变量的值打印出来看看, 如果是控制台程序, 可以使用 printf 之类的. 但其它的程序怎么办?在Windows上, 一种方法是使用 OutputDebugString. 但是它只接受字符串参数, 易用性比 printf 可差远了.下面这种方法不用添加任何代码, 就能在Visual Studio中输出变量的值看看:新建 tra
一个exe是32位的,还是64位的? http://www.techsupportalert.com/content/how-find-out-if-program-or-executable-file-64-bit-or-32-bit.htm只意译了最方便的方法.右键单击exe, 选择"属性", 选择"兼容性", 如果兼容模式默认显示的是"Windows Vista", 则是 64bit 的exe.如果兼
C# struct and Unity3d Vector3 The new operator is also used to invoke the constructor for value types. Value-type objects such as structs are createdon the stack.—— C# new operatorThis is not like Java. In C#, you
查询电脑硬件,操作系统信息的微软API 用Querying WMI查询电脑的硬件、系统信息,相关的:Computer System Hardware ClassesOperating System Classes
Some search result of float to int conversion cast float to int in c++ standard,http://en.cppreference.com/w/cpp/language/implicit_conversionhttp://www.cplusplus.com/doc/tutorial/typecasting/http://en.cppreference.com/w/cpp/numeric/math
unsigned minus unsigned Unsigned integer arithmetic is always performed modulo 2^nwhere n is the number of bits in that unsigned integer. A better name for unsigned integer + and - should be "circular plus" and "circular minus".
Unusual Errors of the Unity3D Editor -- Caused by Virus 1. Failed to import package with error: Couldn't decompress package UnityEditor.Web.JSProxyMgr:DoTasks()Maybe 7z.exe under \Unity\Editor\Data\Tools is infected with virus and deleted by security sof
Remake Quaternions That said when quaternions are used in geometry, it is more convenient to define them as a scalar plus a vector.An equivalent definition of Quaternion ( R3R^3 means 3D euclidean real vector space): Q