很久很久去外省市旅行过了。
疫情前,因为工作性质的原因,虽然父母无需打卡上班,看似自由支配的时间很多,但实际上也意味着不会有明确的长假安排,家里出去基本也以一日游居多。记忆里上一次出去是初中去杭州。疫情后老妈子总是担心出去要得病,而且要求我们也非必要不出游。
我从小也对于旅游不感冒,非常傲慢地认为,旅游不就是花很多钱,在难得的空闲时间里,挤到人最多的地方,然后看几个也没啥好看的景点,然后带着一身疲惫去读书吗?那时候我还不理解旅行和旅游的区别。
说来小时候出去玩印象最深的其实是行的过程。去西湖印象最深的是和麻麻骑双人自行车绕湖骑了一圈。去北京印象最深的是爬了好久长城,到顶之后还一股脑滚下来过。
慢慢长大,我在高三暑假那年明确跟家里人说我要去骑行,而且要骑个远的,要到拉萨。当时可把他们吓得够呛呀。后来因为综评等一系列事情,发现时间凑不出来,我也就作罢,宅了一个暑假。大概是这个时候,我对于出去玩这件事情的认识,第一次从旅游变成了旅行。即,出去玩不是为了游乐,为了到特定的地区场所,高效汲取同质化的快乐,而是为了行万里路,在行的过程中认识人,认识路,认识自己。我认为禅宗之意是旅途中不可分离的一部分。走马观花而心不明净,是为游而非行。行者无疆,旅行带来的便该是这种开阔,自信,昂扬。
到大二,和航模队的大家去阜新参加比赛。第一次乘绿皮,还在绿皮上学会了斗地主。绿皮上,hmt和我说,下次工训的比赛,我们一起;crz跟我说一起创立一个club。
然后便是目前处于大四春假的时候了。老爸几年前就开始嚷嚷着要去厦门玩了,但因为种种原因一直没去,我感觉他都快忘了。我提出,失恋了好痛苦呀,网上说必须要看海!老妈子自然是担心我一个人去会出事(比如找个风水好的地把自己埋了),所以就让老爸一起,完美!!
拟题:
基于混合现实的智能体交互
具体功能:
通过hololens2获取场景数据(识别小车/其他物体的位置,网格信息)。
通过hololens2的立体空间交互能力,指挥小车进行移动,执行任务(譬如抓取柱体并移动到相应位置)。
- 关于移动,可以是在眼镜中通过手部动作画一条路径
- 关于执行任务,可以是眼镜识别出物体的位置后规划小车移动和动作序列(A*or强化学习)->相关信息发给小车->小车收到后执行
通过hololens2的虚拟物体放置功能,譬如可以放置小车的车库,柱体移动到的目标位置等
可以通过hololens2显示小车将要移动的意图
The example site: https://chen-yulin.github.io/Besiege-Modern-Docs/
Initialize the local project
node -v >= 18.0
1 | npm init docusaurus@latest Besiege-Modern-Mod-docs classic |
1 | /developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility |
Configuration
Add a source code button
src/pages/index.js,in function HomepageHeader(), add a <div>.
1 | function HomepageHeader() { |
Two button too close to each other, change the css style for button.
In src/pages/index.module.css
1 | .buttons { |
Deployment
Add the remote repository on github.
1 | git remote add origin git@github.com:Chen-Yulin/Besiege-Modern-Docs.git |
Change the deployment configurations
1 | // Set the production url of your site here |
Change the page setting in repository settings, Branch set to deploy branch.
Deploy command: yarn deploy
1 | [INFO] `git commit -m "Deploy website - based on aa492c3f0934f0177ca946345c2d32940c1900c3"` code: 0 |
Purpose:
We use OpenROAD to generate timing analysis reports for each design. However, manually modifying parameters, running commands, and intercepting important information will be too arduous work. It is mainly due to the following points.
- First of all, the report generated by OpenROAD for each design is too long, and the report file may be as large as hundreds of megabytes. It is almost impossible to open and find tns, wns data using a text editor.
- Secondly, the locations of the configuration files running OpenROAD are very scattered. Moreover, the configuration file directory for timing modification is stored in the
tclscript. Manual search and modification are too anti-human and prone to misoperation. - Furthermore, the amount of data we need is very large. For each design, we hope to test its performance under 7 different clock cycles and 5 different core area sizes. In other words, for each design, it is necessary to manually modify parameters, run commands, and intercept important information 35 times, which is unbearable, not to mention that we have 7 designs.
Due to these drawbacks, I decided to use shell script to automate the process of OpenROAD testing. I have the following requirements for the script. - The script can modify the
core_area,die_areaparameter in thetclscript given the path to thetclscript and the desired scale of area. - The script can modify the
create_clock‘s-periodparameter in thesdcconfiguration file referred by thetclscript, given the path to thetclscript and the desired clock period. - The script can set all the parameters and run OpenROAD analysis one by one, given the choice set of clock period and area scale.
- After the OpenROAD generated the report file, the script can read the report and extract the information of tns & wns for each stop point and export these data to a csv table.
Main Test Framework
The entry script is named as runit.gxy, which can receive the name of design as an argument.
For each design, the corresponding tcl script is fixed, so I decided to map the name of design to the tcl script.
1 | design="$1" |
The reason I use _bak post-fix is that, I want to reserve the original core_area and die_area configuration in the origin tcl file, since the original configuration is needed in the following steps.
Then I use nested loop to change the configuration one by one. The choice set can be modified in the condition statement of each for loop.
1 | for period in 2 4 6 8 10 12 14 |
The set clk period, set area scale, export to csv function will be covered in the following steps.
Set the Period of Clock
I create a new shell script called set_clk.sh to manage the automation of changing clock period.
It takes two arguments, the path to the tcl script (string) and the desired clock period (integer).
I first preprocess the period parameter, namely, divide it by 10.
1 | time="$2" |
The clock configuration can be modified in the sdc file, while the path to the sdc file can be extracted from the tcl file, with the format of set sdc_file "PATH_TO_SDC"
I decided to use grep to locate the line of set sdc_file and extract the path to sdc file using regex substitution.
1 | tcl_path="$1" |
In the sdc file, the configuration has a format of create_clock ... -period 0.x.
Still, use regex substitution to replace the original period with the input period and everything is done.
1 | sed -i "s/^\(create_clock.*-period \)[0-9]*\.*[0-9]\(.*\)$/\1$period\2/" "$sdc_path" |
Set the core_area and die_area
The area of the design is expressed in the form of {x1 y1 x2 y2}, where x1 y1 stands for the coordinate of bottom-left corner and x2 y2 stands for the coordinate of upper-right corner.
Since the area of different design varies a lot, I need to change the area proportionately. As a result I need to reserve the original area stored in tcl script as mentioned before.
First, I read the origianl core_area and die_area from the original script.
1 | file_path="$1" |
Then I calculate the desired core/die area size based on the scale and original area.
1 | core_x_size=$(echo "$core3" - "$core1" | bc) |
Finally, use regex substitution to modify the area configuration in _bak.tcl script.
1 | sed -i "s/die_area {[^}]*}/die_area {$die1 $die2 $die3 $die4}/g" "$file_path" |
Collect data and export to .csv
The key information I need from the report generated by OpenROAD is tns & wns.
By observation, the block containing the data has the following pattern.
1 | *** |
Therefore, I use the grep and awk command to get the last word in each data block. In this case, it’s stoppoint*, [number1], [number2].
1 | input_file="$1" |
Each report contains totally 6 valid stop points, so I use a loop to get the desired data.
1 | csv_file="${design}.csv" |
After getting the desired tns and tws, I want to export these data to a csv table.
I decided to let the table has the following columns, period, scale, stop point number, tns and wns, one such table for each design.
This function can be achieved with the following script
1 | design="$2" |
Replace the comment in the loop and everything is done.
Result
I assemble runit_gxy.sh in a single script named runit_cyl.sh to run the analysis of all designs at once.
1 | ./runit_gxy.sh APU |
Then redirect the output to runit_cyl.log.
Here is the content of APU.csv and runit_cyl.log
1 | Period,Scale,Stoppoint,tns,wns |
1 | use design: APU |
将命运的苦难表现得非常纯粹
就是指这种苦难它甚至和客观条件都不那么相关,也就是说,这种苦难是哲学的,普遍的,而不是特别的,临时的,它难以被真正改变。
描写旧时代的小说中最常见的底层人民的苦难,穷,病,愚昧,被剥削,这些在《边城》中都很少,几乎没有。
《边城》中,百姓淳朴善良,邻里关系好。能管事的也慷慨正值。老船夫一家虽然不富裕,但温饱不愁。甚至关于老人的病和城中的水灾,作者也都写得很克制。
但表现上越是美好,最后的结局也就越是让人意难平。
因为即使没有“穷,病,愚昧,被剥削”,人还是得不到想要的东西。
用作者的话来说:一切充满了善,然而到处都是不凑巧。既然是不凑巧,因之朴素的善终难免产生悲剧。
这便是更残酷的生命真相。
Basic
Useful tools
- Dnspy: decompile the runtime library of ONI
- Visual Studio (though it’s too fat)
- Poedit: read the
.pofile for zh-en translation
Hello world
Apply patches on the Initialize() method in Db class.
1 | public class Patches |
Add new building
Take gold washer (just like water purifier but output small amount of gold) as an example.
- Find the source code for water purifier.
i.e.1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60using System;
using TUNING;
using UnityEngine;
// Token: 0x0200039A RID: 922
public class WaterPurifierConfig : IBuildingConfig
{
// Token: 0x06001314 RID: 4884 RVA: 0x000665C4 File Offset: 0x000647C4
public override BuildingDef CreateBuildingDef()
{
string id = "WaterPurifier";
int width = 4;
int height = 3;
string anim = "waterpurifier_kanim";
int hitpoints = 100;
float construction_time = 30f;
float[] tier = BUILDINGS.CONSTRUCTION_MASS_KG.TIER3;
string[] all_METALS = MATERIALS.ALL_METALS;
float melting_point = 800f;
BuildLocationRule build_location_rule = BuildLocationRule.OnFloor;
EffectorValues tier2 = NOISE_POLLUTION.NOISY.TIER3;
BuildingDef buildingDef = BuildingTemplates.CreateBuildingDef(id, width, height, anim, hitpoints, construction_time, tier, all_METALS, melting_point, build_location_rule, BUILDINGS.DECOR.PENALTY.TIER2, tier2, 0.2f);
...
return buildingDef;
}
// Token: 0x06001315 RID: 4885 RVA: 0x000666A8 File Offset: 0x000648A8
public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
{
...
}
// Token: 0x06001316 RID: 4886 RVA: 0x0006688B File Offset: 0x00064A8B
public override void DoPostConfigureComplete(GameObject go)
{
...
}
// Token: 0x04000A88 RID: 2696
public const string ID = "WaterPurifier";
// Token: 0x04000A89 RID: 2697
private const float FILTER_INPUT_RATE = 1f;
// Token: 0x04000A8A RID: 2698
private const float DIRTY_WATER_INPUT_RATE = 5f;
// Token: 0x04000A8B RID: 2699
private const float FILTER_CAPACITY = 1200f;
// Token: 0x04000A8C RID: 2700
private const float USED_FILTER_OUTPUT_RATE = 0.2f;
// Token: 0x04000A8D RID: 2701
private const float CLEAN_WATER_OUTPUT_RATE = 5f;
// Token: 0x04000A8E RID: 2702
private const float TARGET_OUTPUT_TEMPERATURE = 313.15f;
}
Create a new csharp class file in VS and copy the content into it.
Remember to rename
- the class name
idin methodCreateBuildingDef()IDin class
In this example change them toGoldWasher
- Add GoldWasher to build menu.
create a new patch forGeneratedBuildings1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27using System;
using HarmonyLib;
namespace ONI_CuppyUniverse_Mod
{
[]
public class GeneratedBuildings_LoadGeneratedBuildings
{
public static void Prefix()
{
Strings.Add(new string[] {
"STRINGS.BUILDINGS.PREFABS.GOLDWASHER.NAME",
"淘金器"
});
Strings.Add(new string[] {
"STRINGS.BUILDINGS.PREFABS.GOLDWASHER.EFFECT",
"从纯净水中淘取黄金"
});
Strings.Add(new string[] {
"STRINGS.BUILDINGS.PREFABS.GOLDWASHER.DESC",
"你是信无中生有的"
});
ModUtil.AddBuildingToPlanScreen("Food", "GoldWasher");
}
}
}
Reference
很小的时候,我爸我妈就跟我说,之所以起这个名字,是因为当时有一档节目叫语林趣话,当时小两口都喜欢看,感觉当时他们也颇为大胆,毕竟直接把节目的名字拿了过来,如果中意的是《奇葩说》,我岂不是成了陈奇葩了(小声)。
再就是参考了活跃于20世纪初的林语堂(说实话这三个字,比起语林趣味,更像是一档节目),是个了不起的人物啊,发明过汉字打字机,也有人写他的传记,还写过苏东坡传,哈哈,还听说过他关于音译“幽默”二字的小故事。近日这本《吾国与吾民》便是出自先生之笔。
文化的稳定性
林语堂认为的,中华民族稳定的重要因素:
- 家族制度
- 阶层流动
- 以及它们所导致的田园理想
中国人的性格
Mellowness
形成原因:
- 中国社会轻视,甚至鄙视“年轻人的热情”。很早便重视责任和理性选择。
patience
indifference
old roguery
中国人思维方式
中西方对于“学者”的态度不同
中国人更敬重日常生活中的智者,用体验而不是理论来学习(孔子及其学生)。
综合,具体,感性,依赖直觉的思维方式(啊,Ni人感到了慰藉)
过去的中国人缺乏一些抽象“分析能力”
依赖经验来解决问题。
- 会心于忘言之境
- 知其然而不知其所以然
- 道即真理,不知其然谓之道
理想人物
出自林语堂《生活的艺术》
是一个对人生有一种建于明慧悟性上的达观者。
这种达观产生宽宏的怀抱, 能使人带着温和的讥评心里度过一生,丢开功名利禄,乐天知命地过生活。
这种达观也产生了自由意识,放荡不羁的爱好,傲骨和漠然的态度。
一个人有了这种自由的意识以及冷漠的态度,才能深切热烈地享受快乐的人生。
在《吾国与吾民》的最后,秋的精神
我们现在正处于民族的秋天。
在我们的生活中,无论国家还是个人,我们生命都被初秋的精神所弥漫,其中绿色和金色混合,悲伤和喜悦混合,希望和回忆混合。
在这个时刻,春天的纯真成为记忆,夏天的繁荣如同逝去的歌曲,只在空气中留下微弱的回声。
当我们展望生活时,我们的问题不在于如何成长,而在于如何真正地生活。
不在于如何奋斗和劳动,而在于如何享受我们拥有的宝贵时刻。
而在于如何为即将到来的冬天做好准备。
我们有一种感觉,一种以及达到了某个目标的感觉,一种安定下来,并找到了我们想要的东西的感觉,我们有一种已经取得了成就的感觉,虽然当下可能和我们过去的繁荣相比微不足道,但我们仍将有所成就。
就像秋天的森林,虽然失去了属于夏的繁茂,但仍然保留了这份树林原本的荣光,并将一直闪耀下去。
春天很有生机,但过于稚嫩;夏天万物繁茂,但却过于骄矜;
所以我最喜欢秋天,因为它有金黄的叶子,有圆润的格调和斑斓的色彩,它略带悲伤和死亡的预感。
它的金黄的浓郁不是属于春天的天真,也不是发自夏天的力量,而是接近高迈之年的柔和与善良。
它知道生命的有限,但却也因此而感到满足。
在秋天,清晨的山风吹过,把颤抖的树叶欢快地舞到地上,你不知道那落叶的歌声是欢笑的歌声还是别离的歌声,但这正是初秋精神的歌声。
它平静,智慧,成熟,他会用微笑面对伤感的景象,会赞许眼前那青春焕发的清新凉爽的空气,即使中国人本来就应该配得这些。
诗的逻辑
相较于推理片或典型的“起承转合”(注重因果的直线逻辑),电影的逻辑应该更像诗,也就是要遵循诗的逻辑(思维跳跃,不注重因果关系),且诗的逻辑更贴近生活。如果生活的所有事情都能推导出来,这个人很可能生活在楚门的世界。
有一种诗电影
淡化叙事和情节,看中隐喻与抒情。形式上贴近诗。
并不能展现电影的诗意,因为诗意是内涵层面的。
由此,塔可夫斯基认为,电影应该还原生活,纪实就是诗的逻辑。
电影对于我们来说,不仅仅代表里技术进步、我们又多了一种阐释世界的方法而已,它的意义不止这样,电影诞生的那一刻——1895年卢米埃尔的《火车到站》诗所有电影的源头,只有半分钟长,却难以令人忘怀。就在火车朝摄像机开来是,放映厅里的人开始躁动不安,四处逃窜——就在电影诞生的这一刻,一种全新的美学原则便诞生了:人第一次在艺术史上找到了直接留存时间的方法。
而这,就是雕刻时光,这就是电影了
老塔认为电影应该还原客观环境,以及主观感受。有力量的电影应该是来自于对生活的直接观察。





