# !/usr/bin/python # -*-coding:utf-8-*- import sys import time time1 = time.time() from PIL import Image import pytesseract ###########二值化算法 def binarizing(img, threshold): pixdata = img.load() w, h = img.size for y in range(h): for x in range(w): if
在数据库的运用过程中,我们时常会碰到根据身份证号码来获取当前的年龄,今天我在这里写了一个函数,就是关于获取年龄的 create or replace function FUNC_COMPARE_SFZHM( sfzhm in varchar2) --输入身份证号码 return number /* 函数说明,返回值0为小于18岁:值为1是大于75岁:其他情况是返回值为2 在这个函数里用到了trunc(months_between()) 然后就是将身份证号码里的年月日组合成'yyyy-mm-dd'
项目要用到这个功能,就写了一个,完整类也就二百来行,很简单.可以在项目中用,也可以作为学习. 源码下载 http://yunpan.cn/cmQCSWkhDnZLJ 访问密码 0227 核心代码如下: using System; using System.Collections.Generic; using System.Collections; using System.Text; using System.Xml; using System.Text.RegularExpressions;
package xidian.sl.netcredit.util; /** * Copyright (C) 2009-2010 Yichuan, Fuchun All rights reserved. * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this wo