This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import List | |
''' | |
python3 leetcode data structure helper | |
''' | |
class ListNode: | |
def __init__(self, val=0, next=None): | |
self.val = val | |
self.next = next |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3 | |
EXPOSE 8000 | |
CMD ["python", "-m", "http.server"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
建立全文索引并使用ngram插件 | |
ALTER TABLE `student` ADD FULLTEXT INDEX ft_stu_name (`name`) WITH PARSER ngram #ft_stu_name是索引名,可以随便起 | |
或者:ALTER TABLE `student` ADD FULLTEXT ft_stu_name (`name`) WITH PARSER ngram | |
设置中文检索分词插件ngram参数,在文件/etc/mysql/conf.d/my.cnf,增加一行: | |
ngram_token_size=2 | |
每次修改ngram_token_size后 需要 OPTIMIZE TABLE TABLE_NAME | |
OPTIMIZE TABLE会锁定表,而且可能会用掉较长时间,因此应在空闲时运行。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
昨天在Docker上部署的Scrapyd突然挂了,重启不成功。 | |
一开始显示类似于如下的错误信息: | |
Error response from daemon: Cannot start container gitlab: Error getting container baba68ebcffe338504c31cc31ae109e1d57f4e8e1910433263ed2c1ea1217ddd from driver devicemapper: Error mounting '/dev/mapper/docker-253:0-1048720-baba68ebcffe338504c31cc31ae109e1d57f4e8e1910433263ed2c1ea1217ddd' on '/var/lib/docker/devicemapper/mnt/baba68ebcffe338504c31cc31ae109e1d57f4e8e1910433263ed2c1ea1217ddd': device or resource busy | |
Error: failed to start containers: [gitlab] | |
运行: | |
sudo umount /var/lib/docker/devicemapper/mnt/baba68ebcffe338504c31cc31ae109e1d57f4e8e1910433263ed2c1ea1217ddd | |
后能够成功执行docker命令,但是Scrapyd容器依然不断自动重启。 |