用户登录(三次机会) enumrate 为可迭代的对象添加序号 li = [11,22,33] for k,v in enumerate(li, 1): print(k,v) range和xrange 指定范围,生成指定的数字 print range(1, 10) # 结果:[1, 2, 3, 4, ...
分类:
编程语言 时间:
2018-11-06 21:24:21
阅读次数:
147
在kernel中使用 half 类型可以在牺牲一定精度的代价下来提升运算速度. 在kernel中, 可以比较方便的对half数据进行计算, 但在host上的, 对half的使用就没那么方便了. 查看 cl_float 的定义: 可知其本质是一个 uint16_t . 所以, 如果直接拿cl_floa ...
分类:
其他好文 时间:
2018-11-06 15:43:18
阅读次数:
1321
Vaswani A, Shazeer N, Parmar N, et al. Attention is all you need[C]//Advances in Neural Information Processing Systems. 2017: 5998-6008. 文章提出纯粹基于atten ...
分类:
其他好文 时间:
2018-11-06 13:36:13
阅读次数:
343
Give a string s, count the number of non-empty (contiguous) substrings that have the same number of 0's and 1's, and all the 0's and all the 1's in th ...
分类:
编程语言 时间:
2018-11-06 11:20:10
阅读次数:
137
java读取Excel文件,笔者认为:从结构上来看,Excel文件是由一个一个的单元格组成的,有点像细胞cell,逐行的排列。那么我们读的时候也应该逐行逐行的读,从左到右的寻找每一个cell。一、实例代码:只是实现了一种方式,因为依照读取内容的不同,读取的后想要的操作不同,因此不能苟同全部,只是方法是相通的。说道Excel文件的结构,这货从数学的角度来说,绝对是一个二维数组,因此我就拿字符串二维数
分类:
编程语言 时间:
2018-11-06 01:03:00
阅读次数:
210
PAT对Scanner类很不友好,会花费大量时间,导致运行时间超时。可采用下列代码优化时间 ...
分类:
编程语言 时间:
2018-11-06 00:47:52
阅读次数:
120
Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have ex ...
分类:
其他好文 时间:
2018-11-05 22:24:22
阅读次数:
176
1. JavaScript 特殊字符 2. 正反斜杠互相替换 'a/b/c'.replace(/\//g,'\\') // "a\b\c" $0.value.replace(/\\/g,'\/') // 'a/b/c' 获取到 而不提取出 某个值后进行直接处理 \ 有转义功能,所以一旦解析必然转义, ...
分类:
Web程序 时间:
2018-11-05 20:05:27
阅读次数:
232
from selenium import webdriver import os driver = webdriver.Chrome() driver.get("http://cn.bing.com") driver.find_element_by_xpath("//input[@id='sb_fo... ...
分类:
编程语言 时间:
2018-11-05 19:05:39
阅读次数:
122