上一页 1 2 3 4 5 6 7 8 ··· 27 下一页
摘要: ``` # pattern支持字符或者字符串 def my_split(string, pattern): ret = [] len_pattern = len(pattern) while True: index = string.find(pattern) if index == -1: ret.append(st... 阅读全文
posted @ 2019-05-27 20:39 Rocin 阅读(674) 评论(0) 推荐(0) 编辑
摘要: 解决步骤 1. 从https://github.com/boot2docker/boot2docker/releases下载iso到~/.docker/machine/cache/里 2. docker machine create driver virtualbox virtualbox boot 阅读全文
posted @ 2019-05-03 20:24 Rocin 阅读(2743) 评论(0) 推荐(0) 编辑
摘要: 问题 过多的文字会把盒子撑开,造成布局错乱。 解决 效果 阅读全文
posted @ 2019-03-13 13:28 Rocin 阅读(1890) 评论(0) 推荐(0) 编辑
摘要: 效果 踩坑经历 TLDR; 在几个小时的google和stack overflow的苦苦搜索后,无果。 经过自我思考,想到了一种实现方法: 整个页面是一个盒子,要出现滚动条,必然里面的元素要溢出。也即是,元素水平overflow,那么就出现水平滚动条。元素垂直overflow,那么会出现垂直滚动条。 阅读全文
posted @ 2019-03-12 02:18 Rocin 阅读(11736) 评论(0) 推荐(1) 编辑
摘要: 方法一代码 在新Tab打开 方法二代码 阅读全文
posted @ 2019-03-11 15:31 Rocin 阅读(5759) 评论(0) 推荐(0) 编辑
摘要: 实现这三个功能的踩坑记录。 1. 需求 在Vue中,有一个input, 双击时编辑文本,点击该input节点外的其他地方,则取消编辑。 那么这里有三个要实现的地方 第一是双击显示编辑框。 第二是自动聚焦点击的显示框。 第三是点击编辑框外的地方,隐藏编辑框。 一二点都是在startPipeLineNa 阅读全文
posted @ 2019-03-05 23:47 Rocin 阅读(6655) 评论(0) 推荐(0) 编辑
摘要: To be a Pythonista 1. assert 例子1 如果关闭assert, 很危险 def delete_product(prod_id, user): assert user.is_admin(), 'Must be admin' assert store.has_product(p 阅读全文
posted @ 2019-02-19 12:54 Rocin 阅读(1596) 评论(0) 推荐(0) 编辑
摘要: 参考 https://simpleit.rocks/python/django/generate uml class diagrams from django models/ 运用django extensions(中的graph_models) + pygraphviz(or pydotplus) 阅读全文
posted @ 2019-02-18 10:12 Rocin 阅读(972) 评论(0) 推荐(0) 编辑
摘要: ``` from functools import wraps def cache(func): cache = {} @wraps(func) def wrap( args): if args not in cache: cache[args] = func( args) return cache 阅读全文
posted @ 2019-02-11 22:21 Rocin 阅读(2039) 评论(0) 推荐(0) 编辑
摘要: 参考网址 https://mathiasbynens.github.io/rel noopener/ 例子 target="_blank"会打开一个新tab,如果不加rel="noopener",那么在新tab中会有一个window.opener对象,相当于可以控制打开这个tab的前一个页面,这样会 阅读全文
posted @ 2019-02-10 17:27 Rocin 阅读(1330) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 27 下一页