Inside Job: TV series review

Futurama but at current times. Various conspiracy theory instead of sci-fi fantacy. Reagan as Leela the leader, Brett as Fry the fool, with their colleagues as the office members.

Blowing one's mindset just like Rick and Morty but more usually in terms of morality sarcasm. What they do have in common, the despise of hypocritic morality, the confidence of running the world (literally), the respect for reason, science, and knowledge, the sense of liberty and freedom of souls.

v2ray-configurator

online

I chose React as the framework of the frontend. Despite I have been developing using React, this is the first React project of mine that starts from scratch. MUI seems pretty handy.

So it went online now.

There are still a lot of bugs to fix and features to add, but I'll take a breath before carrying on. Atm, finding costomers with requirement prevails my service to provide.

structured data in database

Consider the following data structure to implement in a database:

class ComponentBase:
	name: str
	...
	def serialize(self):
		assert False

class ComponentA(ComponentBase):
	def serialize(self):
		...

class ComponentB(ComponentBase):
	def serialize(self):
		...

...

class ComponentList(ComponentBase):
	children: list[ComponentWrapper | ComponentList | ComponentSet | ComponentA | ComponentB ...]
	def serialize(self):
		...

class ComponentSet(ComponentBase):
	children: set[ComponentWrapper | ComponentList | ComponentSet | ComponentA | ComponentB ...]
	def serialize(self):
		...

class ComponentWrapper(ComponentBase):
	target: ComponentList | ComponentSet | ComponentA | ComponentB
	def serialize(self):
		...

The purpose of a database implementation is to query like 'which componentWrapper recursively includes a given componentA?', 'get all the related componentB of a gievn componentWrapper', and such.

And the trouble arises not only because there is a list to maintain (performance concern), but also, there are unions of types (how? all in one table?), and loops in definition (safety concern, unknown depth problem).

The current approach uses json field to store the data above, which solves all the problem at the expense of additional backend workload (it basically reads everything into memory) which I intend to avoid.

Well it all depends on actual requirements. Reading the database recursively is actually acceptable compared to loading the entire table into memory. Saving list as a json value is acceptable when the lists only have length of like 10.

Best solution would be the recursive approach with cache field to avoid deep loop when querying. However, this would make configuration harder as pure json appoach is much more human readable than nested sql table entries. Moreover, it means the updating certain value of database will now have to go through the backend to ensure the cache is valid. Even then, the cache updating is more complicated than normal one-way cache. It has to be in both direction, allowing it to propagate through any cache that it relys on, and that relys on it. Consider all of these troubles the price of performance. Such huge modification would mean some fundamental change of the program... Maybe when I have time.

If I do it, this would be the 4th major version of this program, by major I mean none of these versions is back compatible. The cause of such iteration is that the need of requirement and need of performance is quite divided, and I am kinda stuck in between. It's difficult to vision all the requirement in advance, and optimization usually limits future functions.

Pantheon: TV series review

plot

s01e01-s01e06

Steve, founder and CEO of the best company of his time, tried to upload human mind to Matrix and almost succeeded. To ensure the job is kept on even after his eraly death of some incurable cancer, he opted to make a clone of himself. The clone would then be nurtured in the Truman Show based on Steve's own biography to ensure his genius.

  • Steve Jobs, the reality layer.
  • Trumen Show, the connection layer and sideline.
  • Matrix, the sci-fi layer, the metaverse.

It's good TV series in terms of story, great anime production in terms of visulization, but still, it lacks true sci-fi innovation of concept, and not quite consistant in character personality development and logic, in other words it feels awkward to watch from time to time.

plot holes

With the ability to manipulte the entire internet with root access to every device connected, the 'gods' seem quite unimaginative.

The antagonist turns out to have mental problems, which lowers the credibility of the entire set.

The latest development includes some very interesting settings about immortality. I guess the story hasn't quite prepared to introduce the ture enternity. The flaw, that the uploaded mind will decay over usage shows significant similarity to those of original life, which is both reasonable and disappointing. Having such a limit on its core sci-fi setting creates a sense that it's just a common story with some sci-fi tech, restricting further development.

easter eggs

The antagonist, an Indian, shared the tech with 'nations of top cyber', which turns out to be US, Russia, UK, Isreal, Iran, and China. Cannot say if he is trying to protect India by not letting them know such technology. Also, France is the only absent P5.
P.S. 20221005 I just learned that the writer, Ken Liu, is a Chinese... all make sense now.

s01e07

It takes the life of a protagonist to make an antagonist. Classic Joffery move. But too many plotholes,too may stereotypes.

Why no backup when everything is digitalized?
Why physical annihilation when code injection is much more easy and cost effective?

As to the classic 'Chinese people are kind and reasonble it's CCP causing problems'... It would definitely be interesting to find out how a Chinese degenerated into a white left. Sure, it might not be the problem of Ken but the ideology gets across nontheless.

滑板事故,膝关节受伤,诊断,及康复

20220925 损伤自诊

事故回忆(5天后)

20日晚减速带路障未提前注意,30km/h滑板撞击后失稳,踉跄后摔倒,时双膝呈外翻跪地状(膝盖向内)

三处擦伤按严重程度递减分布于右腿膝盖左下约5cm²×2,左腿膝盖1cm²,左手小指根关节背0.5cm²,均为磨破裤子或手套后形成

伤初右腿即跛,静坐3分钟后滑板离开现场

创面处理

受伤当晚适疫情封校,当时校医院已下班,受伤20min内喷表面物理抗菌材料,1h内就近滑板前往土木实验室获取碘伏清创消毒,窗口贴,纱布橡皮胶临时包扎。三处伤口均仅有轻微渗血,认为擦伤深度不大。知乎学习无痂愈合。受伤10h内(21日早)前往校医院双氧水清创,碘伏消毒,要求医生使用凡士林纱布包扎右腿伤口,其余伤口覆窗口贴以提供无痂愈合环境。

医院包扎36h后(22日晚)换药,再48h(24日晚)换药。此时左手已无痂愈合,左腿伤口收缩至0.5cm²。

韧带损伤自诊

受伤前2日不能区分疼痛深度,走路跛行严重,直立右腿膝盖处有痛感,长距离只能依靠滑板出行。

2日后直立时右膝痛感轻至可忽略,弯曲不能超过15度,走路逐渐恢复但需要保持右腿僵直。

根据侧卧抬腿时的痛感,外侧收拉时无异常,内测收拉时疼痛,诊断为内测副韧带拉伤。

Google及知乎学习内测副韧带拉伤,其位置及症状符合。谢等[1]引用指出

膝关节内侧副韧带(medial collateral ligament,MCL)由 MCL 浅层(superficial MCL,sMCL)、深层(deep MCL,dMCL)以及后斜韧带(posterior oblique ligament,POL)三部分组成,是维持膝关节外翻及旋转稳定性的重要结构。sMCL 是 MCL 中最表浅的韧带,是维持膝关节外翻稳定性的主要结构,也是维持膝关节旋转稳定性的次要结构[1-2]。POL 是维持膝关节内旋稳定性的主要结构,也是维持膝关节外翻和外旋稳定性的次要结构[3-5]。生物力学研究发现,膝关节屈曲 25° 时,sMCL 提供 78% 的抗外翻和外旋应力;而膝关节屈曲 0°~30° 时,POL 对维持内旋稳定性发挥关键作用[1, 6]。因此,同时有效地修复 sMCL 和 POL,对恢复膝关节稳定性和生物力学性能起着重要作用。

MCL 损伤是临床常见的运动损伤类型,根据 Hughsyon 标准[7]分为 3 级。单纯 Ⅰ、Ⅱ级损伤无需手术治疗[8];合并前交叉韧带(anterior cruciate ligament,ACL)损伤的 Ⅲ 级损伤需要手术干预,以避免膝关节外翻松弛及旋转不稳,进而继发膝关节骨关节炎及外翻畸形,影响患者运动水平及生活质量[9-10]。

根据弯曲情况,0-30度时无问题,之后有痛感,可知POL未受损或程度较低,sMCL受损较重。考虑到sMCL的位置靠表面,受力时承拉最大,且离实际碰擦表面最近,与事故发生原因符合。

考虑到直行走路尚可,因此交叉韧带损伤概率低(即使损伤也需要伤2周后再手术),认为是Ⅰ或Ⅱ 级损伤,因此维持现状保守治疗,尽可能卧床休息,保持直腿或在15度弯曲内,降低sMCL受力(疼痛为准),观察至两周。

康复计划

预期6周,时间节点及内容参考膝关节内侧副韧带撕裂的治疗和康复

20220930 损伤自诊

创面康复

由于脱离包扎后,手部伤口重新结痂,预计数天完全康复。左腿伤口相同,但预计仍需1周以上。右腿伤口渗液面积已经缩减至0.5cm²以内,由于凡士林纱布包扎基本无痂。腿部伤口依然按48h换药。

韧带损伤

27日晚28日早曾发生肌肉强直,疑似同姿势保持太久血液循环不畅引发抽筋,捶打放松后强行出门,数小时后恢复。29日起行走不再有明显疼痛,但关节僵硬,疑为肌肉自发力维系关节稳定所致。步态远未恢复正常。

右腿始终不能弯曲超过30度。

30日行走及滑板时开始尝试弯曲右腿膝关节,膝关节内偶尔有刺痛感,有软腿感,结合伤口位置及受伤情景(小腿上部受向后冲力)推断可能存在后交叉韧带PCL损伤[2],程度未知,疑为撕裂。拟之后恢复僵直行走。

过度屈曲:如常见的跪地伤,患者跌倒导致胫骨着地,过度暴力作用于胫骨上端,致使胫骨过度后移牵拉PCL从而断裂。

需要后抽屉实验和后向lachman实验,以及核磁共振影像做最终判定。[2:1]

索性后交叉韧带自愈能力同样强,亦可保守治疗,但需要严格固定[2:2]。计划4日校医院骨科医生值班时问诊实验,国庆假期后视情况人民医院门诊MRI做判定。

20221003 转诊海宁市人民医院

海宁市人民医院骨科主治医生,唐新民,在未对伤口做任何检测及观察时即要求患者购买敷药,不成又推荐服药,拒绝后疑似恼怒。患者强调是韧带损伤后光速开单核磁共振检查,开单时甚至还不知所伤是左腿还是右腿。从问诊到结束总共30秒,患者尚未反应过来即已开单完成。诊断结果共四字“压痛,肿胀”均为其臆测,与事实完全不符。全过程毫无医德可言,治疗思路堪比机器人,完全依赖药物和技术,甚至不曾观察过患处。

后再询对门诊室医生李耀,在明知所挂号已经被唐医生用过的情况下,仔细询问了摔伤过程,按压患处,检查疼痛角度后给出建议睡眠时垫小腿(这点符合后交叉韧带损伤护理),问诊持续至少3分钟。

20221004 MRI

核磁共振影像诊断,

右股骨下段骨挫伤,内侧韧带复合体损伤,前交叉韧带损伤可能。右侧膝关节外侧半月板变性,伴少量关节积液。

根据影像,自判断均为I类损伤,医生建议限制右腿行动,睡眠抬高小腿(?未提及应当垫小腿何位置)。受力分析,如垫膝盖端,前叉受力。因此前叉损伤最多垫脚踝,使后叉紧张承力,前叉放松,但这会导致疼痛,疑为侧副韧带紧张及伤骨受压所致。实际无法执行。事实上完全放松无痛感姿势为膝盖轻微内翻(恰与摔伤姿势完全相反),右侧面向下躺卧。此姿势下,内侧副韧带放松,外侧半月板不承压,前交叉韧带和股骨不在受力方向,膝关节稳定主要依靠外侧副韧带。

预计恢复2个月。

20221010 康复

左手及左腿擦伤完全愈合,右腿7日换药时发现凡士林纱布下已结痂,显暗红色,极薄且柔软,仅最中心区域(即最后一次渗液处)约0.3cm²为颜色较深的血痂,二者边界模糊。由于伤口状态极好且已结痂,换药后不再使用凡士林纱布,只以普通纱布保护。

7日问诊时换药医生(亦为海宁市人民医院骨科医生)给出完全不同的建议:不应保持卧床2个月而应当即刻开始康复训练。遵后者建议。但后者不能解释不能屈腿的直接原因。

3周卧床及左腿代偿行动导致右腿股四头肌及排肠肌处周长均较左腿少至少3cm,肌肉力量差异可能是无法恢复正常步态的主要原因之一。右膝弯曲情况无明显进展,自行车右腿只能中途踩下不能收腿,盖右腿弯曲45度起明显不适,停止试探。

9日起恢复办公室工作,当前首要目标是通过低烈度无痛感的正常行动(如正常姿态步行)恢复右腿肌肉力量,次要问题是搞清楚膝盖弯曲受限的原因避免不作为导致其他问题。

