描述: Given a linked list, swap every two adjacent nodes and return its head. For example,Given 1->2->3->4, you should return the list as 2->1->4->3. Yo ...
分类:
其他好文 时间:
2017-08-19 15:47:59
阅读次数:
146
今天上午技术群里的一个人问” 如何在 Spring MVC 中统一对返回的 Json 进行加密?”。 大部分人的第一反应是通过 Spring 拦截器(Interceptor)中的postHandler方法处理。实际这是行不通的,因为当程序运行到该方法,是在返回数据之后,渲染页面之前,所以这时候 Re ...
分类:
Web程序 时间:
2017-08-19 14:24:50
阅读次数:
216
#include <stdio.h> #include <stdlib.h> int flag = 1; void * thr_fn(void * arg) { while (flag){ printf("******\n"); sleep(10); } printf("sleep test thr ...
分类:
编程语言 时间:
2017-08-19 12:47:21
阅读次数:
318
The idea is try to replace every "++" in the current string s to "--" and see if the opponent has the chance to win or not, if the opponent is guarant ...
分类:
其他好文 时间:
2017-08-19 12:44:35
阅读次数:
204
注意val后面不能用空格,就因为有空格坑了我两个小时 ...
分类:
数据库 时间:
2017-08-19 12:42:22
阅读次数:
240
平滑动画扩展宽度 $.animate({width:"+=200px"}); 聚焦 onfocus = ""; 脱离焦点 onblur = ""; 在id为xx的元素前插入 $.insertBefore("#xx"); 移除元素 $.remove(); 元素的内容 $.val(); ...
分类:
Web程序 时间:
2017-08-19 11:15:01
阅读次数:
185
题目链接:http://lightoj.com/volume_showproblem.php?problem=1132 题意: 给定n、k,求(1K + 2K + 3K + ... + NK) % 232。 题解: 设sum(i) = 1K + 2K + 3K + ... + iK 所以要从sum( ...
分类:
其他好文 时间:
2017-08-19 00:53:48
阅读次数:
232
如果这道题没有常数时间的限制,那么将会是一道非常简单的题,我们直接用一个set就可以搞定所有的操作。但是由于时间的限制,我们无法在常数时间内实现获取随机数,所以只能另辟蹊径。 要返回随机数对于数组来说就很简单了,我们只要随机生成一个位置,返回该位置上的数字即可,但是要删除也是O(1)的, 我们还需要 ...
分类:
其他好文 时间:
2017-08-19 00:51:45
阅读次数:
202
function randomCode(){ function rand(){ var str="abcdefghijklmnopqrstuvwxyz0123456789"; var arr=str.split(""); var validate=""; var ranNum; for(var i= ...
分类:
其他好文 时间:
2017-08-18 23:39:13
阅读次数:
231
1.插入数据 insert into 表名(列1,列2,列3)values(值1,值2,值3); insert into product(name,price,pic_path) values('jack',25,'updown'); 2.更新数据 update 表名 set 列名1=值1,列名2= ...
分类:
数据库 时间:
2017-08-18 23:37:14
阅读次数:
194