Chapter1 and Chapter2方法定义:def methodName(param1: ParamType, param2: ParamType2, [maybe more]): ReturnType = { // method body}函数式编程中一个约定俗成的说法就是,方法会返回一....
分类:
其他好文 时间:
2014-06-25 19:15:35
阅读次数:
205
note:在html 标签类中的checkbox实现单选效果。在最近的开发项目中,客户要求使用小方格子实现“单选”功能,显然圆点的radio被out了,只能选择chckbox的方块样式,也在网上搜过,可能有点儿脑残,没有找到。废话不多说直接上代码: checkbox实现单选效...
分类:
Web程序 时间:
2014-06-25 19:14:51
阅读次数:
258
Learn to programming in funtional way如果一个方法中存在var的话,那么这个方法很可能就是指令式编程。如果一个方法中只存在val的话,那么这个方法很可能是函数式编程。我们需要尝试着把方法中的val删除掉。副作用,一个方法满足函数式编程的基本要求,但是返回值是一个U...
分类:
其他好文 时间:
2014-06-25 18:31:47
阅读次数:
166
早上做数据迁移,部署完slave2,发现3台机子的日志狂刷:旧slave:2014-05-29 14:35:35 996 [Note] Slave: received end packet from server, apparent master shutdown: 2014-05-29 14:35...
分类:
其他好文 时间:
2014-06-25 16:22:22
阅读次数:
283
Given a string s consists of upper/lower-case alphabets and empty space characters '
', return the length of last word in the string.
If the last word does not exist, return 0.
Note: A word is...
分类:
其他好文 时间:
2014-06-25 10:30:08
阅读次数:
220
Given an array of integers, every element appears twice except for one. Find that single one.
Note:
Your algorithm should have a linear runtime complexity. Could you implement it without using e...
分类:
其他好文 时间:
2014-06-24 23:30:08
阅读次数:
278
【题目】
Say you have an array for which the ith element is the price of a given stock on day i.
Design an algorithm to find the maximum profit. You may complete at most two transactions.
Note:
You may not engage in multiple transactions at the same time (i...
分类:
其他好文 时间:
2014-06-24 23:28:43
阅读次数:
223
Given a collection of integers that might contain duplicates, S, return all possible subsets.
Note:
Elements in a subset must be in non-descending order.The solution set must not contain duplica...
分类:
其他好文 时间:
2014-06-24 20:58:32
阅读次数:
230
Given an array of integers, every element appears three times except for one. Find that single one.
Note:
Your algorithm should have a linear runtime complexity. Could you implement it without u...
分类:
其他好文 时间:
2014-06-24 15:52:58
阅读次数:
222
【题目】
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.
For example,
"A man, a plan, a canal: Panama" is a palindrome.
"race a car" is not a palindrome.
Note:
Have you consider that the string m...
分类:
其他好文 时间:
2014-06-24 15:35:07
阅读次数:
150