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},

and [IE][\bm{IE}] is the elastic stiffness matrix of the material.

[IE]:=[IE1111IE1122IE1133IE1112IE1123IE1113IE2211IE2222IE2233IE2212IE2223IE2213IE3311IE3322IE3333IE3312IE3323IE3313IE1211IE1222IE1233IE1212IE1223IE1213IE2311IE2322IE2333IE2312IE2323IE2313IE1311IE1322IE1333IE1312IE1323IE1313][\bm{IE}] \vcentcolon = \begin{bmatrix} IE_{1111} & IE_{1122} & IE_{1133} & IE_{1112} & IE_{1123} & IE_{1113} \\ IE_{2211} & IE_{2222} & IE_{2233} & IE_{2212} & IE_{2223} & IE_{2213} \\ IE_{3311} & IE_{3322} & IE_{3333} & IE_{3312} & IE_{3323} & IE_{3313} \\ IE_{1211} & IE_{1222} & IE_{1233} & IE_{1212} & IE_{1223} & IE_{1213} \\ IE_{2311} & IE_{2322} & IE_{2333} & IE_{2312} & IE_{2323} & IE_{2313} \\ IE_{1311} & IE_{1322} & IE_{1333} & IE_{1312} & IE_{1323} & IE_{1313} \\ \end{bmatrix}


Further rewrite {uh}\{\bm{u}^h\}

{uh}=[ϕ]{a}(6)\tag{6} \{\bm{u}^h\} = [\phi]\{\bm{a}\}

where

{a}:={a1a2a3...a3N},[ϕ]:=[ϕ1ϕ2...ϕNϕ1ϕ2...ϕNϕ1ϕ2...ϕN],\{\bm{a}\} \vcentcolon = \begin{Bmatrix} a_1 \\ a_2 \\ a_3 \\ .\\ .\\ .\\ a_{3N}\\ \end{Bmatrix}, [\phi] \vcentcolon = \begin{bmatrix} \phi_1 & \phi_2 & ... & \phi_N & & & & & & & & \\ & & & & \phi_1 & \phi_2 & ... & \phi_N & & & & \\ & & & & & & & & \phi_1 & \phi_2 & ... & \phi_N \\ \end{bmatrix},

choose ν\bm{\nu} with the same basis, but a different linear combination

{νh}=[ϕ]{b}(7)\tag{7} \{\bm{\nu}^h\} = [\phi]\{\bm{b}\}

with (6),(7)(6),(7) we can rewrite (4)(4)

Ω([D][ϕ]{b})T[IE]([D][ϕ]{a})dΩ=Ω([ϕ]{b})T{f}dΩ+Γt([ϕ]{b})T{t}dA+PΓu([ϕ]{b})T{u[ϕ]{a}}dA(8)\tag{8} \begin{aligned} ∫_Ω ([\bm{D}][\phi]\{\bm{b}\})^T [\bm{IE}] ([\bm{D}][\phi]\{\bm{a}\}) dΩ = &∫_Ω ([\phi]\{\bm{b}\})^T\{\bm{f}\} dΩ \\ & + ∫_{Γ_t} ([\phi]\{\bm{b}\})^T\{\bm{t}^*\} dA \\ & + P^\star∫_{Γ_u} ([\phi]\{\bm{b}\})^T\{\bm{u}^*-[\phi]\{\bm{a}\}\} dA \end{aligned}


We can rewrite (8)(8)

{b}T{[K]{a}{R}}=0\{\bm{b}\}^T \{ [\bm{K}] \{\bm{a}\} - \{\bm{R}\} \} = 0

where

[K]:=Ω([D][ϕ])T[IE]([D][ϕ])dΩ+PΓu[ϕ]T[ϕ]dA(9)\tag{9} [\bm{K}] \vcentcolon = ∫_Ω ([\bm{D}][\phi])^T [\bm{IE}] ([\bm{D}][\phi]) dΩ + P^\star∫_{Γ_u} [\phi]^T[\phi] dA

{R}:=Ω[ϕ]T{f}dΩ+Γt[ϕ]T{t}dA+PΓu[ϕ]T{u}dA(10)\tag{10} \{\bm{R}\} \vcentcolon = ∫_Ω [\phi]^T\{\bm{f}\} dΩ + ∫_{Γ_t} [\phi]^T\{\bm{t}^*\} dA + P^\star∫_{Γ_u} [\phi]^T\{\bm{u}^*\} dA


Consider

[K]=e=1Ne[K]e[\bm{K}] = \sum_{e=1}^{N_e}{[\bm{K}]^e}

we can rewrite (9),(10)(9),(10) for e=1,2..,Nee=1,2..,N_e

[K]e:=Ωe([D][ϕ])T[IE]([D][ϕ])dΩe+PΓu,e[ϕ]T[ϕ]dAe(11)\tag{11} [\bm{K}]^e \vcentcolon = ∫_{Ω_e} ([\bm{D}][\phi])^T [\bm{IE}] ([\bm{D}][\phi]) dΩ_e + P^\star∫_{Γ_{u,e}} [\phi]^T[\phi] dA_e

{R}e:=Ωe[ϕ]T{f}dΩe+Γt,e[ϕ]T{t}dAe+PΓu,e[ϕ]T{u}dAe(12)\tag{12} \{\bm{R}\}^e \vcentcolon = ∫_{Ω_e} [\phi]^T\{\bm{f}\} dΩ_e + ∫_{Γ_{t,e}} [\phi]^T\{\bm{t}^*\} dA_e + P^\star∫_{Γ_{u,e}} [\phi]^T\{\bm{u}^*\} dA_e

where

Γu,e=ΓuΩeΓ_{u,e} = Γ_u ∩ ∂Ω_e

Γt,e=ΓtΩeΓ_{t,e} = Γ_t ∩ ∂Ω_e

5

In 3D,

[ϕ^]:=[ϕ^1ϕ^2...ϕ^8ϕ^1ϕ^2...ϕ^8ϕ^1ϕ^2...ϕ^8][\hat\phi] \vcentcolon = \begin{bmatrix} \hat\phi_1 & \hat\phi_2 & ... & \hat\phi_8 & & & & & & & & \\ & & & & \hat\phi_1 & \hat\phi_2 & ... & \hat\phi_8 & & & & \\ & & & & & & & & \hat\phi_1 & \hat\phi_2 & ... & \hat\phi_8 \\ \end{bmatrix}

express [D][\bm{D}] in terms ζ1,ζ2,ζ3ζ_1, ζ_2, ζ_3

[D(ϕ(x1,x2,x3))]=[D^ϕ(Mx1(ζ1,ζ2,ζ3),Mx2(ζ1,ζ2,ζ3),Mx3(ζ1,ζ2,ζ3))][D(\phi(x1, x2, x3))] = [\hat D \phi(M_{x_1}(ζ1, ζ2, ζ3),M_{x_2}(ζ1, ζ2, ζ3),M_{x_3}(ζ1, ζ2, ζ3))]

so that

[D^]=[ζiζix1000ζiζix2000ζiζix3ζiζix2ζiζix100ζiζix3ζiζix2ζiζix30ζiζix1][\hat \bm{D}] = \begin{bmatrix} \cfrac{∂}{ζ_i}\cfrac{ζ_i}{∂x_1} & 0 & 0 \\ 0 & \cfrac{∂}{ζ_i}\cfrac{ζ_i}{∂x_2} & 0 \\ 0 & 0 & \cfrac{∂}{ζ_i}\cfrac{ζ_i}{∂x_3} \\ \cfrac{∂}{ζ_i}\cfrac{ζ_i}{∂x_2} & \cfrac{∂}{ζ_i}\cfrac{ζ_i}{∂x_1} & 0 \\ 0 & \cfrac{∂}{ζ_i}\cfrac{ζ_i}{∂x_3} & \cfrac{∂}{ζ_i}\cfrac{ζ_i}{∂x_2} \\ \cfrac{∂}{ζ_i}\cfrac{ζ_i}{∂x_3} & 0 & \cfrac{∂}{ζ_i}\cfrac{ζ_i}{∂x_1} \\ \end{bmatrix}

therefore

[D^][ϕ^]=[ϕ^1ζiζix1ϕ^2ζiζix1...ϕ^8ζiζix1ϕ^1ζiζix2ϕ^2ζiζix2...ϕ^8ζiζix2ϕ^1ζiζix3ϕ^2ζiζix3...ϕ^8ζiζix3ϕ^1ζiζix2ϕ^2ζiζix2...ϕ^8ζiζix2ϕ^1ζiζix1ϕ^2ζiζix1...ϕ^8ζiζix1ϕ^1ζiζix3ϕ^2ζiζix3...ϕ^8ζiζix3ϕ^1ζiζix2ϕ^2ζiζix2...ϕ^8ζiζix2ϕ^1ζiζix3ϕ^2ζiζix3...ϕ^8ζiζix3ϕ^1ζiζix1ϕ^2ζiζix1...ϕ^8ζiζix1][\hat \bm{D}][\hat\phi] = \begin{bmatrix} \cfrac{∂\hat\phi_1}{ζ_i}\cfrac{ζ_i}{∂x_1} & \cfrac{∂\hat\phi_2}{ζ_i}\cfrac{ζ_i}{∂x_1} & ... & \cfrac{∂\hat\phi_8}{ζ_i}\cfrac{ζ_i}{∂x_1} & & & & & & & \\ & & & & \cfrac{∂\hat\phi_1}{ζ_i}\cfrac{ζ_i}{∂x_2} & \cfrac{∂\hat\phi_2}{ζ_i}\cfrac{ζ_i}{∂x_2} & ... & \cfrac{∂\hat\phi_8}{ζ_i}\cfrac{ζ_i}{∂x_2} & & & \\ & & & & & & & & \cfrac{∂\hat\phi_1}{ζ_i}\cfrac{ζ_i}{∂x_3} & \cfrac{∂\hat\phi_2}{ζ_i}\cfrac{ζ_i}{∂x_3} & ... & \cfrac{∂\hat\phi_8}{ζ_i}\cfrac{ζ_i}{∂x_3} \\ \cfrac{∂\hat\phi_1}{ζ_i}\cfrac{ζ_i}{∂x_2} & \cfrac{∂\hat\phi_2}{ζ_i}\cfrac{ζ_i}{∂x_2} & ... & \cfrac{∂\hat\phi_8}{ζ_i}\cfrac{ζ_i}{∂x_2} & \cfrac{∂\hat\phi_1}{ζ_i}\cfrac{ζ_i}{∂x_1} & \cfrac{∂\hat\phi_2}{ζ_i}\cfrac{ζ_i}{∂x_1} & ... & \cfrac{∂\hat\phi_8}{ζ_i}\cfrac{ζ_i}{∂x_1} & & & \\ & & & & \cfrac{∂\hat\phi_1}{ζ_i}\cfrac{ζ_i}{∂x_3} & \cfrac{∂\hat\phi_2}{ζ_i}\cfrac{ζ_i}{∂x_3} & ... & \cfrac{∂\hat\phi_8}{ζ_i}\cfrac{ζ_i}{∂x_3} & \cfrac{∂\hat\phi_1}{ζ_i}\cfrac{ζ_i}{∂x_2} & \cfrac{∂\hat\phi_2}{ζ_i}\cfrac{ζ_i}{∂x_2} & ... & \cfrac{∂\hat\phi_8}{ζ_i}\cfrac{ζ_i}{∂x_2} \\ \cfrac{∂\hat\phi_1}{ζ_i}\cfrac{ζ_i}{∂x_3} & \cfrac{∂\hat\phi_2}{ζ_i}\cfrac{ζ_i}{∂x_3} & ... & \cfrac{∂\hat\phi_8}{ζ_i}\cfrac{ζ_i}{∂x_3} & & & & & \cfrac{∂\hat\phi_1}{ζ_i}\cfrac{ζ_i}{∂x_1} & \cfrac{∂\hat\phi_2}{ζ_i}\cfrac{ζ_i}{∂x_1} & ... & \cfrac{∂\hat\phi_8}{ζ_i}\cfrac{ζ_i}{∂x_1} \\ \end{bmatrix}

