在Hibernate4中,如果要用SequenceGenerator,其要求数据库中的对应字段为NUMBER等数值类型,但是在具体项目中,因为序列对应的字段往往是主键,虽然是数值但并不参与计算,还有一些其他的原因,...
分类:
Web程序 时间:
2015-03-13 14:43:32
阅读次数:
144
在使用zxing开源库的时候,发现比较大的图片无法扫描成功,报如下异常: com.google.zxing.NotFoundException 通过scale down Bitmap可以解决上述问题,720是一个Magic number,可以根据自己的项目调整 // Scale...
分类:
其他好文 时间:
2015-03-13 14:42:53
阅读次数:
155
Problem Description
Write a program to read in a list of integers and determine whether or not each number is prime. A number, n, is prime if its only divisors are 1 and n. For this problem, the numbers 1 and 2 are not considered primes.
Input
Each inp...
分类:
其他好文 时间:
2015-03-13 14:24:56
阅读次数:
130
An army of n droids is lined up in one row. Each droid is described by m integers a1,?a2,?...,?am,
where ai is
the number of details of thei-th type in this droid's mechanism. R2-D2 wants to destr...
分类:
其他好文 时间:
2015-03-13 14:24:35
阅读次数:
152
Problem Description
Give a number n, find the minimum x(x>0) that satisfies 2^x mod n = 1.
Input
One positive integer on each line, the value of n.
Output
If the minimum x exists, print a line with 2^x mod n = 1.
Print 2^? mod n = 1 otherwise.
You ...
分类:
其他好文 时间:
2015-03-13 11:00:20
阅读次数:
224
Given a string S and a string T, count the number of distinct subsequences of T in S.
A subsequence of a string is a new string which is formed from the original string by deleting some (can be non...
分类:
编程语言 时间:
2015-03-13 10:57:15
阅读次数:
188
浮点数虽然精度很高,但在实际计算中的精度可能不如整数。比如0.1+0.2并不等于0.3,而是0.3000000000000004,所以把浮点数的计算结果当做判断条件会产生失误,这是基于IEEE754数据浮点计算的通病,js的数的表示范围也有限制,如果超过Number.MAX_VALUE或小于Numb...
分类:
编程语言 时间:
2015-03-13 10:50:11
阅读次数:
189
过了一遍基础视频,发现有一些最基本的知识点还掌握的不够,汇总如下:1) 占位符1 string name = "张三";2 int age = 28;3 decimal salary = 7600.33M;4 int number = 1000;5 6 Console.Writeline("我叫{....
Given a column title as appear in an Excel sheet, return its corresponding column number.本质上是一个进制转换问题。1 class Solution {2 public:3 int titleToNumb...
分类:
其他好文 时间:
2015-03-13 01:35:04
阅读次数:
105
Find the contiguous subarray within an array (containing at least one number) which has the largest sum.
For example, given the array [?2,1,?3,4,?1,2,1,?5,4],
the contiguous subarray [4,?1,2,1] ha...
分类:
其他好文 时间:
2015-03-13 00:28:08
阅读次数:
187