Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Java±à³Ì ÓÐ1ÒÚ¸ö¸¡µãÊý£¬ÇëÕÒ³öÆäÖжԴóµÄ10000¸ö

 ÓÐ1ÒÚ¸ö¸¡µãÊý£¬ÇëÕÒ³öÆäÖжԴóµÄ10000¸ö¡£Ìáʾ£º¼ÙÉèÿ¸ö¸¡µãÊýÕ¼4¸ö×Ö½Ú£¬1ÒÚ¸ö¸¡µãÊý¾ÍÒªÕ¾µ½Ï൱´óµÄ¿Õ¼ä£¬Òò´Ë²»ÄÜÒ»´Î½«È«²¿¶ÁÈëÄÚ´æ½øÐÐÅÅÐò¡£
/**
*
*/
package com.code;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Arrays;
import java.util.Collections;
import junit.framework.Assert;
import org.junit.Test;
/**
* @author Chi
*
*/
public class FloatSelector {
// @Test
public void testGenerateData(){
this.generate(100000000);
}
@Test
public void select(){
long start = System.currentTimeMillis();
final int SIZE = 10000;
Float[] selected = new Float[SIZE];
BufferedInputStream in = new BufferedInputStream(this.getClass().getResourceAsStream("data"));
//Set buffer to load array for one time.
final int BUFFER_SIZE = SIZE * 4;
final byte[] buffer = new byte[BUFFER_SIZE];
//1, Fill selected array
int pointer = 0;
int read = 0;
try {
read = in.read(buffer);
for(int i = 0; i < read / 4; i++ ){
selected[pointer ++] = Float.intBitsToFloat(bytes2int(buffer, i*4));
}
//2, sort the array
Arrays.sort(selected, Collections.reverseOrder());
while((read = in.read(buffer)) > 0){
for(int i = 0; i < read / 4; i++ ){
float newValue = Float.intBitsToFloat(bytes2int(buffer, i*4));
int j;
for(j = selected.length - 1; j >= 0 && newValue > selected[j]; j--);
if(j < selected.length - 1){
//move
for(int k = selected.length - 1; k > j + 1; k --){
selected[k] = selected[k - 1];
}


Ïà¹ØÎĵµ£º

Java CGLIB

Java Cglib
1.CGLIB°üµÄ½éÉÜ
     ´úÀíΪ¿ØÖÆÒª·ÃÎʵÄÄ¿±ê¶ÔÏóÌṩÁËÒ»ÖÖ;¾¶¡£µ±·ÃÎʶÔÏóʱ£¬ËüÒýÈëÁËÒ»¸ö¼ä½ÓµÄ²ã¡£JDK×Ô´Ó1.3°æ±¾¿ªÊ¼£¬¾ÍÒýÈëÁ˶¯Ì¬´úÀí£¬²¢ÇÒ¾­³£±»ÓÃÀ´¶¯Ì¬µØ´´½¨´úÀí¡£JDKµÄ¶¯Ì¬´úÀíÓÃÆðÀ´·Ç³£¼òµ¥£¬µ±ËüÓÐÒ»¸öÏÞÖÆ£¬¾ÍÊÇʹÓö¯Ì¬´úÀíµÄ¶ÔÏó±ØÐëʵÏÖÒ»¸ö»ò¶à¸ö½Ó¿Ú¡£Èç¹ûÏë´úÀ ......

JAVA£º°²È«Ö¤Êé ¹«Ô¿¼ÓÃÜ£¬Ë½Ô¿½âÃÜʾÀý³ÌÐò


import java.io.FileInputStream;
import java.security.KeyStore;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.cert.Certificate;
import java.security.cert.CertificateFactory;
import javax.crypto.Cipher;
// ¹«Ô¿¼ÓÃÜ£¬Ë½Ô¿½âÃÜʾÀý³ÌÐò
public class A {
& ......

JAVAµÄÈÝÆ÷ List,Map,Set

JAVAµÄÈÝÆ÷---List,Map,Set
Collection
©ÀList
©¦©ÀLinkedList
©¦©ÀArrayList
©¦©¸Vector
©¦¡¡©¸Stack
©¸Set
Map
©ÀHashtable
©ÀHashMap
©¸WeakHashMap
Collection½Ó¿Ú
¡¡¡¡CollectionÊÇ×î»ù±¾µÄ¼¯ºÏ½Ó¿Ú£¬Ò»¸öCollection´ú±íÒ»×éObject£¬¼´CollectionµÄÔªËØ£¨Elements£©¡£Ò»Ð© CollectionÔÊÐíÏà ......

java·´Éä»úÖÆʾÀý(¶ÌÐŽÓÊÕת·¢ÊµÏÖ)

Ò».Êý¾Ý¿âÉè¼Æ
Éè¼ÆͳһµÄ¶ÌÐŽÓÊÕ,·¢Ë͵ÄÊý¾Ý´æ´¢±í:¶ÌÐŽÓÊÕ±íT_Sms_Incept,¶ÌÐÅ·¢ËͱíT_Sms_Send
/*==============================================================*/
/* Table: t_sms_incept                    ......

ÈçºÎÌá¸ß×Ô¼ºµÄJava±à³Ìˮƽ

       1.
ÔúʵµÄ»ù´¡¡£Êý¾Ý½á¹¹¡¢ÀëÉ¢Êýѧ¡¢±àÒëÔ­Àí£¬ÕâЩÊÇËùÓмÆËã»ú¿ÆѧµÄ»ù´¡£¬Èç¹û²»ÕÆÎÕËûÃÇ£¬ºÜÄÑд³ö¸ßˮƽµÄ³ÌÐò¡£¾ÝÎҵĹ۲죬ѧ¼ÆËã»úרҵµÄÈ˱ÈѧÆäËû
רҵµÄÈ˸üÄÜд³ö¸ßÖÊÁ¿µÄÈí¼þ¡£³ÌÐòÈËÈ˶¼»áд£¬µ«µ±Äã·¢ÏÖдµ½Ò»¶¨³Ì¶ÈºÜÄÑÔÙÌá¸ßµÄʱºò£¬¾ÍÓ¦¸ÃÏëÏëÊDz»ÊÇÒª»Ø¹ýÍ·À´ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