django是属于python语音的web框架,要说django测试,也可以先说说python的测试。django可以用python的方式测试,当然,django也基于python封装了一个自己的测试库。一、python的测试--unitest库def my_func(a_list, idx):
return a_list[idx]
import unittest
class M...
分类:
编程语言 时间:
2015-07-13 16:21:33
阅读次数:
207
N-Queens II
Follow up for N-Queens problem.
Now, instead outputting board configurations, return the total number of distinct solutions.
思路:解决了上题,这题也就迎刃而解,或者说这题要不上题还要简单一些。
具体代码如下:
pub...
分类:
其他好文 时间:
2015-07-13 16:19:17
阅读次数:
111
不多说,贴上代码,大家都明白
import java.io.File;
import android.net.Uri;
public class Transition {
/**
* @param uri
* @return
* 中文处理
*/
public static String transition(String imageUrl) {
File...
分类:
移动开发 时间:
2015-07-13 16:10:39
阅读次数:
138
public class IpUtil {
/**
* ip地址转换成16进制long
* @param ipString
* @return
*/
public static Long ipToLong(String ipString) {
Long[] ip = new Long[4];
int pos1= ipString.indexOf(".");
int ...
分类:
其他好文 时间:
2015-07-13 16:03:44
阅读次数:
137
Oracle数组类型Oracle的数组类型,范例:Sql代码 create or replace function my_test(p_str varchar2) return number as--普通变量 v_var varchar2(1000); --固定长度数组 type v_ar is v...
分类:
数据库 时间:
2015-07-13 16:01:16
阅读次数:
167
题目 134 Gas Station这道题有一个需要利用的条件即是如果存在这样一个station则答案唯一。class Solution: # @param {integer[]} gas # @param {integer[]} cost # @return {integer} ...
分类:
其他好文 时间:
2015-07-13 15:43:58
阅读次数:
93
方法一:JS部分: 1 function addFavorite(url,title){ 2 if(window.sidebar||window.opera)return true; 3 try{ 4 window.external.Ad...
分类:
其他好文 时间:
2015-07-13 15:37:22
阅读次数:
122
Permutations II
Given a collection of numbers that might contain duplicates, return all possible unique permutations.
For example,
[1,1,2] have the following unique permutations:
[1,1,2], [1,...
分类:
其他好文 时间:
2015-07-13 14:06:17
阅读次数:
130
27 Remove Element链接:https://leetcode.com/problems/remove-element/
问题描述:
Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be...
分类:
其他好文 时间:
2015-07-13 14:06:04
阅读次数:
79
Anagrams
Given an array of strings, return all groups of strings that are anagrams.
Note: All inputs will be in lower-case.
思路:这题要是解,必须知道什么是回文构词法。所谓回文构词法就是把一个单词的顺序调整,形成新的单词,如”eat“,"tea"就是回...
分类:
其他好文 时间:
2015-07-13 14:04:39
阅读次数:
119