自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Better Explained

偶尔记录开发中的一些琐事

  • 博客(104)
  • 资源 (1)
  • 收藏
  • 关注

原创 DirectX投影变换矩阵的原理与推导,齐次裁剪空间的应用举例

DirectX Geometry Pipeline的投影变换不是D3DXMatrixShadow或者几何书上的投影变换。 几何书上的投影变换是这样的:分别是平行投影和透视投影,把空间中的三维物体变成二维平面上的图形。 而DirectX Geometry Pipeline的投影变换是这样的:上图分别是 Perspective Camera 和 Orthographic Camera 的视景体1

2016-01-26 19:58:03 3257

原创 矩阵相似的意义和解释

两个n阶矩阵(方阵)相似,具有什么意义呢? 矩阵可以表示线性变换,基于此,来解释一下:{a1,…,an}, {b1,…,bn} 是n维向量空间的两组基。 {b1,…,bn}可以由{a1,…,an}线性表出:(b1,…,bn) = (a1,…,an) P 其中,bi=P1ia1+⋯+Pnian=

2016-01-23 18:49:21 23540 2

原创 Latex相关网站

在线Latex公式编辑:https://www.codecogs.com/latex/eqneditor.phphttp://formulasheet.com/#q手写符号识别:http://detexify.kirelabs.org/classify.html参考大全:Cmd Markdown 公式指导手册

2016-01-12 10:50:01 834 1

原创 平行投影与透视投影的关系与统一的矩阵表示

D3DXMatrixShadow 产生一个矩阵,把几何体投影到平面上,神奇的是这个矩阵不论对平行光还是点光,都具有统一的形式。随着点光源距离平面越来越远,平面上任意两点接收到的光线趋于平行,若点光源位置无穷远,则就是平行光了

2015-10-13 14:28:00 7198

原创 Golang method overriding examples

1. Pointer and Value Receiver2. Structs and embedding

2018-12-23 14:11:18 342

转载 TCP socket 过程图

TCP socket 过程图

2018-06-17 19:58:20 725 1

原创 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 && ...

2018-04-07 15:57:01 879

原创 正则表达式周二挑战赛 第一周