with Gaussian Quadrature

0LF(x)dx=11F(x(ζ))J(ζ)dζ=1GwiF(ζi)J(ζi)\int_0^L{F(x)dx} = \int_{-1}^1{F(x(\zeta))J(\zeta)d\zeta} = \sum_1^G{w_i}F(\zeta_i)J(\zeta_i)

we can rewrite (11),(12)(11),(12)

[K]e=1G1G1Gwqwrws([D^][ϕ^])T[IE^][D^][ϕ^]J+P1G1Gwqwr[ϕ]T[ϕ]Js[\bm{K}]^e = \sum_1^G{\sum_1^G{\sum_1^G{w_q w_r w_s ([\hat \bm{D}][\hat\phi])^T[\hat{\bm{IE}}][\hat \bm{D}][\hat\phi]J}}}+ P^\star\sum_1^G{\sum_1^G{w_q w_r [\phi]^T[\phi] J_s}}

{R}e=1G1G1Gwqwrws[ϕ]T{f}J+1G1Gwqwr[ϕ]T{t}Js+P1G1Gwqwr[ϕ]T{u}Js\{\bm{R}\}^e = \sum_1^G{\sum_1^G{\sum_1^G{w_q w_r w_s [\phi]^T\{\bm{f}\} J}}} + \sum_1^G{\sum_1^G{w_q w_r[\phi]^T\{\bm{t}^*\} J_s}} + P^\star\sum_1^G{\sum_1^G{w_q w_r [\phi]^T\{\bm{u}^*\} J_s}}

where

F:=x(ζ1,ζ2,ζ3)\bm{F} \vcentcolon= ∇x(ζ_1,ζ_2,ζ_3)

J:=FJ \vcentcolon= |\bm{F}|

and

Js=JFTNnJ_s = J\bm{F}^{-T}·\bm{N}·\bm{n}

derived as below


Nanson’s formula

ndAe=JFTNdAe^\bm{n} dA_e = J\bm{F}^{-T}·\bm{N} d\hat{Ae}

where AeA_e is an area of a region in the current configuration, Ae^\hat{Ae} is the same area in the reference configuration, and n\bm{n} is the outward normal to the area element in the current configuration while N\bm{N} is the outward normal in the reference configuration.

multiply n\bm{n} on both sides

dAe=JFTNndAe^dA_e = J\bm{F}^{-T}·\bm{N}·\bm{n} d\hat{Ae}

therefore

Js=JFTNnJ_s = J\bm{F}^{-T}·\bm{N}·\bm{n}


6

6.1

(IKθ)+ρs=0∇⋅(\bm{IK}⋅∇θ)+ρs=0

let the heat flux density[4] qq

q=IKθ\bm{q} = \bm{IK}⋅∇θ

and let

f=ρsf = ρs

therefore

q+f=0∇⋅\bm{q} + f = 0

so we can write

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

now consider

(q)ν=qi,iν(∇⋅\bm{q})·\nu = q_{i,i}\nu

(qν)=(qiν),i=qi,iν+qiν,i∇⋅(\bm{q}\nu) = (q_i \nu)_{,i} = q_{i,i}\nu + q_i \nu_{,i}

(ν)q=qiν,i(∇\nu)·\bm{q} = q_i \nu_{,i}

therefore we can write (13)(13) as

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

Ω(ν)qdΩ=ΩfνdΩ+Ω(qν)∫_Ω (∇\nu)·\bm{q} dΩ = ∫_Ω f\nu dΩ + ∫_Ω ∇⋅(\bm{q}\nu)

using (2)(2)

Ω(ν)qdΩ=ΩfνdΩ+ΩqnνdA∫_Ω (∇\nu)·\bm{q} dΩ = ∫_Ω f\nu dΩ + ∫_{∂Ω} \bm{q}⋅\bm{n} \nu dA

so we have the weak form

Find θH1(Ω),θΓθ=θ, such that νH1(Ω),νΓθ=0Ω(ν)IKθdΩ=ΩfνdΩ+ΩqnνdA\begin{array}{lcr} \text{Find }θ ∈ H^1(Ω), θ|_{Γ_θ} = θ^* \text{, such that }∀\nu ∈ H^1(Ω), \nu|_{Γ_θ}= 0 \\ \displaystyle∫_Ω (∇\nu)·\bm{IK}⋅∇θ dΩ = ∫_Ω f \nu dΩ + ∫_{∂Ω} \bm{q}⋅\bm{n} \nu dA \end{array}

6.2

should θθ^* be different from the applied boundary displacement on ΓθΓ_θ, weak form can be stated as below

Find θH1(Ω),θΓθ=θ, such that νH1(Ω),νΓθ=0Ω(ν)IKθdΩ=ΩfνdΩ+ΩqnνdA+PΓθ(θθ)νdA(14)\tag{14} \begin{array}{lcr} \text{Find }θ ∈ H^1(Ω), θ|_{Γ_θ} = θ^* \text{, such that }∀\nu ∈ H^1(Ω), \nu|_{Γ_θ}= 0 \\ \displaystyle∫_Ω (∇\nu)·\bm{IK}⋅∇θ dΩ = ∫_Ω f \nu dΩ + ∫_{∂Ω} \bm{q}⋅\bm{n} \nu dA + P^\star∫_{Γ_θ} (θ^*-θ) \nu dA \end{array}

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

6.3

same as 3

6.4

rewrite θhθ^h

θh=[ϕ]{a}=ϕiai(15)\tag{15} θ^h = [\phi]\{\bm{a}\} = \phi_i a_i

where

{a}:={a1a2a3...aN},[ϕ]:=[ϕ1ϕ2...ϕN],\{\bm{a}\} \vcentcolon = \begin{Bmatrix} a_1 \\ a_2 \\ a_3 \\ .\\ .\\ .\\ a_{N}\\ \end{Bmatrix}, [\phi] \vcentcolon = \begin{bmatrix} \phi_1 & \phi_2 & ... & \phi_N \end{bmatrix},

choose ν\bm{\nu} with the same basis, but a different linear combination

νh=[ϕ]{b}=ϕjbj(16)\tag{16} \nu^h = [\phi]\{\bm{b}\} = \phi_j b_j

with (15),(16)(15),(16) we can rewrite (14)(14)

Ω([ϕ]{b})IK[ϕ]{a}dΩ=Ωf[ϕ]{b}dΩ+Ωqn[ϕ]{b}dA+PΓθ(θ[ϕ]{a})[ϕ]{b}dA(17)\tag{17} \begin{aligned} ∫_Ω (∇[\phi]\{\bm{b}\})·\bm{IK}⋅∇[\phi]\{\bm{a}\} dΩ = & ∫_Ω f [\phi]\{\bm{b}\} dΩ \\ & + ∫_{∂Ω} \bm{q}⋅\bm{n} [\phi]\{\bm{b}\} dA \\ & + P^\star∫_{Γ_θ} (θ^*-[\phi]\{\bm{a}\})·[\phi]\{\bm{b}\} dA \end{aligned}


We can rewrite (17)(17)

{b}T{K{a}{R}}=0\{\bm{b}\}^T \{ K \{\bm{a}\} - \{\bm{R}\} \} = 0

where

K:=Ω([ϕ])IK[ϕ]dΩ+PΓθ[ϕ]T[ϕ]dA(18)\tag{18} K \vcentcolon = ∫_Ω (∇[\phi])·\bm{IK}⋅∇[\phi] dΩ + P^\star∫_{Γ_θ} [\phi]^T[\phi] dA

{R}:=Ω[ϕ]TfdΩ+Ω[ϕ]TqndA+PΓθ[ϕ]TθdA(19)\tag{19} \{\bm{R}\} \vcentcolon = ∫_Ω [\phi]^Tf dΩ + ∫_{∂Ω} [\phi]^T\bm{q}⋅\bm{n} dA + P^\star∫_{Γ_θ} [\phi]^Tθ^* dA


Consider

K=e=1NeKeK= \sum_{e=1}^{N_e}K^e

we can rewrite (18),(19)(18),(19) for e=1,2..,Nee=1,2..,N_e

Ke:=Ωe([ϕ])IK[ϕ]dΩe+PΓu,e[ϕ]T[ϕ]dAeK^e \vcentcolon = ∫_{Ω_e} (∇[\phi])·\bm{IK}⋅∇[\phi] dΩ_e + P^\star∫_{Γ_{u,e}} [\phi]^T[\phi] dA_e

