0%

Short Circuit

  • a and b evaluates to a if a is falsey, otherwise it evaluates to b
  • a or b evaluates to a if a is truthy, otherwise it evaluates to b
  • not a evaluates to True if a is falsey, otherwise it evaluates to False
1
2
3
4
5
>>> 0 and 'Hello' 0
>>> 'x' and 'y' 'y'
>>> '' or 0
0
>>> -23 or False -23
  • True is represented as 1, and False is represented as 0.
阅读全文 »

image-20211022172413814
image-20211022172413814

The Clustrmaps widget can show the visitors' map of my website. It is nice, but its 3D global version is buggy when put on the Hexo website. So I put its .js file locally, and modified several parts in it, to make it displayed normally on Hexo websites.

Maybe one day the .js file will be updated by Clustrmaps, and I'll need to revise it again. So I record what I did here.

  1. Download the js file, put it here:/themes/next-new-version/source/js/clustrmaps.js, then the script label in the sidebar.swig is change as: <script type="text/javascript" id="clstr_globe" src="/js/clustrmaps.js?d=gWCOZyJlHF_Sc1eqXROD53yLLxxfC2y7Ytvw9JUfmFg"></script>. This way, I can modify codes in the .js file, or it would cause the following bugs.

  2. The variable's name velocity is duplicated with that of Hexo😂😂. So I replaced all with velocityD in the .js file.

  3. When the .js script is executed, the Hexo hasn't rendered the page yet, so the container of this widget still has width of 0. However, in the script, it fetches parent's width and sets it at that time! So it will disappear since its width is 0😅. To fix that, I changed the 302 line as:

    1
    pw = $("#clstr_globe").parent().parent().parent().width();

    The parent of parent of parent of the script label has normal width... This is funny but useful...

阅读全文 »

在复习期末考试,被计算最小公倍数的一道题卡了两次了……怪我数学基础忘光了。在此整理一下最小公倍数和最大公约数相关的概念和定理。然后整理一下这道题:

Write a function to take in a tuple of integers, and it will return the smallest integer that is a multiple of every number in the tuple. Sample run:

>>> print(smallestMultiple((2, 3, 5,)))

30

>>> print(smallestMultiple((1, 2, 3, 4)))

12

>>> print(smallestMultiple((399, 772, 163, 959, 242)))

832307365428

概念和定理

最大公约数:如果一个数可以分别被a和b整除,那它就是a和b的公约数。最大的那个就是最大公约数。

阅读全文 »

My ideal 5 years' cognition plan🤔:

关于哲学/社会/权力/资本主义:黑格尔(《小逻辑》)→马克思(《资本论》)→韦伯(《新教伦理与资本主义精神》)→福柯(《规训与惩罚》)

关于文学/存在主义:加缪/海明威→陀思妥耶夫斯基→尼采/萨特

(关于精神分析:拉康/齐泽克)

阅读全文 »

关于生活

关于生活,值得一提的就是我在学着做菜了。可惜做菜是在异国他乡通过室友、女票、下厨房app、瞎折腾等渠道混合学习的,跟家乡的菜系一点都不搭边;在北京的7年生活里,我的口味本来就已经受到了学校食堂、外卖的影响,做菜风格再这样一混杂,我可就全然不是湖北人的胃了。有机会回家的时候还是要好好学学家里人做菜的。不过,几时才会回家呢?

我不再大费周章地在日记本上写日记,像初高中那样。因为写得再深刻、再动情,日后也懒得翻看啊……而且确实很费时间。我采用了一种新的形式,谓之 video diary (从某部恐怖片里学的方式……),暂时还挺有意思的。

阅读全文 »

我摘了一些关于攻壳机动队tv版第二季的评论,对我挺有启发的.

对政治和社会的认识还不到看懂全剧的程度,过个几年会再二刷的.

阅读全文 »

我最近在看《攻壳机动队》,这是一部赛博朋克动漫系列作品,探讨各种社会、政治、哲学话题。我今晚看了TV版第二季第2话“饱食的我”,是我认为最好的剧集之一。除了这集以外,第一季第13话也很精彩。

《攻壳》TV版的剧集一般都分主线剧集或独立故事剧集,主线之间穿插着独立的故事。第二季第2话就是一集独立故事,总时长也不到半小时,因此如果感兴趣不妨去看一看,b站上就有。《攻壳机动队》TV版第二季第2话

梗概

正义的基诺

阅读全文 »