Time of Update: 2018-12-05
java通過調用tesseract完成圖片中文字識別1.安裝tesseract-ocr-setup-3.00.exe(3.0以上版本才增加了中文識別)2.下載tesseract-ocr的中文包chi_sim.traineddata.gz,解壓縮之後複製到tesseract-ocr的安裝目錄之下。如:D:/Tesseract-OCR/tessdata3.java需要增加2個包:jai_imageio-1.1-alpha.jar,swingx-1.6.1.jar4.java程式清單:ImageIOH
Time of Update: 2018-12-05
剛學java,android下很多用到WeakReference,主要用在非同步情況下,不太明白,特地用段代碼測試一下:import java.lang.ref.PhantomReference; import java.lang.ref.SoftReference; import java.lang.ref.WeakReference; import java.lang.ref.Reference; import java.lang.reflect.Field;import
Time of Update: 2018-12-05
寫自己的文字編輯器(一): 高亮關鍵字一. 高亮的內容:需要高亮的內容有:1. 關鍵字, 如 public, int, true 等. 2. 運算子, 如 +, -, *, /等3. 數字4. 高亮字串, 如 "example of string"5. 高亮單行注釋6. 高亮多行注釋二. 實現高亮的核心方法:StyledDocument.setCharacterAttributes(int offset, int length, AttributeSet s, boolean replace)
Time of Update: 2018-12-05
在jdk提供的List,Set,Map實現中,Set類型依賴於Map的儲存方式,Map對象採用樹形結構以及雜湊(散列表)結構儲存;List對象則依賴於數組和鏈表結構。 類型 實作類別 儲存結構 List ArrayList 數組
Time of Update: 2018-12-05
本人也遇到這個問題,好吧,就轉載了:利用Timer和TimerTask可以實現定時完成某些任務。但是在運行過程中出現了很奇怪的現象:所有TimerTask都完成了,按理說程式應該自動結束,但是它卻沒有!我以為是Eclipse的bug,然後再cmd下嘗試,同樣是無法退出。這種現象在只要new了一個Timer(),就會出現。奇怪,Google了一下,找不到答案,但是找到零星的提問同樣的問題的文章。還是自己動手看看協助文檔吧。。。在JDK1.5的文檔Timer類中,有這樣一句話:“對 Timer
Time of Update: 2018-12-05
1.用java.util.Calender來實現 Calendar calendar=Calendar.getInstance(); calendar.setTime(new Date()); System.out.println(calendar.get(Calendar.DAY_OF_MONTH));//今天的日期 calendar.set(Calendar.DAY_OF_MONTH,calendar.get(Calendar.DAY_OF_MONTH)+1);//
Time of Update: 2018-12-05
今天看Java代碼時,看到了字串有一個方法是startsWith(String str)當時覺得見名之意,很簡單嗎,然後就自己動手做了一下,沒想到發現了一個startsWith()方法的重載,startsWith(String str,int Index),當時上網去查了一下沒有後邊這個方法,於是自己做了一下測試,現在給出如下詳細解釋,startsWith(String str)就是檢查形參參數是否與你要檢查的字串開頭相同,而startsWith(Sring str,int
Time of Update: 2018-12-05
用戶端程式:import java.awt.BorderLayout;import java.awt.Container;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import java.io.BufferedInputStream;import java.io.BufferedOutputStream;import java.io.BufferedReader;import
Time of Update: 2018-12-05
一、activity代碼package com.liudan.activity; import java.util.ArrayList;import java.util.List;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.view.animation.Animation;import
Time of Update: 2018-12-05
今天想寫一個txt檔案,但是磁碟的檔案夾沒有建立。要寫檔案之前判斷,沒有再建立。去網上找java建立TXT檔案並進行讀、寫等操作的,基本上都是一個模板出來的,都是copy來的,很煩。現在我把我寫的發表出來,給有需要的童鞋看看。/** * 寫txt檔案 * @param conent * @param txtPath * @param isNextWriter true表示以追加形式寫檔案 */ public void
Time of Update: 2018-12-05
Tomcat 部署時候 驅動報錯,stack 資訊:java.sql.SQLException: No suitable driver found for jdbc:sqlserver://172.20.0.30:1433;databaseName=SAPDataConvert at java.sql.DriverManager.getConnection(DriverManager.java:602) at java.sql.DriverManager.getConnection(
Time of Update: 2018-12-05
http://www.concretevitamin.com.cn/informatics/Pack/P02.html
Time of Update: 2018-12-05
今天在在處理從網路上接收到的字串,因為是從後台C語言過來的一組拼接的字串,要定長截取,然而由於C語言是用Byte的方式計數,而java中是用Unicode編碼的方式計數,一個中文漢字以Bytes的方式是兩個位元組,而用Unicode的方式是一個字,所以難以準確的截取出我想到的內容,經過半天的探索發現應該以如下的方式來解決。
Time of Update: 2018-12-05
07-12 07:34:04.411: WARN/System.err(533): java.lang.IllegalStateException: database not open07-12 07:34:04.440: WARN/System.err(533): at
Time of Update: 2018-12-05
我的系統是RH9,裝的時候選的全安裝,而後從網上下了一個j2sdk-1_4_2_05-linux-i586-rpm.bin,安裝後 用java -version 發現居然是linux內建的 ----------------------------------------------------------------------------------- java version "1.3.1" jdkgcj 0.2.3
Time of Update: 2018-12-05
使用InputStream和OutputStream來獲得命令列運行結果和輸入內容是首先需要具備的.然後要解決SSH串連問題.在OpenSource項目裡找到了Ganymed SSH-2 for Java
Time of Update: 2018-12-05
這兩天一直在處理flv視頻環境的搭建工作,包括伺服器的安裝和java中的應用。安裝ffmpeg加mencoder倒沒有什麼大問題,不過還是有一個小問題弄得我鬱悶了下,就是在安裝amrwb和amrnb的時候出錯,錯誤如下:/usr/bin/wget -N http://www.3gpp.org/ftp/Specs/archive/26_series/26.104/26104-610.zip--20:41:59-- http://www.3gpp.org/ftp/Specs/archive/26_
Time of Update: 2018-12-05
1.throws 用於拋出方法層次的異常, 並且直接由些方法調用異常處理類來處理該異常, 所以它常用在方法的後面。比如 public static void main(String[] args) throws SQLException 2.throw 用於方法塊裡面的代碼,比throws的層次要低,比如try...catch ....語句塊,表示它拋出異常, 但它不會處理它, 而是由方法塊的throws
Time of Update: 2018-12-05
package com.eshroe.sweetop.concurrency;import java.util.concurrent.ExecutorService;import java.util.concurrent.Executors;import java.util.concurrent.TimeUnit;import java.util.concurrent.locks.Condition;import java.util.concurrent.locks.Lock;import
Time of Update: 2018-12-05
通常,使用的密碼編譯演算法 比較簡便高效,密鑰簡短,加解密速度快,破譯極其困難。本文介紹了MD5/SHA1,DSA,DESede/DES,Diffie-Hellman的使用。第1章基礎知識1.1.