右腿直立受力时不能放松,完全放松状态(即膝关节呈现181度时)会导致疼痛,痛感及位置非常接近弯曲达到45度时。考虑到限制胫骨前移主要是前交叉韧带的职责,初步认为目前伤痛的主因的是前交叉韧带的损伤。

20221014 自诊

海宁市人民医院诊断认为只是韧带撕裂,但韧带撕裂(非断裂)导致不能弯腿的案例很少,绝大部分弯腿困难发生在前交叉韧带重建之后。观察MRI影片发现胫骨上与韧带连接处有疑似裂痕,裂痕处附近隆起。

核磁共振图

核磁共振图

搜索发现正常胫骨平台如其名应为平面,而实拍影像显示裂痕及隆起,与前交叉韧带胫骨髁间嵴撕脱性骨折非常相似。

摩托车事故患者前交叉韧带撕脱性骨折

摩托车事故患者前交叉韧带撕脱性骨折[3]

A-I型,轻度移位-BII型,后方有铰链-CIII型,完全分离

A-I型,轻度移位-BII型,后方有铰链-CIII型,完全分离[4]

寻求亲友帮助,无锡市中医院某专家看过核磁共振后认为确实是前交叉韧带胫骨髁间嵴撕脱性骨折。再次前往校医院,转诊浙大二院。


  1. Xie W, Zhu W. Biomechanical comparison of single-bundle and anatomical double-bundle reconstructions for grade Ⅲ medial collateral ligament injury]. Zhongguo Xiu Fu Chong Jian Wai Ke Za Zhi. 2020 Jun 15;34(6):720-725. Chinese. doi: 10.7507/1002-1892.201911057. PMID: 32538562; PMCID: PMC8171538. ↩︎

  2. 后交叉韧带损伤机制及治疗方法 ↩︎ ↩︎ ↩︎

  3. 这36种骨折,影像医生值夜班时千万不要漏诊! - 知乎 ↩︎

  4. 儿童胫骨髁间棘骨折 - 好大夫在线 ↩︎

Electric Long Board

This is going to be a long sequal.

20220831 1st try

While I was at Berkeley, a girl Lin taught me how to ride a skateboard. I remember I shot the photo of the tall grass right next to the training course that night. That 1.5 hour of practice was all I had with skateboard before I decided to buy an electric one. Technically I do have childhood experience on toy boards, which was driven by twisting, could be a reason why I learned fast.

It paid well. Within the first half hour I was able to cruise at 20 km/h and do normal turns with radius of 3 meters at lower speed. I tried to reach top speed but the board began to shake heavily before I can reach that fast.

20220905 2nd try, reach top speed

4 days of raining stopped my training.

I learned from reddit and Youtube that the 'shaking' I experienced at high speed was called wobbling and it is due to my feet position. By putting my front foot right on the front wheel, I can now accelerate to top speed (but still too cautious to look at the speed meter, it was about 38km/h according to the seller) without any problem.

It is still dangerous to go on road at this stage because I still cannot make sharp turns and fast stops.

On my search for how to make sharp turns, I found there is actually a style called carving in some Youtube videos [1][2]. I will practise that next time.

20220906 carving

I can now pass the corner at 20 km/h, within lane. The actual top speed is 35 km/h at half battery.

Carving is interesting, but I can not drift yet. It could be due to wrong posture, or simply because the board has too good a grip. No matter what, carving is definitely a good way to learn to control the board.

I tried to look for some groups on telegram, facebook, or QQ. Some of these groups are really active, and gave me some really good advice.

For example I was adviced to get a regular board to practise sharp turns and stop. I vaguely remember I could do a sharp turn on a regular board though.

20220912 first accident

I've been using the eskateboard for commuting in the past few days. Today I falled from a skateboard and crashed on land for the first time in my life. It was due to fast break (from >30km/h) before the turn.

This accident proves that the decision to protect myself using only engineering gloves was necessary and almost sufficient under such circumstances. There are further risk of grazing my elbow or bumping my head should I get unlucky though. It turns out 20km/h might be the safe boundry for daily commute.

20220916 ride on the other side

I borrowed a regular board from another classmate. It is slightly shorter, has wheels of half the size, and a much softer bridge. It turned out accelerating on a regular board is much harder.

I taught one of my friends to ride a eskaeboard too.

I also start practising riding on the other side, i.e. with my right foot in front, contrary to normal.

20220917 Yuquan campus

I went to another campus with my eskateboard today. It turned out I have mastered the riding on busy and unfamiliar streets.

I continued to practise on the other side. It seems most of the balance control memory are not transferrable and I have to learn them from like 0. Obviously, balance control is something beyond conciousness. I expect twice or third learning period since I will not use this side for daily commuting.

20220920 Accident


  1. How To Slide Your Electric Skateboard or Longboard EASY - YouTube ↩︎

  2. How To Corner & Carve Like a Pro on Your Evolve Skateboard! - YouTube ↩︎

v2ray-configurator

Go, GORM, and gRPC

v2ray-core is written in Go.

So I tried GORM as yet another alternative to SQLAlchemy and Django. GORM can manage the database by migration just as Django does, and this part works fluently.

As to the config side, it feels uncomfortably hard to implement a model-based configurator in Go. Despite I can get all the struct directly from v2ray-core, they come with very strict type definitions. Implementing another model feels unnecessary, and is troublesome too - no type union, no constructor, no default value for functions. Indeed, Go is not an object-oriented language.

For scenarios where performance is not a problem, Python will do so I am going to save the trouble of reimplementing the whole project yet again in Go.

However, I do still need Go for gRPC for some features of v2ray to work. I can either use a Python package for that, or I can use the GORM model defined earlier to write gRPC directly in Go. The first approach is considered better in the long run because I can save the trouble of aligning the Python and Go ORM model.

v2ray-configurator

ordered list in a database

Previous development reveals that relation-based databases cannot properly handle arrays that need insert() method.

A hack is to use a string-based index that allows gaps between indexes so that insertion can be realized without reordering the rest of the entries. [1]

This is feasible on the SQL level but the availability under ORM tools still needs investigation.

ORM: SQLAlchamy vs Django

On the ORM side, I also tried Django as an alternative to SQLAlchamy.

Some major difference includes:

  • Django builds the database according to the model, while SQLAlchamy requires manual mapping. This may be a desired feature for fast development but comes at a cost of less extensibility as an ORM
  • Django model object links to each other by a query manager while SQLAlchamy object links to each other directly. The Django way will cause a problem in type hint that would require further hacks like django_hint and manual type decalration everytime a query is made. I consider this as a feature missing bug of Django
  • Django comes with a lot of other features since it's developed as more of a website backend than a simple ORM

  1. Django: define a name for reverse ForeignKey - Stack Overflow ↩︎

v2ray-configurator

motivation

I spent 2 days redeveloping a v2ray config generator to fulfill my increasing demand for proxy server configuration.

Currently, I have more than 20 different simple configurations (i.e. one-level proxy) for more than 10 servers. Despite a lot of them being just servers of different domains to balance the load across CDN, managing all of them with complex proxy chains is a headache. A typical proxy chain configuration can reach 500+ lines of JSON, which is quite some work to write even one. Moreover, several of my friends are using the services too, which makes the configuration even harder.

I wrote a super long python script to work with a sqlite3 database one year ago trying to automate the process. It worked well until the demand for proxy chains arises. Due to the lack of knowledge and foresight, I use raw SQL to extract information into python dictionaries. This works at a simple level, but the model information is lost during the process. The work became exponentially more difficult as the requirement became complex.

With all the knowledge acquired last year, I re-implement the program with python and sqlite3, again. But this time I use sqlalchamy and jsonpickle so that I can model the configuration instead of using just dictionaries. It turned out that such a method facilitates my development to a great extent.

I also rebuild the database model. The complete database structure is shown below.

service.chain and virtual_server.chain actually depends on address_group, server, reverse_server, and virtual_server. However, these information are stored in JSON so can not be seen from the database structure.

At this stage, I only implement the config class of my requirement so a lot of functions of v2ray are neglected, thus not ready to be published as a public library.

Asymmetric routing and campus firewall

the problem

Despite Zhejiang University having a clear university-wide policy on domain registration, a Haining campus Information Technology Services (ITS) officer Z told me the campus has its own policy that refuses to follow due to 'security concern'. In other words, the Haining campus refuses to assist with University domain reverse proxy, such that any user who wants to have an Internet-accessible server will have to have its server located elsewhere. In my situation, it means an extra ¥2200/year cost to rent a VPS from ZJU main campus.

The actual scenario is, the Haining campus has internal connections with other ZJU campuses. In my situation, with the service still deployed on a local server, with a forwarded proxy from main campus VPS, any security breach would still happen locally, meaning the 'security concern' is nothing but a poorly made excuse.

Well, since the administrative board is not responsible for users in a typical Chinese-style organization, I will have to fix this issue by myself.

Interestingly, the reverse proxy can be actually configured from the main campus alone, and it should work without problem. So I circumvent the Haining campus ITS and registered a domain reverse proxy directly with the main campus.

The result is, strange. I noticed the server is indeed Internet accessible when applying for an HTTPS certificate, but local tests show that it can not be accessed from within China. In other words, it is accessible only from abroad.

the cause

I spent an entire afternoon trying to figure out why, and with hints from the main campus IT support and traceroute output, I finally discovered that the problem lies in asymmetric routing.

More detailly, all outgoing traffic from the Haining campus is redirected according to its destination. Traffic going abroad is going through the main campus exit, while others directly through the local campus exit. Now since the incoming traffic is all from the main campus entrance, this path is symmetrically routed, and the other one is not. The asymmetric routing will be blocked by the firewall due to DDOS attack prevention.

the fix

Now that I know the cause of the problem, the dillema arises that I still need Haining campus ITS's assistance to fix the issue. I need to make sure even those administrative roles like Z saw my request, they would not understand my true purpose. Considering Z's earlier response, she was either in an administrative position, or is really rookie in the network engineering field, both case I bet she would not want, or be designated to look into some issues too technical to understand.

A ticket is then sent to the Haining campus ITS to request all outgoing traffic of a specific ip to go through the main campus network gateway 'due to asymmetric routing' for 'research purpose, and to avoid incidental firewall block', together with some specified gateway ip I got from traceroute log. It turned out Z was not designated to the ticket.

Now that this is an existed routing, they accepted the reqest 'after requesting superior instruction'. Problem solved.

the bureaucracy

The is a typical bureaucracy 'there are policies and measures to counter' incident.

It turned out, I got lucky because incompetent officer like Z is indeed, incompetent. But this also means tragedy for all those who can not conceive a counter, and thus have to live with trash policies made by those incompetent officers.

On the other hand, trash policy actually works because not enough people know how to counter it, so the incompetent officer can remain in position.

To knowledge.

Reveal all HSAP without 'modified' tag

This is a log rather than a tutorial. It does one very specific thing, to reveal all HSAPs without getting 'modified' tag. Though I think the method of injecting/calling script without modified tag is worth sharing.

Senario

I have my HQ deployed at Unclaimed Sector behind Xenon Secot 524. So When I learned there could be a Unclaimed Sector beta but it's not in my game due to some game start randomness I try to bring it back without losing my game progress or getting a 'modified' tag.

Tools

Procedure

  • write a script z.cheat.mkmark.revealall.hsap.xml to reveal all HSAPs based on cycrow's revealall cheat script, and add a fake signiture
  • extract plugin.turbo.hotkey.xml from corresponding pck file, backup the pck, then replace the pck by a modified xml where z.cheat.mkmark.revealall.hsap are replaced by plugin.turbo.activate
  • follow the 'Unmodifier' instruction to launch a game
  • activate turbo boost in game

the plain script of z.cheat.mkmark.revealall.hsap.xml

$main.universe = get global variable: name='main.universe'
skip if $main.universe -> exists
  $main.universe = get sector from universe index: x=0, y=0
skip if $main.universe -> exists
  $main.universe = [PLAYERSHIP] -> get sector

$x = get max sectors in x direction
while $x
  $y = get max sectors in y direction
  dec $x =
  while $y
    dec $y =

    $sector = get sector from universe index: x=$x, y=$y
    skip if $sector -> exists
      continue

    $flags = [Find.ExcludeTerranGates] | [Find.ExcludeGates] | [Find.Hyperspeed]
    $hsap = find gate: flags=$flags, refobj=$sector, max dist=null, refpos=null
    if $hsap -> exists
      if $hsap ->is hyperspeed access point
        if not $hsap ->is hsap discoverable
          if is valid route between sectors $main.universe and $sector
            $hsap -> set hsap discoverable [TRUE]
          end
        end
      end
    end

  end
end
return null

Reference

  • https://forum.egosoft.com/viewtopic.php?t=436933&start=15#p5068731 (I generally followed Cheese's method but fixed the bug of extra missions)

