摘要: https://leetcode.com/problems/maximum-subarray/Find the contiguous subarray within an array (containing at least one number) which has the largest sum... 阅读全文
posted @ 2015-08-02 10:46 Xander-Hang 阅读(198) 评论(0) 推荐(0) 编辑
摘要: 昨天和同学又聊到了大公司小公司的话题。鸭哥所在的小投资公司昨天因为老板看员工上班着装太随意,喊着大家上街买衣服,老板买单。虽然是一家小公司,好歹也是一家投资公司,钱肯定是不少的。老板拖着一车人到了市里一家定制西装的门店,每个人挑了一件裤子和T恤,差不多每人七八百。鸭哥不敢要,因为自己马上实习就要... 阅读全文
posted @ 2015-07-31 23:39 Xander-Hang 阅读(454) 评论(1) 推荐(0) 编辑
摘要: 测试驱动开发原则 翻译自>测试驱动开发是指首先编写包含所有测试软件特点的测试集,然后再去开发软件。也就是说,在编写软件之前先把这个软件的测试文档写清楚。举个例子,如果有个程序员想编写一个可以计算一组数字平均值的函数,那我们先要写出这个函数是怎么用的。我们可以这样写:assert average(1,... 阅读全文
posted @ 2015-07-31 11:38 Xander-Hang 阅读(302) 评论(0) 推荐(0) 编辑
摘要: Test-Driven Development PrinciplesTDD consists of writing test cases that cover a desired feature, then writing the feature itself. In other words, th... 阅读全文
posted @ 2015-07-31 10:40 Xander-Hang 阅读(201) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/single-number-ii/很无耻的又一次使用了黑暗料理...class Solution: # @param {integer[]} nums # @return {integer} def singleNumbe... 阅读全文
posted @ 2015-07-30 14:30 Xander-Hang 阅读(387) 评论(0) 推荐(0) 编辑
摘要: 无它,非bin()莫属。bin(x)Convert an integer number to a binary string. The result is a valid Python expression. If x is not a Python int object, it has to de... 阅读全文
posted @ 2015-07-29 16:11 Xander-Hang 阅读(297) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/product-of-array-except-self/Given an array of n integers where n > 1, nums, return an array output such that output[i] ... 阅读全文
posted @ 2015-07-29 14:34 Xander-Hang 阅读(230) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/merge-two-sorted-lists/class Solution: # @param {ListNode} l1 # @param {ListNode} l2 # @return {ListNode} de... 阅读全文
posted @ 2015-07-29 12:18 Xander-Hang 阅读(201) 评论(0) 推荐(0) 编辑
摘要: 废话不多说直接祭上python3.3x的文档:(原文链接)object.__hash__(self)Called by built-in function hash() and for operations on members of hashed collections including s... 阅读全文
posted @ 2015-07-23 18:20 Xander-Hang 阅读(8801) 评论(0) 推荐(2) 编辑
摘要: 乱写__eq__会发生啥?请看代码..>>> class A:... def __eq__(self, other): # 不论发生什么,只要有==做比较,就返回True... return True... >>> a = A()>>> b = A()>>> a =... 阅读全文
posted @ 2015-07-23 17:17 Xander-Hang 阅读(6026) 评论(0) 推荐(0) 编辑