# Definition for singly-linked list.class ListNode: def __init__(self, x): self.val = x self.next = Noneclass Solution: # @return ...
分类:
其他好文 时间:
2014-08-29 19:40:58
阅读次数:
164
1.to_proc
class Array
def to_proc
proc { |receiver| receiver.send *self }
end
end
[ 'Hello', 'Goodbye' ].map &[ :+, ' BeiJing!' ]
#=> ["Hello BeiJing!", "Goodbye BeiJing!"]
recei...
分类:
其他好文 时间:
2014-08-29 18:18:48
阅读次数:
165
(1)获取输入框的时间字符串,并转换为date类型,然后与当前时间进行比较。 var start = new Date($(".interviewTime_input").val().replace(/-/g,"/"));var end = new Date();if(start<end){$("....
分类:
Web程序 时间:
2014-08-29 18:06:38
阅读次数:
184
Factorial Problem in Base KTime Limit: 2 Seconds Memory Limit: 65536 KBHow many zeros are there in the end of s! if both s and s! are written in base ...
分类:
其他好文 时间:
2014-08-29 17:46:10
阅读次数:
270
题目:
Given a linked list, remove the nth node from the end of list and return its head.
For example,
Given linked list: 1->2->3->4->5, and n = 2.
After removing the second node fr...
分类:
其他好文 时间:
2014-08-28 18:12:35
阅读次数:
289
二分查找是在已排序好的数组中查找数组中指定元素的一种算法,具有查找效率较高的特点,时间复杂度为O()=O(logn)。今天试着实现了二分查找算法:java例子:public int binarySearch(int[] ary, int val, int st, int end){ if (ary....
分类:
其他好文 时间:
2014-08-28 18:04:35
阅读次数:
248
SQL 跳出游标 breakif xx<=30 begin break end else FETCH NEXT FROM 游标 INTO 参数转载自http://tom-cat.blog.163.com/blog/static/393230201281631964/,感谢Tom 的博客 171106...
分类:
数据库 时间:
2014-08-28 17:59:05
阅读次数:
339
目前lua最新版本,5.2.3。
此例为一个简单的lua解析器,源码摘自《Lua游戏开发实践指南》。
测试例程功能为:解析简单的lua指令,如:print("Hello world!");
function fun(x ,y) return x + y end
z =fun(1,1);
print(z);
结果如下图:
源码如下:
simple_main.cpp:
...
分类:
其他好文 时间:
2014-08-28 11:31:09
阅读次数:
362
其实我没有做到记忆一些已经判定过的状态,增加trace来记忆已判定状态,去掉重复判断#include #define N 9 int q[N] = {0};int not_end = 1;int trace = 0;int cnt = 0;int sum = 0;void print_q() { ....
分类:
其他好文 时间:
2014-08-28 11:15:49
阅读次数:
186
public EmailBean[] findByPage(Date begin, Date end, String emailreference, int pageNo, final int pageSize, String status) throws AIException { ...
分类:
系统相关 时间:
2014-08-28 11:01:51
阅读次数:
234