def all_equal(lst): print(lst[:]) # [1, 2, 3, 4, 5, 6] # [1, 1, 1, 1] print(lst[::-1]) # [6, 5, 4, 3, 2, 1] # [1, 1, 1, 1] print(lst[1:] == lst[:-1]) ...
分类:
其他好文 时间:
2020-05-03 14:48:11
阅读次数:
52
from re import sub def camel(s): print(s) # some_database_field_name # Some label that needs to be camelized # some-javascript-property # some-mixed_s ...
分类:
其他好文 时间:
2020-05-03 14:45:22
阅读次数:
68
def capitalize_every_word(s): print(s) # hello world! print(s.title()) capitalize_every_word('hello world!') # Hello World! 2020-05-03 ...
分类:
其他好文 时间:
2020-05-03 14:31:29
阅读次数:
57
表3 IP地址规划表 设备名称 VLAN端口名称 IP地址 端口连接状况 RG-S3760-1 VLAN1 192.168.11.1/24 F0/1-RG-S2126G1 VLAN2 192.168.12.1/24 F0/2-RG-S2126G2 VLAN10 192.168.13.1/24 F0/ ...
分类:
其他好文 时间:
2020-05-03 12:28:18
阅读次数:
110
前言 用 WebGL 渲染的 3D 机房现在也不是什么新鲜事儿了,这篇文章的主要目的是说明一下,3D 机房中的 eye 和 center 的问题,刚好在项目中用上了,好生思考了一番,最终觉得这个例子最符合我的要求,就拿来作为记录。 效果图 http://hightopo.com/demo/3DRo. ...
分类:
Web程序 时间:
2020-05-03 01:23:34
阅读次数:
85
7-1 Knuth洗牌法 (20分) Knuth 洗牌法是生成 { 1, 2, ..., n } 的一个随机重排列的算法。与每次反复随机生成一个数字,直到获得一个不重复的新数字的算法不同,Knuth 洗牌法从原始序列 { 1, 2, ..., n } 开始,逐次洗牌。洗牌的方法是从左到右,每轮从没确 ...
分类:
其他好文 时间:
2020-05-02 09:38:13
阅读次数:
118
PyQt5 无边框窗口重新定义鼠标事件 #! /usr/bin/env python # -*- coding:utf-8 -*- import sys from PyQt5.QtWidgets import QApplication, QWidget from PyQt5.QtCore impor ...
分类:
其他好文 时间:
2020-05-01 20:55:07
阅读次数:
92
平常一直用SSH Secure连接Centos,一段时间不用,发现突然连不上,遂翻看博文 以下转自 JohnJin2018 博主 自己在VMware中装了CentOS 6.3,然后主机(或者说xshell)与里面的虚拟机连不通,刚学习,一头雾水,查了半天,也不知道怎么弄。 经指点,找到下面这篇文章, ...
分类:
其他好文 时间:
2020-05-01 20:24:51
阅读次数:
63
一.水平居中 (1)直接父集设置text-align:center; .parent{text-align:center;} <div class="parent"> <div class="child">DEMO</div> </div> 优点:兼容性好,甚至可以兼容ie6、ie7缺点:child ...
分类:
其他好文 时间:
2020-05-01 16:39:00
阅读次数:
61