静静的小窝

记录自己的感受与收获

静评原为我发布在学校内部平台的内容,现同步到这里。
原文地址 https://shuiyuan.sjtu.edu.cn/t/topic/187269

静评旨在抛砖引玉。

https://mp.weixin.qq.com/s/_nS7aQUcgs5shiCgcSGm_A

静静发现,这个样例中的人普遍被想变“美”但是在社会规约下难以变“美”而困扰,末尾的做整容手术与看心理医生这一已是不太被认可的行为做比较,进一步凸显出来了这些人的矛盾处境。

静静觉得,她们的境遇有多个因素。一个是外界他人的“精致”与自身的不“精致”带来的冲突与压力,让这些人看到其他人的“精致”而感到一定的自卑,同时这也是传统“万般皆下品,惟有读书高”式微,外貌愈加被看重后的自我认同的冲突的结果。

静静想,在评价方式撕裂的当下,如何良好地认识自己可能越来越重要,正如文末提到的心理医生一样,多元化的问题不断出现。

静静还想,和那些更早“精致”的人比,文章中的主人公们是晚的,但也有人还没开始,那是换一条赛道还是和那些已经进场的玩家比赛,先追赶再超越呢?文章中的这种撕裂的苦恼,是否也是中国在发展中遇到的复杂方向选择的一个缩影呢?

静静也想,人作为一种自以为高级的物种,是否有能力超脱出此时的“精致”定义呢?是否有可能,我们有着更复杂混合的“精致”呢?

源友们,你们怎么看呢?

本静评对象为此篇文章,对于其真实性完整性等无法保证,如有错误漏洞,请大家指出。

静评原为我发布在学校内部平台的内容,现同步到这里。
原文地址 https://shuiyuan.sjtu.edu.cn/t/topic/186912

静评旨在抛砖引玉。

https://mp.weixin.qq.com/s/cFvtC6ErQgNa_XF6xrUunQ

静静发现,这里面提到了两个场所的“按摩椅”问题,一个是在火车候车区域出现大量按摩椅,一个是在电影院出现按摩椅。

静静觉得,这两个场景可能存在着不同。对于候车,这只是铁路部门给予的便利服务,购买的票是从甲地到乙地的车票,这是否可以解释为包括了乘车前在候车区域有座位的服务呢?对于电影院,票上已经明确了座位,那么理应提供相应的位子,并保证相应的卫生等。当然,按摩椅也是座位,提供按摩椅算是提供座位吗?

静静想,这个问题的关键矛盾在于服务的提供方不认为提供普通座椅是包括在售出票中的,而购买者则认为是在的。在这方面,法律上可能需要进一步的进行责任的划分,对相关合同的权责关系进行细致的明确。

源友们,你们怎么看呢?

本静评对象为此篇文章,对于其真实性完整性等无法保证,如有错误漏洞,请大家指出。

静评原为我发布在学校内部平台的内容,现同步到这里。
原文地址 https://shuiyuan.sjtu.edu.cn/t/topic/186810

静评旨在抛砖引玉。

https://mp.weixin.qq.com/s/9xwsdhsNNM9VEq6WVgvMbA

比较明确的是,限制性措施还没有实行,相关行业企业仍有运作空间。

想必不少源友会想到“教培”事件的影响,进行比较,

静静发现,存在2点不同,一个是时间上,一个几乎是立刻,一个则还有数月。一个是受影响的企业,一个立刻表明了支持,一个则表示了一定的反对。

静静觉得,这两种各有利弊,一种是快刀斩乱麻式地处理,避免了长时间博弈的消耗以及部分企业“钻空子”的行为。一种这是温水煮青蛙式地处理,避免了快速变化带来的市场波动。

静静想,看不见的手需要受约束越来越成为共识,但是如何管,如何放,如何平稳过度,仍是一个需要讨论的话题。

源友们,你们怎么看呢?

本静评对象为此篇文章,对于其真实性完整性等无法保证,如有错误漏洞,请大家指出。

