Confession [1]

简单的记录一下最近的问题和进展.

=/

Complex-valued functions as mappings

[先开坑 慢慢填]

[就算这样我也还是不会写作业]

 

#Holomorphic functions verses real differentiable functions

In short, the Cauchy-Riemann Equations hold if and only if \(\textrm{D}F(x,y)\) is a conformal matrix, i.e. an \(\mathbb{R}\)-linear transformation corresponding to multiplication by a complex number.

 

#Cauchy-Riemann Equations, Harmonic functions, and 1-forms

 

 

Confession

 

(简单写两笔算是日记了。

实在是没什么动力写(做)学术方向上的事情。 大概是颓废太久了, 对这方面的东西有点… 既然没法扶大厦之将倾 就回头再慢慢重新盖吧。 (废物的自白。

嗯反正说我是废物的人也不止一个两个了idc lol.

 

大概之后会写一些low dimensional topology 和 machine learning相关的,看这学期的进程好了。

(现在翻到大一的时候写的parametrized by arc length的po文 感觉真是… 尼玛早点跟我说这个微分几何里要用我就多写点了啊QwQ

 

==

 

生活节奏变得莫名诡异。 具体体现在作息时间(… 和奇奇怪怪的事情上。

学术上的东西.. Complex Analysis我干你娘 这problem set和课上讲的东西有半毛钱关系吗 教授咱们出来打一架?

Applied Math is not math at all. 我真觉得图论已经傻逼到一定境界. 我怎么想都想不通一个planer graph怎么可能满足\(v-e+f=2\), 后来翻了半天才发现书上把unbounded region也算进去了…

你他妈一定是在逗我(一脸严肃。 unbounded region也tm 算region? 无穷远点算不算点! 干!

而且Amath的作业比Math的还多我简直是想杀人。 时不时改一下due date这种事情更是感觉被狗*了。

 

然后Machine learning上来就先讲了我一头雾水的probability。 一节课从conditional probability讲到likelihood让我实在是也想教他做人, 下课去找prof说enrollment的事他还问我这个比起math major的课是不是简单多啦是不是这里用到的数学很简单…. 微笑看。后边讲到Bayesian Network的时候我的心情已经只剩下 “我努力跟你的节奏 请你不要丢下我 carry me!”  这样。

心里总想着 Ok回去再读读notes读读书应该还是可以handle, 但是事实上… 读了个毛。嘻嘻。

Seminar更是血崩 … 讲道理说一些抽象的东西其实还好讲。 不管是说由equivalent class定义的quotient space上如何定义metric还是topology的一些概念还是可以轻松跟上。但是gluing opposite sides of an octagon / hexagon我就只能给自己点根蜡烛。感觉自己对这些比较具体实在的东西的幻想能力实在是远弱于抽象能力。

虽然仍然是被Complex Analysis吊打了。

虽然这门课上课的时候我感觉一切都好。

但是problem set一po出来我感觉我整个人都不会再好了QwQ。

 

==

 

被迫长大真的是一件很惨的事情, 具体体现在开始发现 “你什么闲心都不要操 管好自己学业就好了” 这样以前蛮讨厌的被说教的状态居然成了奢望。

什么时候再能什么闲心都不操只管学业就好了啊 摔。

不过其实也无所谓。现在其实过得也不算太差 讲道理。

反正自己也算是一个比较标准的享乐主义者。

 

 

==

 

最近有点迷Coldplay

虽然总感觉自己很早以前应该就被各种人以各种方式安利过。

各位父亲们都表示这都是他们听腻的…WTF!

虽然以前也听过「Yellow」的样子, 但是情歌还是情歌 没那么catching.

前一阵试Apple Music的时候莫名其妙点开「Parachutes」这张专辑, 单纯是因为封面好看。

然后看到第一首曲子叫「Don’t Panic」

Well, Don’t Panic.

作为「银河系漫游指南」的脑残粉 我当然是二话不说点来听了听。

…你妹 这个有点洗脑啊!

然后就走偏了hhhhhhh

We live in a beautiful world.

Yeah we do, yeah we do.

 

然后Viva la Vida我也不多说。

“I used to rule the world”

QwQQQQQQ星星眼!

讲道理我还是个中二病啊!

 

==

 

呐。

Happy New Year.

 

We live in a beautiful world.

Yeah we do, yeah we do.

Hope I can get somebody to lean on.

Then there will be nothing to run from.

 

==

 

I’m so fucking sorry.

Love is difficult as there’s no way to adjust it.

I’m just pretty fucking sure the one I love is not you but her.

 

==

Not obsessed.

Cuz I love u.

Bye 2015

好久没有po文了… 主题轻快一些就po一个年终总结吧lol

本来想在2015年结尾po 但是被League耽误了(. 我想我一时半会儿是忘不了一页红的恐惧

不管怎么样 小炮你的ID我记住了 见你一次挂一次机 哼.

Anyway lol, 今天突然想起来 < 50 Ways To Say Goodbye > , 在钟宇的车上听过两次 当时沉浸在失恋的痛苦中并不认为这首歌应景

现在想想 我tm真的应该唱一年这首歌.

 

总结一下这一年 大概就是 下次麻烦让我谈恋爱好不好? lol

这么说有点mean但是讲道理我真的遭不住她们带节奏带的飞起啊23333

 

嘛生活上其实没有什么太大的进展或者改变 (如果硬要算的话可能我都得把拿到Permit这样的事情都算进去心疼自己

学术上.. 大概是终于开始向着完全没有接触过的领域进发了. 也终于是时候让别人知道我是一个智障了lol

比如本学期的Topology, 用了半个学期的篇幅讲homotopic class和degree的关系 而我到学期末尾才终于理解到这个有什么用意233333

不过也还好嘛终于接触到了manifold这种工具 以后要多多关照啦(误

还有differential form是真的看起来就很有趣23333

 

唠叨好多也不知道自己在讲些什么

总之我也是一个怕寂寞的人吧。

嘛一个人呆久了就感觉总有会抑郁的tendency, 很多事情还是不要多想 也不要往深里想就好

对不起了很多的人 也被很多的人套路

说精彩也是活的像是一部戏 更多的感觉还是浮夸吧

希望以后不要再有这些乱七八糟的事情烦扰了。

 

那么祝自己在新的一年里

做一个无忧无虑的废物就好 lol

(为了不吵到父上睡觉 在明天要去漫展的情况下用mbp的键盘强行码的我只想给自己点个赞

Diagonalizability

The diagonalizability of a linear operator \(T\) is equivalent to find a basis consisting of eigenvectors of \(T\).

For \(T\), calculating its characteristic polynomial \(c(t)\), if it splits, for one particular eigenvalue \(\lambda\), we have already known that \(E_\lambda = \textrm{null}(T-\lambda I)\) is a vector space spanning by the eigenvectors of \(T\) corresponding to \(\lambda\).

At the same time, we also know that the eigenvectors corresponding to different eigenvalues are linearly independent, we can divided them into some smaller linear space.

Thus, our destination is that, can we treat the origin vector space as a direct sum of all of those eigenspaces?

On the other hand, it’s easy to conclude that \(1 \leq \dim(E_\lambda) \leq m\), where \(m\) is the multiplicity of \(\lambda\).

Moreover, the sum of all multiplicities are \(\dim V\), since the degree of \(c(t)\) is equals to \(\dim V\).

It’s easy to see that, if we can treat \(V\) as the direct sum of all those eigenspaces, the dimensions of those eigenspaces must equal to its corresponding multiplicity. One way to understand this is considering the basis in each eigenspace.

Normal vector & Curvature

Let \(\gamma\) be a parametrized curve, \(\textbf{t} = \frac {\dot{\gamma}(t)} { \left | \dot{\gamma}(t) \right |}\) is the unit tangent vector.

Generally, we can rewrite \(\left | \dot{\gamma}(t) \right |\) as \(\dot{s}\). Thus \(\dot{\gamma}(t) = \dot{s}(t)\textbf{t}(t)\).

In particular, suppose that \(\gamma\) is parametrized by arc length, \(\textbf{t} = \dot{\gamma}(t)\), we can infer that \(\dot{\textbf{t}}\) is orthogonal to \(\textbf{t}\) from \(\left | \textbf{t} \right |^2 = 1\).

Thus, calculating the second-order derivative of \(\gamma\), we would get that \[\ddot{\gamma} = \ddot{s}\textbf{t} + \dot{s}\left | \dot{\textbf{t}} \right | \textbf{n}\]

where \(\textbf{n} = \frac {\dot{\textbf{t}}} {\left | \dot{\textbf{t}} \right |} \) is the principal normal vector along \(\gamma\).

Here, we can treat the first part \(\ddot{s}\textbf{t}\) as the tangential acceleration, and the second part \(\dot{s}\left | \dot{\textbf{t}} \right | \textbf{n}\) as the centripetal acceleration.

From physics (CM), we could get a grasp of the concept of curvature: the radius of the trace of movement, which would be a part of centripetal acceleration.

If \(\gamma\) traces a twice-differentiable smooth curve, then the curvature at \(\gamma(t)\) is the scalar \[\kappa(t) = \left | \frac {\textrm{d}\textbf{t}} {\textrm{d}s} \right | \]

From the chain rule, we can treat it as \(\left | \frac{\textrm{d}\textbf{t}} {\textrm{d}t} \cdot \frac{\textrm{d}t} {\textrm{d}s} \right |\). Since \(\dot{s} > 0 \), it equals to \(\frac {\left | \dot{\textbf{t}} \right |} {\dot{s}}\).

Thus, we have \(\left | \dot{\textbf{t}} \right | = \dot{s}\kappa\), and \(\ddot{\gamma} = \ddot{s}\textbf{t} + \dot{s}^2\kappa\textbf{n}\).

Parameterization by arc length

Our goal is to find a specific parametrization which is convenient in our application, one is arc length parametrization.

Def : The arc length function \(s=s(t)\) of a curve parametrized by \(\textbf{x} = g(t)\) on \(t_0 \leq t \leq t_1\) is defined by

\[s(t)=\int_{t_0}^t \left| \dot{\textbf{x}}(u)\right| \textrm{d}u\]

Def : A curve \(\gamma : [0,L] \to \mathbb{R}^n\) is parametrized by arc length if \(\left | \dot\gamma (t) \right | = 1 \) for all \(0 \leq t < L\).

For this parametrization, we have such a property: If \(\gamma : [0,L]\to\mathbb{R}^n\) is parametrized by arc length, then the length of the arc \(\{\gamma(t) : t_1 \leq t \leq t_2\}\) is precisely \(t_2 – t_1\).

For an arbitrary parametrization \(\gamma_2 : [a,b]\to\mathbb{R}^n\), we can build a relation between this one and arc length parametrization, by the definition of arc length itself.

let \(s(t)\) be a function of \(t\) : \[s(t) = \int_a ^t \left | \dot\gamma_2(t) \right | \textrm{d}t\]

let \(\phi\) be a mapping from \([a,b]\) to \([0,L]\) (L is the length of this curve): \[\phi : [a,b] \to [0,L] = s(t)\]

It follows that:

  • \(\phi(a) = \int_a^a = 0\)
  • \(\phi(b) = \int_a^b = L\)
  • \(\phi’>0\), since \(\left | \dot \gamma_2 (t) \right | > 0 \) (which ensure that \(\phi\) is invertible)
  • Thus, \(\gamma(\phi(t)) = \gamma_2(t)\), where \(\gamma\) is a parametrization on \([0,L]\)

    Then we’ll show that \(\gamma\) is parametrized by arc length from definition, since
    \[\begin{align*} \dot \gamma_2(t)
    &= \frac {d} {dt} (\gamma(\phi(t))) \\
    &= \dot{\gamma}(\phi(t))\,\phi'(t) \\
    &= \dot{\gamma}(\phi(t))\, \left | \dot\gamma_2(t) \right | \\
    \end{align*}\]

    which implies:

    \[\left | \dot \gamma_2 (t) \right | = \left | \dot \gamma (\phi(t)) \right | \, \left | \dot \gamma_2 (t) \right | \]
    Therefore, we have proved that \(\left | \dot \gamma(\phi(t)) \right | = 1\), which means that \(\gamma\) satisfies all the requirement of being parametrized by arc length from the its definition.

    As a consequence, we have shown that for any parametrization \(\gamma_2\), we can treat it as a transformation applied on the parameter of a parametrization by arc length, and the transformation is directly from a particular parameter \(t\) to the arc length from the start point \(a\) to this parameter.


    Moreover, for any arbitrary parametrization, we can also find the function of the arc length based on the parameter itself first, then apply the parametrization to the inverse of the arc length to obtain a parametrization by arc length.

    Since we want to obtain a mapping \(\phi : [0,L] -> [a,b]\) s.t. \(\left | \frac {d} {dt} \gamma(\phi(t)) \right | = 1\) for any arbitrary parametrization \(\gamma\). i.e.
    \[\left | \dot \gamma(\phi(t)) \right | \phi'(t) = 1\]
    which means:
    \[\phi'(t) = \frac {1} {\left | \dot \gamma(\phi(t)) \right |}\]
    As we all know, \({f^{-1}}'(x) = \frac{1}{f'(x)}\), we can treat \(\phi\) as the inverse function of \(s(t)\), which is the primitive function of \(\left | \dot \gamma(\phi(t)) \right |\) as we showed before. (At the same time, we have shown the existence of such a inverse function before.)

    Thus, \(\gamma(\phi(t))\) is the parametrization we want to obtain before.

    [Project] MCSync [同步Client和Server端的mods]

    Motivation

    唔…开服和小伙伴们玩MC的时候总是不由自主的想加几个新mod玩

    这时候就苦了..挨个告知 给他们发过去mod 有的时候还得亲自动手给他们copy到指定的目录下..

    Here comes a question..

    为什么不直接写一个简单的和server通讯 同步mod的工具呢….

     

    Implementation

    大概是打算server上提供一个接口 返回一个mod list.

    和本地文件名校验后 本地直接把缺的mod下载下来 再调用一个外部的launcher

    (回头顺便写一个launcher好了..

    Update: 于是我真的写了一个launcher…
    明天起来写细节..
    我都忘了我在这儿开了个坑(.

    Launcher

    大概情形就是因为处女座(. 所以强行用Python撸了一个launcher.

    其实MC的launcher很简单的. 主要就是以特定的参数调用Java去执行几个jar文件.

    但是因为不同版本/ 不同系统/ 是否包含forge/ etc 多种情况, 如果只是单纯的记录一个参数,将其丢给shell的话还是有点蠢.

    那么官方的launcher是怎么完成的呢

    首先在对应版本的jar文件目录下同时有一个json文件. 这个文件在minecraftArguments这个key下定义了之后要传入的一系列参数, 并在libraries这个key下定义了我们所有要添加的libs.

    实现launcher的重点主要就在于如何parse这个key对应的list

    首先观察其中元素, 每一个都是一个dict, 比如:

    {
    "name": "org.apache.httpcomponents:httpclient:4.3.3"
    },

    这里的表示形式很有趣…这个其实指的是library/org/apache/httpcomponents/httpclient/4.3.3/httpclient-4.3.3.jar

    也就是所有的句号可以直接替换成’/’作为路径分隔符( 别忘了Windows用的是邪恶反斜杠orz

    然后从第一个冒号开始 把后边的都替换成’-‘ 最后加上’.jar’的后缀名, 组成一个文件名, 然后再把他们这些冒号统统当做句号处理就好.

    嘛 基本上这样就可以把所有libraries所对应的路径名搞出来, 我把它写成了parceLibs这个函数..

    在parse的过程里,还涉及到natives和arch的问题, 不过其实很容易就能分辨出来具体的规则, 也不难实现.

    基本上解决了这个 照着ps -ef下看到它启动时调用的参数 就可以实现出读取指定版本的json文件然后启动游戏了..

    当然作为一个处女座 不能用正版登录 不能用twitch推流 这都是不能忍受的

    正版登录的话其实就是把--username这个参数改成你的账号, --password这个参数改成你的密码 然后去post到它的authserver就好. 这里需要注意的是对parameters的构造, 在这个链接里有很详细的阐述.

    取回的response里就会有accessToken和uuid, 替换掉参数里的就好.

    同时 如果和twitch绑定的话, 在response里会给一个twitch的access token. 用这个去替换参数里的--userProperites就好.

    基本上原理就是这样..当然在实际coding里有各种各样奇葩的bugs, 比如和傻逼windows有关的, 得用一大堆引号去保证路径中空格的合法化的这种…简直无情.

    还有最坑爹的就是编码问题!

    我就艹了!

    你说你路径里带中文就带吧

    存UTF-8好不好!!

    存nmb的GBK!