现在大多数网站在登陆或者是发表评论等时必须要输入验证码,这样能有效的避免暴力破解和恶意注册等不安全因素。
下面看一下如何使用JSP实现验证码功能。
首先看一下效果图:
然后看源代码。
首先看生成数字验证码的JSP页面
<%@ page language="java"
contentType="image/jpeg" import="java.util.*,java.awt.*...
分类:
其他好文 时间:
2014-09-05 16:17:11
阅读次数:
242
#import<UIKit/UIKit.h>@interfaceUIColor(Addition)+(UIColor*)lightGreenColor;@end#import"UIColor+Addition.h"@implementationUIColor(Addition)+(UIColor*)lightGreenColor{return[UIColorcolorWithRed:kRed/255.0green:kGreen/255.0blue:kBlue/255.0alpha:1.0];}@end
分类:
其他好文 时间:
2014-09-05 03:24:21
阅读次数:
249
校验和是经常使用的,这里简单的列了一个针对按字节计算累加和。其实,这种累加和,使用将字节翻译为无符号整数和带符号整数,结果是一样的。
使用python计算校验和时记住做截断就可以了。 这里仅仅是作为一个代码样本,权作标记,直接上代码
'''
Created on 2014年9月4日
@author: lenovo
'''
import random
'''
实际计算校验和时,解释为无符号整...
分类:
编程语言 时间:
2014-09-04 22:19:30
阅读次数:
249
A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.
Return a deep copy of the list.
/**
* Definition for singly-lin...
分类:
其他好文 时间:
2014-09-04 19:12:40
阅读次数:
201
#pragmamark-将16进制字符串转换成UIColor-(UIColor*)generateColorObjectWithHex:(NSString*)hexString{unsignedintred=0,green=0,blue=0;NSRangerange={0,2};range.location=0;NSString*redString=[hexStringsubstringWithRange:range];NSScanner*redScanner=[NSScannerscann..
分类:
移动开发 时间:
2014-09-04 03:05:08
阅读次数:
170
importjava.util.Random;importandroid.content.Context;importandroid.graphics.Bitmap;importandroid.graphics.Canvas;importandroid.graphics.Color;importan...
分类:
其他好文 时间:
2014-09-03 19:45:27
阅读次数:
332
代码截屏分五步:
首先在视图控制器上创建一个视图
UIView *aView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 568)];
aView.backgroundColor = [UIColor blackColor];[self.view addSubview:aView];[aView release];
...
分类:
移动开发 时间:
2014-09-03 13:04:36
阅读次数:
222
冒泡排序,顾名思义,按照一定的规则,把数据一直排下去直接上代码 1 import random 2 3 def bubblesort(data): 4 change=True 5 for i in range(len(data)-1,1,-1): 6 for j i...
分类:
编程语言 时间:
2014-09-03 12:54:46
阅读次数:
184
快排,取一个key值,一般取第一个即可,将小于key的放到左边,大于key的放到右边,递归实现 1 import random 2 def quicksort(data, low = 0, high = None): 3 if high == None: 4 high = l...
分类:
编程语言 时间:
2014-09-03 12:48:36
阅读次数:
343