自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

youshang520i

脑子不好使。。时间来凑

  • 博客(2)
  • 资源 (5)
  • 收藏
  • 关注

原创 Oracle游标 隐视游标、显示游标

游标1. 游标的属性(重点----记)%FOUND             SQL语句影响一行或者多行的时候为true;%NOTFOUND          SQL语句没有影响到任何一行的时候为true(常用)%ROWCOUNT SQL语句影响的行(返回为数字,数字是几就返回几)%ISOPEN 游标是否打开始终,为false(游标一结束就自动关闭,要是想测试,可以试试在触发器...

2018-01-14 21:21:27 1121

原创 灵活的运用别名

在Oracle中使用别名SELECT REPLACE(R,'3','P'),DNAME FROM (       SELECT REPLACE(M,'4','R') R,DNAME FROM (              SELECT  REPLACE(A,'9','M') M,DNAME FROM (                      SELECT REPLACE(DSF

2018-01-13 22:12:24 92

测试demo123.xlsx

将Excel中的内容添加双引号和逗号,方便在数据库或者程序中处理

2019-08-02

里面有mysql基本操作,自定义jsp标签,XML的解析

可以选择查看我的博客,我把文档的内容分了好几次发博客

2018-11-13

JS三级联动网页版的

省市区三级联动。。。。json版的。。修改起来也挺方便的

2018-03-30

JS三级联动

要是要更新省市区的内容,修改city.JS就好了。。。个人感觉挺好用的

2018-03-30

java缩略图

引用包后调用包就好了 package image; import java.io.File; import java.io.IOException; public class Test { public static void main(String[] args) { long start = System.currentTimeMillis(); try { ImageUtil.resizeFix(new File&#40;"D:\\qqͼƬ\\1111.jpg"&#41;, new File&#40;"D:\\qqͼƬ\\99999.jpg"&#41;, 100, 100); long end = System.currentTimeMillis(); System.out.println("success:" + (end - start)); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } jar包的源码 package image; /** * 图片缩小算法,方形区域抽样 */ import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import javax.imageio.ImageIO; import org.apache.commons.io.FileUtils; public class ImageUtil { private int width; private int height; private int zoomWidth; private int zoomHeight; private File destFile; private BufferedImage srcBufferImage; public static void resizeFix(File srcFile, File destFile, int width, int height) throws IOException { new ImageUtil(srcFile, destFile, width, height); } public static void resizeFix(BufferedImage bufImg, File destFile, int width, int height) throws IOException { new ImageUtil(bufImg, destFile, width, height); } protected ImageUtil(File srcFile, File destFile, int zoomWidth, int zoomHeight) throws IOException { this.destFile = destFile; this.zoomWidth = zoomWidth; this.zoomHeight = zoomHeight; this.srcBufferImage = javax.imageio.ImageIO.read(srcFile); this.width = this.srcBufferImage.getWidth(); this.height = this.srcBufferImage.getHeight(); if (width <= zoomWidth && height <= zoomHeight) { FileUtils.copyFile&#40;srcFile, destFile&#41;; } else { resizeFix(); } } protected ImageUtil(BufferedImage srcBufferImage, File destFile, int zoomWidth, int zoomHeight) throws IOException { this.destFile = destFile; this.zoomWidth = zoomWidth; this.zoomHeight = zoomHeight; this.srcBufferImage = srcBufferImage; this.width = this.srcBufferImage.getWidth(); this.height = this.srcBufferImage.getHeight(); resizeFix(); } /** * 压缩图片 * * @throws IOException */ protected void resizeFix() throws IOException { if (width <= zoomWidth && height <= zoomHeight) { resize(width, height); } else if ((float) width / height > (float) zoomWidth / zoomHeight) { resize(zoomWidth, Math.round((float) zoomWidth * height / width)); } else { resize(Math.round((float) zoomHeight * width / height), zoomHeight); } } private void resize(int w, int h) throws IOException { BufferedImage imgBuf = scaleImage(w, h); File parent = destFile.getParentFile&#40;&#41;; if (!parent.exists()) { parent.mkdirs(); } ImageIO.write(imgBuf, "jpeg", destFile); } private BufferedImage scaleImage(int outWidth, int outHeight) { int[] rgbArray = srcBufferImage.getRGB(0, 0, width, height, null, 0, width); BufferedImage pbFinalOut = new BufferedImage(outWidth, outHeight, BufferedImage.TYPE_INT_RGB); double hScale = ((double) width) / ((double) outWidth);// 宽缩小的倍数 double vScale = ((double) height) / ((double) outHeight);// 高缩小的倍数 int winX0, winY0, winX1, winY1; int valueRGB = 0; long R, G, B; int x, y, i, j; int n; for (y = 0; y < outHeight; y++) { winY0 = (int) (y * vScale + 0.5);// 得到原图高的Y坐标 if (winY0 < 0) { winY0 = 0; } winY1 = (int) (winY0 + vScale + 0.5); if (winY1 > height) { winY1 = height; } for (x = 0; x < outWidth; x++) { winX0 = (int) (x * hScale + 0.5); if (winX0 < 0) { winX0 = 0; } winX1 = (int) (winX0 + hScale + 0.5); if (winX1 > width) { winX1 = width; } R = 0; G = 0; B = 0; for (i = winX0; i < winX1; i++) { for (j = winY0; j < winY1; j++) { valueRGB = rgbArray[width * j + i]; R += getRedValue(valueRGB); G += getGreenValue(valueRGB); B += getBlueValue(valueRGB); } } n = (winX1 - winX0) * (winY1 - winY0); R = (int) (((double) R) / n + 0.5); G = (int) (((double) G) / n + 0.5); B = (int) (((double) B) / n + 0.5); valueRGB = comRGB(clip((int) R), clip((int) G), clip((int) B)); pbFinalOut.setRGB(x, y, valueRGB); } } return pbFinalOut; } private int clip(int x) { if (x < 0) return 0; if (x > 255) return 255; return x; } private int getRedValue(int rgbValue) { int temp = rgbValue & 0x00ff0000; return temp >> 16; } private int getGreenValue(int rgbValue) { int temp = rgbValue & 0x0000ff00; return temp >> 8; } private int getBlueValue(int rgbValue) { return rgbValue & 0x000000ff; } private int comRGB(int redValue, int greenValue, int blueValue) { return (redValue << 16) + (greenValue << 8) + blueValue; } } 所需要的驱动包 commons-io-1.3.2.jar commons-io-1.3.2.jar + 上面的代码 = 你下载的jar

2018-03-30

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除