Raspberry Pi libcamera low-latency http streaming

  • model: Raspberry Pi 4B
  • system: Ubuntu 22.04 aarch64

Through resources of Pi http streamings are widely available over the Internet, few address the libcamera library which is the only option under aarch64, and few address the low-latency part of the streaming.

I managed to achieve the above with the following:

This process has a very low latency due to the rendering workload being undertaken by the client, while Pi just hardware encoding the video into h264 and serving the binary directly.

pipeline

libcamera-vid
libcamera-vid
scene
scene
websockify
websockify
tcp+h264
tcp+h264
nginx
nginx
websocket+h264
websocket+h264
nginx
nginx
html
html
jmuxer
jmuxer
html
h264
html...
html
video
html...
Text is not SVG - cannot display

install

  • compile libcamera following the guide
  • compile libcamera-apps following the guide
  • install websockify following the guide
  • launch the following, or optionally create systemd services of these commands
libcamera-vid -t 0 --width 1920 --height 1080 --inline --listen -o tcp://0.0.0.0:8000
websockify 0.0.0.0:8001 0.0.0.0:8000
  • create static nginx html server with /rpicam/index.html as following
<head>
    <meta name="color-scheme" content="dark">
    <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/jmuxer@2.0.4/dist/jmuxer.min.js"></script>
    <style>
        body{
            margin: 0;
        }
    </style>
</head>
<body>
    <div id="container" style="width: 100%; margin: 0 auto;">
        <div class="vsc-controller"></div>
        <video width="100%" autoplay muted id="player"></video>
    </div>
    <script>
        function parse(data) {
            var input = new Uint8Array(data),
            video = input;

            return {
                video: video,
            };
        }

        window.onload = function () {
            var socketURL = document.location.href.replace('http', 'ws')+'ws/';
            var jmuxer = new JMuxer({
                node: 'player',
                mode: 'video',
                flushingTime: 0,
                fps: 30,
                debug: false
            });

            var ws = new WebSocket(socketURL);
            ws.binaryType = 'arraybuffer';
            ws.addEventListener('message', function (event) {
                var data = parse(event.data);
                jmuxer.feed(data);
            });
        }
    </script>
</body>
  • configure nginx server to serve /rpicam/ to static file directory, and /rpicam/ws/ to 0.0.0.0:8001. Typical configuration of the later is as following.
location /rpicam/ws/ {
    proxy_redirect off;
    proxy_pass http://0.0.0.0:8001;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
}

known issues and solutions

  • current configuration can support only one client at a time
    • a dedicated backend to stream tcp/websocket data to multiple clients would be necessary
  • libcamera-vid will exit each time websocket is closed
    • auto restart is possible using systemd
    • if one have a dedicated backend this can be managed
  • no audio is served. jmuxer supports audio, to combine audio one will have to either
    • write a dedicated backend to repackage the binary data by adding audio and duration information
    • or serve audio through a seperate websocket, but could lead to audio/video being not synchronized

For now I am happy with the result, but a dedicated backend would be optimal/necessary to solve these issues.

Campus network exploitation

original plan with exploit

The campus has strange regulations to restrict outbound speed but not LAN speed. The goal was to utilize every accessible computer with wired LAN access to speed up my campus outbound connections. By using load balancer over a large number of computers the outbound bandwidth is combined for multithread downloading. n2n is used to connect devices with admin access for easy management, direct v2ray is deployed to devices without admin access but with fixed ip and port access, and v2ray of reverse proxy is to deploy to devices without fixed ip and admin access.

new exploits

While I was examing the campus HPC I noticed something strange: the outbound speed is not limited (in terms of LAN speed) on the HPC. This is reasonable consider that many people are using the cluster. Furthermore, the HPC is shared with commercial users from outside the campus, and further inspection confirms that the HPC outbound is a direct link to local China Telecom network instead of China Education and Research Network. This is a major advantage as the former one is much more reliable and efficient.

First of all, I only have a user account on the HPC, meaning opening ports on firewall is out of the quesiton, let alone creating tun devices. A common practise under such situation would be creating a reverse proxy to another server.

However, a port scan shows local 90 and 8080 port is open but unused. Port 90 is unavailable to common users, but 8080 is totally accessible. This is unexpected as well as hilarious. Nginx and v2ray is then deployed with ws+tls+vmess to provide maximum security. Crontab is configured to ensure availablity across reboot.

sudo nmap -n -Pn -sS -p0-65535 [ip]

result

Due to the unlimited outbound speed of HPC the connection bottle neck is now the campus LAN. Ping to various servers drops significantly due to the advantage of China Telecom over CERNET. Secure connections are established. While all operations are under campus regulation, some part of the process should be seen as exploits.

potential counter measures

To counter the exploits campus net admin would have to:

  • properly configure firewall of public workstations
  • block all ports of LAN devices to avoid NAT traversal, which is totally unreasonable, or
  • restrict the LAN speed to outbound speed, which is equivelantly unreasonable

Before that the campus network outbound speed limit is merely a trash policy, an inconvenience, rather than a restriction. Considering the inconvenience inflicted, and the total legal and reasonable process, I hardly find any motivation to report such exploits.

Backup and synchronization summary

Disk failure costs. As a general rule, all valuable data should be kept in copy, preferably on different devices, in real time, and with 2-way sychronization support.

In the early days I had been using robocopy with batch script, rsync with shell script, even adb-sync with batch/shell scripts. Configurations were complex, the backup system was vulnerable to various compatibility problems (typically system locale problems and path naming restrictions). The backup was also not in real time, nor does these methods support 2-way sychronization due to the absense of a database.

Commercial solution costs, while a lot of open-source solutions do not work in a real-time fashion.

Syncthing is a great tool to solve the problems above. It even comes with bundled NAT traversal capability. A typical backup network shows as below,

private
NAS
private...
workgroup
NAS
workgroup...
workgroup
devices
workgroup...
private
devices
private...
Text is not SVG - cannot display

where arrow shows backup direction, solid line represents user files, and dash line represents system files.

Some personal files are sychronized across devices as needed, while backup operations typically have the following ignore cases.

Linux user

.stignore at $HOME

/.cache
/.conda
/.config/syncthing/index*
/.local/share/tracker
/.nvm
/.npm
/.rbenv
/.vscode-server
/installation
/go
/repos/**/node_modules
/repos/**/node_cache
/**/cache

Linux root

.stignore at /

!/etc/nginx/nginx.conf
!/etc/nginx/conf.d
!/var/lib/postgresql
*

Windows user

.stignore at %userprofile%

\.vscode
!\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json
\AppData
\Documents\Tencent Files\*\TIM\Registry2.0.db
\Documents\Tencent Files\*\TIM\Registry2.0.db-journal
\Music
\notes
\OneDrive*
\repos\**\node_modules
\repos\**\node_cache
\Searches
\Videos
(?i)\NTUSER*

Proxy summary

I built a proxy network allowing me to access various resources across the Internet. As shown in the figure below, servers on different locations are deployed and connected by either direct proxy (solid line) or reverse proxy (dash line). connection mapping are labelled in the format of '(x to y) * z', indicating z groups of x clients each connecting to y servers.

campus
campus
Internet
Internet
China
China
campus
campus
1 to m
1 to m
client
n2n edge
client...
s to n
s to n
server * s
vmess+ws
n2n supernode
server * s...
(n/k to 1) * k
(n/k to 1) * k
CDN server * n
https
CDN server * n...
VPS server * k
vmess+ws+tls
VPS server * k...
server
reverse proxy
server...
1 to n
1 to n
client
client
VPS
server
http
VPS...
1 to k
1 to k
client
client
China campus
outbound
China campus...
Internet VPS
outbound
Internet VPS...
Internet campus
outbound
Internet campus...
server
reverse proxy
server...
server * (m-s)
socks
n2n edge
server * (m-s)...
(m-s) to n
(m-s) to n
Text is not SVG - cannot display

by tools

  • v2fly/v2ray-core: secure proxy, balancer, router
    • Qv2ray/Qv2ray: v2ray gui for pc
    • SagerNet/SagerNet: v2ray gui for android
  • ntop/n2n: virtual LAN adaptor
  • alexkirsz/dispatch-proxy: adaptor combiner
  • nginx/nginx: server side http proxy, http reverse proxy, http port reuse
  • haad/proxychains: proxy chains, socks,http->app, for pc
  • proxifier: proxy chains, socks,http->app, for windows
  • ambrop72/badvpn/tun2socks: socks->adaptor
  • torproject/tor,tpo/applications/tor-browser: anonymous http
  • FelisCatus/SwitchyOmega: socks,http->browser

by application senario

bypass GFW with server port access

  • v2fly/v2ray-core+nginx/nginx: vmess+ws+tls->socks5, balancer, multiple domain cdn servers for acceleration and camouflage

bypass campus Internet outbound speed limit (campus has no LAN speed limit)

has LAN servers with server port access

  • v2fly/v2ray-core+nginx/nginx: vmess+ws->socks5, balancer, multiple in-campus servers for acceleration, speed *= number of servers

without servers

  • alexkirsz/dispatch-proxy: LAN + WLAN + USB LAN + USB hotspot: speed *= 4

reverse proxy without server port access

  • v2fly/v2ray-core: reverse proxy
  • microsoft/vscode: temporary port forwarding

LAN traversal with server root access

  • ntop/n2n

notes

  • campus LAN should be seen as public with even more strict censorship but less decryption ability, never use unencrypted proxy in campus LAN
  • watch out for DNS leak, use firewall rules to block port 53 if necessary
  • if necessary use firewall rules to block all connections except localhost proxy

rss news

why rss

rss is the best solution to aggregate news with the advantages of being

  • free, no ads, no tracking, no targeting
  • highly customizable
  • across platform
  • decentralized

In short, by using rss we can choose sources rather than being targeted by algorithms with ads and propaganda.

feed

tool

mkmark/RSSHub

source

The guideline is to choose from most unbiased media, i.e. AP and Reuters. Their positional (western) bias is then offset using TASS and 人民网 for voices from Russia and China.

This strategy covers:

  • Top 4 of the 5 UN security council members, with the exception of France
  • 3 of the 5 larget news agencies, with the exception of UPI which is yet another US news agency, and Agence France-Presse which does not provide mature english content.

Read More

六子吃粉

  • 六子吃了两碗粉 - 让子弹飞
  • 伊拉克有生化武器 - US Congress
  • 新疆维吾尔族强迫劳动 - US Gov
  • 武汉病毒研究所制造新冠病毒 - US Gov
  • 中国要求俄罗斯奥运会结束再开战 - NY Times

宣传系统

体系:利益方 - 枪手 - 媒体 - 缺乏判断力的群众

缺乏判断力的群众是社会现状,历史,以及可见未来内的必然特点,参《乌合之众》。在权力分配集中在群众的政体中,宣传系统(无论内外)及其代表的利益团体对政策走向有极大影响,弱国的民主往往沦为这些团体的操纵工具

武器化的宣传系统只对利益团体负责,当利益团体内讧时,其影响也会被放大到整个社会。特朗普当选是这个宣传系统反噬的一个案例,双方采取互相污蔑等流氓手段直接降低了整个美国行政系统的公信力和执行效率,并在处理2021年美国国会大厦遭冲击事件中开了言论管控的先河,违背了宪法第二修正案,降低了整个美国自由价值观的道德水平

乌克兰战争中不得不再次采取言论管控应对敌对阵营的宣传系统诽谤/合理怀疑

诽谤公关

基于宣传系统,可以谈一谈诽谤公关的应对,其困难在于成本的不对称即控方成本显著低于辩方,效果的不对称即控方先入为主的优势。

  • 无视
    成本最低,有刻意回避的负面效果
  • 简单否认
    成本极低,效果一般。
  • 要求控方拿出切实有效的证据
    抬升控方成本,转移焦点
  • 允许控方调查
    成本不可控且毫无意义
  • 有公共认可的第三方,允许第三方调查
    成本偏高,抬升控方成本,效果一般但通常能较为长期地解决问题
  • 反向污蔑/合理怀疑
    成本偏高,降低自身道德标准,丧失公信力
  • 揭露控方诽谤的本质
    成本取决于控方诽谤的水平,需要发掘控方犯下的错误,长期来看能降低控方公信力
  • 引诱控方犯下低级错误的诽谤
    难度极高,钓鱼执法

典型案例

美匿名官员报俄向中请求军援,中方否认

Russia seeks military equipment from China after Ukraine invasion -reports March 14, 2022 9:09 PM GMT+0
第一步:提出指控
重点:
匿名美国官员
无法提供细节
白宫国家安全委员会拒绝评论
可以解读为:
真:俄罗斯军事无法负担乌克兰战争
假:无意义

