自定义 Person 类class Person: NSObject { var name: String? var age: Int?}getter & settervar _name: String?var name: String? { get { return...
分类:
其他好文 时间:
2015-06-24 23:45:13
阅读次数:
186
闭包定义闭包参数闭包返回值闭包简化 - 尾随闭包闭包的循环引用weak var weakSelf = selfdemo("zhangsan") { (_) -> Int in println(weakSelf?.view.backgroundColor) return 20}
分类:
其他好文 时间:
2015-06-24 23:44:20
阅读次数:
168
Related to question
Excel Sheet Column Title
Given a column title as appear in an Excel sheet, return its corresponding column number.
For example:
A -> 1
B -> 2
C -> 3
...
Z ...
分类:
其他好文 时间:
2015-06-24 22:40:14
阅读次数:
150
1. Question合并两个有序链表,返回的新链表是通过拼接原来的两个链表得到Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together th...
分类:
其他好文 时间:
2015-06-24 22:28:44
阅读次数:
208
#include
#include
bool isValidIp(char *s)
{
int len=strlen(s);
int i=0;
if(len<7)
return false;
for(i=0;i<len;i++)
{
if(('0'<=s[i]&&s[i]<='9')||(s[i]=='.'))
continue;
else
return fal...
分类:
其他好文 时间:
2015-06-24 21:05:55
阅读次数:
155
1 高阶函数的使用:import mathdef add(x, y, f): return f(x) + f(y)sq = math.sqrtprint add(25, 9,sq)2. map函数:map()函数map()是 Python 内置的高阶函数,它接收一个函数 f 和一个 list,...
分类:
编程语言 时间:
2015-06-24 20:42:58
阅读次数:
206
import timeimport randomimport threadingimport inspectdef get_current_function_name(): return inspect.stack()[1][3] class Inclass: def __init...
分类:
编程语言 时间:
2015-06-24 20:32:29
阅读次数:
155
doPost(null, "https://www.baidu.com/");/** * 访问数据库并返回JSON数据字符串 * * @param params * 向服务器端传的参数 * @param url * @return * @throws Excep...
分类:
Web程序 时间:
2015-06-24 20:31:53
阅读次数:
130
文件大小未知长度
已经下载0
完成进度0%
//文件长度
var filesize=0;
function $(obj) {return document.getElementById(obj);}
//设置文件长度
function setFileSize(fsize) {
filesize=fsize;
...
分类:
其他好文 时间:
2015-06-24 19:03:46
阅读次数:
117
#83 Remove Duplicates from Sorted List
Given a sorted linked list, delete all duplicates such that each element appear only once.
For example,
Given 1->1->2, return 1->2.
Given 1->1->2->3->3...
分类:
其他好文 时间:
2015-06-24 19:01:53
阅读次数:
123