在使用python的过程中遇到很多问题,知识点比较散,通过这篇文件进行归纳。 一、python的itertools模块 combinations函数:将列表,按给定的长度进行组合。 结果:[(1,), (2,),(3,),(4,),(1,2),(1,3)...(1,2,3),(1,2,4), ... ...
分类:
编程语言 时间:
2018-04-07 12:51:23
阅读次数:
190
将条件逻辑表述为数组运算 numpy.where()是一个三目运算的表达式 假设有上面三个数组,当condi中的值为True的时候,从xarr中选取值,否则从yarr中选取值,组成一个新的数组。利用普通的列表推导式如下: result = [(x if c else y) for x,y,c in ...
分类:
编程语言 时间:
2018-04-06 15:21:40
阅读次数:
227
本文目录:1.BEGIN...END2.true和false3.if结构4.case结构5.loop、leave和iterate6.repeat循环7.while循环 MySQL/MariaDB中的符合语句结构有:BEGIN...END,if,case,while,loop,repeat,curso ...
分类:
数据库 时间:
2018-04-05 21:05:56
阅读次数:
308
Remove adjacent, repeated characters in a given string, leaving only one character for each group of such characters.AssumptionsTry to do it in place.... ...
分类:
其他好文 时间:
2018-04-05 14:31:52
阅读次数:
145
进行以下操作前先 import random ,导入random模块 1. random.seed(int) 给随机数对象一个种子值,用于产生随机序列。 对于同一个种子值的输入,之后产生的随机数序列也一样。 通常是把时间秒数等变化值作为种子值,达到每次运行产生的随机系列都不一样 seed() 省略参 ...
分类:
编程语言 时间:
2018-04-04 18:14:35
阅读次数:
226
选择器分为3种 1. 元素选择器——标签名 2. id选择器—— #(井号) 3. 类选择器—— .(点) 背景的选择 background-color background-image:url(文件路径) background-repeat属性可以设置背景是否重复 字体的设置 行间距: line- ...
分类:
Web程序 时间:
2018-04-03 10:54:43
阅读次数:
250
在做JavaWeb的SSH框架开发的时候,遇到过很多的细节问题,这里大概记录下 我使用的IDE是Eclipse(老版本)三大框架:Spring4、Struts2、Hibernate5 1.web.xml的配置 1.ContextLoaderListener的作用: ContextLoaderList ...
分类:
编程语言 时间:
2018-04-01 23:04:22
阅读次数:
261
1.需求分析 2.功能设计 基本功能 基本功能 拓展功能 拓展功能 高级功能 高级功能 3.设计实现 4.代码说明 递归查重 递归查重 // //代码功能:递归实现二叉树查重 // //实现思路: //1、先判断两个算式答案相不相同,不相同则算式一定不相同。 //2、然后对两式计算左右两边的值是否能 ...
分类:
其他好文 时间:
2018-03-31 22:16:49
阅读次数:
177
本地推送: UILocalNotification *notification=[[UILocalNotification alloc] init]; if (notification!=nil) { NSDate *now=[NSDate new]; notification.fireDate=[ ...
分类:
移动开发 时间:
2018-03-31 12:07:17
阅读次数:
237
Reverse bits of a given 32 bits unsigned integer. For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), retur ...
分类:
其他好文 时间:
2018-03-27 10:21:26
阅读次数:
193