Chinese embassy says has never heard of Russian requests for help March 14, 2022 9:20 PM GMT+0
第二步:等待否认
可以解读为:
真:前报道不实,事件毫无意义。
假:中国在撒谎,且对俄罗斯背信弃义

一真一假之间,一种解读毫无意义,另一种解读则充满了故事。乌合之众,还是喜欢故事的。

U.S. warns China not to help Russia as anti-war protest disrupts state TV
第三步:道德绑架

外交部发言人就美方签署所谓 “维吾尔强迫劳动预防法案”发表谈话

2021-12-24 08:46

当地时间12月23日,美方将所谓“维吾尔强迫劳动预防法案”签署成法。该案罔顾事实真相,恶意诋毁中国新疆人权状况,严重违反国际法和国际关系基本准则,粗暴干涉中国内政,中方对此表示强烈愤慨、坚决反对。

所谓新疆地区存在“强迫劳动”和“种族灭绝”,完全是反华势力炮制的恶毒谎言。新疆经济发展和社会安定举世公认,各族人民安居乐业有目共睹。美方反复借涉疆问题造谣生事,实质是打着人权的幌子搞政治操弄和经济霸凌,企图破坏新疆繁荣稳定、遏制中国发展。

美国自身劣迹斑斑,就人权问题指责抹黑中国是滑天下之大稽。美国是贩卖人口和强迫劳动的重灾区,近5年来每年被贩卖到美国从事强迫劳动的人口多达10万。美国历史上对印第安原住民犯下的反人类罪行早已构成事实上的“种族灭绝”。“强迫劳动”和“种族灭绝”这两顶帽子还是美国留着自己戴最合适。

涉疆问题根本不是人权问题,而是反暴恐和反分裂问题。中方正告美方,利用涉疆问题搞阴谋诡计,阻挡不了新疆各族人民追求美好生活的坚定步伐,阻挡不了中国不断发展壮大。美方行径完全违背市场规则和商业道德,只会破坏全球产业链供应链稳定,扰乱国际贸易秩序,损害美自身利益和国家信誉,纯属搬起石头砸自己的脚。

我要再次强调,涉疆事务纯属中国内政。中国政府和人民捍卫国家主权、安全和发展利益的决心坚定不移。我们奉劝美方立即纠正错误,停止利用涉疆问题散布谎言、干涉中国内政、遏制中国发展。中方将视形势发展作进一步反应。

驻美国使馆就美发布所谓“新冠病毒溯源报告”发表声明

2021/08/28   8月27日,美国国家情报总监办公室发布所谓“新冠病毒溯源调查报告”要点,认为目前看新冠病毒源自自然界和实验室泄漏的两种可能性都不能排除。报告诬蔑中方阻挠国际调查、拒绝共享信息并指责他国。白宫同日就新冠病毒溯源调查发布声明,妄称中方阻挠溯源工作的国际调查,缺乏透明度,企图纠集有关伙伴方对中方施压。中方对此坚决反对、强烈谴责。

首先,报告是美由情报部门主导杜撰的,毫无科学性和可信度可言。新冠病毒溯源是科学问题,应该也只能由科学家而不是情报专家研究。历史上,美情报部门搞出不少“杰作”,诸如把一小瓶洗衣粉当作伊拉克大规模杀伤性武器证据,自导自演“白头盔”组织摆拍所谓“叙利亚化学武器袭击”视频。现在美方又故技重施,放着中国—世卫组织联合研究报告不信,偏要取信情报部门炮制的报告,那怎么还可能是科学、可靠的溯源?

第二,美方声称中方不透明,这完全是为其推动政治化、污名化寻找借口。疫情发生以来,中方始终本着公开、透明、负责任原则,第一时间对外介绍、对外分享病毒基因序列、对外开展抗疫合作。2019年12月27日,武汉地方有关部门首次报告可疑病例,30日下发关于做好不明原因肺炎救治工作的紧急通知,31日中国向世卫组织通报有关情况,2020年1月3日中方开始定期向世卫组织和美国等有关国家主动通报疫情信息。在溯源问题上,中方也从一开始就表明了科学、专业、严肃和负责任的态度,率先同世卫组织开展全球溯源合作,去年以来两次邀请世卫专家来华开展溯源研究。世卫专家组来华开展溯源工作时,中方完全公开透明,满足了其全部参访要求,未作任何限制。专家们在武汉去了所有他们想去的地方,会见了所有他们想见的人,查看了所有他们想看的资料。世卫组织3月30日正式发布的中国—世卫组织联合研究报告,其形成遵循了世卫组织程序,采取了科学方法,体现了权威性和科学性。中方在病毒溯源问题上展现的开放、透明态度也得到国际专家充分肯定。

第三,美方情报部门出台报告恰恰说明了美方一意孤行在政治操弄的错误道路上越走越远。疫情暴发以来,美国成为感染和死亡人数最多的国家,已经让美国民众付出了沉重代价。美国政府通过情报机构搞所谓溯源报告,妄图对中国进行“有罪推定”,是为了推卸自身抗疫失败责任、向中国甩锅推责。美方这种做法只会对国际溯源和全球抗疫合作造成干扰和破坏,已经遭到国际社会普遍反对。世界上100多个国家和地区,300多个政党、社会组织和智库向世卫组织秘书处提交《联合声明》,坚决反对将溯源问题政治化。美方难道不应该听一听这些声音吗?

最后,美方对自身溯源讳莫如深,把溯源大门关得死死的。美方如果真的“透明负责”,就该公布并检测早期病例数据。美国新冠肺炎疫情发生的时间线不断前移。美国至少有五个州的新冠病毒感染情况早于美国首例确诊病例报告时间。近日也有美国媒体报道,美国首例新冠肺炎死亡病例出现的时间为2020年1月初,比官方此前认定的2月初要早数周。

武汉病毒研究所已两次接待世卫组织专家,新冠病毒源自武汉病毒研究所泄漏“极不可能”是中国—世卫组织联合研究报告得出的明确结论。美方如果非要坚持实验室泄漏的说法,难道不应该邀请世卫组织专家前往德特里克堡和北卡罗来纳大学调查吗?德堡长期从事冠状病毒研究、改造,2019年发生严重安全事故并被关停,随后美国国内暴发与新冠肺炎症状相似的疾病。北卡大学巴里克团队早就具备极其成熟的冠状病毒合成及改造能力,该校于2015年1月至2020年6月1日共向美国国立卫生研究院报告28起涉及基因工程微生物的安全事故,其中6起涉及包括SARS、MERS和新冠病毒等在内的冠状病毒。美方不调查公布自家实验室的情况,却光顾着往别人身上泼脏水。

中方对全球溯源问题的立场是一贯、明确的。溯源是科学问题,中方始终支持并将继续参加科学溯源。我们反对的是政治操弄,反对的是有罪推定,反对的是嫁祸于人。第二阶段溯源应该在第一阶段溯源的基础上全面延伸,在全球多国多地开展溯源工作,才能真正找到真相和答案。

美情报部门提供的报告没有给出美方想要的确切答案,再搞下去,也是竹篮打水一场空,因为它的调查本身就是子虚乌有、反科学的。

防卫挑拨

往上一层,公关不是目的,而是手段,是一种战术。诽谤公关背后的战略,除了对吃瓜群众三人成虎的舆论进攻,还有对直接当事方的挑拨,诱使其做出过激行为,是以假借正当防卫的接口实现反击。

胡万污蔑六子,引其自残,这只能称得上战术。背后的战略则是黄四郎要诱使张麻子要是当众杀了胡万。张麻子如果中计,那就是过激行为,身为县长怕是不仅要被革职查办甚至处刑,而且再复仇黄四郎就名不正言不顺了。短期来看,哑巴亏吃定了。

乌克兰堵上国命要加入北约欧盟,实际上是对北约和欧盟的道德绑架,这种摆烂行为都称不上战术。背后的战略则是美国要诱使俄罗斯做出过激行为,离间俄欧,绑架欧盟。按照预想,俄罗斯这样的国家会像张麻子一样冷静思考,吃个哑巴亏几乎是必然结果。结果俄罗斯不是张麻子。虽然乌克兰甘愿当胡万的话美国怎么都能赢,但俄罗斯不像张麻子有复仇黄四郎的抱负。但他有切实的担心,今天胡万蹬鼻子上脸,明天胡千,后天胡百,谁都敢来踩一脚了。结果俄罗斯顶着被全世界查办的压力,选择当众暴揍乌克兰。

亚洲国家大部分都和美国交过手,当胡万这种事情狗都不干。立陶宛乌克兰这种,属实差劲,结果自然狗都不如。但试试还是要试试的,万一碰上傻狗了呢?就算政府可能不傻,群众还不好挑拨?到时候政府不搞点动作怎么顺应民意呢?

防卫挑拨之多,案例不胜数。印度进犯边境,中国进亦输退亦输。美国打台湾牌南海牌,中国打也输不打也输。

攻守之势

再上一层,防卫挑拨也只是战术,战略则是通过进攻改变现状。麻子在鹅城,四郎要是不反应,臣服是早晚的事。主动出击,或许有翻盘的机会。

当今欧陆,军事上俄攻美守。当经亚太,经济上美攻中守,军事上中攻美守。遥想冷战,军事上苏攻美守。何人欲守?既得利者。何人欲攻?试图改变现状者。

一目了然。

我又懂了。

乌克兰局势

2022-03-01

  1. 俄罗斯把乌克兰北东南三面合围以后不动了。既不合拢口袋,也不攻城。说明俄罗斯不着急。西乌部队肯定不会往口袋里钻,那无异于自杀。东乌政府军正面没有打赢的可能,长期来看除了撤退就是投降,没有别的选择。
  2. 俄罗斯没有切断乌西南即波兰罗马尼亚边境,甚至都没往西乌进军,尤其是北约武器现在在往西乌不断输送的情况下,说明俄对西乌没有任何兴趣。
  3. 表面上和乌克兰谈判但完全不停军事行动,说明俄罗斯没达到预期目标。
  4. 很多人说乌克兰会变成下一个阿富汗,我看未必。乌克兰地形缺乏打游击的条件,大平原重武器的对抗游击队根本活不了。乌克兰有抵抗意志但目前远没到阿富汗的血海深仇。

综合以上,俄罗斯在等乌东政府军撤离或者投降,把乌东自愿空出来。东西乌分治。剥离了重工业的西乌实际上失去了独立军事化的能力。东乌有亲俄文化和传统,扶持亲俄政府(可以就像现在这样打散);泽连斯基留在西乌。保留西乌是乌克兰民族分布导致的必然结果。

如果说前24小时的突进是希望乌克兰政府立即奔溃,那显然没达到目的,但不代表军事行动就没有意义了。目前还要打的是东西乌的分界线和对西乌停火的条件。

  1. 是否承认东乌各国独立
  2. 是否承诺永不入欧,永不入北约
  3. 是否承诺去军事化

东西乌分治后其实上述三个条件都不重要了,很有可能西乌一个都不会答应,继续要求加入欧盟北约。考虑到届时东西乌互为对方阵营缓冲带,西乌加入欧盟北约是真的有可能的。

Ukraine War

Countries

US

The biggest, if not only, winner of the event. The only one who wishes the event to happen, so that money can go back to US from EU (due to regional instability) to reduce the high inflation in US.

The only loss would be the confidence of US's allies accounting on its support.

If Russia does not invade Ukraine, NATO will be dancing at its doorstep which is super preferable to EU and US, but intolerable as to Russia.

If Russia invades Ukraine, EU and Russia will be against each other by sharing a military border, so that US (and UK) will have much less to worry about on these two opponents.

Russia

Has no advantage but military strength, has no means of diplomacy but threatening, has no choice but war. Pity.

European Union

Realize the event too late. Cannot do much. Now that Ukraine is under war, EU is bonded to US once more.

Ukraine

Stupid as fk. Lost everything because of some vague promise by US. Let war happen on its own soil due to some stupid and irresponsible politician breaching the status quo.

China

Cannot do anything. Cannot blame Ukraine as it's the victim. Cannot blame Russia since they are to some degree allies against US. Cannot defend Russia since Ukraine’s sovereign is threatened as a fact. Can blame US but few would listen, and the plot is just too good to believe.

Similar Event in History

Philippine on South China Sea

Stayed calm. Knows its position and is smart enough to avoid being used as pawns of US against China. US did not get anything but swear from Duterte to Obama.

Japan on Fishing Island

Japanese forced to lose its ground. US succeeded to break down the free trading pact between China and Japan.

South Korea on THAAD

Korea was forced to lose its ground. US succeeded to break down the free trading pact between China and South Korea.

Ukraine’s Only Options

Ukraine could be independent as North Korea if it did not give up its nuclear arsenal. Could be stable as Taiwan if it did not join any sides between NATO and Russia.

People

Zelenskyy

