- 博客(40)
- 资源 (126)
- 问答 (1)
- 收藏
- 关注
转载 Gallery Modified a little
function showPic(whichPic){ var placeHolder = document.getElementById("placeHolder"); if(!placeHolder)return false;//节点存在性判断 if(placeHolder.nodeName != "IMG")return false;//节点标签判断 var ...
2018-03-31 14:28:32 187
转载 Web Gallery 简单地写一写
function showPic(whichPic){ var src = whichPic.getAttribute("href"); var placeHolder = document.getElementById("placeHolder"); placeHolder.setAttribute("src",src); // console.log("exec...
2018-03-30 23:56:03 1054
原创 Java AccessController.doPrivileged 简单的操作
package com.xiuye.security;public class Privilege { public static void main(String[] args) { System.setProperty("java.security.policy", "security.policy"); System.setSecurityManager(new Secu...
2018-03-29 18:00:56 1207 1
转载 Java HashCode 简单的了解了解
2^5 = 32 31 = 32 - 1 = 2^5 - 1for(int i = 0;i < len ;i++){ h = h*31 + num[i];}hashcode = h以上循环看成如下实例:abcde 看成 31 进制的数,位:高 -> 低(((((h*31+a)*31+b)*31+c)*31+d)*31+eif h = 0=>((((a*...
2018-03-29 14:58:19 111
原创 Java security policy 简单的操作
package com.xiuye.security;import java.io.FilePermission;import java.security.AccessController;import java.security.PrivilegedAction;public class TestAccessController2 { public static void mai...
2018-03-29 13:09:35 1827
原创 Java Lambda:return and not return And Ordinary Function same same as classname
package com.xiuye.lambda;@FunctionalInterfaceinterface Fn { void f();}@FunctionalInterfaceinterface FnRet<T> { T f();}public class AmbiguousLambda2 { //it's OK(); void AmbiguousLa...
2018-03-29 12:37:14 157
转载 Java 输入VM命令参数获取
List<String> params = ManagementFactory.getRuntimeMXBean().getInputArguments(); System.out.println("java "+params);VM settings: Max. Heap Size (Estimated): 247.50M Ergonomics Machine C...
2018-03-28 19:50:35 1422
原创 Java lambda 同格式 歧义消除
package com.xiuye.lambda;@FunctionalInterfaceinterface Fn1 { default void f() { System.out.println("Fn1 f"); } void g();}@FunctionalInterfaceinterface Fn2 { void h();}@FunctionalInterf...
2018-03-28 19:27:10 286
原创 catch(Exception ChildException){}
package com.xiuye.jdk.issue;class A extends Exception {}class B extends A {}public class ThrowException { public static void main(String[] args) { try { try { log("try"); thr...
2018-03-27 22:07:02 275
原创 finally { return variable; }
package com.xiuye.jdk.issue;public class ReturnFinally { public static void main(String[] args) { log(f()); } public static String f() { try { log("try"); return "return try"; } cat...
2018-03-27 22:05:19 168
原创 查询不满足条件并且平均值最大的那个数据
example : 查询 学生中 某科目 不及格, 平均分数 最大 的学生:create table student(id number primary key,name varchar2(10),subject varchar2(20),score number);select * from user_tables;select abs(mod(dbms_random.rando...
2018-03-26 14:37:01 246
转载 Counter Sort Test
#include"MyOutput.hpp"template<typename T>void CounterSort(T a[],int len){ int max = 0; for(int i=0;i<len;i++){ if(a[i] > max){ max = a[i]; } }...
2018-03-24 19:59:39 205
原创 Shaker Sort Test (鸡尾酒排序)
#include"MyOutput.hpp"template<typename T>void MyShakerSort(T a[],int len){ int i=0; int j=len-1; while(i<j){ //max ,min1,min2,min3 //==> min1,min2,min3,max...
2018-03-24 17:22:58 409
转载 Heap Sort Test
#include"MyOutput.hpp"template<typename T>int idxMax(T a[],int i,int j){ return a[i] > a[j]?i:j;}template<typename T>void MyAdjustHeap(T a[],int len){ int lastNonLeafNod...
2018-03-24 01:24:09 162
转载 Binary Insertion Sort Test
#include"MyOutput.hpp"/** * 二分插入排序,将已经排好序的数组,按二分法 * 比较大小,最终确定left == 子区间中间点(最后确定的点)索引. * a[left] > x (要插入的点) * * */ template<typename T>void BinaryInsertionSort(T a[],int len){ ...
2018-03-23 21:00:17 252
转载 Merge Sort (Recursion) Test
#include"MyOutput.hpp"template<typename T>void MergeSortedArray(T a[],int alen,T b[],int blen){ T *t = new T[alen+blen]; int i = 0; int j = 0; int k = 0; while(i < a...
2018-03-22 21:58:32 233
原创 Random Quick Sort Test
#include"MyOutput.hpp"template<typename T>int partition(T a[],int p,int r){ T x = a[p];//将首元素设置为哨兵 int i=p+1;//从首元素的下个元素开始比较 int j=r; //这里先++i,++j增(减)再比,很重要 wh...
2018-03-22 20:16:30 397
原创 Quick Sort Test
#include"MyOutput.hpp"template<typename T>int partition(T a[],int p,int r){ T x = a[p];//将首元素设置为哨兵 int i=p+1;//从首元素的下个元素开始比较 int j=r; //明白算法的大致思想,但要实现算法的时候,注意实现代码,这...
2018-03-22 19:54:10 186
转载 Shell Sort Test
#include"MyOutput.hpp"template<typename T>void ShellSort(T t[],int len){ int insertNum; int gap = len/2; while(gap > 0){ /** * 从后往前i = gap,i++,i<len;t[j-gap...
2018-03-21 16:19:49 153
原创 Insertion Sort Test
#include"MyOutput.hpp"template<typename T>void insertionSort(T t[],int len){ // println(typeid(t).name()); for(int i=1;i<len;i++){ T tmp = t[i]; // The following c...
2018-03-19 22:19:28 229
原创 Selection Sort Test
#include"MyOutput.hpp"#include<vector>template<typename T>void selectionSort(T t[],int len){ for(int i=0;i<len;i++){ int minIdx = i; for(int j=i+1;j<len;j++){...
2018-03-19 21:26:53 205
转载 Longest Palindromic Substring (最长回文串)
Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.Example:Input: "babad"Output: "bab"Note: "aba" is also a valid answer. Exa...
2018-03-18 23:43:52 184
原创 Median of Two Sorted Arrays(not optimized)
There are two sorted arrays nums1 and nums2 of size m and n respectively.Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).Example 1:nums1 = [1, 3]...
2018-03-17 20:33:33 193
原创 Dubble Sort Test
#include"MyOutput.hpp"template<typename T>void swap(T *t1,T *t2){ T t = *t1; *t1 = *t2; *t2 = t;}template<typename T>void dubble_sort_optimized(T *t,int len){//effect not...
2018-03-17 14:44:43 395
转载 3Sum
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note: The solution set must not contain dup...
2018-03-15 20:41:56 148
原创 Longest Substring Without Repeating Characters (not optimized)
Given a string, find the length of the longest substring without repeating characters.Examples:Given "abcabcbb", the answer is "abc", which the length is 3.Given "bbbbb", the answer is "b", with...
2018-03-15 20:38:53 138
原创 Add Two Numbers(not optimized)
You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return i...
2018-03-15 20:35:41 198
原创 Two Sum(not optimized)
Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may not use the same ...
2018-03-15 20:33:39 172
原创 C++ int 和 unsigned int 比较谁大呢?
#include<iostream>using namespace std;int main(){ int a = -1; unsigned int b = 100; if(a < b){ cout << "a(-1) < b(100)" << endl; } else{ cout << "a(-1) &g
2018-03-15 19:23:41 3468
原创 Java WebService简单实现
package com.xiuye.webservice;import javax.jws.WebMethod;import javax.jws.WebService;import com.xiuye.util.LogUtil;@WebServicepublic class DemoService { public void serviceOne(){ LogUtil.l...
2018-03-14 13:45:31 1125
转载 OpenCV RGB三色直方图
#include"OpenCVLib2.hpp"using namespace cv;int main(){ Mat src = imread("p1.jpg"); imshow("src",src); int bins = 256; int hist_size[] = {bins}; float range[] = {0,256}; cons...
2018-03-11 22:37:21 1162
原创 线性同余随机数算法简单地实现
#include<iostream>#include<ctime>#include"MyOutput.hpp"using namespace std;static unsigned int a = 17;static unsigned int b = 139;static const unsigned long BASE_VALUE = ULONG_MAX;/...
2018-03-11 01:59:04 1209
原创 简单计算程序运行时间 and 解决模板实例重复链接问题
#ifndef __TIMESPEC_H_#define __TIMESPEC_H_#include<ctime>class TimeSpec{ private: static clock_t start; static clock_t end; private: static double cost_time(...
2018-03-10 01:33:16 221
原创 Dubbo Demo Running Successfully and Update Native Maven Repositories
package com.xiuye.service;public interface DemoService { String hello(String str);}package com.xiuye.provider;import java.text.SimpleDateFormat;import java.util.Date;import com.xiuye.servic...
2018-03-08 23:09:34 628
原创 Maven 编译整个 Spring Boot 项目 and 跳过编译错误项目
mvn compile --fail-never 编译mvn package --fail-never 打包(jar/zip)mvn install --fail-never 导入本地库--fail-never 就能保证跳过编译错误的工程,继续编译下一个项目,而不会停止编译...
2018-03-07 19:14:49 4295
原创 OpenCV 图像一维直方图 and Java类中大括号{}作用
package com.xiuye.opencv;import java.util.ArrayList;import java.util.List;import java.util.Random;import org.opencv.core.Core;import org.opencv.core.Core.MinMaxLocResult;import org.opencv.core...
2018-03-06 23:06:47 414
原创 对软引用,弱引用,虚(幽灵)引用的简单理解
package com.xiuye.reference;import java.lang.ref.PhantomReference;import java.lang.ref.ReferenceQueue;import java.lang.ref.WeakReference;public class Reference2 { static class A { @Override...
2018-03-04 18:30:25 379
原创 JNDI 简单地实践
package com.xiuye.jndi.test;import java.util.HashMap;import java.util.Hashtable;import java.util.Map;import javax.naming.Binding;import javax.naming.Context;import javax.naming.Name;import ja...
2018-03-04 16:40:40 258
my mine x.jar
2020-08-08
windows nasm 2.13.1
2017-09-04
linux nasm-2.13.01 编译成功
2017-09-04
nasm-2.13.01-win64
2017-09-04
jna_4.2.1 java
2017-09-03
spring-boot-1.5.6-src
2017-08-18
go语言SDK1.8
2017-03-06
rust-1.15.1-i686-pc-windows-msvc
2017-02-27
DOSBox0.74-win32
2017-01-21
java证书开发包(修正版)
2017-01-19
java证书开发工具包
2017-01-18
my jsonp with spring
2017-01-12
grub2 loader加载kernel和输出helloworld(x86)
2021-03-27
cocos2dx android apk javascript
2020-02-04
cocos2dx android apk
2020-02-04
freeglut.zip
2019-12-31
我的工具类upgrade2
2019-05-08
我的工具类upgrade1
2019-05-07
类型操作工具类
2019-05-04
jboss-eap-7.1.0
2018-03-08
UEFI规范参考文档
2017-12-28
apr-iconv linux 编译成功
2017-09-04
apr linux 编译成功
2017-09-04
apr-util linux 编译成功
2017-09-04
linux apache2 编译成功
2017-09-03
linux eclipse
2017-09-03
java就是调库吗?只要有就是调
2015-11-04
TA创建的收藏夹 TA关注的收藏夹
TA关注的人