Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd8f531e

Browse files
Lenovo LYGLenovo LYG
Lenovo LYG
authored and
Lenovo LYG
committed
程序员的修养+5% 罗瑶光20190628
1 parentcc03a09 commitd8f531e

File tree

12 files changed

+4
-63
lines changed

12 files changed

+4
-63
lines changed

‎DP/MD5Processor/StringUtil.java‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,13 @@ public static String encode(String input) throws Exception {
1010
Stringresult =Base64.getEncoder().encodeToString(input.getBytes("UTF-8"));
1111
returnresult;
1212
}
13-
1413
publicstaticStringdecode(Stringstr)throwsUnsupportedEncodingException {
1514
if(str.equalsIgnoreCase("undefined")) {
1615
returnstr;
1716
}else {
1817
returnnewString(Base64.getMimeDecoder().decode(str),"UTF-8");
1918
}
2019
}
21-
2220
publicstaticStringEncoderByMd5(Stringsalt,Stringpwd,intenctimes)throwsNoSuchAlgorithmException,
2321
UnsupportedEncodingException {
2422
StringsaltTemp =salt;
@@ -27,7 +25,6 @@ public static String EncoderByMd5(String salt, String pwd, int enctimes) throws
2725
}
2826
returnsaltTemp;
2927
}
30-
3128
publicstaticStringEncoderByMd5(Stringsalt,Stringpwd)throwsNoSuchAlgorithmException,
3229
UnsupportedEncodingException {
3330
MessageDigestmd5 =MessageDigest.getInstance("MD5");

‎DP/MD5Processor/TokenUtil.java‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ public static Token getNewTokenFromUsrAndUsrToken(Usr usr, UsrToken usrToken) th
1414
token.setmPassword(mPassword);
1515
returntoken;
1616
}
17-
1817
publicstaticStringgetSecondMD5Password(StringuPassword)throwsException {
1918
returnStringUtil.EncoderByMd5("Author:Yaoguang Luo",uPassword,8);
2019
}