He is the main one accountable for this event due to lack of insight in foreign affairs and diplomacy status quo. He is not smart enough and has too much goodwill as the leader of a weak nation. He is bound to fail just as Allende in Chile.

If he dies he will become martyr of Ukraine Nationalism and neo-Nazism (ironically as a Jewish), and as an iron proof of Russia invasion. This is the last thing Russia would like to see, but the best thing US wants to see.

If he flees to US without public announcement he would probably be killed by US to fake the previous scenario.

If he flees to US with a public announcement, Ukraine Nationalism would suffer such a hit that Ukraine may just disappear as a country forever. The best thing Russia wants to see.

If he stays and is still the president after the Russian invasion, he will be a National traitor that sell his country to Russia.

In other words, his 'friends' wish he dies and his 'enemies' wish he lives.

Putin

He is what he is. He knows what Russia is good at and is not afraid to use its force when necessary. But honestly, he has no choice.

US Politicians

Still so good at manipulating the world.

X3 - Marines, and all the sarcasm

A deep discussion into the nature of development and authority, from the perspective of marines in the game X3.

https://forum.egosoft.com/viewtopic.php?f=199&t=444071

X3FL - Board Q with 0 Casualty

Boarding a Xenon Q with 0 casualty was easy in TC since one can save load at each deck. Need a little more SL in AP, but was easier than P IIRC. Now it's very hard, but I finally made it after 717 attempts.

So I lower the Q's shield, launch 21 marines, initiate the jump sequence, keep shields low, and save right before boarding pods hit Q. After each reload, once the jump is completed, I open the property menu to watch the marine status, take a screenshot at the hacking stage, save the game, and copy the save to somewhere else.

I wrote a .ahk script to automate the above process, gathering a lot of saves and corresponding screenshots. The screenshots are later processed and clustered using python.

Of all the 793 scenarios recorded, 101 times Q launched a Firestorm Torpedo against me but ironically destroyed itself due to close-range detonation by my anti-missile system.

Of the remaining 692 scenarios, 447 times the marines did not survive till hacking the core. The other 245 (almost) successful scenarios have a distribution of remaining crews as follows at the hacking stage. Note there are occasions when less than 16 marines made it to this stage but were not eliminated.

Only in one scenario, at the 717th attempt, did all 21 crews survive the operation.

Autarky

Autarky is the characteristic of self-sufficiency, usually applied to societies, communities, states and their economic systems.

Autarky - Wikipedia

I came to know this word as a Nazi Germany economy policy in 1930s. It triggers me deep, as even for an already industrialized country, autarky is still an option.

Read More

Design a Space Elvator

TV series Foundation shows a space elevator 911 event. How should a space elevator be designed and what will its collapse look alike?

Consider the space elevator to be a link with linear mass m^(l)\hat{m}(l) and a total length LL.

To have a straight link, everything below the Geosynchronous orbit, or GSO would be rotating too slow to support its own mass. To balance the effect one can choose from 2 sources of support: base reaction from the ground, or tension from above GSO.

The tension of link at height xx

T(x)=Fr0xGMm^(Re+l)2dl+0Lm^ωe2(Re+l)dlT(x) = - F_{r} - \int_0^x{\cfrac{GM\hat{m}}{(R_{e}+l)^2}}dl + \int_0^L{\hat{m}\omega_{e}^2(R_{e}+l)}dl

where ReR_e is earth radius, ωe\omega_e is earth rotating angular speed, FrF_r is base reaction force.

The boundry condition

T(L)=0T(L) = 0

Intuitively, a reasonable model will have the ground part in compression, but not that much of the entire gravity of things below synchronous orbit. The link at synchronous orbit will be in tension, so somewhere below there would be a zero force point.

The major payload should be deployed right at GSO, such that it doesn't pose any extra load into the link. Another benefit of the design is that the major payload can always survive any 911 attacks not targeted at it directly by simply cutting itself off the link. In such design, cut the link anywhere will have the lower part fall to Earth and upper part go into space. The TV series made a reasonable assumption.

Though seemingly unavoidable, it is by design inevitable for a (common civillian) building to fail a 911 attack due to economic concern, even a space elevator.

Axial force diagram should look like moment diagram of a cantilever beam under distributed load, and so should a reasonable section design be alike.

Project: Golden Horizon

Introduction

A(n award winning) rural planning project, designed entirely by a group of Civil Engineer students (and newly graduated ones). The result is somehow not so bad since it at least won us an award, but I definitely wouldn't want to show it off. See the news report (in Chinese) for detail.

Read More

论仪式感

【扒】莫爸为了找工作拼上命,可全世界只想糟蹋他?瑞克和莫蒂漫画之进击的loser

莫爸难得上进一回,但全世界都似乎都要跟他作对,很容易怀疑他就是命中注定的loser。从荒诞的层面理解这个故事很爽,但如果仔细想想,莫爸为什么非要象牙白的打印纸,就不难发现,他是想要一个梦幻的开局,一个伟大的起点,最好充满仪式感,能配得上loser翻身的彻底与神奇。可这不是追求完美,而是在寻求拖延。
就像我们最爱的新年计划,或者在20岁,30岁生日许个心愿,仿佛买入下一个节点,一切都会突然改变,人会变得特别上进,事情会变得特别顺。我们喜欢这种仪式感,几乎每年都会来一次,道理和莫爸非要用象牙白的纸类似,往往是对现状不满或者焦虑,所以才期待一个伟大的转折。因为细小的进步很难安抚人心,它必须足够伟大才能消除焦虑。
即使找到了象牙白的简历纸,我想莫爸还是会找各种事情“刁难”自己,这样他就能把失败甩锅给这个世界。所以并不是他以努力全世界都跟着作对,为是他自己跟自己作对。冰冻三尺,非一日之寒。他幻想着一把大火给自己解冻,可有看不起脚下的爝火微光。

对于沉湎仪式的loser,仪式的背后是小心掩藏的焦虑和浮躁。但仪式感绝非loser的专属。古往今来,遍历东西,无论信仰,种族,地位,成功或是失败,仪式感绝非偶然。

实质

第一次接触仪式感这个词仅有数周,缘起于讨论节日习俗是否有其必要性。细想之下,诸多节日习俗竟占据了绝大部分的仪式。当然事实上,正是对仪式感的执着方才造就了这些节日。公共的节日之外,私人的xx纪念日,生日,成年礼,等等诸如此类,似乎便是除去日常生活的全部了。

仪式
举行典礼的程序、形式
——现代汉语词典

仪式之所以特别提出,大概是其程序和形式本身产生的实际效用往往远小于其投入。其所强调的程序、形式,恰恰是灵活、效率的死敌。尽管如此,人们谈起仪式往往毫不计较其投入、效率,而仪式一词本身,不仅中性,还颇有庄重的褒义感。

感官

仪式的程序本身暗示此类行为是重复的,有经验的,系统化的。其经验来源也许是个人本身先前的行动,也许是他人教授,例如节日习俗的代代相传。

但无论如何,主持参与仪式者事先应当已有准备,是有计划,有准备,有预期,有把握完成的。高度程序化的仪式保证了事情按计划实现,不仅仅是个人,而且所有仪式参与者的行为通通可以预判,因此反馈给感官的往往是一种带有控制力的成就感,仿佛征服了仪式,便征服了生活。

结合其重复性,仪式可以说是获得一种快乐最稳定最有保障的途径了。正如一切成瘾性的快乐,正反馈促成了仪式感的诞生。

本能

摒除了人造的节日,剩下的即是真正的人生大事,无非生死婚丧。巧合,绝大多数生物亦是如此。生物间的仪式同样纷繁复杂,总体上来说当然还是远不如人类。毕竟生存第一的大自然,任何对能量的浪费都必须精确计算。生死有命,动物行生日葬礼者确少。但在如此严苛的环境里,我们依然可以看到诸多动物为求偶做出的奇特仪式。

所谓动物的仪式,当然也要摒除那些有实际意义的内容,例如真打实斗非死即伤的求偶矛盾便不宜认为是单纯的仪式。单论仪式,开屏的孔雀便是最好的案例。具体来说,求偶仪式无非是为了体现发育良好,身体健康,有能力为人父(母),保护家庭。至于仪式展示的内容,往往如孔雀开屏,有形无实,颇有内卷的味道。或许对于人类这种数千年前就脱离了基本生存限制的生物来说,仪式便是本能驱动下内卷的典型产物。

社会

公序良俗。儒家最讲究宗法礼节,突出一个“序”。仪式之与社会,最大的好处便是让人有了共同的语言和合作的空间。做的事情有没有用不重要,统一了心性,有了共鸣,社会才能和谐有序,才能保障体系的正常运转。

远古以来,人类逐渐摆脱物质基本需求的支配。游手好闲的人却成为了社会失稳的一大隐患。无用的仪式恰好给了社会一个能量的宣泄口,将人们的剩余精力组织起来集中耗散。

既能组织社会,又能耗散能量,作为维护社会稳定的双重保障,礼,确有其效用。2000年前儒家发现了这个神奇的工具,将它化成思想钢印刻进汉文化圈,最终成为宗教以外维护社会稳定的一大支柱。

结语

不论读者是否认同仪式感,是否能从仪式感中获得快乐,我想不应当把仪式感当作一种神秘的感受,其产生与影响应当是有迹可循的,这也是笔者写作此文的主要目的。

古往今来社会活动中能成大事者,应当对仪式有极其深刻的理解,其不仅自身不受仪式教条的禁锢,往往还能利用其操纵社会。阅兵,国葬,烟花。当然,人心难测,仪式只是其一罢了。

Analogy of life and society form

A topic over immortality triggered my extended thought over the similarity of life and society.

Read More

Zhejiang University Network

Had a chat with one of the local campus network admin, here is some of what I learned about the Zhejiang University network

  • the entire lab building is merely connected with 2 1-Gbps links
  • the new campus WIFI is restricted to 30 Mbps as requested by old main campus leader 'to ensure consistency'
  • office table network switches are trash with only 100 Mbps link speed
  • private router can cause DHCP problems thus DHCP should always be turned off, or they will ban the mac address
  • private router is against regulation as security might be breached that some connection can not be traced
  • all records are preserved permanently for security purpose
  • all connections to campus network can be traced to someone who is responsible
    • common link for sure can be traced to the account that is using it
    • direct link (static ip) can be traced to the applicant
    • most, if not all, direct link is bound to the device mac address
  • proxy service is detected using self developed software, through various techniques including using ip range pool

教师节贺词

萧萧竹间雨,

炎炎漠上风。

角弓得风劲,

狩月照海宁。

结庐傍林泉,

日暮倚栏杆。

快意从心起,

乐趣自无穷。

并祝所有老师节日快乐

Project: NewLink Group Carbon Assessment Report 2021

First time InDesign user.

40p in 20 hours by InDesign, and a little Illustrator.

To be uploaded upon releasing.

Project: Terrain Modelling

This is a sub project of the ongoing project: Hengjin Villiage Plan.

Terrain Model Report

DEM data source

GoogleEarth - RenderDoc - Blender

earth.google.com
not seamless, unable to use

SketchUp - Digital Globe

low resolution

picture 1

Dataset: ASTGTMV003_N29E121

DOI 10.5067/ASTER/ASTGTM.003
earthdata
2000-03-01 00:00:00 - 2013-11-30 23:59:59
resolution of 1 arc second (approximately 30 meter horizontal posting at the equator)

picture 2

Dataset: ALPSRP133840570-RTC_HI_RES

alaska.edu
earthdata
2008-07-29 14:21:47 - 2008-07-29 14:21:55
resolution of 12m

picture 3

Satalite: TerraSAR-X

esa.int
region not found

image data source

SketchUp - Digital Globe

Photoshop: remove excessive water print, and additional drawing
Illustrator: vectorization
caffe: scale up resolution

Satalite: Worldview-3

esa.int
resolution of 0.3m
proposal required, need waiting within 14 days
owned by digital globe so potentially we may have already get it

Satalite: 高分二号

resdc.cn
resolution of 0.8m
要钱
分辨率不如Worldview-3

Read More

Project: X3-notoriety-hack

mkmark/X3-notoriety-hack

Turing machine on Hilbert's question on decidability

Math Has a Fatal Flaw - YouTube

Is it possible to tell beforehand if a program will halt or not on a particular input?

Turing's claim (or what Veritasium claims to be his claim)

let p(i)p(i) be any program with its inputs

assume h(p,i)h(p, i) satisfy the requirement, that it tells beforehand if a program will halt or not on a particular input, such that

