摘要: 1. Python pass是空语句,是为了保持程序结构的完整性。 pass 不做任何事情,一般用做占位语句。 2.删除一个list里面的重复元素 方法一:是利用map的fromkeys来自动过滤重复值,map是基于hash的,大数组的时候应该会比排序快点吧 方法二:是用set(),set是定义集合 阅读全文
posted @ 2017-02-07 19:52 chaha 阅读(179) 评论(0) 推荐(0) 编辑
摘要: Emmet 语法探析 Emmet(Zen Coding)是一个能大幅度提高前端开发效率的一个工具。 大多数编辑器都支持Snippet,即存储和重用一些代码块。但是前提是:你必须先定义 这些代码块。 Emmet的特点在于你可以设置CSS形式的能够动态解析的表达式,然后根据所输入 的表达式来... 阅读全文
posted @ 2015-10-19 22:56 chaha 阅读(178) 评论(0) 推荐(0) 编辑
摘要: http://code.kpman.cc/2014/10/14/sublime text 3 mac %E6%8C%87%E5%8D%97/ gif 屏幕录制:http://recordit.co/ 或者 http://www.cockos.com/licecap/ http://blog.wp... 阅读全文
posted @ 2015-10-18 16:37 chaha 阅读(246) 评论(0) 推荐(0) 编辑
摘要: 在做项目的过程中通常会有一些可复用的通用性功能,之前的做法是把这个功能抽取出来独立为一个函数统一放到 commonFunctions.js 里面(捂脸),实现类似于 snippets 的代码片段收集。 在理想情况下,开发者只需要实现核心的业务逻辑,其他通用功能可以加载已经实现的模块。 ... 阅读全文
posted @ 2015-10-17 14:01 chaha 阅读(201) 评论(0) 推荐(0) 编辑
摘要: You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you c... 阅读全文
posted @ 2015-10-02 23:00 chaha 阅读(108) 评论(0) 推荐(0) 编辑
摘要: You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality c... 阅读全文
posted @ 2015-10-02 18:01 chaha 阅读(143) 评论(0) 推荐(0) 编辑
摘要: JS中substr和substring的用法和区别 substr和substring都是JS截取字符串函数,两者用法很相近, substr方法 返回一个从指定位置开始的指定长度的子字符串。 string.substr(start[,length]) 注意: length可选项。如length... 阅读全文
posted @ 2015-10-01 13:22 chaha 阅读(167) 评论(0) 推荐(0) 编辑
摘要: Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non zero elements. For example, g... 阅读全文
posted @ 2015-09-30 09:54 chaha 阅读(139) 评论(0) 推荐(0) 编辑
摘要: IndexdDB 是 HTML5 的本地存储,把一些数据存储到浏览器(客户端)中,当与网络断开时,可以从浏览器中读取数据,用来做一些离线应用。Cookie 通过在客户端 ( 浏览器 ) 记录信息确定用户身份,最大为 4 kb 。url 参数用的是 get 方法,从服务器上获取数据,大小不能大于 2 ... 阅读全文
posted @ 2015-09-27 23:27 chaha 阅读(136) 评论(0) 推荐(0) 编辑
摘要: Bootstrap 框架的网格系统工作原理如下:1 、数据行 (.row) 必须包含在容器( .container )中,以便为其赋予合适的对齐方式和内距 (padding) 。 2 、在行 (.row) 中可以添加列 (.column) ,但列数之和不能超过平分的总列数,比如 12 。 3 、具... 阅读全文
posted @ 2015-09-27 21:43 chaha 阅读(204) 评论(0) 推荐(0) 编辑