Tux


KISS

Move To Front

```Python
"""1.3.40 Move-to-front.
Read in a sequence of characters from standard input and
maintain the characters in a linked list w...

Algorithms_4th #algs-4th #move-to-front-python 0 comments 103

环形缓冲区(ring buffer)

```Python
"""1.3.39 Ring ring_buffer
A ring ring_buffer, or circular queue, is a FIFO data structure of a fixed size N.
It is useful f...

Algorithms_4th #algs-4th #ring-buffer #算法 0 comments 101

使用Docker部署站点,文件操作编码错误小记

碰到的问题如下

UnicodeEncodeError: 'ascii' codec can't encode characters in position xx-xxx: ordinal not in range(128)

因为要进行文件操作,而文件名含有中文的...

Docker #PYTHONIOENCODING #Docker #Python3 0 comments 116

We're venom

原来还是附身题材呀。电影在北美上映没多久,漫威之父就R.I.P了。一看到寄生虫(parasite),突然间就想起了之前看的蜘蛛侠,第几部就不记得了,同样是寄生,蜘蛛侠里面的是黑蜘蛛,而毒液里面的是外星生物——毒液罢了。两者的共同点还是有的,如都是在蓝色星球上面准备搞破坏的,...

movie #venom #剧集 #电影 0 comments 134

log about linux kernel's sysctl

vfs_cache_pressure

这个参数用于控制内核回收缓存目录和索引节点对象的频率。

它的默认值是100,相对于页缓存和交换缓存回收,内核将尝试以一种相对快的频率试图回收目录条目(dentries)和inode。...

Linux #Linux #系统性能调优 #sysctl 0 comments 110

Writing selection sort in hand or on white board

选择排序

```Python3
class SelectionSort:
"""Ascending sort
"""
def selection_sort(self, array):
for i in ran...

ds_alg #ds_alg #algorithms #selection sort 0 comments 113