‎DP/cacheProcessor/CacheManager.java‎

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
packagecacheProcessor;
22
importjava.util.*;
3+
//refer javadoc-api/org/springframework/cache/CacheManager.html 这是spring 早期的缓存函数进行了2次修改。
4+
//修改人 罗瑶光
35
publicclassCacheManager {
46
@SuppressWarnings("rawtypes")
57
privatestaticHashMapcacheMap =newHashMap();
68

79
privateCacheManager() {
810
super();
911
}
10-
1112
@SuppressWarnings("unchecked")
1213
publicsynchronizedstaticbooleansetSimpleFlag(Stringkey,longserverbegrundt) {
1314
if (cacheMap.get(key) ==null) {
@@ -17,22 +18,17 @@ public synchronized static boolean setSimpleFlag(String key, long serverbegrundt
1718
returnfalse;
1819
}
1920
}
20-
21-
2221
//private synchronized static Cache getCache(String key) {
2322
privatesynchronizedstaticCachegetCache(Stringkey) {
2423
return (Cache)cacheMap.get(key);
2524
}
26-
2725
// private synchronized static boolean hasCache(String key) {
2826
privatesynchronizedstaticbooleanhasCache(Stringkey) {
2927
returncacheMap.containsKey(key);
3028
}
31-
3229
publicsynchronizedstaticvoidclearAll() {
3330
cacheMap.clear();
3431
}
35-
3632
@SuppressWarnings({"rawtypes","unchecked" })
3733
publicsynchronizedstaticvoidclearAll(Stringtype) {
3834
Iteratori =cacheMap.entrySet().iterator();
@@ -53,17 +49,14 @@ public synchronized static void clearAll(String type) {
5349
ex.printStackTrace();
5450
}
5551
}
56-
5752
publicsynchronizedstaticvoidclearOnly(Stringkey) {
5853
cacheMap.remove(key);
5954
}
60-
6155
//public synchronized static void putCache(String key, Cache obj) {
6256
@SuppressWarnings("unchecked")
6357
publicsynchronizedstaticvoidputCache(Stringkey,Cacheobj) {
6458
cacheMap.put(key,obj);
6559
}
66-
6760
publicsynchronizedstaticCachegetCacheInfo(Stringkey) {
6861
if (hasCache(key)) {
6962
Cachecache =getCache(key);
@@ -74,7 +67,6 @@ public synchronized static Cache getCacheInfo(String key) {
7467
}else
7568
returnnull;
7669
}
77-
7870
@SuppressWarnings("unchecked")
7971
publicstaticvoidputCacheInfo(Stringkey,Cacheobj,longdt,booleanexpired) {
8072
Cachecache =newCache();
@@ -84,7 +76,6 @@ public static void putCacheInfo(String key, Cache obj, long dt, boolean expired)
8476
cache.setExpired(expired);
8577
cacheMap.put(key,cache);
8678
}
87-
8879
@SuppressWarnings("unchecked")
8980
publicstaticvoidputCacheInfo(Stringkey,Cacheobj,longdt) {
9081
Cachecache =newCache();
@@ -94,7 +85,6 @@ public static void putCacheInfo(String key, Cache obj, long dt) {
9485
cache.setExpired(false);
9586
cacheMap.put(key,cache);
9687
}
97-
9888
publicstaticbooleancacheExpired(Cachecache) {
9989
if (null ==cache) {
10090
returnfalse;
@@ -107,11 +97,9 @@ public static boolean cacheExpired(Cache cache) {
10797
returntrue;
10898
}
10999
}
110-
111100
publicsynchronizedstaticintgetCacheSize() {
112101
returncacheMap.size();
113102
}
114-
115103
@SuppressWarnings("rawtypes")
116104
publicstaticintgetCacheSize(Stringtype) {
117105
intk =0;
@@ -145,7 +133,6 @@ public static ArrayList getCacheAllkey() {
145133
returna;
146134
}
147135
}
148-
149136
@SuppressWarnings({"rawtypes","unchecked","finally" })
150137
publicstaticArrayListgetCacheListkey(Stringtype) {
151138
ArrayLista =newArrayList();

‎DP/imageProcessor/Emboss.java‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,10 @@ public int[][] Processor( int[][] g) throws IOException {
1111
//GROUP OPERATION
1212
Gx=newGroupOperator().GO(gxk,refG,size);
1313
for(inti=0;i<Gx.length;i++){
14-
for(intj=0;j<Gx[0].length;j++)
15-
{
14+
for(intj=0;j<Gx[0].length;j++){
1615
g[i][j]=(int) (Gx[i][j]/2+127);
1716
}
1817
}
19-
2018
intout[][] =newint[g.length][g[0].length];
2119
for (inti =0;i <g.length;i++) {
2220
for (intj =0;j <g[0].length;j++) {

‎DP/imageProcessor/GetMean.java‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,4 @@ public double print_Mean(double[][] outDIR){
2222
meanValue =sum/(outDIR.length *outDIR[0].length );
2323
returnmeanValue;
2424
}
25-
26-
2725
}

‎DP/imageProcessor/Guassian.java‎

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,7 @@ public int[][] Processor1D(int[][] g,int d,int e,double sig) throws IOException
133133
returnnewCheckRange().Processor(g);
134134
}
135135

136-
publicBufferedImageProcessor(BufferedImagelygimage,doubled,doublee,doublek)throwsIOException
137-
{
136+
publicBufferedImageProcessor(BufferedImagelygimage,doubled,doublee,doublek)throwsIOException {
138137
//image to r[][] g[][] b[][]
139138
//r[][]
140139
//g[][]
@@ -154,14 +153,4 @@ public BufferedImage Processor(BufferedImage lygimage, double d, double e,double
154153
lygimage=newReadWritePng().createBufferImage(r,g,b);
155154
returnlygimage;
156155
}
157-
158-
159-
160-
161-
162-
163-
164-
165-
166-
167156
}

‎DP/imageProcessor/HoughTransform.java‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ public void HoughTransformLoop(int[][] g, int pix,int scale) {
1616
}
1717
}
1818
}
19-
2019
publicvoidinitHTMatrix(int[][]g) {
2120
intmax=0;
2221
for(inti=0;i<g.length;i++){

‎DP/imageProcessor/Reflection.java‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,82 +3,67 @@ public class Reflection {
33
publicint[][]PadImage (int[][]_image,intheight,intwidth){
44
intlines =_image.length;
55
intsamples =_image[0].length;
6-
76
intpadded_lines =lines +height -1;
87
intpadded_samples =samples +width -1;
9-
108
int[][]paddedImage =newint[padded_lines][padded_samples];
11-
129
inthalfWidth =width /2;
1310
inthalfHeight =height /2;
14-
1511
// -- Fill interior of padded array with actual image.
1612
for (inti =0;i <lines; ++i) {
1713
for (intj =0;j <samples; ++j) {
1814
paddedImage[i +halfHeight][j +halfWidth] =_image[i][j];
1915
}
2016
}
21-
2217
// -- Fill border of padded array with a mirror image of
2318
// the actual image reflected about the boundaries.
24-
2519
// left border
2620
for (inti =0;i <lines; ++i) {
2721
for (intj =0,oj =halfWidth -1;j < (int)halfWidth; ++j, --oj) {
2822
paddedImage[i +halfHeight][oj] =_image[i][j];
2923
}
3024
}
31-
3225
// right border
3326
for (inti =0;i <lines; ++i) {
3427
for (intj =samples -halfWidth,oj =samples + (2 *halfWidth) -1;j <samples; ++j, --oj) {
3528
paddedImage[i +halfHeight][oj] =_image[i][j];
3629
}
3730
}
38-
3931
// top border
4032
for (inti =0,oi =halfHeight -1;i < (int)halfHeight; ++i, --oi) {
4133
for (intj =0;j <samples; ++j) {
4234
paddedImage[oi][j +halfWidth] =_image[i][j];
4335
}
4436
}
45-
4637
// bottom border
4738
for (inti =lines -halfHeight,oi =lines + (2 *halfHeight) -1;i <lines; ++i, --oi) {
4839
for (intj =0;j <samples; ++j) {
4940
paddedImage[oi][j +halfWidth] =_image[i][j];
5041
}
5142
}
52-
5343
// top left corner
5444
for (inti =0;i < (int)halfHeight; ++i) {
5545
for (intj =0,oj =halfWidth -1;j < (int)halfWidth; ++j, --oj) {
5646
paddedImage[i][oj] =paddedImage[i][j +halfWidth];
5747
}
5848
}
59-
6049
// bottom right corner
6150
for (inti =lines +halfHeight;i <lines + (2 *halfHeight); ++i) {
6251
for (intj =samples,oj =samples + (2 *halfWidth) -1;j <samples +halfWidth; ++j, --oj) {
6352
paddedImage[i][oj] =paddedImage[i][j];
6453
}
6554
}
66-
6755
// top right corner
6856
for (inti =0;i < (int)halfHeight; ++i) {
6957
for (intj =samples,oj =samples + (2 *halfWidth) -1;j <samples +halfWidth; ++j, --oj) {
7058
paddedImage[i][oj] =paddedImage[i][j];
7159
}
7260
}
73-
7461
// bottom left corner
7562
for (inti =lines +halfHeight;i <lines + (2 *halfHeight); ++i) {
7663
for (intj =0,oj =halfWidth -1;j < (int)halfWidth; ++j, --oj) {
7764
paddedImage[i][oj] =paddedImage[i][j +halfWidth];
7865
}
7966
}
80-
8167
returnpaddedImage;
8268
}
83-
8469
}

‎DP/imageProcessor/RegionGet.java‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ public RegionGet(int[][] g) throws IOException{
3131
scale=new_region.length-1;
3232
//return new_region;
3333
}
34-
3534
publicvoidbuildGraph(int[][]g,Stringoutput)throwsIOException{
3635
int[][]temp=newint[g.length][g[0].length];
3736
for(intq=0;q<g.length;q++) {

‎DP/imageProcessor/Sobel.java‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ public int[][] Processor( int[][] g,int choice) throws IOException {
2121
default:returnnull;
2222
}
2323
}
24-
2524
privateint[][]mag(double[][]gx,double[][]gy,int[]size )throwsIOException{
2625
double[][]mag =newdouble[size[0]][size[1]];
2726
int[][]outmag =newint[size[0]][size[1]];
@@ -33,7 +32,6 @@ private int[][] mag(double[][] gx,double[][] gy,int[]size ) throws IOException{
3332
}
3433
returnnewCheckRange().Processor(outmag);
3534
}
36-
3735
privateint[][]dir(double[][]gx,double[][]gy,int[]size)throwsIOException{
3836
double[][]dir =newdouble[size[0]][size[1]];
3937
int[][]outdir =newint[size[0]][size[1]];

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp