当前位置: 首页 > 编程日记 > 正文

身份证敏感信息处理 图片添加蒙版

实现效果

需要的jar包

<!-- https://mvnrepository.com/artifact/com.jhlabs/filters --><dependency><groupId>com.jhlabs</groupId><artifactId>filters</artifactId><version>2.0.235-1</version></dependency>

调用

public static void main(String[] args) {try {byte[] bytes = PDFbox.pdf2Jpg(new BASE64Decoder().decodeBuffer(GetImageStr("E:/workspace/fline_work/js/2.pdf")));String filterBytes = MyGaussianFilterUtil.getFilterBytes(bytes);FileUtil.decoderBase64File(filterBytes,"E:\\workspace\\fline_work\\js\\file\\"+UUID.randomUUID().toString()+".jpg");
//            System.out.println(filterBytes);} catch (Exception e) {e.printStackTrace();}
}

根据坐标裁剪图片

import javax.imageio.ImageIO;
import javax.imageio.ImageReadParam;
import javax.imageio.ImageReader;
import javax.imageio.stream.ImageInputStream;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.*;
import java.util.Iterator;/*** 更具坐标裁剪图片*/
public class OperateImageUtils {// ===源图片路径名称如:c:\1.jpgprivate String srcpath;// ===剪切图片存放路径名称.如:c:\2.jpgprivate String subpath;// ===剪切点x坐标private int x;private int y;// ===剪切点宽度private int width;private int height;public OperateImageUtils() {}public OperateImageUtils(int x, int y, int width, int height) {this.x = x;this.y = y;this.width = width;this.height = height;}/*** 对图片裁剪,并把裁剪完蛋新图片保存 。*/public void cut() throws IOException {InputStream is = null;ImageInputStream iis = null;try {// 读取图片文件is = new FileInputStream(srcpath);/** 返回包含所有当前已注册 ImageReader 的 Iterator,这些 ImageReader* 声称能够解码指定格式。 参数:formatName - 包含非正式格式名称 .*(例如 "jpeg" 或 "tiff")等 。*/Iterator<ImageReader> it = ImageIO.getImageReadersByFormatName("jpg");ImageReader reader = it.next();// 获取图片流iis = ImageIO.createImageInputStream(is);/** <p>iis:读取源.true:只向前搜索 </p>.将它标记为 ‘只向前搜索'。* 此设置意味着包含在输入源中的图像将只按顺序读取,可能允许 reader* 避免缓存包含与以前已经读取的图像关联的数据的那些输入部分。*/reader.setInput(iis, true);/** <p>描述如何对流进行解码的类<p>.用于指定如何在输入时从 Java Image I/O* 框架的上下文中的流转换一幅图像或一组图像。用于特定图像格式的插件* 将从其 ImageReader 实现的 getDefaultReadParam 方法中返回* ImageReadParam 的实例。*/ImageReadParam param = reader.getDefaultReadParam();/** 图片裁剪区域。Rectangle 指定了坐标空间中的一个区域,通过 Rectangle 对象* 的左上顶点的坐标(x,y)、宽度和高度可以定义这个区域。*/Rectangle rect = new Rectangle(x, y, width, height);// 提供一个 BufferedImage,将其用作解码像素数据的目标。param.setSourceRegion(rect);/** 使用所提供的 ImageReadParam 读取通过索引 imageIndex 指定的对象,并将* 它作为一个完整的 BufferedImage 返回。*/BufferedImage bi = reader.read(0, param);// 保存新图片ImageIO.write(bi, "jpg", new File(subpath));} finally {if (is != null)is.close();if (iis != null)iis.close();}}/*** 对图片裁剪,并把裁剪完蛋新图片保存 。*/public void cut(byte[] bytes,String subpath) throws IOException {InputStream is = null;ImageInputStream iis = null;try {// 读取图片文件is = byte2InputStream(bytes);/** 返回包含所有当前已注册 ImageReader 的 Iterator,这些 ImageReader* 声称能够解码指定格式。 参数:formatName - 包含非正式格式名称 .*(例如 "jpeg" 或 "tiff")等 。*/Iterator<ImageReader> it = ImageIO.getImageReadersByFormatName("jpg");ImageReader reader = it.next();// 获取图片流iis = ImageIO.createImageInputStream(is);/** <p>iis:读取源.true:只向前搜索 </p>.将它标记为 ‘只向前搜索'。* 此设置意味着包含在输入源中的图像将只按顺序读取,可能允许 reader* 避免缓存包含与以前已经读取的图像关联的数据的那些输入部分。*/reader.setInput(iis, true);/** <p>描述如何对流进行解码的类<p>.用于指定如何在输入时从 Java Image I/O* 框架的上下文中的流转换一幅图像或一组图像。用于特定图像格式的插件* 将从其 ImageReader 实现的 getDefaultReadParam 方法中返回* ImageReadParam 的实例。*/ImageReadParam param = reader.getDefaultReadParam();/** 图片裁剪区域。Rectangle 指定了坐标空间中的一个区域,通过 Rectangle 对象* 的左上顶点的坐标(x,y)、宽度和高度可以定义这个区域。*/Rectangle rect = new Rectangle(x, y, width, height);// 提供一个 BufferedImage,将其用作解码像素数据的目标。param.setSourceRegion(rect);/** 使用所提供的 ImageReadParam 读取通过索引 imageIndex 指定的对象,并将* 它作为一个完整的 BufferedImage 返回。*/BufferedImage bi = reader.read(0, param);// 保存新图片ImageIO.write(bi, "jpg", new File(subpath));} finally {if (is != null)is.close();if (iis != null)iis.close();}}public static InputStream byte2InputStream(byte[] bytes) {return new ByteArrayInputStream(bytes);}public int getHeight() {return height;}public void setHeight(int height) {this.height = height;}public String getSrcpath() {return srcpath;}public void setSrcpath(String srcpath) {this.srcpath = srcpath;}public String getSubpath() {return subpath;}public void setSubpath(String subpath) {this.subpath = subpath;}public int getWidth() {return width;}public void setWidth(int width) {this.width = width;}public int getX() {return x;}public void setX(int x) {this.x = x;}public int getY() {return y;}public void setY(int y) {this.y = y;}
}

图片添加高斯模糊


import com.jhlabs.image.PixelUtils;
import sun.misc.BASE64Encoder;import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.awt.image.ColorModel;
import java.awt.image.Kernel;
import java.io.*;
import java.util.Hashtable;
import java.util.UUID;/*** 给图片添加蒙版方法*/
public class MyGaussianFilterUtil {public static int CLAMP_EDGES = 1;public static int WRAP_EDGES = 2;protected Kernel kernel;protected boolean alpha = false;protected boolean premultiplyAlpha = false;protected float radius;public MyGaussianFilterUtil() {this(2.0F);}public MyGaussianFilterUtil(float radius) {this.setRadius(radius);}public void setRadius(float radius) {this.radius = radius;this.kernel = makeKernel(radius);}public float getRadius() {return this.radius;}public BufferedImage filter(BufferedImage src, BufferedImage dst) {int width = src.getWidth();int height = src.getHeight();if (dst == null) {dst = this.createCompatibleDestImage(src, (ColorModel)null);}int[] inPixels = new int[width * height];int[] outPixels = new int[width * height];src.getRGB(0, 0, width, height, inPixels, 0, width);if (this.radius > 0.0F) {//这里是对图片进行处理convolveAndTranspose(this.kernel, inPixels, outPixels, width, height, this.alpha, this.alpha && this.premultiplyAlpha, false, CLAMP_EDGES, 1);convolveAndTranspose(this.kernel, outPixels, inPixels, height, width, this.alpha, false, this.alpha && this.premultiplyAlpha, CLAMP_EDGES, 2);}dst.setRGB(0, 0, width, height, inPixels, 0, width);return dst;}public BufferedImage createCompatibleDestImage(BufferedImage src, ColorModel dstCM) {if (dstCM == null) {dstCM = src.getColorModel();}return new BufferedImage(dstCM, dstCM.createCompatibleWritableRaster(src.getWidth(), src.getHeight()), dstCM.isAlphaPremultiplied(), (Hashtable)null);}public static Kernel makeKernel(float radius) {int r = (int)Math.ceil((double)radius);int rows = r * 2 + 1;float[] matrix = new float[rows];float sigma = radius / 3.0F;float sigma22 = 2.0F * sigma * sigma;float sigmaPi2 = 6.2831855F * sigma;float sqrtSigmaPi2 = (float)Math.sqrt((double)sigmaPi2);float radius2 = radius * radius;float total = 0.0F;int index = 0;int i;for(i = -r; i <= r; ++i) {float distance = (float)(i * i);if (distance > radius2) {matrix[index] = 0.0F;} else {matrix[index] = (float)Math.exp((double)(-distance / sigma22)) / sqrtSigmaPi2;}total += matrix[index];++index;}for(i = 0; i < rows; ++i) {matrix[i] /= total;}return new Kernel(rows, 1, matrix);}public static void convolveAndTranspose(Kernel kernel, int[] inPixels, int[] outPixels, int width, int height, boolean alpha, boolean premultiply, boolean unpremultiply, int edgeAction,int type) {float[] matrix = kernel.getKernelData((float[])null);int cols = kernel.getWidth();int cols2 = cols / 2;int y = 0;//这里的height相当于要模糊图片的width(x轴),默认从0开始,我们修改这里的开始值,就能定义模糊位置if (type == 2) {y = height/3;}for(; y < height; ++y) {int index = y;int ioffset = y * width;for(int x = 0; x < width; ++x) {float r = 0.0F;float g = 0.0F;float b = 0.0F;float a = 0.0F;int moffset = cols2;int ia;int ix;int rgb;for(ia = -cols2; ia <= cols2; ++ia) {float f = matrix[moffset + ia];if (f != 0.0F) {ix = x + ia;if (ix < 0) {if (edgeAction == CLAMP_EDGES) {ix = 0;} else if (edgeAction == WRAP_EDGES) {ix = (x + width) % width;}} else if (ix >= width) {if (edgeAction == CLAMP_EDGES) {ix = width - 1;} else if (edgeAction == WRAP_EDGES) {ix = (x + width) % width;}}rgb = inPixels[ioffset + ix];int pa = rgb >> 24 & 255;int pr = rgb >> 16 & 255;int pg = rgb >> 8 & 255;int pb = rgb & 255;if (premultiply) {float a255 = (float)pa * 0.003921569F;pr = (int)((float)pr * a255);pg = (int)((float)pg * a255);pb = (int)((float)pb * a255);}a += f * (float)pa;r += f * (float)pr;g += f * (float)pg;b += f * (float)pb;}}if (unpremultiply && a != 0.0F && a != 255.0F) {float f = 255.0F / a;r *= f;g *= f;b *= f;}ia = alpha ? PixelUtils.clamp((int)((double)a + 0.5D)) : 255;int ir = PixelUtils.clamp((int)((double)r + 0.5D));ix = PixelUtils.clamp((int)((double)g + 0.5D));rgb = PixelUtils.clamp((int)((double)b + 0.5D));outPixels[index] = ia << 24 | ir << 16 | ix << 8 | rgb;index += height;}}}public static void  filter(String path,String savepath){try {MyGaussianFilterUtil gaussianFilter = new MyGaussianFilterUtil();BufferedImage fromImage = ImageIO.read(new File(path));BufferedImage toImage = new BufferedImage(fromImage.getWidth(), fromImage.getHeight(),BufferedImage.TYPE_INT_RGB);gaussianFilter.setRadius(40);gaussianFilter.filter(fromImage, toImage);ImageIO.write(toImage, "jpg", new File(savepath));} catch (IOException e) {e.printStackTrace();}}/*** 递归删除目录下的所有文件及子目录下所有文件* @param dir 将要删除的文件目录* @return boolean Returns "true" if all deletions were successful.*                 If a deletion fails, the method stops attempting to*                 delete and returns "false".*/public static boolean deleteDir(File dir) {if (dir.isDirectory()) {String[] children = dir.list();for (int i=0; i<children.length; i++) {boolean success = deleteDir(new File(dir, children[i]));if (!success) {return false;}}}// 目录此时为空,可以删除return dir.delete();}public static String getImageEncode(String imgPath,String filePath) {// 将图片文件转化为字节数组字符串,并对其进行Base64编码处理String imgFile = imgPath;// 待处理的图片InputStream in = null;byte[] data = null;String encode = null; // 返回Base64编码过的字节数组字符串// 对字节数组Base64编码BASE64Encoder encoder = new BASE64Encoder();try {// 读取图片字节数组in = new FileInputStream(imgFile);data = new byte[in.available()];in.read(data);encode = encoder.encode(data);} catch (IOException e) {e.printStackTrace();} finally {try {in.close();} catch (IOException e) {// TODO Auto-generated catch blocke.printStackTrace();}}deleteDir(new File(filePath));return encode;}public static String getFilterBytes(byte[] bytes){try {String filePath = System.getProperty("user.dir") + File.separator + "tempfile"+ File.separator + UUID.randomUUID().toString()+File.separator;File file = new File(filePath);if(!file.exists()){file.mkdirs();}//截取图片OperateImageUtils operateImage = new OperateImageUtils(325, 390, 540, 745);String subPath = filePath+ UUID.randomUUID().toString()+".jpg";operateImage.cut(bytes,subPath);//给图片添加蒙版String savepath =filePath+ UUID.randomUUID().toString()+".jpg";MyGaussianFilterUtil.filter(subPath,savepath);//合并图片String bigPath = filePath+ UUID.randomUUID().toString()+".jpg";MergeImageUtil.mergeImage(bytes,bigPath,savepath,"325","390");return getImageEncode(bigPath,filePath);} catch (Exception e) {e.printStackTrace();}return null;}
}

根据坐标合并图片

import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;/*** 合并图片*/
public class MergeImageUtil {/**** @param bigPath 需要进行合并的大图* @param smallPath 需要进行合并的小图* @param x 坐标* @param y 坐标* @throws IOException*/public static void mergeImage(String bigPath, String smallPath, String x, String y) throws IOException {try {BufferedImage small;BufferedImage big = ImageIO.read(new File(bigPath));if (smallPath.contains("http")) {URL url = new URL(smallPath);small = ImageIO.read(url);} else {small = ImageIO.read(new File(smallPath));}Graphics2D g = big.createGraphics();float fx = Float.parseFloat(x);float fy = Float.parseFloat(y);int x_i = (int) fx;int y_i = (int) fy;g.drawImage(small, x_i, y_i, small.getWidth(), small.getHeight(), null);g.dispose();ImageIO.write(big, "jpg", new File(bigPath));} catch (Exception e) {e.printStackTrace();}}/*** @param bytes 数据源* @param bigPath 需要进行合并的大图* @param smallPath 需要进行合并的小图* @param x 坐标* @param y 坐标* @throws IOException*/public static void mergeImage(byte[] bytes,String bigPath, String smallPath, String x, String y) throws IOException {try {BufferedImage small;BufferedImage big = ImageIO.read(byte2InputStream(bytes));if (smallPath.contains("http")) {URL url = new URL(smallPath);small = ImageIO.read(url);} else {small = ImageIO.read(new File(smallPath));}Graphics2D g = big.createGraphics();float fx = Float.parseFloat(x);float fy = Float.parseFloat(y);int x_i = (int) fx;int y_i = (int) fy;g.drawImage(small, x_i, y_i, small.getWidth(), small.getHeight(), null);g.dispose();ImageIO.write(big, "jpg", new File(bigPath));} catch (Exception e) {e.printStackTrace();}}public static InputStream byte2InputStream(byte[] bytes) {return new ByteArrayInputStream(bytes);}
}

相关文章:

Linux bash管道符“|”使用介绍与例子

https://blog.csdn.net/wangqianyilynn/article/details/75576815转载于:https://www.cnblogs.com/dhName/p/10967718.html

PostgreSQL第一步:安装

PostgreSQL是一个自由的对象-关系数据库服务器&#xff08;数据库管理系统&#xff09;&#xff0c;它在灵活的BSD-风格许可证下发行。它在其他开放源代码数据库系统&#xff08;比如MySQL和Firebird&#xff09;&#xff0c;和专有系统比如Oracle、Sybase、IBM的DB2和Microsof…

【Henu ACM Round#15 A】 A and B and Chess

【链接】 我是链接,点我呀:) 【题意】 在这里输入题意 【题解】 统计大写和小写的个数。 比较答案。输出即可。 【代码】 #include <bits/stdc.h> using namespace std;string s[10]; map<char,int> dic; int inc[300];int main() {for (int i 0;i < 8;i)cin…

[转载] static class 静态类(Java)

一般情况下是不可以用static修饰类的。如果一定要用static修饰类的话&#xff0c;通常static修饰的是匿名内部类。   在一个类中创建另外一个类&#xff0c;叫做成员内部类。这个成员内部类可以静态的&#xff08;利用static关键字修饰&#xff09;&#xff0c;也可以是非静态…

tomcat监控-psi-probe使用

什么是psi-probe 这是一款 Tomcat 管理和监控工具&#xff0c;前身是 Lambda Probe。由于 Lambda Probe 2006不再更新&#xff0c;所以 PSI Probe 算是对其的一个 Fork 版本并一直更新至今。 下载 下载地址&#xff1a;https://github.com/psi-probe/psi-probe 百度网盘地址…

配置文件app.config

无论对于客户端程序还是web应用程序&#xff0c;配置文件的作用不言而喻&#xff0c;现总结用法如下&#xff1a; 1. 创建配置节类 必须创建继承自ConfigurationSection的对象才能进行配置数据读写操作&#xff0c;ConfigurationSection提供了索引器用来获取和设置配置数据&…

windows远程桌面如果超出最大连接数, 使用命令行mstsc /console登录即可

远程桌面如果超出最大连接数, 使用命令行mstsc /console登录即可。 &#xff08;也可以用 mstsc /admin&#xff09; 可以在运行里使用mstsc /console /v:IP:远程端口即可强制登录; 如果直接在远程桌面连接端使用就直接输入/console /v:IP:远程端口. 如&#xff1a;mstsc /cons…

AppiumForWin安装

尝试安装Windows版本的Appium参考&#xff1a;http://www.cnblogs.com/fnng/p/4540731.html第一步&#xff1a;安装nodehttps://nodejs.org/en/安装成功后使用&#xff1a;node -v&#xff0c;进行验证第二步&#xff1a;安装Appium下面的方法失败&#xff1a;原因下载不成功&a…

prometheus--初见

什么是prometheus Prometheus&#xff08;普罗米修斯&#xff09;是一个开源系统监控和警报工具&#xff0c;最初是在SoundCloud建立的。自2012年成立以来&#xff0c;许多公司和组织都采用了普罗米修斯&#xff0c;该项目拥有一个非常活跃的开发者和用户社区。它现在是一个独立…

JavaScript时间日期格式化

/** 时间对象的格式化;*/ Date.prototype.format function(format) {/** eg:format"YYYY-MM-dd hh:mm:ss";*/var o {"M" :this.getMonth() 1, // month"d" :this.getDate(), // day"h" :this.getHours(), // hour"m" :th…

Hello World

作为所有编程语言的起始阶段&#xff0c;HELLO WORLD占据着无法改变的地位&#xff0c;所有中/英/法/德/美……版本的编程教材中&#xff0c;HELLO WORLD总是作为第一个TEST记录于书本之中&#xff0c;所有的编程第一步就在于此了&#xff01;经典之中的经典&#xff01;HELLO …

POJ 1144 Network (求割点)

题意&#xff1a; 给定一幅无向图&#xff0c; 求出图的割点。 割点模板&#xff1a;http://www.cnblogs.com/Jadon97/p/8328750.html 分析&#xff1a; 输入有点麻烦&#xff0c; 用stringsteam 会比较简单 #include<cstdio> #include<iostream> #include<queu…

mongoose简单使用

介绍&安装 官网&#xff1a;http://www.mongoosejs.net/ npm i -S mongoose 使用 1.连接mongodb&创建模型 var mongoose require(mongoose)​//1、连接mongodb mongoose.connect(mongodb://localhost/test)​//2、设置文档结构var userSchema new mongoose.Schema…

Codeforces Round #563 (Div. 2)/CF1174

Codeforces Round #563 (Div. 2)/CF1174 CF1174A Ehab Fails to Be Thanos 其实就是要\(\sum\limits_{i1}^n a_i\)与\(\sum\limits_{n1}^{2n}a_i\)差值最大&#xff0c;排一下序就好了 CF1174B Ehab Is an Odd Person 一个显然的结论就是如果至少有一个奇数和一个偶数&#xff…

Enterprise Architect 中文经典教程

一、Enterprise Architect简介Enterprise Architect是一个对于软件系统开发有着极好支持的CASE软件&#xff08;Computer Aided Software Engineering&#xff09;。EA不同于普通的UML画图工具&#xff08;如VISIO&#xff09;&#xff0c;它将支撑系统开发的全过程。在需求分析…

[WebDev]Web 开发与设计师速查手册大全

Cheat Sheet 一词在中文中并没有很贴切的对译&#xff0c;大概是考试作弊条一类的东西&#xff0c;这要求 Cheat Sheet 必须短小精悍又覆盖广泛&#xff0c;作为 Web 开发与设计师&#xff0c;免不了在工作时查询大量资料&#xff0c;某个 Web 色值&#xff0c;某个 JavaScript…

android中的回调

1、引子 android中的回调最经典的就是点击事件设置监听&#xff08;一般通过switch&#xff08;v.getId()&#xff09;&#xff09;这里写个最主要的 btn_rigister.setOnClickListener(new View.OnClickListener() {Overridepublic void onClick(View view) {// TODO log in} }…

nodejs回调函数理解

回调实例 问题&#xff1a;想要得到一秒后 计算出的结果 //错误写法function add(x,y) {console.log(1);setTimeout(function () {console.log(2);var ret x y;return ret;},1000);console.log(3)}console.log(add(10,20))添加一个函数作为参数&#xff0c;将计算出来的结果传…

C# 运算符的优先级

优先级由高到低 --(用作前缀); ; -(一元); () ; ! ; ~ * ; / ; % ; - <<; >> < ; > ; < ; > ; ! & ^ | && || ; * ; / ; % ; ; - ; << ; >> ; & ; ^ ;| --(作后缀);转载于:https://www.cnblogs.com/h…

Service Manager 的系统要求

以下各节包含有关 Service Manager 的硬件和软件要求的信息&#xff0c;并基于以下环境。System Center Service Manager 2010 已经过测试&#xff0c;并且正在使用一个支持 80 到 100 个并发 Service Manager 控制台的 Service Manager 管理服务器&#xff0c;测试根据本指南中…

读Lodash源码——chunk.js

The time is out of joint: O cursed spite, That ever I was born to set it right. --莎士比亚 最艰难的第一步 最近学习遇到了些障碍&#xff0c;浮躁浮躁又浮躁。很难静下心来做一件事&#xff0c;北京的寒风也难以让我冷静下来. 之前一直很想找个源码读读&#xff0c;太懒…

使用相对路径时,./、../、../../,代表的什么?

./ 当前目录。../ 父级目录。/ 根目录。 举个栗子&#xff1a; 页面引入js、css等文件&#xff1a; 1.如果about.jsp页面想引入common.css文件&#xff1a; 以about.jsp为基点寻找 直到 和static文件在同一级&#xff1b; 2.如果引入的外部css、js文件又引入image等时&#x…

asyncawait

简单理解 async async就是将方法变成异步 await 是等待异步方法的执行完成&#xff0c;可以获取异步方法里面的数据&#xff0c;但必须得用在异步方法(async)里面 创建异步方法 定义一个普通方法&#xff0c;返回值是一个字符串 function getData() {return 这是一个数据;}co…

引起路由器重启的“元凶”

文章出处&#xff1a;www.net1980.com在我们的日常维护中&#xff0c;偶然会遇到一些路由器自动重启的故障。那么大家都会自然地猜测到是否设备已经运行一段长时间&#xff0c;设备稳定性开始减低。或者可能有工作人员把电源拨松了&#xff0c;又或者设备负荷过重等原因。那么究…

python csv.reader参数指定

转载于:https://www.cnblogs.com/mahailuo/p/8375997.html

xBIM 实战01 在浏览器中加载IFC模型文件

系列目录 【已更新最新开发文章&#xff0c;点击查看详细】 一、创建Web项目打开VS&#xff0c;新建Web项目&#xff0c;选择 .NET Framework 4.5选择一个空的项目新建完成后&#xff0c;项目结构如下&#xff1a; 二、添加webServer访问文件类型由于WexXplorer 加载的是 .w…

node 判断文件夹是否存在

判断文件夹是否存在 let filePath path.join(__dirname,../)/download_tmp/fs.exists(filePath, function(exists) {if(!exists){fs.mkdir(filePath,function (err) {if(err){console.log(err)}})}});生成excle文件到本地 业务要求&#xff1a;生成excle文件到本地的路径 #安装…

IE9 : DOM Exception: INVALID_CHARACTER_ERR (5)

以下代码在IE8下运行通过&#xff0c;在IE9中出错&#xff1a;document.createElement(<iframe id"yui-history-iframe" src"../../images/defaults/transparent-pixel.gif" style"position:absolute;top:0;left:0;width:1px;height:1px;visibilit…

数字家庭开发者中心

数字家庭开发者中心 http://www.adobe.com/devnet/devices/digital_home.html转载于:https://www.cnblogs.com/kobo/archive/2010/07/06/1772136.html

LeetCode 1021:Remove Outermost Parentheses

C语言 char * removeOuterParentheses(char * S){int len strlen(S);int j 0;int sum 0;for(int i 0; i < len; i){if (S[i] (){sum 1;}else if (S[i] )){sum - 1;}if (S[i] ( && sum > 1){S[j] (;j;}else if (S[i] ) && sum > 0){S[j] );…