匹配连续出现的重复单词(不限次数):/(\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...

2018-04-02 00:49:49 327

原创 正则表达式匹配n个以上连续的数字(包含空白字符的情况)

func filterOutNumbers(src string) string { re, _ := regexp.Compile("(?:(?:[0-9]|零|一|二|三|四|五|六|七|八|九|〇|壹|贰|叁|肆|伍|陆|柒|捌|玖)[[:space:]]*){4,}") return re.ReplaceAllString(src, "")}https://github.com/go...

2018-03-30 13:46:23 17742

原创 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

2018-03-12 23:46:41 23154 6

原创 无法点击”我信任此应用“ Android

想从Google Play上安装Packet Capture抓包工具,可是打开代理APP却一直无法点击”我信任此应用“。解决:关掉护眼类的APP,就可以了。比如我用的“薄暮微光”。原因:据网上查到的,这类软件会开启省电优化,阻止VPN链接。同样地,运行Packet Capture的时候也要暂时关掉“薄暮微光”。...

2018-03-12 23:04:30 1530

原创 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

2017-08-23 18:41:37 650

翻译 Windows上重定向到剪贴板的小技巧

ipconfig /all | clip 把 ipconfig /all 的输出复制到剪贴板此外, 按F7可以显示前几次输入的命令 From: https://www.hanselman.com/blog/ForgottenButAwesomeWindowsCommandPromptFeatures.aspx

2017-08-18 16:38:48 1321

原创 C++日志库_spdlog

日志库?我需要这个干什么?除了可以记录产品的错误信息, 以供反馈debug之用; 还不失为一种更方便的文件IO库. 而且像spdlog, 可以同时向文件及Windows Debugger输出信息.Windows Debugger 是指 Visual Studio 的 Output 窗口, 或者可以用工具 Dbgview 查看, 其使用的Windows API是OutputDebugSt

2017-07-07 17:27:03 5335

原创 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

2017-07-07 15:04:43 428

原创 求补码就是先找到倒数第一个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

2017-06-17 14:54:49 596

原创 Visual Studio 设置追踪点

有时候, 我们不想设断点让程序的执行暂停下来, 而是把变量的值打印出来看看, 如果是控制台程序, 可以使用 printf 之类的. 但其它的程序怎么办?在Windows上, 一种方法是使用 OutputDebugString. 但是它只接受字符串参数, 易用性比 printf 可差远了.下面这种方法不用添加任何代码, 就能在Visual Studio中输出变量的值看看:新建 tra

2017-06-16 15:02:30 2071

翻译 一个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.如果兼

2017-06-14 17:39:04 1379

原创 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

2017-06-06 12:04:05 389

转载 查询电脑硬件,操作系统信息的微软API

用Querying WMI查询电脑的硬件、系统信息,相关的:Computer System Hardware ClassesOperating System Classes

2017-05-10 14:23:03 662

转载 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

2017-04-28 11:56:07 329

原创 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".

2017-03-27 22:51:08 445 1

转载 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

2017-03-17 15:47:03 577

原创 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

2017-03-10 01:16:42 484 2

原创 A Simple Algebraic Way to understand Quaternions and Rotations in 3D

Before doing this study, using quaternions to represent rotation (v′=qvq−1v' = qvq^{-1}) is a magical formula to me. It’s easy to verify its correctness by expanding the identity to the vector rotatio

2017-03-08 00:15:11 351

原创 Notepad++ 正则表达式替换 例子

\{ 和 \} 分别代表 { 和 } [^ \{\}]匹配 除了 { 和 } 之外的一个字符* 尽可能多得匹配它前面的那种字符,至少匹配0个+ 尽可能多得匹配它前面的那种字符,至少匹配1个

2017-02-24 15:46:52 2250

转载 windows shared memory -- msdn document of the file mapping object

EXECUTE? Execute addresses within the shared memory?CreateFileMappingPAGE_READONLY Allows views to be mapped for read-only or copy-on-write access. An attempt to write to a specific region results

2017-01-15 13:32:33 583

转载 How to write a console application running in background (hidden window)?

On windows platform with visual studio:#pragma comment( linker, "/subsystem:windows /entry:mainCRTStartup" )int main(){ // ... return 0;}/subsystem:windows :Application does not require a c

2017-01-13 15:22:31 226

转载 (offline) documentation browser

Dash(Apple Mac) or Zeal(other platform)DevDocsZest

2016-12-23 11:47:15 305

原创 some common usage of robocopy

Using robocopy in Visual Studio's Post-Build Event:You may encounter the error MSB3073: robocopy exit with code 1.Visual Studio thinks that only code 0 means success. But robocopy returns a value greater than 7 when it failed.

2016-12-08 10:16:36 369

原创 unresolved external symbol __imp__... when I want to link a static library

So I build the static library to use : $(SolutionDir)..\dependency\glew-2.0.0\lib\Debug\Win32\glew32sd.libBut the linker error happens: ... unresolved external symbol __imp__glewInit@0 ... and lots of other "__imp__..." unresolved symbols (which are omitt

2016-12-01 18:54:47 566

原创 GCC 6.1 (C++17) doesn't compile std::atomic<std::chrono::system_clock::time_point> with default ctor

The code below will help you get through:

2016-11-10 11:46:51 1346

原创 Set font size and color in GUI.Label

unity GUI.Label:public static void Label(Rect position, string text);public static void Label(Rect position, string text, GUIStyle style);GUIStyle myStyle;void Start () { myStyle

2016-08-29 15:26:58 1208

原创 A Bug which is not a std::vector bug

The story basically  goes like this:/* some guy's code */struct Foo{ std::vector ints;};Foo Fooes[7];.../* another guy's code */Fooes[7].ints.push_pack(5); // Bad things happen silen

2016-08-19 20:37:35 350

原创 矩阵(n阶方阵)的初等变换 初等矩阵 几何意义

任何一个可逆矩阵A都可以经初等行变换,变换到单位矩阵E。 A也可经初等列变换,变换到E。 A每经过一次初等行变换,就相当于在A的左边乘一个初等矩阵。 A每经过一次初等列变换,就相当于右乘一个初等矩阵。 左(行)右(列)初等变换的逆变换还是初等变换。 初等矩阵的逆矩阵还是初等矩阵。 所以A一定可以写成一系列初等矩阵的乘积。初等变换(初等矩阵)有三种。... 下面表格总结了初等变换几何意义

2016-01-27 15:08:25 16139 1

原创 Volume of n-simplex | n维单纯形的体积

n-simplex supported by n vectors of same origin

2016-01-27 14:34:45 3010

原创 3D 坐标变换 公式 推导

下面使用行向量: e1=(1,0,0) e2=(0,1,0) e3=(0,0,1) i, j, k是三个线性无关的向量,它们在e1,e2,e3坐标系下的坐标也记作i,j,k i’, j’, k’是三个线性无关的向量,它们在e1,e2,e3坐标系下的坐标也记作i’, j’, k’ denote⎡⎣⎢ijk⎤⎦⎥=A,⎡⎣⎢i′j′k′⎤⎦⎥=Bdenote \quad \begin{b

2016-01-23 10:13:45 6318 2

原创 线性变换与仿射变换 点和向量的代数定义

[用抽象代数讨论仿射变换和仿射空间中的坐标变换] 是重新整理的,以下是之前的内容。这里谈论的是计算机图形学中的内容,当然源自数学,但有的地方没有使用纯粹数学上的那种严格定义。线性变换抽象定义域F上的向量空间V,任意的x、y∈V a∈F, 若 映射f: V-&gt;V满足 f(x+y)=f(x)+f(y) f(ax)=af(x) 则映射f是一个线性变换。矩阵表示 When V are finit

2016-01-20 23:53:25 4030

原创 解决 Excel 打开 UTF-8 编码 CSV 文件乱码的 BUG

直接用 Excel 2013 打开 UTF-8 编码的 CSV 文件会导致汉字 出现乱码。原因可能是 Excel 以 ANSI 格式 打开,不会做编码识别。打开 UTF-8 编码的 CSV 文件的方法:用 Notepad++ 打开 csv文件,选择主菜单上的 "Encoding" -> "Convert to ANSI",轻松搞定。然后再用Excel打开就好了。...

2015-12-24 21:59:57 6611

原创 各种代数结构(抽象代数)总结,仿射空间和点的数学定义

运算的封闭性是大前提:结合律 -> 半群(Semigroup)+ 幺元 -> 幺半群(Monoid)+ 逆元 -> 群(Group) + 交换律 ->交换群环(ring):集合R和定义于其上的二元运算 + 和•:1. 加法形成一个 交换群2. 乘法形成一个 半群3. 乘法关于加法满足分配律

2015-12-17 21:06:21 5064 1

二维正态概率密度

用Microsoft Mathematics打开

2015-06-27

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除