{R}e:=Ωe[ϕ]TfdΩe+Ω,e[ϕ]TqndAe+PΓu,e[ϕ]TθdAe\{\bm{R}\}^e \vcentcolon = ∫_{Ω_e} [\phi]^Tf dΩ_e + ∫_{∂Ω,e} [\phi]^T\bm{q}⋅\bm{n} dA_e + P^\star∫_{Γ_{u,e}} [\phi]^Tθ^* dA_e

where

Γθ,e=ΓθΩeΓ_{θ,e} = Γ_θ ∩ ∂Ω_e

7

Key difference is that the diemsion of the equations derived for thermodynamics are generally lower than those for linear elasticity.

This is because θθ and ss are scalers rather than vectors as u\bm{u} and g\bm{g}, and IK\bm{IK} is a second order tensor rather than a forth order tensor as IE\bm{IE}.

Reference


  1. Tensor derivative (continuum mechanics) Cartesian coordinates, https://en.wikipedia.org/wiki/Tensor_derivative_(continuum_mechanics)#Cartesian_coordinates_2 ↩︎

  2. Lallit Anand and Sanjay Govindjee, 2019, Introduction to Continuum Mechanics of Solid ↩︎ ↩︎

  3. Allan F. Bower, 2012, Applied Mechanics of Solids, Chapter 3 ↩︎

  4. Thermal conduction differential form, https://en.wikipedia.org/wiki/Thermal_conduction#Differential_form ↩︎

Anti Chinese Sentiment

'Unfavorable views' of China reach historic highs, new report finds

Reality

It's been an issue since several years ago, or maybe longer as Wikipedia suggests. Last year when I was taking LP380 I discussed this problem with Prof. Ellan, a democrat. As most left-wing Americans would recognize such an issue and blame it on racism, it's not within their power to solve it. There are way more people holding different options, no matter holding themselves as racist or not.

Read More

Politicized virus and sins of government

Who is responsible

Who should be blamed for a pandemic event? Several choices:

Read More

Procrastinator’s dark playground

Inside the mind of a master procrastinator | Tim Urban

Youtube has successfully identified me as a procrastinator so it sent me this.

Read More

WordPress PHP short code to parse markdown

Requirements to include a markdown file from elsewhere emerged when I decide to auto update my blog with github readme page.

Since markdown itself cannot include another markdown file, I come up with a work around to parse the github raw on the air.

The following example requires wp-githuber-md - since I am already using it anyway. Any equivalent will do.

/*====== parse_md shortcode ======*/
function parse_md($atts = [])
{
	$src = $atts['src'];
    $md = file_get_contents($src);

    if ($md === false)
	{
		$html = "Could not load $src";
	}
	else
	{
        require_once $_SERVER['DOCUMENT_ROOT'] . "/wp-content/plugins/wp-githuber-md/src/Modules/MarkdownParser.php";
		$markdownParser = new Githuber\Module\MarkdownParser;
		$html = $markdownParser->transform($md);
	}

    return $html;
}
add_shortcode( 'parse_md', 'parse_md' );

Usage

