N-Queens
The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other.
Given an integer n, return all distinct solutions to the n-quee...
分类:
其他好文 时间:
2015-07-13 14:02:20
阅读次数:
114
萌生写这个代码的原因,是在使用struts2的验证框架时,总觉的有些不太灵活。当一个action中有多个表单需要处理的时候,struts处理起来就稍微麻烦一点,当校验失败时都会return "input"字符串。但我不同表单单校验失败后一般都希望返回不同的result,渲染不同的视图。另外如果我的校...
分类:
其他好文 时间:
2015-07-13 13:54:19
阅读次数:
195
angular.module(‘GR.app‘, []) .filter( ? ? "store",function(){ ? ? ? ? return function(params){ ? ? ? ? ? ? var spec = params["spec"]; ? ? ? ? ? ? for(var key in spec){ ? ? ? ?...
分类:
其他好文 时间:
2015-07-13 12:28:02
阅读次数:
109
java后台访问url,并获取或者传递数据
1、无参数传递,以微信开发为例,后台访问url连接获得全部的人员列表
/**
* 获取全部人员列表
* @return
*/
public JSONObject getAllEmployee(){
//获取微信号
String token=getTokenFromWx();
Str...
分类:
编程语言 时间:
2015-07-13 12:07:16
阅读次数:
259
Given an integern, generate a square matrix filled with elements from 1 ton2in spiral order.For example,Givenn=3,You should return the following matri...
分类:
其他好文 时间:
2015-07-13 11:39:59
阅读次数:
99
Given a stringsconsists of upper/lower-case alphabets and empty space characters' ', return the length of last word in the string.If the last word doe...
分类:
其他好文 时间:
2015-07-13 11:36:56
阅读次数:
92
Given two integers representing the numerator and denominator of a fraction, return the fraction in string format.
If the fractional part is repeating, enclose the repeating part in parentheses.
...
分类:
其他好文 时间:
2015-07-13 10:29:56
阅读次数:
115
构造随机是程序中常用的功能,Python内置了这方面的支持,简洁又高效。这篇博客主要记录一下Random中常用的几个函数功能。random.random() :返回一个零到一之间左闭右开的浮点数。
Return the next random floating point number in the range [0.0, 1.0).random.uniform(a, b) :返回a到b之间的一个...
分类:
编程语言 时间:
2015-07-13 10:22:59
阅读次数:
182
Given a collection of intervals, merge all overlapping intervals.For example,Given[1,3],[2,6],[8,10],[15,18],return[1,6],[8,10],[15,18]./** * Definiti...
分类:
其他好文 时间:
2015-07-13 00:35:59
阅读次数:
151
Which are in?Given two arrays of strings a1 and a2 return a sorted array in lexicographical order and without duplicates of the strings of a1 which ar...
分类:
其他好文 时间:
2015-07-12 23:21:01
阅读次数:
174