这学期上了一门关于数据处理的课程,需要使用hadoop,版本为3.2.2(一个在hadoop官网下载链接里面都没有的的旧版本。
但是在我们组的电脑上(manjaro + WSL + VM ware + Virtual box 各种东西齐了)根据官方的教程没有能够成功开启多机的集群(不过启动了单机的伪集群),经过一些分析和上网的查询,发现是自带的bash脚本存在问题,导致启动失败,使用完脚本之后,jps显示并没有启动任务。

换用hdfsyarn 直接启动可以避免这个问题。

在namenode上,使用以下命令:

1
2
3
4
5
6
7
8
9
# 第一行是前台运行,第二行是后台启动,第三行是停止后台的任务。
hdfs namenode
hdfs --daemon start namenode
hdfs --daemon stop namenode

# 第一行是前台运行,第二行是后台启动,第三行是停止后台的任务。
yarn resourcemanager
yarn --daemon start resourcemanager
yarn --daemon stop resourcemanager

在datanode上,使用以下命令:

1
2
3
4
5
6
7
8
9
# 第一行是前台运行,第二行是后台启动,第三行是停止后台的任务。
hdfs datanode
hdfs --daemon start datanode
hdfs --daemon stop datanode

# 第一行是前台运行,第二行是后台启动,第三行是停止后台的任务。
yarn nodemanager
yarn --daemon start nodemanager
yarn --daemon stop nodemanager

个人感觉可以先多开终端前台运行,方便及时看到出现的各种问题:

  1. format格式化出现问题,解决方法:重新format(根据网上的资料,好像要使用Y,而不能是y,必须大写)。这种情况可能在多次失败重启之后发生。
  2. 提示hdfs的文件夹访问失败,解决方法:删除对应的文件夹,然后重新启动。这种情况可能在多次失败重启之后发生。

注意使用虚拟机时,注意对应的IP,端口,hostname的对应关系,如果出现了提示链接失败,无法连接服务器的日志,有可能就是这些地方有问题导致无法访问,当然也可能是对吗服务器的node炸了。可以使用lsof -i 去确认网络连接情况,确认是否端口在listen,对面机器是否有成功连接过。当然,还有可能是防火墙之类的阻断了连接。

这是之前出的一道题,稍微进行了一些小修改。
题目链接:https://codeforces.com/contest/894/problem/A

  1. 最简单的方法就是搜索遍历所有的可能的排列情况,即枚举结果字符串的每一位在原字符串中的位置,故复杂度为$O(n^3)$,如果需要的匹配的字符串更长,那么复杂度更高。

  2. 随后可以发现目标字符串要完全符合要求,意即只要有一位不符合就一定不被计算,故可剪枝,只有当前面的字符串都符合要求的时候才继续遍历,常数可以进行优化为原来的$\frac{1}{26}$,但复杂度仍旧不变。

  3. 从前面的剪枝可以发现并不一定要遍历每种可能才可以,可以保存中间量直接相加即动态规划

可以一维存储原字符串的下标,一维存目标字符串的下标,表示到目前为止符合的字符串数量,随后从前往后相加得最后得数。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
for (int j = 0; j < 105; j++)
{
for (int i = 1; i < 5; i++)
{
dp[i][j] = 0;
}
dp[0][j]=1;
}
for (int j = 0; j < st.length(); j++)
{
for (int i = 0; i < 3; i++)
{
if (st[j] == base[i])
{
dp[i + 1][j + 1] = dp[i][j] + dp[i+1][j];
}
else
{
dp[i + 1][j + 1] = dp[i + 1][j];
}
}

最后输出dp[3][st.length()]作为答案。

可以注意到过程当中一直是dp[i]dp[i+1],说明实际并不需要这一维度,可以删去这一维度到

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
for (int i = 1; i < 5; i++)
{
dp[i] = 0;
}
dp[0] = 1;
for (int j = 0; j < st.length(); j++)
{
for (int i = 0; i < 3; i++)
{
if (st[j] == base[i])
{
dp[i + 1] = dp[i] + dp[i + 1];
}
else
{
dp[i + 1] = dp[i + 1];
}
}
}

同时注意到else实际上什么都没有做,可以直接删去。

这是几个月前的VY223的周记,放出来和大家交流一下。

Journal 1

It’s the first week of my Summer 2022, the term with VY223, which is also my first full online term. Fully online gives more challenging with some advantages. For example, I could read more times in the chat box rather than just listen to others’ works one time.

There are many reasons why I take this class as an engineering student.

First, I think there are no conflicts between engineering and creative writing. Let me provide some conditions that it helps. This week, the Student Science and Technology Innovation Association of JI, cooperating with other institutes, organized a competition in computer programming. Instead of just giving definitions directly, we need to use a story to make them up to help to understand.

Also, I need HU course credits. So I chose many classes in the first and the second round of course selection because there were much more people who want to have HU classes than the maximum limits, so I selected many classes to increase the chance that I could get one HU class. Luckily, I caught VY223 from other candidates.

During the third round, I received many emails, telling me that some courses had empty seats to select. However, I didn’t drop VY223 for its first experience, in which I followed the instruction to finish a short story. The process, that writing sentences to build a grotesque universe without thinking of detailed logic relations at first and then adding details to fill the story, lured me in immediately.

For me, a person who prefer science fiction and detective novels, a good idea is the soul of a story. For example, Around the World in Eighty Days written by Jules Verne is a story about a debt that whether one can travel around the world in eighty days. The best point I think is that after failing to come back to London on time, they surprisingly got one more day thanks to the time zone. Points like that make a story good because it will never let you down at the end of the story with many hints through the story.
For a short story, like the one we make in the first class, a clear aim should be given to the main character which could lead to the development of the story and keep the readers’ will to explore what will happen or why something happened. What’s more, not like stories that have more space to introduce the background at the beginning of the story, short stories can give hints about the world during the actions of the main character that leave enough space for the readers to have their own understanding.

阅读全文 »

John died.

Mr. Smith opened his diary with a strong sense of curiosity, wondering what made him stir the city for a month. Reading John’s diary, Smith believed he knew what happened.

Everything started two months ago which was the time John started his diary by his self-introduction “As one of the young individuals who had just graduated as a doctor in 2050, full of hope in life, John, the writer, is sitting behind the screen, with his hands flying above the keyboard.”, followed by his recalling what his parents told him when he was young.

阅读全文 »