摘要: uttep github 1 个人技术倾向: c/c++ c++熟悉STL库, boost库等常用组件 熟悉qt gui开发,Graphics/View框架,Graphic/Model框架等 linux平台软件开发 2 练习项目 crafting interpreter 学习编译器原理,按照同名书指 阅读全文
posted @ 2022-05-22 10:14 uttep 阅读(30) 评论(0) 推荐(0) 编辑
摘要: 译者注:给自己开个新坑,讲PRNG(Pseudorandom Number Generators)的。 主要是翻译这篇文章A little bit about PRNG stuff 阅读全文
posted @ 2022-02-22 00:05 uttep 阅读(49) 评论(0) 推荐(0) 编辑
摘要: bcode parser不使用switch实现 B编码中有四种类型:string,integer,dictionary,list。示例分别如下: integer: i43e 表示数字32。 string: 5:world 前面数字表示字符长度为5,字符串为world。 dictionary: d9: 阅读全文
posted @ 2021-12-13 16:40 uttep 阅读(196) 评论(0) 推荐(0) 编辑
摘要: Intro RAII是c++的看手好戏,用过的都说好。面对c,可没有RAII这种东西使用。还好,gcc提供了一些折中的方案来剑走偏峰,来实现RAII。如下: __attribute__((cleanup(free-function))) attribute的使用简介还请看ref。此不在讲解范围内。 阅读全文
posted @ 2021-11-23 00:12 uttep 阅读(294) 评论(0) 推荐(1) 编辑
摘要: 技巧1 Shell + inotifywait 的使用 在修改代码时,总会编译一下看一下,运行是否正常。但是每次写完还要切换make一下,比较麻烦。于是乎,发现inotifywait这个工具真好用。其详解见man inotify。 $ while inotifywait -e modify <fil 阅读全文
posted @ 2021-11-22 22:20 uttep 阅读(438) 评论(0) 推荐(1) 编辑
摘要: 哲学家进餐问题的mutex解法 筷子的数据结构 typedef struct chopstick { pthread_mutex_t mtx; char* whoami; } chopstick_t; chopstick_t* chopstick_get(char const* const str) 阅读全文
posted @ 2021-10-12 11:28 uttep 阅读(107) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <thread> #include <string> #include <vector> #include <memory> #include <algorithm> #include <numeric> #include <random> 阅读全文
posted @ 2021-10-08 14:54 uttep 阅读(125) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <string> #include <fstream> #include <sstream> #include <map> #include <set> #include <vector> #include <list> #include < 阅读全文
posted @ 2021-09-08 01:10 uttep 阅读(41) 评论(0) 推荐(0) 编辑
摘要: 使用成员函数指针 Author: David Kieras 原文地址 Using Pointers to Member Functions 翻译 Uttep 成员函数指针不像普通的函数指针,因为成员函数有一个“隐藏的this pointer”,以至于仅仅只能提供一个对象来充当this的作用,使用特殊 阅读全文
posted @ 2021-09-03 11:15 uttep 阅读(217) 评论(0) 推荐(0) 编辑
摘要: class A { public: A():aa(42) { std::cout <<"My aaa=> uninitialize:" aaa << std::endl; aaa = aa; std::cout <<"My aaa=> " aaa << std::endl; } private: l 阅读全文
posted @ 2021-08-17 09:39 uttep 阅读(1250) 评论(0) 推荐(0) 编辑