h(p,i)={WILL_HALT,if p(i) will haltWILL_NOT_HALT,if p(i) will not halth(p, i) = \begin{cases} \text{WILL\_HALT}, & \text{if } p(i) \text{ will halt}\\ \text{WILL\_NOT\_HALT}, & \text{if } p(i) \text{ will not halt} \end{cases}

let h^\hat{h} be

h^(p,i)={[infinite loop],if h(p,i)=WILL_HALT0,if h(p,i)=WILL_NOT_HALT\hat{h}(p, i) = \begin{cases} \text{[infinite loop]}, & \text{if } h(p, i) = \text{WILL\_HALT}\\ 0, & \text{if } h(p, i) = \text{WILL\_NOT\_HALT} \end{cases}

consider h(h^,h^)h(\hat{h}, \hat{h})

h(h^,h^)={WILL_HALT,if h^(h^) will haltWILL_NOT_HALT,if h^(h^) will not halth(\hat{h}, \hat{h}) = \begin{cases} \text{WILL\_HALT}, & \text{if } \hat{h}(\hat{h}) \text{ will halt}\\ \text{WILL\_NOT\_HALT}, & \text{if } \hat{h}(\hat{h}) \text{ will not halt} \end{cases}

or equivalently

h(h^,h^)={WILL_HALT,if h(h^)=WILL_NOT_HALTWILL_NOT_HALT,if h(h^)=WILL_HALTh(\hat{h}, \hat{h}) = \begin{cases} \text{WILL\_HALT}, & \text{if } h(\hat{h}) = \text{WILL\_NOT\_HALT}\\ \text{WILL\_NOT\_HALT}, & \text{if } h(\hat{h}) = \text{WILL\_HALT} \end{cases}

The problem is, h^(h^)\hat{h}(\hat{h}) and h(h^)h(\hat{h}) does not exist as h^\hat{h} and hh takes two parameters, and there is no reason to assume (h^)=(h^,h^)(\hat{h}) = (\hat{h}, \hat{h}), leaving us no contradiction in the end.

The fix

To construct the paradox, we need to lower the input numbers. Instead of h^\hat{h} we define

h~(p)={[infinite loop],if h(p,p)=WILL_HALT0,if h(p,p)=WILL_NOT_HALT\tilde{h}(p) = \begin{cases} \text{[infinite loop]}, & \text{if } h(p, p) = \text{WILL\_HALT}\\ 0, & \text{if } h(p, p) = \text{WILL\_NOT\_HALT} \end{cases}

consider

h(h~,h~)={WILL_HALT,if h~(h~) will haltWILL_NOT_HALT,if h~(h~) will not halth(\tilde{h}, \tilde{h}) = \begin{cases} \text{WILL\_HALT}, & \text{if } \tilde{h}(\tilde{h}) \text{ will halt}\\ \text{WILL\_NOT\_HALT}, & \text{if } \tilde{h}(\tilde{h}) \text{ will not halt} \end{cases}

or equivalently

h(h~,h~)={WILL_HALT,if h(h~,h~)=WILL_NOT_HALTWILL_NOT_HALT,if h(h~,h~)=WILL_HALTh(\tilde{h}, \tilde{h}) = \begin{cases} \text{WILL\_HALT}, & \text{if } h(\tilde{h}, \tilde{h}) = \text{WILL\_NOT\_HALT}\\ \text{WILL\_NOT\_HALT}, & \text{if } h(\tilde{h}, \tilde{h}) = \text{WILL\_HALT} \end{cases}

Philosophy, physics, and other thoughts

Until I figure the fix out I thought Veritasium is making fake assertions and baiting, turned out he's just been careless, and a paradox does exist.

The logic behind the problem is that, if there exists a program that can tell beforehand whether any problem has a solution, it cannot tell beforehand whether itself has a solution, thus vetoes its own existence.

An analogy would be, if a predictor exists, and we do adversely to whatever it predicts, then its prediction is wrong, and we conclude the predictor does not exist.

Now in terms of predictor people's been creative that in terms of whether things happen at a given future time, it may provide a possibility instead of a definite binary happens or not. The result does not collapse until the given future time, and the behavior of observation does have an influence over the outcome since we can now alternate the predicted future (in forms of possibility). This possibility model solves all the paradox mentioned above.

Back port the possibility model into the problem, there might be a program that can tell beforehand the possibility of whether any program has a solution (with further limits on observer) which is useless though.

The conclusion, however, does not necessarily escalate to 'whether all problems has a solution' since a problem does not necessarily equal a turing machine program. It does, imho, might escalte to 'whether all problems has a definite solution', as is in coherence with quantum physics.

Though I wonder whether mathematicians are satisfied with such conclusion like 'Goldbach conjecture' has a 99.9999... possibility to be true.

On the other hand, an interesting research direction is to prove that 'Goldbach conjecture' is impossible to prove.


用粗野或恶意的话侮辱人:~街|张嘴就~。
斥责:他爹~他不长进。
-- 现代汉语词典

我且认为,日常汉语的演进,大有把咒骂当作一种口头情绪的宣泄的趋势。此类咒骂,形式上确实多含侮辱,或为斥责,目的却不见得。倘若出门忘了带钥匙,骂一句“卧槽”,不见得此人便是认真侮辱斥责自己。如此咒骂,和叹词无异。

年少时读范仲淹岳阳楼记[1],读到“不以物喜,不以己悲”,以为至理。但人性本兽,若是不准咒骂,未免过于严苛而有矫揉造作之嫌,仿佛不咒骂便不会有负面情绪。又读到陈涉世家[2]“王侯将相宁有种乎”,叹为千古绝骂,可惜新课本里整篇删掉了。

我认为情绪的宣泄与斥责,可以咒骂,但不宜有侮辱之意。虽然骂大多只是情绪的宣泄,但其必有来由。例如“傻逼”“智障”,不见得施法对象就真是“弱智”,但多有嫌弃“幼稚”“naive, too young”之意。在这一方面,长者可谓道行颇深。骂人幼稚,好歹还有长进的空间。

特别是以斥责为主的骂,其目的多是要施法对象意识到错误改正,除去情绪外还有强烈的目的性。我一般反对在这种时候带情绪处理问题。忍无可忍,也应当以讽刺为主。讽为幽默,刺求精准,这就对文化素养要求很高了。

有些骂,看似侮辱,实则,确实侮辱。鲁迅先生曾专就此写过一篇杂文《论“他妈的!”》[3]。先生认为国骂出处或无据可考,但北魏有邢子才“卿何必姓王?”,颇有骂人仰仗门第之意。这解读多少与先生反封建的社会背景有关。现在有人再讲“他妈的”,含义基本等同于“肏他妈的”。放到白左嘴里这大概可以解读成中国人歧视侮辱女性了,当然他们自己也有"mother fucker",倒是巧合?回到国骂本身,倘若当面骂人“肏你妈的”,不见得真要行不轨之事,但侮辱之意甚矣。

此类宣泄,虽不能说毫无由来,但适用性未必太广了一些,甚至有直接升格成叹词的趋势。按我说,不如以叹词职行叹词事,一句“什么东西”,大概能代替绝大部分的“肏他妈的”,保留惊怒,卸除侮辱。至于像“肏你妈的”这样当面刻意的侮辱,我是反对的。

按此思路,整理如下表格。尽量剥离不必要的侮辱,精准保留惊叹和负面的情绪及批判目的,力争骂出水平,骂出风采,尽量不被打死。此表长期更新,欢迎补充。后续表同。

Read More

Chengdu Trip

20210726 Chengdu

First impression, Chengdu feels just like any costal city of East China, with modern CBD, railway station, and subway. Living cost seems somehow lower though.

Food is not so good as one would normally claim, possibly due to my bad strategy to try to get accustomed to authentic local food. However some dessert does impress me as I had my first taste on sweet jellied Tofu, very much like pudding.

Local city feels like a strange combination of 2020 East coast CBD with 2000 East coast streets. Prostitutes advertisements are everywhere in hotel, and occasionally I can see one or two of them sharing an elevator.

The elder generally speaks only local accent which is a trouble for me. Good for me that my girlfriend can understand them quite well.

There has been an effort to modernize, or to renovate old streets as tourist spots all over China. What surprised me is that old Chengdu streets, feels just like any East China old street.

Panda, as one of the most famous local cultural element, can be seen everywhere in the city, i.e. posters, sculptures, clothes. Some of these sculptures are really interesting, and the one really impressed me was one built right in the middle of CBD, right on top of one building, featuring a climbing pose.

20210801 Dujiangyan

Ancient irrigation system.

Refer to https://zhuanlan.zhihu.com/p/334943779 as a general tour plan. Nothing too bad, yet nothing exceeding expectation either.

20210801 Qingchengshan

If I may say, just as Qingchengshan itself is a mountain developed for religious purpose, the best, and most interesting scenery, is local people.

Read More

The Complexity of Humanity

Everyone knows "complicated" is code for "bitch."
-Gone Girl (2014)

Read More

Project: X3FL dynamic relationships

mkmark/X3FL-dynamic-relationships

Project: zju-health-reporter

mkmark/zju-health-reporter

Project: Prefabricated Engineered Bamboo Mobile House - BIM Modeling

Glubam is short for glue laminated bamboo, which is a new material[1].

This is the BIM modeling project for a new code: Technical specification for prefabricated engineered bamboo mobile house.


  1. Wu, Y., and Y. Xiao. "Steel and glubam hybrid space truss." Engineering Structures 171 (2018): 140-153. ↩︎

The 2nd Civil Engineering Computing and Simulation Technology Academic Conference

I would not put my half organized notes here.

I met some of the greatest Chinese scholars in the field. Watched their report, and found myself at a very strange position.

I love computing and simulation technology, but the deeper it goes the more clear its boundry is - technology is technology, civil engineering is engineering, not science.

Read More

Changsha Trip

True Fans
Changsha Culture and Art Center, by Zaha Hadid.

A true fans sees him everywhere.

20210509 College of Civil Engineering, Hunan University

Odd enough, the metro exit reads 'College of Civil Engineering, Hunan University' instead of just 'Hunan University', despite the entire campus is just outside of the exit and College of Civil Engineering is the one most far from the exit.

Project: Glubam Building

A real glubam project to be built in Changsha, Hunan, China.

It will be the first glubam[1] multistory office building in the world.

It is also my first calculation completely done in python. The code can be found here, in Chinese. You're always welcome to use google translate though.

Architecture

The current accepted architecture proposal is

20210408 Glubam Building 4.6-2

Read More

苏康码自动健康申报

https://gist.github.com/mkmark/91e2a8a3b848a064773d75df597e7071

Read More

TL-R473G Router Hack

I finally come back home to reset the router which was accidentally turned into brick half an year ago. With more experience in Linux I finally successfully gained root access to the device.

Read More

Math in Banished - Maximum Population

enfo13[1] posted a 4000+ population reddit yet I think some of the popular models/conclusions might be wrong so I decide to write this paper.

The majority of this paper is based on theory and is yet to be testified.

The game is so time consuming that I don't even know if I'll be able to test my theory.

Read More

San Francisco Night Drive

Night drive with Han Li, Xin Chen, and Siqi Yao.

For the first time I found out that Lombard Street exists more than just in GTA. > <

20210130201505 San Francisco - Oakland Bay Bridge from Treasure Island
20210130201505 San Francisco - Oakland Bay Bridge from Treasure Island

20210130210724 San Francisco - Oakland Bay Bridge from Inside
20210130210724 San Francisco - Oakland Bay Bridge from Inside

Blog Migration

TLDR, I moved from WordPress to Jekyll, then to Hexo, with WordPress still working as a CMS.

Read More

Chrome Dark Scroll Bar

Chrome now supports dark scroll bar as Github has implemented. After careful search and debug I finally located 2 syntax for its implementation, being:

A HTML meta tag telling Chrome supported color-schemes with preference by order. Chrome users with system-wide light/dark theme will find it respect this tag on page reload. The light theme remains what it was, while the dark theme features a default pure black background and pure white font color, with other colors like purple for hyperlinks.

<meta name="color-scheme" content="light dark">

A CSS property which can override previous meta tag and works without reloading the page

:root {
  color-scheme: dark;
}

Reference

Improved dark mode default styling with the color-scheme CSS property and the corresponding meta tag

Tall Grass

202101202110 Tall Grass

Night of first trials on tennis and skateboard, taught by and practised with Xinyu Hu, Han Li, Zhirong Lin, and Xin Chen.

Virtualize Dual-boot Linux

Comparing with WSL2

  • Pro
    • Allow maximum performance when using physical machine
    • Have Native GUI which can be accessed using VirtualBox
    • Native disk operation performance under virtual machine
  • Con
    • No app optimization and support in Windows, e.g. vscode, cuda (but vscode has ssh feature, and you have native linux cuda under physical machine)
    • Mapped file in RAM is not managed by Windows, naturally, thus requiring a larger RAM (Your RAM stores mapped files from both host Windows and VM Linux now)
  • Even
    • Other performance under windows, e.g disk operation across systems (using SMB)

Read More

Chrome OS on Surface Pro 7

20210113

Working

except # Not Working

Not Working

  • Multi-touch Finger Input (Single-touch works)
  • Stylus Input
  • Camera
  • Surprise, dark mode hasn't been implemented in Chrome OS 87!

Have Problem Working

Speaker will make hissing noises with headphone injected

Mechanism

Chrome OS cannot be installed directly to PC due to hardware compatibility. Some hardware, e.g. the Intel Precise Touch Screen of Surface Pro, even requires special driver. Moreover, Chrome OS, or Android, are built to install on the entire disk (not a partition).

'brunch' is a framework project featuring these problems by including support for PC hardwares and installing Chrome OS on a .img disk mirror file.

Repo

sebanc/brunch: Boot ChromeOS on x86_64 PC (supports most Intel CPU/GPU or AMD Stoney Ridge)

Rammus recovery bin from CrOS Updates Serving

Bottle neck upstream repo

linux-surface/iptsd: Userspace daemon for Intel Precise Touch & Stylus

Install script

I use WSL to pack up the '.img' file. Due to the warning given by brunch readme, I made a special partition, a 32 GB NTFS 'G:', i.e. '/mnt/g/' in wsl for safety concern. The img size is thus set at 31 (GB).

The reason to use NTFS is to facilitate disk operation in Windows. An EXT4 file system will work too, but not FAT32 due to lack of support of large file.

sudo apt-get install pv
sudo apt-get install cgpt
sudo bash chromeos-install.sh -src chromeos_13505.73.0_rammus_recovery_stable-channel_mp-v2.bin -dst /mnt/g/chromeos.img -s 31;

GRUB2

Need to disable Secure Boot and Bitlocker first.

Turning Secure Boot back on is an easy method to disable GRUB - thus booting directly into Windows.

I use grub2win for multi-boot. Add the boot code generated by brunch (next to the generated '.img' file) to grub.cfg to add the Chrome OS boot entry, and specify options=ipts in kernel parameters to enable touchscreen input.

Update

Follow instructions of BiteDasher/brcr-update: Script to update Chrome OS installed using the brunch framework

Android Remote Control

A completely open-source solution, partly stimulated by TeamViewer's aggressive approach to classify personal users as commercial users. Btw, Chrome Remote Desktop is recommended for desktop remote control.

Read More

KaTeX with VSCode, Jekyll, and WordPress Markdown

I use KaTeX in VSCode extension Markdown All in One for notes and homework. It's by far the easiest and most flexible way.

Markdown is such a markup language (see the paradox? lol) without a widely-accepted, strong official organization regularizing its syntax and grammar. Typical standards includes:

Implementation of Javascript libraries into Markdown, such as KaTeX, is done independently by Markdown processors, thus creating even more variants of syntax and grammar.

In an attempt to use the same syntax and grammar throughout my Markdown documents, i.e KaTeX with VSCode, Jekyll, and WordPress Markdown, and considering the possible transplantation to LaTeX, I adopt the following configuration for most consistent experience.

Read More

Celestial Coordinate Systems

This work is from part of UCB CS289A 2020 Fall Project S Final. See Github repo for more information.

A physical model is evaluated so that we can understand the problem more properly.

Solar-centered ecliptic coordinate system

Solar-centered ecliptic coordinate system is centered at the sun, using spring equinox as x+x+ or polar axis, ecliptic as xyxy plane.

Earth location (polar)

xe=(re,θe,0)\mathbf{x}_e = (r_e, \theta_e, 0)

where

θe=2πTeyt+θe0\theta_e = \frac{2 \pi}{T_{ey}} t + \theta_{e0}

or (dirichlet)

xe=[recos(2πTeyt+θe0)resin(2πTeyt+θe0)0]\mathbf{x}_e = \begin{bmatrix} r_e \cos{(\cfrac{2 \pi}{T_{ey}} t + \theta_{e0})}\\ r_e \sin{(\cfrac{2 \pi}{T_{ey}} t + \theta_{e0})}\\ 0\\ \end{bmatrix}

other planets can have a similar definition.

Earth-centered ecliptic coordinate system

Solar-centered ecliptic coordinate system is centered at the earth, using spring equinox as x+x+ or polar axis, ecliptic as xyxy plane.

Equatorial coordinate system

Equatorial coordinate system is centered at the earth, using spring equinox as x+x+ or polar axis, equator as xyxy plane.

Planets location in such system is defined as right ascension α\alpha and declination δ\delta,

as (polar)

Xp=(Rp,π2δ,α)\mathbf{X}_p = (R_p, \frac{\pi}{2} - \delta, \alpha)

as we normally do with spherical coordinate system (r,θ,ϕ)(r,\theta,\phi)

or (dirichlet)

Xp=[RpcosδcosαRpcosδsinαRpsinδ]\mathbf{X}_p = \begin{bmatrix} R_p \cos\delta \cos\alpha\\ R_p \cos\delta \sin\alpha\\ R_p \sin\delta\\ \end{bmatrix}

Horizontal coordinate system

Horizontal coordinate system is centered at the observer, using local north as x+x+ or polar axis, local vertical up direction as z+z+.

Planets location in such system is defined as azimuth AA and altitude aa,

as (polar)

X^p=(Rp,π2a,A)\hat \mathbf{X}_p = (R_p, \frac{\pi}{2} - a, A)

as we normally do with spherical coordinate system (r,θ,ϕ)(r,\theta,\phi)

or (dirichlet)

X^p=[RpcosacosARpcosasinARpsina]\hat \mathbf{X}_p = \begin{bmatrix} R_p \cos a \cos A\\ R_p \cos a \sin A\\ R_p \sin a\\ \end{bmatrix}

Coordinate transformation

It is easy to transform between the solar-centered ecliptic coordinate system and the earth-centered ecliptic coordinate system. A planet with coordinate xp\mathbf{x}_p in solar-centered ecliptic coordinate system is at xpxe\mathbf{x}_p - \mathbf{x}_e in earth-centered ecliptic coordinate system.

xpxe=[rpcos(2πTpyt+θp0)recos(2πTeyt+θe0)rpsin(2πTpyt+θp0)resin(2πTeyt+θe0)0]\mathbf{x}_p - \mathbf{x}_e = \begin{bmatrix} r_p \cos{(\cfrac{2 \pi}{T_{py}} t + \theta_{p0})} - r_e \cos{(\cfrac{2 \pi}{T_{ey}} t + \theta_{e0})}\\ r_p \sin{(\cfrac{2 \pi}{T_{py}} t + \theta_{p0})} - r_e \sin{(\cfrac{2 \pi}{T_{ey}} t + \theta_{e0})}\\ 0\\ \end{bmatrix}

transformation from the earth-centered ecliptic to equatorial coordinate system [1]

[xequatorialyequatorialzequatorial]=[1000cosεsinε0sinεcosε][xeclipticyeclipticzecliptic]\begin{bmatrix} x_{\text{equatorial}}\\ y_{\text{equatorial}}\\ z_{\text{equatorial}}\\ \end{bmatrix} = \begin{bmatrix} 1 & 0 & 0\\ 0 & \cos \varepsilon & -\sin \varepsilon \\ 0 & \sin \varepsilon & \cos \varepsilon \\ \end{bmatrix} \begin{bmatrix} x_{\text{ecliptic}}\\ y_{\text{ecliptic}}\\ z_{\text{ecliptic}}\\ \end{bmatrix}

where ecliptic obliquity

ε=23°2620.512ε=23\degree26'20.512''

so we have

[RpcosδcosαRpcosδsinαRpsinδ]=[1000cosεsinε0sinεcosε][rpcos(2πTpyt+θp0)recos(2πTeyt+θe0)rpsin(2πTpyt+θp0)resin(2πTeyt+θe0)0]=[rpcos(2πTpyt+θp0)recos(2πTeyt+θe0)cosε(rpsin(2πTpyt+θp0)resin(2πTeyt+θe0))sinε(rpsin(2πTpyt+θp0)resin(2πTeyt+θe0))]\begin{aligned} \begin{bmatrix} R_p \cos\delta \cos\alpha\\ R_p \cos\delta \sin\alpha\\ R_p \sin\delta\\ \end{bmatrix} &= \begin{bmatrix} 1 & 0 & 0\\ 0 & \cos \varepsilon & -\sin \varepsilon \\ 0 & \sin \varepsilon & \cos \varepsilon \\ \end{bmatrix} \begin{bmatrix} r_p \cos{(\cfrac{2 \pi}{T_{py}} t + \theta_{p0})} - r_e \cos{(\cfrac{2 \pi}{T_{ey}} t + \theta_{e0})}\\ r_p \sin{(\cfrac{2 \pi}{T_{py}} t + \theta_{p0})} - r_e \sin{(\cfrac{2 \pi}{T_{ey}} t + \theta_{e0})}\\ 0\\ \end{bmatrix} \\ &= \begin{bmatrix} r_p \cos{(\cfrac{2 \pi}{T_{py}} t + \theta_{p0})} - r_e \cos{(\cfrac{2 \pi}{T_{ey}} t + \theta_{e0})}\\ \cos \varepsilon (r_p \sin{(\cfrac{2 \pi}{T_{py}} t + \theta_{p0})} - r_e \sin{(\cfrac{2 \pi}{T_{ey}} t + \theta_{e0})})\\ \sin \varepsilon (r_p \sin{(\cfrac{2 \pi}{T_{py}} t + \theta_{p0})} - r_e \sin{(\cfrac{2 \pi}{T_{ey}} t + \theta_{e0})})\\ \end{bmatrix} \end{aligned}

transformation from equatorial to horizontal coordinate system [2]

cosAcosa=cosϕsinδ+sinϕcosδcosH\cos A\cdot \cos a=-\cos \phi \cdot \sin \delta +\sin \phi \cdot \cos \delta \cdot \cos H

sinAcosa=cosδsinH\sin A\cdot \cos a=\cos \delta \cdot \sin H

sina=sinϕsinδ+cosϕcosδcosH\sin a=\sin \phi \cdot \sin \delta +\cos \phi \cdot \cos \delta \cdot \cos H

or

[cosAcosasinAcosasina]=[sinϕ0cosϕ010cosϕ0sinϕ][cosδcosHcosδsinHsinδ]\begin{aligned} \begin{bmatrix} \cos A\cdot \cos a\\ \sin A\cdot \cos a\\ \sin a\\ \end{bmatrix} &= \begin{bmatrix} \sin \phi & 0 & -\cos \phi\\ 0 & 1 & 0\\ \cos \phi & 0 & \sin \phi \\ \end{bmatrix} \begin{bmatrix} \cos\delta \cos H\\ \cos\delta \sin H\\ \sin\delta\\ \end{bmatrix} \\ \end{aligned}

where hour angle[3]

H(t,α)=GST(t)+λαH(t,\alpha) = GST(t) + \lambda - \alpha

One of the final goal of this project is to predict AA and aa with tt, given longitude λ\lambda and latitude ϕ\phi under specific model, which we are to try explaing.

Note

  • Planets are actually in ellipse orbits instead of circle ones and zz is not 00 to be precise, here we made some simplification just to show the complexity of the problem
  • A slow motion of Earth's axis, precession, causes a slow, continuous turning of the coordinate system westward about the poles of the ecliptic, completing one circuit in about 26,000 years.

Reference


  1. Ecliptic coordinate system - Wikipedia, https://en.wikipedia.org/wiki/Ecliptic_coordinate_system ↩︎

  2. Horizontal coordinate system - Wikipedia, https://en.wikipedia.org/wiki/Horizontal_coordinate_system ↩︎

  3. Hour angle - Wikipedia, https://en.wikipedia.org/wiki/Hour_angle ↩︎

Core Concepts in FEA

0

Before we start, some basic mathematic theorem[1][2].

Divergence

v=vi,i∇·v = v_{i,i}

T=Tij,iej∇·T = T_{ij,i} e_j

Gradient (dim+1)

ϕ=ϕ,iei∇\phi = \phi_{,i} e_i

v=vi,jeiej∇v = v_{i,j} e_i⊗e_j

T=Tij,keiejek∇T = T_{ij,k} e_i⊗e_j⊗e_k

Curl (dim=)

×v=εijkvj,iek∇ × v =ε_{ijk} v_{j,i} e_k

×T=εijkTmj,iekem∇ × T =ε_{ijk} T_{mj,i} e_k⊗e_m

The product rule of differentiation

σν=σijνjei\because \bm{σ}·\bm{\nu} = \bm{σ}_{ij}\bm{\nu}_j e_i

(σν)=(σijνj),i=σij,iνj+σijνj,i\therefore ∇·(\bm{σ}·\bm{\nu}) = (\bm{σ}_{ij}\bm{\nu}_j)_{,i} = \bm{σ}_{ij,i}\bm{\nu}_j + \bm{σ}_{ij}\bm{\nu}_{j,i}

also

(σ)ν=σij,iνj(∇·\bm{σ})·\bm{\nu} = \bm{σ}_{ij,i} \bm{\nu}_j

ν:σ=νi,jσji∇\bm{\nu} : \bm{σ} = \bm{\nu}_{i,j}\bm{σ}_{ji}

or as Prof. Zohdi suggested

ν:σ=νi,jσij∇\bm{\nu} : \bm{σ} = \bm{\nu}_{i,j}\bm{σ}_{ij}

but since σ\bm{σ} is symmetric

σij=σji\bm{σ}_{ij} = \bm{σ}_{ji}

therefore

(σν)=(σ)ν+ν:σ(1)\tag{1} ∇·(\bm{σ}·\bm{\nu}) = (∇·\bm{σ})·\bm{\nu} + ∇\bm{\nu} : \bm{σ}

Divergence Theorem

RϕndA=RϕdV∫_{∂R} \phi n dA = ∫_{R} ∇·\phi dV

RvndA=RvdV(2)\tag{2} ∫_{∂R} \bm{v}·n dA = ∫_{R} ∇·\bm{v} dV

RTndA=RTdV∫_{∂R} \bm{T} n dA = ∫_{R} ∇·\bm{T} dV

or

RϕnidA=Rϕ,idV∫_{∂R} \phi n_i dA = ∫_{R} \phi_{,i} dV

RvinidA=Rvi,idV∫_{∂R} v_i n_i dA = ∫_{R} v_{i,i} dV

RTijnjdA=RTij,jdV∫_{∂R} T_{ij}n_j dA = ∫_{R} T_{ij,j} dV

Stokes theorem

Cϕdx=Sn×ϕdA∫_{C} \phi d\bm{x} = ∫_{S} n × ∇\phi dA

Cvdx=Sn×vdA∫_{C} v·d\bm{x} = ∫_{S} n·∇×v dA

CTdx=S(×T)TndA∫_{C} T d\bm{x} = ∫_{S} (∇×T)^T n dA

or

Cϕdxi=Sεijknjϕ,kdA∫_{C} \phi dx_i = ∫_{S} ε_{ijk} n_j \phi_{,k} dA

Cvidxi=Sniεijkvk,jdA∫_{C} v_i dx_i = ∫_{S} n_i ε_{ijk} v_{k,j} dA

CTijdxj=SεjpqTiq,pnjdA∫_{C} T_{ij} dx_j = ∫_{S} ε_{jpq} T_{iq,p} n_j dA

1

The SMALL deformation of the body is governed by (strong form):

(IE:u)+ρg=0∇⋅(\bm{IE}:∇\bm{u})+ρ\bm{g}=\bm{0}

since

σ=IE:u\bm{σ} = \bm{IE}:∇\bm{u}

let

f=ρg\bm{f} = ρ\bm{g}

thus

σ+f=0∇·\bm{σ} + \bm{f} = 0

so we can write

Ω(σ+f)νdΩ=0∫_Ω (∇·\bm{σ} + \bm{f} ) · \bm{\nu} dΩ = 0

using (1)(1)

Ω((σν)ν:σ)dΩ+ΩfνdΩ=0∫_Ω (∇·(\bm{σ}·\bm{\nu})-∇\bm{\nu}:\bm{σ}) dΩ + ∫_Ω \bm{f}·\bm{\nu} dΩ = 0

using (2)(2)

Ων:σdΩ=ΩfνdΩ+ΩσνndA∫_Ω ∇\bm{\nu}:\bm{σ} dΩ = ∫_Ω \bm{f}·\bm{\nu} dΩ + ∫_{∂Ω} \bm{σ}·\bm{\nu}·n dA

because

t=σn\bm{t} = \bm{σ}·\bm{n}

therefore

Ων:σdΩ=ΩfνdΩ+ΓttνdA∫_Ω ∇\bm{\nu}:\bm{σ} dΩ = ∫_Ω \bm{f}·\bm{\nu} dΩ + ∫_{Γ_t} \bm{t}·\bm{\nu} dA

so we have the weak form

Find u,uΓu=u, such that ν,νΓu=0Ων:IE:udΩ=ΩfνdΩ+ΓttνdA\begin{array}{lcr} \text{Find }\bm{u}, \bm{u}|_{Γ_u} = \bm{u}^* \text{, such that }∀\bm{\nu}, \bm{\nu}|_{Γ_u}= 0 \\ \displaystyle∫_Ω ∇\bm{\nu}:\bm{IE}:∇\bm{u} dΩ = ∫_Ω \bm{f}·\bm{\nu} dΩ + ∫_{Γ_t} \bm{t}·\bm{\nu} dA \end{array}

where uu^* is the applied boundary displacement on ΓuΓ_u, t=tt = t^* on ΓtΓ_t

since the integrals must be finite, we improve the weak form as below

Find uH1(Ω),uΓu=u, such that νH1(Ω),νΓu=0Ων:IE:udΩ=ΩfνdΩ+ΓttνdA\begin{array}{lcr} \text{Find }\bm{u} ∈ \bm{H}^1(Ω), \bm{u}|_{Γ_u} = u^* \text{, such that }∀\bm{\nu} ∈ \bm{H}^1(Ω), \bm{\nu}|_{Γ_u}= 0 \\ \displaystyle∫_Ω ∇\bm{\nu}:\bm{IE}:∇\bm{u} dΩ = ∫_Ω \bm{f}·\bm{\nu} dΩ + ∫_{Γ_t} \bm{t}·\bm{\nu} dA \end{array}

where

H1(Ω):=[H1(Ω)]3\bm{H}^1(Ω) \vcentcolon= [H^1(Ω)]^3

explained as below


similar to the definition of uH1(Ω)u ∈ H^1(Ω) which states

uH1(Ω) if uH1(Ω)2:=Ωu,ju,jdΩ+ΩuudΩ<u ∈ H^1(Ω) \text{ if } ||u||_{H^1(Ω)}^2 \vcentcolon= ∫_Ω u_{,j}u_{,j} dΩ + ∫_Ω uudΩ < \infty

the definition of uH1(Ω)\bm{u} ∈ \bm{H}^1(Ω) states as below

uH1(Ω) if uH1(Ω)2:=Ωui,jui,jdΩ+ΩuiuidΩ<\bm{u} ∈ \bm{H}^1(Ω) \text{ if } ||\bm{u}||_{\bm{H}^1(Ω)}^2 \vcentcolon= ∫_Ω u_{i,j}u_{i,j} dΩ + ∫_Ω u_iu_idΩ < \infty


2

should u\bm{u}^* be different from the applied boundary displacement on ΓuΓ_u, weak form can be stated as below

Find uH1(Ω), such that νH1(Ω)Ων:IE:udΩ=ΩfνdΩ+ΓttνdA+PΓu(uu)νdA(3)\tag{3} \begin{array}{lcr} \text{Find }\bm{u} ∈ \bm{H}^1(Ω) \text{, such that }∀\bm{\nu} ∈ \bm{H}^1(Ω) \\ \displaystyle∫_Ω ∇\bm{\nu}:\bm{IE}:∇\bm{u} dΩ = ∫_Ω \bm{f}·\bm{\nu} dΩ + ∫_{Γ_t} \bm{t}·\bm{\nu} dA + P^\star∫_{Γ_u} (\bm{u}^*-\bm{u})·\bm{\nu} dA \end{array}

or

Find uH1(Ω), such that νH1(Ω)Ωνi,jIEijkluk,ldΩ=ΩfiνidΩ+ΓttiνidA+PΓuuiνiuiνidA\begin{array}{lcr} \text{Find }\bm{u} ∈ \bm{H}^1(Ω) \text{, such that }∀\bm{\nu} ∈ \bm{H}^1(Ω) \\ \displaystyle∫_Ω \nu_{i,j} IE_{ijkl} u_{k,l} dΩ = ∫_Ω f_i \nu_i dΩ + ∫_{Γ_t} t_i \nu_i dA + P^\star∫_{Γ_u} u^*_i \nu_i - u_i \nu_i dA \end{array}

where the (penalty) parameter PP^\star is a large positive number.

3

To have

{ϕ^i(ζ1,ζ2,ζ3)=1 , ζ1=ζi1,ζ2=ζi2,ζ3=ζi3ϕ^i(ζ1,ζ2,ζ3)=0 , others\begin{cases} \hat{\phi}_i(\zeta_1,\zeta_2,\zeta_3) = 1 &\text{ , } \zeta_1=\zeta_{i1},\zeta_2=\zeta_{i2},\zeta_3=\zeta_{i3} \\ \hat{\phi}_i(\zeta_1,\zeta_2,\zeta_3) = 0 &\text{ , } \text{others} \end{cases}

for each ϕ^i\hat{\phi}_i 8 functions (for each of the 8 points) with 8 unknowns, aka. ζ1mζ2nζ3k\zeta_1^m \zeta_2^n \zeta_3^k where m,n,k=0,1m,n,k=0,1 can be derived, leading to the only solution as following

{ϕ^1=18(1ζ1)(1ζ2)(1ζ3)ϕ^2=18(1+ζ1)(1ζ2)(1ζ3)ϕ^3=18(1+ζ1)(1+ζ2)(1ζ3)ϕ^4=18(1ζ1)(1+ζ2)(1ζ3)ϕ^5=18(1ζ1)(1ζ2)(1+ζ3)ϕ^6=18(1+ζ1)(1ζ2)(1+ζ3)ϕ^7=18(1+ζ1)(1+ζ2)(1+ζ3)ϕ^8=18(1ζ1)(1+ζ2)(1+ζ3)\begin{cases} \hat{\phi}_1 = \frac{1}{8} (1-\zeta_1) (1-\zeta_2) (1-\zeta_3) \\ \hat{\phi}_2 = \frac{1}{8} (1+\zeta_1) (1-\zeta_2) (1-\zeta_3) \\ \hat{\phi}_3 = \frac{1}{8} (1+\zeta_1) (1+\zeta_2) (1-\zeta_3) \\ \hat{\phi}_4 = \frac{1}{8} (1-\zeta_1) (1+\zeta_2) (1-\zeta_3) \\ \hat{\phi}_5 = \frac{1}{8} (1-\zeta_1) (1-\zeta_2) (1+\zeta_3) \\ \hat{\phi}_6 = \frac{1}{8} (1+\zeta_1) (1-\zeta_2) (1+\zeta_3) \\ \hat{\phi}_7 = \frac{1}{8} (1+\zeta_1) (1+\zeta_2) (1+\zeta_3) \\ \hat{\phi}_8 = \frac{1}{8} (1-\zeta_1) (1+\zeta_2) (1+\zeta_3) \end{cases}

4

IE\bm{IE} has the following symmetries [2:1][3]

IEijkl=IEklij=IEjikl=IEijlkIE_{ijkl} = IE_{klij} = IE_{jikl} = IE_{ijlk}

allowing us to rewrite (3)(3) in a more compact matrix form

Ω([D]{ν})T[IE]([D]{u})dΩ=Ω{ν}T{f}dΩ+Γt{ν}T{t}dA+PΓu{ν}T{uu}dA(4)\tag{4} \begin{aligned} ∫_Ω ([\bm{D}]\{\bm{\nu}\})^T [\bm{IE}] ([\bm{D}]\{\bm{u}\}) dΩ = &∫_Ω \{\bm{\nu}\}^T\{\bm{f}\} dΩ \\ &+ ∫_{Γ_t} \{\bm{\nu}\}^T\{\bm{t}^*\} dA \\ &+ P^\star∫_{Γ_u} \{\bm{\nu}\}^T\{\bm{u}^*-\bm{u}\} dA \end{aligned}

where

[D]:=[x1000x2000x3x2x100x3x2x30x1],{u}:={u1u2u3},{f}:={f1f2f3},{t}:={t1t2t3},(5)\tag{5} [\bm{D}] \vcentcolon = \begin{bmatrix} \cfrac{∂}{∂x_1} & 0 & 0 \\ 0 & \cfrac{∂}{∂x_2} & 0 \\ 0 & 0 & \cfrac{∂}{∂x_3} \\ \cfrac{∂}{∂x_2} & \cfrac{∂}{∂x_1} & 0 \\ 0 & \cfrac{∂}{∂x_3} & \cfrac{∂}{∂x_2} \\ \cfrac{∂}{∂x_3} & 0 & \cfrac{∂}{∂x_1} \\ \end{bmatrix}, \{\bm{u}\} \vcentcolon = \begin{Bmatrix} u_1 \\ u_2 \\ u_3 \\ \end{Bmatrix}, \{\bm{f}\} \vcentcolon = \begin{Bmatrix} f_1 \\ f_2 \\ f_3 \\ \end{Bmatrix}, \{\bm{t}^*\} \vcentcolon = \begin{Bmatrix} t^*_1 \\ t^*_2 \\ t^*_3 \\ \end{Bmatrix},