在交互式环境中输入: 如下图: 还是在交互式环境中: 图片展示: 这种反射机制的用字符串来操作类的属性和方法的三个函数并不常用。编写框架等特殊项目是采用到。 但这时用户仍然可以通过w._water来访问实例属性,封装的不好,也不会自动检查数据是不是浮点型,不好。 怎么解决? 用@属性.setter ...
分类:
编程语言 时间:
2017-06-05 23:52:43
阅读次数:
289
A power network consists of nodes (power stations, consumers and dispatchers) connected by power transport lines. A node u may be supplied with an amo ...
分类:
其他好文 时间:
2017-06-01 16:34:06
阅读次数:
163
apt-get install openssh-server 主要报错是:Unable to correct problems, you have held broken packages. 此时解决方法:sudo apt-get install openssh-client=1:5.3p1-3ub ...
分类:
其他好文 时间:
2017-05-29 16:38:31
阅读次数:
788
Completely uninstalling Astrill fixed the issue but this solution is not what I want. Astrill support answered (within 2 hours) saying the correct fix ...
分类:
编程语言 时间:
2017-05-27 21:54:05
阅读次数:
299
1、查看新添加的磁盘,如下: /dev/sde为新添加磁盘 可用如下脚本进行扫描 echo ' - - - ' > /sys/class/scsi_host/host0/scan [root@rac01 ~]# fdisk -l Disk /dev/sda: 21.5 GB, 21474836480 ...
分类:
系统相关 时间:
2017-05-25 14:50:25
阅读次数:
311
什么是递归?简单的说就是:函数自身调用自身。 “普通程序员用迭代,天才程序员用递归” 虽然递归 在运行时会不断出栈压栈,调用底层的寄存器,造成空间上的占用以及时间上的缓慢, 但在一些算法上面仍然是递归很实用 但需要注意的是: #递归是自己调用自己 很消耗时间,还会有消耗空间的危险,所以递归递归一定要 ...
分类:
编程语言 时间:
2017-05-23 23:43:14
阅读次数:
271
To 洛谷.2879 区间统计 题目描述 FJ's N (1 ≤ N ≤ 10,000) cows conveniently indexed 1..N are standing in a line. Each cow has a positive integer height (which is a ...
分类:
其他好文 时间:
2017-05-23 15:59:28
阅读次数:
194
题目大意:输入一个字典,再输入一些单词,如果单词在字典里有的则输出“*** is correct”,否则如果字典里某些单词能通过增加/删除/修改一个字符变成输入的单词,则依次输出这些单词。 思路:模拟、字符串处理。 按照题目要求模拟即可。 ...
分类:
其他好文 时间:
2017-05-21 20:40:55
阅读次数:
175
随着直播越来越火,所在公司也打算制作自己的直播,所以去了解了这方面,使用后发现还是有些问题需要记录的。 经过分析,制作直播应该是分为两块来做,即直播与实时评论。这里先去制作实时评论,等直播ok后,也会将相应心得写上来。 我们直播采用了阿里云,评论采用了融云。 其实融云的api还是比较清晰的,只不过w ...
分类:
Web程序 时间:
2017-05-18 11:35:07
阅读次数:
461
i = 0 tname = 'tom' tpasswd = '123456' for i in range(3): #while i<3: username = (input('please input username:')).strip() password = input('please in... ...
分类:
其他好文 时间:
2017-05-18 01:20:46
阅读次数:
200