[parse_md src="<url>]

流媒体平台与垄断

往大里说,垄断完大家都没好果子吃。
往小里说,听音乐的方案现在已经由一个软件转化成了多个部分。

  • 听新歌:网易云日推仍然是不错的选择,搭配unblockneteasemusic可以基本覆盖国内流媒体的资源。Spotify备选。
  • 下载 :musictools.exe, spotdl
  • 整理 :music-organizer.py, mp3tag
  • 歌单 :netease-cloudmusic-playlist-exporter
  • 听老歌:foobar2000
  • 安卓 :adb-sync

若是在七年前,上述方案已经简直不要太完美,下载的歌曲配合iTunes便能实现多终端同步,而现在连Apple都转向做流媒体了。
流媒体的到来改变了一切。尝到了流媒体的便捷,再往回走就显得格外困难。
从好处说,流媒体音乐平台极大扩充了音乐来源,保护了音乐版权,激励了音乐人的创作。
往坏处说,垄断的平台使用户丧失了议价的能力,长远来看也会侵蚀音乐人的权益。
垄断平台甚至不需要完全阻断用户的自行方案,他们需要做的只是尽量抬高其他方案的实现门槛。只要他们的方案简单易用并且掌握了大量用户群体,便无需再为用户考虑,躺着数钱即可。
举例来说网易云已经从最开始的自由听歌下载变成了基本不能下载,部分歌曲仅能试听,用来笼络顾客的云盘也基本报废(Edit-20200731 不稳定)。

版权完善方向看,音乐流媒体化是大势所趋。
从道德角度上讲,所有媒体,但凡未曾声明自由传播,都不是免费的。互联网成为盗版的温床正是因为少数人的盗版行为(做种的,上传的,开服务器的,以及许多流媒体平台的早期),配合上法律的漏洞,为普罗大众的盗版行为提供了便捷的借口。
让人感到不安的是,为了保护版权所付出的代价事实上正从用户身上提取。在过去,获得的音乐便是实实在在的文件,如何管理,放在那里听都是用户的选择,也正是这种极大的自由促生了盗版。而现如今,流媒体服务商正以一种廉价的方式提供加密版的文件或数据流以阻止这类自由使用,并同时把越来越多的受众捆绑在自己的平台上,反馈于垄断的加剧。

一方面我认为保护版权不应当以损害用户的自由为代价,另一方面,事实上盗版这类社会问题最终也只能通过社会的协商和妥协来解决,这意味着必须有群体让出曾经享受的权益。对用户,付费的流媒体和不再自由的音乐文件便是代价。对音乐人,凭空出现的中间商保护费保护了他们的版权的同时也瓜分了他们的蛋糕——但也同时做大了蛋糕,激发许多了原本不存在的需求。

说到底,整件事情中用户始终站在弱势方。音乐,到底是卖方市场,而垄断平台的加入更加促成了这一事实。

Project: netease-cloudmusic-playlist-exporter

mkmark/netease-cloudmusic-playlist-exporter

Project: Elastic-dark

mkmark/elastic-dark

Email Service!

Purpose

To create a personal email service

How to

Creating MySQL user

dnf install postfix dovecot dovecot-mysql postfix-mysql mutt
sudo mysqladmin -u root -p create mailserver
sudo mysql -u root -p

Creating the database and tables

/*! Create the MySQL user and grant the new user permissions over the database. */
GRANT SELECT ON mailserver.* TO 'mailuser'@'localhost' IDENTIFIED BY 'mailuserpass';
FLUSH PRIVILEGES;
USE mailserver;

/*! Create a table for the domains that will receive mail */
CREATE TABLE `virtual_domains` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(50) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*! Create a table for all of the email addresses and passwords */
CREATE TABLE `virtual_users` (
  `id` int(11) NOT NULL auto_increment,
  `domain_id` int(11) NOT NULL,
  `password` varchar(106) NOT NULL,
  `email` varchar(100) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `email` (`email`),
  FOREIGN KEY (domain_id) REFERENCES virtual_domains(id) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*! Create a table for the email aliases */
CREATE TABLE `virtual_aliases` (
  `id` int(11) NOT NULL auto_increment,
  `domain_id` int(11) NOT NULL,
  `source` varchar(100) NOT NULL,
  `destination` varchar(100) NOT NULL,
  PRIMARY KEY (`id`),
  FOREIGN KEY (domain_id) REFERENCES virtual_domains(id) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*! Add the domains */
INSERT INTO `mailserver`.`virtual_domains`
  (`id` ,`name`)
VALUES
  ('1', 'mkmark.net');
  
/*! Add the users */
INSERT INTO `mailserver`.`virtual_users`
  (`id`, `domain_id`, `password` , `email`)
VALUES
  ('1', '1', ENCRYPT('password', CONCAT('$6$', SUBSTRING(SHA(RAND()), -16))), 'info@mkmark.net'),
  ('2', '1', ENCRYPT('password', CONCAT('$6$', SUBSTRING(SHA(RAND()), -16))), 'noreply@mkmark.net'),
  ('101', '1', ENCRYPT('password', CONCAT('$6$', SUBSTRING(SHA(RAND()), -16))), 'mark@mkmark.net');
  
/*! Add the alias */
INSERT INTO `mailserver`.`virtual_aliases`
  (`id`, `domain_id`, `source`, `destination`)
VALUES
  ('1', '1', 'markma@mkmark.net', 'mark@mkmark.net'),
  ('2', '1', 'mark.ma@mkmark.net', 'mark@mkmark.net');

note the password can also be generated from python

import crypt
import hashlib
import random
salt = hashlib.sha1(str(random.random()).encode()).hexdigest()[0:16]
print(crypt.crypt("password", "$6$"+salt+"$"))

Postfix

modified and added files: (see reference for detail)

/etc/postfix/main.cf
/etc/postfix/mysql-virtual-mailbox-domains.cf
/etc/postfix/mysql-virtual-mailbox-maps.cf
/etc/postfix/mysql-virtual-alias-maps.cf
/etc/postfix/mysql-virtual-email2email.cf
/etc/postfix/master.cf

Dovecot

modified and added files: (see reference for detail)

/etc/dovecot/dovecot.conf
/etc/dovecot/conf.d/10-mail.conf
/etc/dovecot/conf.d/10-auth.conf
/etc/dovecot/conf.d/auth-sql.conf.ext
/etc/dovecot/conf.d/10-master.conf
/etc/dovecot/conf.d/10-ssl.conf
/etc/dovecot/dovecot-sql.conf.ext

Post processing

sudo chown -R vmail:dovecot /etc/dovecot
chown -R vmail:dovecot /etc/dovecot
chmod -R o-rwx /etc/dovecot
systemctl restart dovecot
chmod -R o-rwx /etc/postfix
systemctl restart postfix
systemctl enable dovecot
systemctl enable postfix

Test

dnf install mailx
mail email1@example.com
tail /var/log/maillog

Client config

465 smtp TLS
587 smtp STARTTLS
993 imap ssl
995 pop3 ssl

Reference

  1. Email with Postfix, Dovecot and MariaDB on CentOS 7
  2. Virtual user mail system with Postfix, Dovecot and Roundcube

Heart of Iron 4 (Man the Guns) Germany Fast World Conquest 2nd Try

Basic order

  • Poland, Belgium
  • France, Netherland, UK, Czechoslovakia, Canada
  • US, Australia, New Zealand
  • Switzerland, Italy, South Africa, Romania, Turkey
  • Soviet Union
  • ...

Detailed gameplay (important decisions)

  • 19360319 justify Poland and Belgium (use cancel justification trick to control world tension below 20%)
  • 19360628 MOFO Bill extension
  • 19361225 MOFO Bill extension
  • 19370401 war Poland Belgium
  • 19370607 Poland capitulated
  • 19370728 wait for Maco Polo Incident until world tension increase and Belgium joins Ally, then taking the capital and Belgium capitulated
  • 19370802 France starts the war
  • 19370807 France capitulated
  • 19370815 Vichy France established
  • 19370901 war Netherland
  • 19370907 Netherland capitulated
  • 19370929 cross English Channel
  • 19371217 UK almost capitulated, hold force, 1 division invade Canada
  • 19380111 Czechoslovakia justified
  • 19380119 Czechoslovakia joins Ally
  • 19380126 1 division attack Czechoslovakia and takes capital, US justified, take the final victory point from UK and Ally capitulated, puppet UK established, colony sovereign transferred and everything else annexed
  • 19380406 war US
  • 19380625 US capitulated
  • 19380904 naval invade Australia
  • 19381020 naval invade New Zealand
  • 19381109 Switzerland Italy justified, Ally capitulated, puppet US established, colony sovereign transferred and everything else annexed
  • 19390321 war Italy
  • 19390821 war South Africa
  • 19400210 war Turkey, justify Romania, Ally capitulated (later puppet Romania)
  • 19400411 German East Indies annexed
  • 19400911 France annexed
  • 19400913 Turkey released
  • 19410125 Soviet starts war against Finland, start the war against Soviet, call Romania to join the war
  • 19410310 German Raj annexed
  • 19410709 free attack
  • 19410721 Führer Directive 21 finished
  • 19410810 Sevastopol circled
  • 19411007 Soviet capitulated, puppet Soviet established

Notes for basic gameplay

  • Don't research Navy and Oil, and should be able to keep up with all other researches. Still going to own the strongest navy by annexing France, UK, and US. Still going to have more than enough oil after conquering US.
  • Don't do Rhine land focus because it increases world tension. When the war kicks off it's automatically bypassed. Also, don't set any National focus before 19360319 for the earliest war goal justify.
  • Ally starts war actively if leaving Belgium until Marco Polo incident, which is highly favorable. If world tension is still not high enough, justify Netherland.
  • Use national focus 'Befriend Denmark' for Greenland port access so we can naval invade Canada.
  • 1 division invade Canada, Czechoslovakia, Turkey before Ally capitulated for instant victory.
  • Always remember to justify war goals before Ally capitulated as it cost only 10 or 25 days when at war.
  • Establish Vichy France, UK, US puppet for their navy; Romania for focus (8 bonus military factories); Turkey as buffer country against Soviet; US, Soviet for their manpower (give full territory back before drawing manpower), annex others
  • Draw manpower from German East Indies and France before going to war with Soviet

Notes for invading Soviet

  • Remember to deploy all aircrafts captured before war kicks off.
  • Attack Soviet when it's attacking Finland and its north defence is almost gone. And they still have debuff from Great Purge by then.
  • When invading Soviet leave an army to circle Sevastopol but don't attack. After Moscow falls (so are Leningrad and Stalingrad) the new Soviet capital will be Sevastopol. Block its land access from north and east each with a total of 80 width divisions (1 block width), raiding Black Sea convoy, and the whole Soviet army will be out of supply.
  • Build 40-width tank division for aggressive attack, 20 width infantry division for normal attack, 20-width motorized infantry division for cautious attack (so they don't actively engage and can follow the tank push really fast).
  • 40-width tank divisions are composed of 8 medium tank divisions, 4 SPART divisions, and 6 motorized infantry divisions. 20-width (motorized) infantry divisions are just normal 7+2.
  • The main force composed with 1 army of 24 tank divisions for pushing, 3 armies of 3 tank divisions for micro-management, 1 army of 24 motorized infantry divisions for fast catch up, 5 armies of 24 infantry divisions for holding position and normal attack.
  • Don't try to circle Soviet divisions in large scale until very late, because it's almost impossible when they have a huge amount of backup divisions and will definitely be a supply nightmare. Just do small scale circle that covers 1 to 10 provinces would be good enough. Always build infrastructure when pushing.
  • Don't use a lot of force to invade Soviet from Turkey because the infrastructure is so awful and takes too much to fix. Instead, use a 3 tank divisions army to flank and circle Soviet army just after the main force pushes over Stalingrad.

To continue

In Oct. 1941 China is still resisting Japanese invasion. A navy composed of German, France, UK, US navy should already be overkill for the Japanese navy. Raiding Japanese convoys and their main force will be out of supply. Literally there's no other major which can pose any threat at this point.

To improve

  • This gameplay ensures there is always only 1 main front line so it's easy to micromanage. For ultimate fast conquer multiple frontlines are necessary.
  • Paratroopers are worth considering for even fast early conquer.

Heart of Iron 4 (Man the Guns) Germany Fast World Conquest 1st Try

Basic order

  • Poland, Belgium
  • France, (Netherland), UK, Canada
  • US, Australia, New Zealand
  • Soviet Union
  • Japan

Read More

Project: create_m3u_from_NeteaseCloudMusic

This project is completed reworked for much better performance and .m3u8 compliance. See release/project-netease-cloudmusic-playlist-exporter/

Netease is working hard to prevent users from listening to local music, especially those VIP exclusive ones. Today (20200531) they even replaced the UWP app with the win32 version in Microsoft Store to force users to accept their new rules: No more VIP music unless you paid, even local ones are not permitted, which is totally ridiculous.

The original UWP app, despite deprecated quite long ago and a little bit ugly, was quite useful on windows tablets as UWP apps are the only choice to play music with the screen turned off.

The project has 2 parts: to find a UWP music player, and exporting the Netease Cloudmusic playlist to it. After some searching, the foobar2000 mobile (not foobar2000) seems to be the only choice.

The exporting process uses Netease Cloudmusic local SQLite database to retrieve the playlist information. Introducing project create_m3u_from_NeteaseCloudMusic: Command Line Tool to Extract ".m3u8" Playlist out of Netease Cloudmusic Library (forked from xyqyear/create_m3u_from_NeteaseCloudMusic)

Usage

Exporter.exe

(wich is equivalent to 'python Exporter.py')

Show help

Exporter.exe -h

Specify playlist to export, or export all

Exporter.exe [-p PLAYLISTNAME]

With this updated version of the command-line tool, an automatic update can be easily done with a '.bat'. Example:

@echo off
REM declare using UTF-8 encoding
chcp 65001
%UserProfile%\AppData\Local\Programs\Python\Python38\python.exe %UserProfile%\repo\create_m3u_from_NeteaseCloudMusic\Exporter.py --playlist 我喜欢的音乐

The way Foobar2000 mobile works will always ensure the updated '.m3u8' playlist be used.

China Unicom is Stealing User Privacy Including Accounts and Passwords

It’s lucky for me to find this backdoor as there must be some programming error leading to the crash. There is no reason for China Unicom to show up when a user is importing account information of a totally irrelevant service. The only explanation is that it's trying to steal the data. But what's the motive?

ShadowsocksR is a VPN technology that can be used to falsify data streams. China Unicom is probably using this backdoor to capture those who are using ShadowsocksR to get free cellular data.

No matter what its purpose is, this is an act totally ignorant of user privacy, and apparently illegal. The ShadowsocksR configuration it’s been trying to steal contains user account information like account names and passwords. Who knows what other information it might be stealing secretly?

Shame on China Unicom and all those behind it.

Curve Generation Algorithm Development

UCB ARCH 259 Robotic Fabrication

Mark Ma, Yasaman Yavari

Goals

The final object is to make something fantastic, while creating a workflow including techniques of 3D scanning, parametric modeling, robotic arm operations, 3D printing and bio-mechanical knowledge.

While breaking down the final object, Yasaman and I found our interest in the parametric modeling part. With instructions from Professor Simon, we began our quest to develop a robot-printing friendly curve generation algorithm. To be robot-printing friendly, the curve generated should have the following features:

  • Artistic (subjective)
  • Reasonably structured (objective)
  • As continuous as possible so that saves the trouble of reconnecting during printing (objective)

Modeling

Base shape

With the conclusion that we’re to use elastic canvas for basic form-finding, the first step of our modeling would be simulating this process. Several opinions are available:

  • Use finite element method to find the exact shape of the canvas under loading
  • Use Kangaroo to simulate the physical process
  • Use minimal surface

The minimal surface method is dropped due to the fact that we are to use form-finding in reality. The FEA method, despite exact and promising, does not go well with the rest of the project with its model format. Considering that the modeling precision would not be a big issue in this step, Yasaman and I decided to use Kangaroo for base shape simulation.

The drawback of Kangaroo is that we can hardly define an isotropic elastic material. The Quadrilateral Mesh, despite simple and straightforward, promises the same modulus only in the orthogonal direction of the mesh UV basis.

Through careful modeling, I add another restriction at 45° and 135° of the UV basis, making it closer to an isotropic material. Considering the exact model are to be found out using real form-finding and 3D-scanner, the remaining error is neglected.

20200501 Base Shape
20200501 Base Shape

Structural reasonableness

Considering the problem to be print on the basic form, several ideas of curve generation have been proposed. One plan is to adopt optimized principle stress lines. The advantage is obvious, as such a structure would be very reasonable under loading. However, principal stress lines turned out hard to be adopted. The continuity of the principle stress line does not guarantee the well-distribution of these lines, which often leaves large holes in structure generated. Due to the high sensitiveness to shape and load, the principal stress lines are hard to manipulate too. Consequently, we decided to start from the curve generation itself.

Curve generation

Step 1. Curve generated according to force distribution

One way of curve generation is to divide and lengthen parts of a continuous curve, while keeping the curve away from intersecting with itself, which defines all the goals we need to implement this idea with Kangaroo:

  • Lengthen curve sections
  • Prevent curve from intersecting with itself

To adapt the generated curves responsive to structural behavior, it's natural to densify the area with large stress, which gives the third goal:

  • Curve distribution responsive to stress distribution

With these goals the curves are successfully generated, meeting all our objective goals. Further development should focus on the subjective part, aka the artistic effects.

20200501 Step 1
20200501 Step 1

Step 2. Curve generated freely

To gain more control of the curve generation, some restrictions have to be dropped. Now take a look back at the initial three goals, if we neglect the curve distribution requirement, we can achieve something looks very alike Zaha’s project.

20200501 Step 2
20200501 Step 2

Recall that Zaha’s project uses a manually defined base curve to approximate initial stress distribution, we now certainly have a better solution: to use the curve generated in 1st step as the base shape for 2nd step, which gives us the following result.

20200501 Step 12
20200501 Step 12

Step 3. Combination

There is an infinite number of curves we can generate by tweaking with all the parameters, and an even larger infinite number of combinations with different layer position, tube thickness, color, etc. For a quick example, this is what it will look like if we combine Step 1+2 as a thicker base layer and Step 2 as a thinner decoration layer.

20200501 Step 3
20200501 Step 3

Conclusion

The curve generation is a complex workflow not fully automated, as lots of attention needs to be paid to calibrate all the parameters in order to get the best shape. All generated curves have the potential to become the final project, with a combination of each other and further improvement based on printing practice.

Due to the virus situation nowadays, it’s becoming harder for our project to be actually constructed. I hope all these quests into curve generation can be preserved, developed, and applied in future practice.

Reference

  1. Zaha Hadid Design - Thallus for for White in the City Animation - YouTube

  2. Curve growth - differential growth (Where to Start?) - Grasshopper - McNeel Forum

Data 100 Spring 2020 Project 2b Competition Ranked 3/749

File address: https://github.com/mkmark/CS-C200A-sp20/tree/master/proj/proj2b

20200427 Data 100 Spring 2020 Project 2b Competition Ranked 3/749
20200427 Data 100 Spring 2020 Project 2b Competition Ranked 3/749

Coco (2017)

A story about a boy trying to prove himself a citizen with unconditional civil rights, and a distant relative (his great-great-grandpa) trying to get a visitor visa through him.

Family ties ARE important. For sure. Gracias, señor Trump.

Evidence of your employment and/or your family ties may be sufficient to show the purpose of your trip and your intent to return to your home country.

Visitor Visa

Chinese Virus

This is a discussion panel from UCB LP380 on a podcast ‘I Become a Person of Suspicion’ - The New York Times

Read More

Export MATLAB LiveScript into Viewable PDF

MATLAB LiveScript can be exported into pdf but the function is often broken. Sometimes figures are too large to stay in page frame, or it doesn't show figures at all.

To bypass this broken feature one possible way around is to save as HTML, and edit CSS to make sure things look normal before finally printing it into PDF.

Some useful CSS property to pay attention to:

.inlineElement
{
	max-hight: none; !important
}
.figureContainingNode{
	max-width: 100%;
}

ncmc

Convert encrypted ncm file to original music file

Forked from magic-akari/ncmc

Replace comments value with the original 163 key so songs can be recognized correctly by cloudmusic clients.

https://github.com/mkmark/ncmc

License: MIT

Hope is earned, or someone's gonna fake some for you.

Guess what happened if you're fed with fake hope.

You vomit.

Tribute to hero Wenliang Li.

悼民族英雄李文亮。

Uncle Sam

There's something. A lot of people don't know this: George Washinton's brother was the uncle of our country.
Tell that to your kid. Tell him to tell his teacher that. He'll be home way before three o'clock.

George Carlin - HILARIOUS STAND-UP

Well, it's true.

Samuel Washington (November 27, 1734 [O.S. November 16, 1734] – September 26, 1781) was a colonial American officer and politician who was the brother of United States President George Washington.

Samuel Washington - Wikipedia

Dynamo vs. Grasshopper

I finally got my hands on Dynamo trying to model a parametric triangular sphere, which I have done several weeks earlier in Grasshopper. Convinced by Zhekai Li that Dynamo would perform better since it has advantage over complex modeling situation, I started from scratch to learn Dynamo. And 2 days later, eureka!

20200124110448-Triangular-Sphere-Dynamo.png
20200124110448-Triangular-Sphere-Dynamo

So let's come back to the topic: how does it feel to model something in Dynamo comparing with Grasshopper?

Read More

美国暴发40年来最致命流感 ,是真的吗,目前情况如何?

知乎回答备份。“回答建议修改:违反知乎社区管理规定”

Read More

Los Angeles Trip on Christmas

I finally decided to participate in the trip after 1 minutes' 'careful' consideration. It would be such a pity if I didn't take a tour around LA when I am living so close to it - only 381.9 miles away, especially with the Airbnb already booked and trip planned ahead by someone else. After all what could go wrong? Everthing

Read More

梦回梁溪

夷歌阿豪切大?偶德尼涩偶fə'lə窝里哼nou个尼泽古古, nou’ciang么挖机撒落列wə

... you never really forget them. It just takes a while for your memory to come back to you - Spirited Away (2001)

UnblockNeteaseMusic Online

UnblockNeteaseMusic is a project as indicated by its name.

Source
https://github.com/nondanee/UnblockNeteaseMusic

Read More

n2n

n2n is a solution for Virtual LAN.

With VLAN many things can be quite easy, e.g. SMB sharing across NAT.

Read More

工E十周年 贺电

大家好,我是马克。首先祝工E十周年生日快乐。

谁能想到,今天十周年的工E,五年前的今天只是一个五周年的工E。那年在礼堂看着前辈们录制的平凡之路被感动得热泪盈眶,现在终于有机会在这里和大家谈谈人生和理想。

工E的核心是设计,而设计的核心则是技术和创造力。信息爆炸的时代,技术的普及和更迭指数式的演进,任何企图掌握所有最新技术的行为都属于以一己之力抗衡全人类创造力的螳臂当车。然而,工E依然选在在此时为大家普及基础的设计技术,不仅是为了给历史和人民做一点微小的贡献,更因为我们发现,技术的普及是培养创造力的最好方式,也是将志同道和的同志们团结起来的最佳途径。

但凡走上设计这一不归路者都对美有着近乎偏执的追求,希望工E能在这不平凡的路上越走越好。

Spirited Away (2001)

Now go, and don't look back.

Spirited Away (2001)
Faceless. Exiled by myself.

7 years.

It's time.

General parametric design of a steel-glubam hybrid space truss

Ma, K., and Xiao, Y. “General Parametric Design of a Steel-Glubam Hybrid Space Truss.” In Modern Engineered Bamboo Structures: Proceedings of the Third International Conference on Modern Bamboo Structures (ICBS 2018), June 25-27, 2018, Beijing, China, 1st ed., 223–29. CRC Press, 2019.

K. Ma

Zhejiang Univ.-Univ. of Illinois at Urbana Champaign Institute, Jiaxing, Zhejiang, China

Y. Xiao

Zhejiang Univ.-Univ. of Illinois at Urbana Champaign Institute, Jiaxing, Zhejiang, China

Nanjing Tech University, Nanjing, Jiangsu, China

Department of Civil Engineering, University of Southern California, Los Angeles, CA, USA

ABSTRACT: This paper introduces a parametric design method for a hybrid truss system composed of glued laminated bamboo (glubam) and steel. Experiments on determining material’s physical and mechanical parameters were carried out first, on basis of which design stages from modeling, analysis, optimization to manufacturing are all rendered possible through parametric ways by defining corresponding parameters within one single platform - Grasshopper. By maximizing automation during the process, efficiency and extensibility are taken into consideration for possibly further, larger, and more complex design.

Good Lab

A structural lab that is clean is not a good lab.
-- Khalid M. Mosalam on CE 249, Sept. 6, 2019

edit 20220801:

The ZJU Haining campus recruited a new Civ Lab engineer recently, who is dedicated to make the Civ lab 'as clean and beautiful as a museum'. He once proposed that wood cutting should be done outside of the Lab to minimize the noise and ash, and I had to call the Dean in to revert this policy.

With his help everyting is now put in order far away from its supposed working location, just we can not find things when we need, and the lab engineer has no idea too.

How ironically!

University of California, Berkeley

20190810 Sather Tower
20190810 Sather Tower
20190810 Davis Hall
20190810 Davis Hall

Force Loading Earlier Version Extension in Visual Studio 2019

Encountered 'This extension is already installed to all applicable products.' error when trying to install 'NewGrasshopperTemplate.vsix' to vs2019.
Open vsix as zip, update all '.json' files by replacing [15.0,16.0\) with [15.0,17.0\)
And it worked.

Project: Large Waste Transfer Station

20190628 Large Waste Transfer Station
20190628 Large Waste Transfer Station

20190811 Large Waste Transfer Station
20200811 Large Waste Transfer Station

20190815 Large Waste Transfer Station
20200815 Large Waste Transfer Station

Credits

Directed by Prof. Yan Xiao.

Designed by Mark Ma.

Non-commercial project for research and demo purpose.

wm density Crash Rescue

device: Mi MIX 2S system: MIUI 10

Try and fail

My device crashed after trying to modify window density.

su
wm density 120

Screen went dark, adb shell reports error.

.\adb shell wm density reset

Tried force reboot, not working, and adb shell no longer worked due to permission. Device auto reboot into recovery.

Tried everything from Google and nothing works.

Tried adb command when restarting but encountered error.

.\adb shell wm density reset
Security exception: Must hold permission android.permission.WRITE_SECURE_SETTINGS

Solution

This reminds me of a way to circumvent device password lock, which I accidentally bumped into 2 weeks ago when modifying status bar icon.

Simply rename/remove

/system/priv-app/MiuiSystemUI/MiuiSystemUI.apk

Then reboot, you'll find yourself home screen immediately!!! Do anything you like to fix the resolution.

Project: Concrete Dragon

About the project

Concrete is something not often linked to boat, let alone dragon boat. Traditional concept of concrete based building material is embedded deeply not only in common folks but also in Civil Engineering students.

Concrete, usually Portland cement concrete (for its visual resemblance to Portland stone), is a composite material composed of fine and coarse aggregate bonded together with a fluid cement (cement paste) that hardens over time

Concrete - Wikipedia

Still, concrete is just a material, and material evolves as scientific progress advances. New material such as FRP rebars show even better performance than traditional steel rebars. Moreover, as its Chinese name indicated, concrete is just 'some sort of ash mixed and hardens', expanding its concept to a even higher dimension. Comparing to traditional boat building material, concrete has its own pros and cons.

Pros:

  • Stain proof (v.s. steel)
  • Flexible shape (v.s. timber)
  • Economical (v.s. steel and timber)

Cons:

  • Heavier than water and timber
  • Brittle
  • Low tensile strength

The whole project is aimed at exploiting the advantages of concrete while fixing its problems, expanding our knowledge of concrete through engineering practice.

Prototype 1.x - The First FRP Concrete Dragon Boat

Goal

A new type of boat construction method is proposed firstly by Prof. Yan Xiao. The basic idea is to use a self-hardening FRP cloth material as both concrete model and structural part that provides tensile strength.

20190615 Prototype 1.x Cross Section
20190615 Prototype 1.x Cross Section

Material

FRP Clothes

This is some material recently become popular for its ability of free shaping and fast hardening. Most common scenario of usage is replacement of medical bondage and plaster, or electrical wire joint protection. The mechanism is really simple as it's just piece of FRP soaked into glue. Exposition to air solidify the glue in several minutes, providing the structure with some strength.

Things become interesting when several layers of such kind of material are glued together. As FRP clothes is extremely strong in tensile direction, even glue can sustain the relatively less strong shearing force, guaranteeing high bending and shearing strength.

Plastic Hull

A plastic hull is needed for this model, primarily for the shape control of the self-hardening FRP clothes. To achieve better dynamic performance, hull is modeled to be smooth and continuous - NURBS interposition of key points. Therefore, 3D-printing technology is adopted for precise realization of the model.

20190406 3D Printing
20190406 3D Printing
20190223 Modal Boat Hull
20190223 Modal Boat Hull
20190317 Modal Boat Covered by FRP with Kaihang Zhang
20190317 Modal Boat Covered by FRP with Kaihang Zhang

Concrete

ECC concrete is a new kind of concrete which includes PVA fiber to increase its tensile strength and crack resistance. Ingredients are listed as below:

Cement1
Quartz Sand 20-401.1
Silica Fume0.3
Flyash0.15
Mineral Powder0.1
Quartz Sand 3250.1
PVA Fiber
Water0.18
Water Reduce Agents0.10%
Early Strength Agents0.10%

Next Stage

Prototype 1.x focuses itself on boat construction. A boat floating on the water marked success of the first stage. On that occasion, however, path splits for two different prototypes though.

Prototype 2.x stays small and is optimized for wireless remote control. A concrete dragon boat (model) competition is later held based on this. Prototype 3.x is develped with optimization for man-powered sailing in a much larger scale - a real concrete dragon boat.

Prototype 2.x - ICDBC 2019

Goal

Fast, stable, swift steering

To make it fast, the boat has to be speed boat alike, narrow, and light. The concrete layer needs to be as thin as possible. For sure, boat surface still needs to be smooth and continuous.

To make it stable and swift steering, the boat has to be not that narrow in width, motors parallel to each other and as far away as each other as possible.

Power system

Duo RH-380 motors, 1500mAh Li-ion battery

Should gave adopted stronger motors.

Competition

Server

https://www.concretedragon.org/

CentOS7, php7.2, MySQL5.3, Nginx, WordPress Vultr Dallas

See Concrete Dragon Online.

Rule

Should have set limitations on motor power.

Template

Should have provided ai version.

Should have made it clear that theme color can be switched.

Should have designed certificate templates.

Next stage

Should have adopted Arduino.

20190606 ICDBC Boat of My Team
20190606 ICDBC Boat of My Team
20190606 ICDBC Jury Committee with Boats
20190606 ICDBC Jury Committee with Boats
20190606 ICDBC Prof. Yan Xiao
20190606 ICDBC Prof. Yan Xiao
20190606 ICDBC Everyone
20190606 ICDBC Everyone

Prototype 3.x - The Great Dragon Boat

Goal

Strong, stable, light

The large boat is very different from the small boat as construction method can not be inherited directly. It is too slow for the hull to be 3d-printed out. Instead, EPS foam slices cut by CO2 laser are glued (or tied) up to form the basic model of the boat. A FRP clothes layer is then put on the foam, then concrete with FRP bars inside.

20190526 Laser Cut Plastic Foam
20190526 Laser Cut Plastic Foam

To make the boat strong, the boat is modeled even more smooth, to the extent that FRP rebars can be put inside the concrete from head to tail without cut or connect. Such smooth shape without any edge can be regarded as a 2-d arch, making the most of the compressive strength of the concrete. To make the boat stable, the boat should have a lower gravity center.

20190615 Prototype 2.x Cross Section
20190615 Prototype 2.x Cross Section
20190531 Great Dragon Boat Foam and Dr. Dade Lai
20190531 Great Dragon Boat Foam and Dr. Dade Lai
20190601 Great Dragon Boat Covered by Concrete
20190601 Great Dragon Boat Covered by Concrete
20190604 Great Dragon Boat under Painting
20190604 Great Dragon Boat under Painting
20190606 Great Dragon Boat
20190606 Great Dragon Boat

Next stage

  • Should have the whole boat hull made by solid EPS form.
  • Should have adopted sprayed concrete technique.
  • Should have used more PVA.
  • Should have used more FRP fiber clothes.

Credit

Instructor

Yan Xiao 肖岩

Boat Designer, Engineer, Manufacturer, Website Programmer and Designer

Ke Ma 马克

Construction

Ke Ma 马克, Dade Lai 赖大德, Zhiwei He 贺智伟

Also thanks for help by

Anqi Tan 谭安琪, Yiqi Feng 冯亦奇, Kaihang Zhang 张开航, Zhekai Li 李哲楷, Mengjun Wang 王梦君, Guoli Wang 汪郭立, Yang Zhou 周洋, Shangchun Jiang 江上春, Cristoforo Demartino, Zicheng Bao 包梓成

Decoration by

Jiahui Liang 梁嘉惠, Ke Ma 马克, Sicheng Zhou 周思成, Anqi Tan 谭安琪, Qingyun Liu 柳青云

Concrete Recipe

Bo Shan 单波, Dade Lai 赖大德

Logistic Support by

Sicheng Zhou 周思成

Competition Rule Maker

Yan Xiao 肖岩, Ke Ma 马克, Yiqi Feng 冯亦奇, Anqi Tan 谭安琪, Kaihang Zhang 张开航

Activity Organizer

Hang Wu 吴行, Ke Ma 马克, Binbin Li 李宾宾, Yanlong Xie 谢焱龙, Sichen Zhou 周思成, Tao Li 李涛, Jiahui Liang 梁嘉惠, Zhiwei He 贺智伟, Dade Lai 赖大德, Haixiang Zhu 朱海翔, Yi Zhang 张旖, Chenchen Ye 叶晨晨, Qian Yu 余倩, Jinyan Yu 俞静琰, Fengqing Jiang 江凤清 and other volunteers from ZJUI

Special Thanks for

Logistic Support

Jiyao Guo 郭霁瑶, Zhaijin Jia 贾翟菁, Qingbing Xie 谢庆兵

Technical Support

Tianyi Han 韩天屹, Si Li 李斯

Participation

Yue Feng 冯越, Hanyin Shao 邵寒吟

秦山建设,浙江大学创新创业学院

Some Thoughts from the Great Dragon Project

Stress does not get the better of me, but sense of responsibility does. I am accustomed to be alone, still, sense of loneliness and isolation horrified me.

People like me do not climb to leading position due to their ability to lead people, but as a result of responsibility and judgement. Team members may not believe the leader's judgement, but they do rely on it - as long as the leader shoulder all the responsibility, they are happy with it. Such ultra unstable system will collapse as soon as any mistake happens, especially those out of control, either by the leader himself, or by some team member - doesn't matter - team members will soon lose their interest or hope to fix the problem. And mistake is almost definitely to come around.

Problem originates from the responsibility system. Students who I lead, most come to the project with just out of curiosity, or even unwillingness. They have nothing beneficial from me, nor threatened by any power from me. The only reason they follow my order, is out of trust, that I could make sure that the problem be solved at the lowest cost of their time and work.

So the 'solution' is clear now. Under such condition, best solution is to assign tasks and orders as simple as possible to everyone and let them believe that this is the best way that they could get away from this, after they finish their part. Sadly, machine is always stronger than people in terms of obeying orders.

First rule of leadership: PICK the right team member.

Project: Blossom

Project subject to IBCC 2019. No prize.

Read More

UFO

Shot on my way back to office after dinner, in Zhejiang University International Campus, Haining, Zhejinag, China.
The flying object was flying with a tail of fixed length, generally from South to North, to the West of the campus.
Video shot with my phone, stabilized by Ae and is speeded up to 10 times.

Given the almost horizental track, and the fact that there's no smoke behind, there's high possibility that the object was moving at high altitude.

No news though.

Project: Waste Transfer Station

20190324 Waste Transfer Station 1.0.1 Day 1
20190324 Waste Transfer Station, by Y. Xiao, K. Ma

202001030925 Waste Transfer Station
202001030925 Waste Transfer Station, Photo by S.C. Zhou

Credits

Directed by Prof. Yan Xiao.

Designed by Mark Ma.

Non-commercial project for research and demo purpose.

Concrete Dragon Online

https://www.concretedragon.org

IBCC 2019 Online

https://www.ibcc2019.org

My first commercial web project, fully by myself.

Guess who designed its logo :)

Employed as Solid Mechanics TA

20190114 Employed as TA of TAM 251
20190114 Employed as TA of TAM 251

http://tam251.intl.zju.edu.cn/people.html(LAN Access Only)
It's been like a decade since I was designated as a class president or such sort of things. Still, I feel honoured. It's a fun fact that most of the TAM 251 website is edited by me (revised from UIUC), as years of playing with html, servers, etc. finally get me on the course :)
Last time I was soaked in with Solid Mechanics, I scored 94 out of 100. To me, it's almost the most interesting Mechanics subject I learned (comparing with structual mechanics and others). The point is, it's a theory-based subject for scientific research rather than an experience-based one for practical engineering. That means fun for me.

Notes from International seminar on computational and performative design thinking

Nanjing University
2018.12.07

Read More

Mist at Zhejiang University

20181130 Mist at Zhejiang University
20181130 Mist at Zhejiang University

No modification. Totally original photo.

Android Root

Things one can do after gainning root access of their Android. Pls note that this is not a guidance to unlock and root a Android device.

Date

20181110

Device: Xiaomi MIX 2S

Read More

Cersei and John Snow???

- How did I get married?
  Did I ever learned to play the mandolin?
  Who was to living at the end of Game of Thrones?
- OMG I forgot u haven't seen it yet!
  So, Cersei and John Snow...
Planet Money #872: The Hallowing Tapes

Just What I am Thinking

20181024 Just What I am Thinking
20181024 Just What I am Thinking

Polylang no-translation Redirection

Polylang redirects to home page when it's not able find a translation for current page. Following code will enable it to stay on the same page but still to update the language cookie.

Read More

VS Code LaTeX

20181015 VS Code LaTeX
20181015 VS Code LaTeX

Read More

Cooperation or Competition

From the first stirring of life beneath water, to the great beast of Stone Age, to man taking his first upright steps, we have come far. All of the progress instilled these two seemingly paradoxical characteristics into mankind: competition and cooperation. Species without competition will surly lose its dominating position soon, and a single man can never protect himself from any physically overwhelming animal. Thousands of years later, these two inherited features still play important roles in modern society regardless of fundamentally massive change within human society itself. We have long evolved from cave Australopithecus to intelligent man who stands on the top of the food chain, and the importance of competition and cooperation shall be rebalanced.

Read More

Monopoly from the Perspective of Mass Gambling

There is a live video platform in China called Douyu who offers virtual currency gambling, from which I find out a very interesting phenomenon - the return rates always stay low, i.e. on specific conditions when the outcome is a random event (50% chance on each side), the return rates always stay below 1 (often 0.1 - 0.7) on both sides, rendering it unfair for any gamblers who pays - take it or not.

Read More

UX Optimization

My friend lespirt is a UX designer. She took a look at my website and offered me several great suggestions, which I interpret as following.

Read More

Mobile Choice

Moving to Android

Finally, I decide to give up iOS, despite having using it for so many years. When I began to use iOS on 2011, it's still far less mature than today. People jailbroke it for better UI and more features. I can still remember some of the classic debian packages, i.e. SBSettings which iOS later introduced as Control Center. Good days back then.
With Apple constructing its firewall taller and harder, jailbreaking is becoming much more difficult nowadays, not only for hackers, but also for common geeks. I'm not here to comment on the righteousness of Apple's action to promoting this. Objectively, fewer users means fewer developers, then fewer apps to serve even fewer users. To begin with, after iPhone 4s, iOS users can no longer freely downgrade their devices even one wants to enjoy fluency of earlier version. Year after year, the limits just became stronger and stronger. It finally leads to the collapse of jailbreaking community. A lot of cydia apps began to lose maintaince after iOS 9.
I have my iPhone se locked at iOS 9.3.3 to keep it working fluently for 2 years. And after this only 2 years, with the screen malfunctioning, infra-red sensor no longer working, cameras poulluted by ashes and speakers making noises, it's high time I decided to move away from iOS, from Apple. (I'm a bit too objective here. What I am truly thinking, F**k Apple.)
I choose to move on, and hope I can find some lost freedom from the Android world.

Read More

Project: RE Frame

Non-commercial project for research and demo purpose.

Project Introduction

This project is based on the 1st-prize-winning project 'RE Frame' of the Bamboo Pavilion Competition in Mediterranean University of Reggio Calabria by Stefano Vitale and his team. It's an honor to join him in such a great project. All following are based on my own understanding of the project.

Read More

X3 Online Complex Calculator Mirror

Sadly the original server went dark.

Fortunately, I made a copy of the TC version even before that.

With some help from web.archive.org, I successfully build the AP version from the TC one.

Read More

Douyu Auto Loot Script

My work is based on EternalPhane - 斗鱼助手

Add function:

  • Automatic start
  • 5 seconds count down notification by TTS audio message

Read More

HTTPS!

After being continuously locked up by GFW for a whole week I decide to change my site into a real https site.
Given the fact that I can only use port 80 and 443 for all the activities across GFW, I have to make port 443 for both nginx and ShadowsocksR (for scurity reason).
Thus, ssr will divide the inbound packages into two parts, one for itself and another redirected to port xxx for nginx, as following.

Read More

Percolation

Programming Assignment 1: Percolation
Algorithms, Part I
Princeton University

Write a program to estimate the value of the percolation threshold via Monte Carlo simulation.

Read More

Dictionary Patch 3

Goal

With Chrome extension, user-defined protocol and Windows API integrated in C#, the auto-look-up process when reviewing words on Shanbay can be even more cost-efficient and precise comparing with former methods.

Read More

Village Bamboo Summer School Camp & Zhejiang Trip

The trip has two parts. One from June 21st to 23rd, and the other from June 28th to July 2ed. I spend the gap between the two parts in Beijing, for detail see my previous post.

Read More

BARC 2018 & Beijing Trip

I earned myself this trip to Beijing through my dissertation, with Lin Runze's help. To someone who has already graduated, it was such a surprise that I even don't have time to prepare my suit.
Despite the fact that I was working almost the same as a free apprentice, I saw and learned a lot.

Read More

Notes from BARC 2018 Ministerial Summit

Before discussing how to promote bamboo industry you’ll have to inspire people how they can benefit from it – especially their superior renewability comparing to trees. In most south America countries, bamboo is still considered as a type of tree which means that they will have to be registered for being cut down, and the register process could last 3-6 months which is almost insane for modern commercial activities.

Moreover, rather than inspiring the youth of the innovation of bamboo structure, it’s better to have them inspire us.

基于Grasshopper的曲面木结构网壳参数化设计研究

马克. 基于Grasshopper的曲面木结构网壳参数化设计研究[D]:[学士学位论文].南京工业大学土木工程学院, 2018.

指导老师:陆伟东

国家重点研发项目(2017YFC0703506)资助

摘要

曲面木结构网壳具有节能、绿色、环保、经济的特点。考虑到曲面网壳形态上的不规则性,其设计、分析、优化通常较一般结构更为复杂。相比传统的设计方法,使用参数化设计方法可以大大提高其设计流程的效率,使得曲面木网壳优良的性能得以充分发挥。

目前,曲面木网壳在国外的应用较为广泛,尤其是大跨的后张拉成型网壳。国内学者在参数化网壳方面也有一定研究,但多基于规则形态的钢网壳,而在曲面木结构网壳方面的参数化研究则开展很少。

本课题基于Rhino平台Grasshopper参数化插件进行曲面木结构网壳的参数化设计研究。通过总结设计方法,归纳设计思路,进而编制参数化建模、分析、优化以及输出的相关程序,使参数化设计的效率优势在木网壳结构中得到尽可能大的发挥,以期最终形成曲面木结构网壳的参数化建模、受力分析、建造等相关问题的一体化通用解决方案,为工程实践提供借鉴和参考。

在参数化建模的具体实现上,对于传统的基于几何外观设计的规则几何形态网壳,本文逐一给出了参数化建立相关模型库的方法和示例;对于自由曲面网壳,本文给出了一种参数化网格划分及优化的思路和示例;对于后张拉成型网壳,本文给出了通过模拟倒悬法动态优化建立模型的思路和示例。

在参数化受力分析、优化的实现上,本文基于Grasshopper插件给出了一种有限元分析方法并验证了其可靠性。该方法不仅能参数化分析传统网壳的受力,也能为模拟倒悬法找形获得的后张拉成型网壳提供精确的找形计算。在此基础上给出了此外,给出了基于进化算法对曲面整体做几何优化的思路和示例。

关键词:木网壳 参数化设计 Grasshopper


Voronoi 4.2
Voronoi 4.2

致谢

感谢陆伟东教授、孙小鸾老师、屈丽荣博士、陆斌辉学长为本课题提供的指导,正是他们给出的指导和建议使本课题的开展成为可能。尤其感谢我的导师陆伟东教授,他敏锐的学术洞察力使我在课题中受益良多;也要感谢屈丽荣博士,她同样在整个课题期间倾注了大量心血和精力,提出了许多宝贵的指导和建议。

感谢Grasshopper的开发者David Rutten以及整个社区,特别是Paneling Tools, Kangaroo(2), LunchBox, NGon, Karamba等插件和他们的开发者。他们的工作为本课题的开展提供了巨大的便利,并在实际应用中带给了我一些思路上的启发。

感谢工E设计,使我在大学期间得以学习到几乎一切用于此论文的展示工具,并指导了我在艺术设计领域上的发展,尤其感谢赵文炀、韦雨杏在建筑学上的指导。

感谢一路关心、理解、支持我的父母,老师,朋友。无论课题进展是喜是忧,总能得到你们的鼓励和帮助。正是你们在过去的二十多年中的不断影响使我走到了现在,我的感恩之情无以言表。

一个人的历史造就了他的如今,而整个人类的历史亦是他的后盾。在学术研究的道路上,无数先人开辟道路,才有了如今我这些微小的工作。感谢所有。


参见

[1] 关于公布南京工业大学2018届本科生优秀毕业设计(论文)、优秀指导教师的通知

Credits

Designed by Mark Ma.

Non-commercial project for research and demo purpose.

Produced with

  • Rhino 6, Educantional License
  • Lumion 6, Trial License
  • Adobe Creative Cloud, Educational License

Word 图表标题按章节自动编号

问题

最近写毕业论文,有大量图片需要按照“图[章节号]-[图片号] [图片标题]”的格式生成标题。例如第2章第4张图应为“图2-4 某某图片”。

由于国内论文的某些标准,章节号并不使用阿拉伯数字。因此第二章第4张图实际自动生成的图片标题会变成“图二-4 某某图片”。

Read More

Avengers: Infinity War (2018)

Great expectation, so is the disappointment.

Warning: Spoilers.

Read More

Dictionary Patch 2

This post is outdated. See the following for update.
Dictionary Patch 3

Goal

To replace Eudic with GoldenDict for better responding speed, better extensibility, better and more flexible UI, free of charge, and less stability issues.

Read More

Force Web Page Scaling on IOS

Aim

To scale the page up for precise control while formerly forbidden.
To scale the page down for better UI (and sometimes extra options) by simulating a larger screen.

Read More

Dictionary Patch

This post is outdated. See the following for update.
Dictionary Patch 2

Goal

I'v already written some Apple script on Hackintosh for fast dictionary search. Now I seek to have a handy dictionary at disposal on windows platform.

Read More

Rejailbreak ios 9.3.3 Mirror Online

For those who wonder whether jbme.qwertyoruiop.com would expire someday like me, here is my mirror.

WTFPL Applied.

Horticultural Expo Construction Site

20180503 Horticultural Expo Construction Site
20180503 Horticultural Expo Construction Site

Wuxi Railway Station North Plaza

20180502 Wuxi Railway Station North Plaza
20180502 Wuxi Railway Station North Plaza

Ctrl + F5

THIS IS THE MOST POWERFUL FIX EVER (FOR A WEBSITE).

Read More

HDMI Dummy Plug

Wrong Lizard

"Because if they didn't vote for a lizard," said Ford, "the wrong lizard might get in"

— Douglas Adams, So long, and thanks for all the fish

Note that the book was published in 1984. And 32 years later the competition actually began with the same feeling, "Who's worse?" I doubt this has ever happened in the whole U.S. history.

Anyway it's not the right time to discuss any serious topic. Just enjoy the nonesence cause I couldn't help laughing even when it was 2 a.m. and all my roommates were in dream.

十佳 又一年

工E设计工作室 2018 校五星社团 十佳社团

感谢所有

Solution to Abaqus ErrElemMissingSection When Analyzing Truss

Encountered the ErrElemMissingSection problem when analyzing truss, though I did 100% assign the section.

Finally found out that Abaqus would by default Assign Element Type 'Beam' in Module 'Mesh'. So remember to change the setting to 'Truss' when meshing.

GEDesign Order System

It's been 2 years since the first time I thought of building an online order system for 工E设计, the Gong E Design Studio.

Two years ago when I was the chairman of 工E设计, I received orders from all over the campus with different types and requirements. It would have been a mess if I did't manage all the orders with a calendar to remind myself of the deadline. Simple work, but quite annoying, especially when you get quite a lot of messages without a general form to regulate the styles - actually I did try to regulate, and wrote a well composed docx file, on the basis of some former chairman's work. Even then it was too much information to type into a calendar so I end up adding only the title and deadline to the calendar. By then the idea had emerged to have a automatic system developed.

Read More

Common Languages

201804121146 Brian A. Murray
201804121146 Brian A. Murray

I don't speak Chinese. But I speak three languages, Chemical, Mathematical and Geometrical language. These are the common languages.
— Brian A. Murray, Nanjing Tech-ITT Bilateral Workshop, Nanjing, Apr. 12th, 2018

404

Me: Where can I find you?

Zhang: 404.

Well, he does live in 404.

Compact Archives compact.php modify

In order to display the compact archives as a table, I modified part of the compact.php as below, pay attention to the li part.

foreach ( $dates as $year => $months ) {
    $result .= $before . '<li class="theyear"><a href="' . get_year_link( $year ) . '">' . $year . '</a></li>';
    for ( $month = 1; $month <= 12; $month += 1 ) {
        $month_has_posts = ( isset( $months[$month] ) );
        $dummydate = strtotime( "$month/01/2001" );
        // get the month name; strftime() localizes
        $month_name = strftime( "%B", $dummydate );
        switch ( $style ) {
        case 'initial':
            $month_abbrev = $month_name[0]; // the inital of the month
            break;
        case 'block':
            $month_abbrev = strftime( "%b", $dummydate ); // get the short month name; strftime() localizes
            break;
        case 'numeric':
            $month_abbrev = strftime( "%m", $dummydate ); // get the month number, e.g., '04'
            break;
        default:
            $month_abbrev = $month_name[0]; // the inital of the month
        }
        if ( $month_has_posts ) {
            $result .= '<li><a class="amonth" href="' . get_month_link( $year, $month ) . '" title="' . $month_name . ' ' . $year . '">' . $month_abbrev . '</a></li> ';
        } else {
            $result .= '<li><span class="emptymonth">' . $month_abbrev . '</span></li> ';
        }
    }
    $result .= $after."\n";
}

一个人的独裁是如何形成的,为什么很难垮台?

Original post on zhihu, 因「政治敏感」已于Apr 9, 2018 3:47 PM被删除。

Question by [Anonym]

一个国家那么多人,生活艰难,为什么不去推翻,是不是能有什么数学模型能解释这种至上而下的统治。

My Answer

统治集团和平民间悬殊的力量差是维持独裁的根本原因。

常规情况下,维持不是问题。一旦统治集团出现权力空档,无法继续维持力量差,机会就来了。

Read More

People of the Same Tarde

People of the same trade seldom meet together, even for merriment and diversion, but the conversation ends in a conspiracy against the public, or in some contrivance to raise prices.

— Adam Smith, An Inquiry into the Nature and Causes of the Wealth of Nations

Read More

Hello, World!

Beginner

It’s been five days since I decided to build this site on a boring Sunday afternoon. Now that almost everything feels good, and I think it’s time I paused and wrote something.

Read More

HDD Unknown Problem

This is the problem hard drive I talked about in 系统盘迁移小记.

Read More

系统盘迁移小记

帮舍友迁移系统(Win10)。新买的固态,需要把hdd上的C盘完整复制过去。

舍友电脑上没有ngff接口,所以买了sata口的固态,需要把原硬盘挪到光驱位,再把固态放到原硬盘位。

硬件搞定直接开机,还是从机械硬盘启动,给固态指定盘符然后测速——固态倒是没什么问题,但后来才意识到这一步正是作死第一步。

Read More

X3 逼降算法 附源码

Original post on deeptimes

翻译自https://forum.egosoft.com/viewtopic.php?p=2342693#2342693
根据原贴,该作者根据某俄罗斯玩家的反编译成果从俄文翻译而来。
感谢Macaulish的提醒,已在该贴基础上根据源码做出诸多修正。LZ不是专业搞编程的,欢迎各位大佬指导。

Read More

X3 可利用BUG合集

Original post on deeptimes

以下内容均为本人凭记忆手打,如有出错遗漏欢迎各位大佬指出。
所有BUG基于原版(Vanilla),因为修改版(Modified)作弊可以直接用脚本编辑器调出,不需要利用卡BUG这种低阶方式。所有列出的BUG不会导致Modified Tag。
鉴于LZ本人只玩过TC2.5, AP3.3, 所以下文的适用版本号都是凭印象给的,基本准(cuo)确(wu)。当然如果你看到了Lv.6-7, 你会发现神马版本号都是浮云。

Read More

Fake Synaptics Precision Touchpad Driver in Win10 1709

!important

The problem must lie somewhere else. May be the system upgrade process.

After a clean reinstallation of the Win10, the driver now instantly functions without error. No longer need any more configuration.

However if you're having some problems anyway, the following part may still help.

Read More

百度云管家同时下载任务上限修改

目标文件:

/users/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/PersonalSetting.xml

先在软件里修改下载任务数,保存以后用Hexeditor定位。规律是每增加一个任务数某个值会减一。

似乎每个版本(或者用户)对应的值都不一样,所以没有通用的搜索、替换模式。

具体修改时:关闭软件,修改,重启。最多修改到9个,否则自动重置。

Thermal Grizzly with 970m

201803101923 Thermal Grizzly with 970m

IOS Vibration Modification

I found my iPhone's vibration really annoying - especially when you have to leave it on for some important news but irrelevant messages and notifications just keep jumping in.

So after some research I located the configuration file in control of ios vibration.

Read More

《神们自己》

Original post on zhihu.

直译:神们自己(也)徒劳地应付愚昧。

原文:Against stupidity the gods themselves contend in vain.

contend [no obj.] (contend with/against) struggle to surmount (a difficulty or danger)

——NEW OXFORD AMERICAN DICTIONARY

surmount近似overcome,克服,应付。

之前没想到中文的是意译一头栽进“缄口不言”。原文并没有强调不说话。

就最终结果来看,到底还是没有“智慧生命”能直面愚昧,结局好莱坞式的皆大欢喜只是设法逃避得来的罢了。

在智力上,群体的表现远不如构成这一群体之中的个人,所以在涉及到智慧这方面上,我们是绝不能依赖于群体的。

——古斯塔夫·勒庞《乌合之众》

2017-01-11


时隔一年,再回忆起这则小说,觉得作者的确有着重强调群体themselves的劣势,不仅“低智”、而且“低道德”。

不论构成群体的个体有多智慧,道德水平有多高,只要这些个体有不同的利益诉求,他们组成的群体在宏观上就容易体现的“愚昧”、甚至“道德沦丧”。

在外星人身上,Odeen, Dua, Tritt分别寓言了理性、感性、责任的极致god,合起来的Estwald,抛开他的学识,不过是一介鼠目寸光道德沦丧的败类。

至于人类社会,亦然。

2018-04-04


Bug

另外我认为本书逻辑存在bug。

巴特议员的发言指出:“公众所期望的只有一件事——他们自己过上安逸舒适的生活。” 那么对付电子通道的方案之一就是证明电子通道有可能让公众过不上安逸的生活,比如说,证明太阳有爆炸的可能(不要和我说无法证明,只要提出可能性就行了)这就像证明地球有变暖的可能性一样,只要有利益集团的支撑,就一定能找到代言人。

在本例中,电子通道的利益受损人中就有比如说传统能源企业的代言人。找到了代言人就一定能对公众产生影响,然后就不难真正证明了。

2017-01-02

Hover your mouse or tap on the left edge to navigate.
Upon dismissing, you acknowledge that you have read and understand our Privacy Policy.