HDC調(diào)試需求開發(fā)(15萬預(yù)算),能者速來!>>>
就是我想知道 logback能不能輸出的日志信息中有出問題的logger所在的行數(shù)。比如我同一個(gè)文件里面有多個(gè)logger.error??刂婆_輸出一條logger.error信息,但是我怎么能快速找到這個(gè)位置。比如在控制臺顯示所在的行數(shù)
HDC調(diào)試需求開發(fā)(15萬預(yù)算),能者速來!>>> logback指定maxHistory,按照文檔中說明測試,發(fā)現(xiàn)過期的日志歸檔文件并不能被刪除: The optional maxHistory property controls the maximum number of archive files to keep, deleting older files. For example, if you specify monthly rollover, and set maxHistory to 6, then 6 months worth of archives files will be kept with files older than 6 months deleted. Note as old archived log files are removed, any folders which were created for the purpose of log file archiving will be removed as appropriate. 路過的大蝦給看看.
logFile.log logFile.%d{yyyy-MM-dd}.log 30 %-4relative [%thread] %-5level %logger{35} - %msg%n HDC調(diào)試需求開發(fā)(15萬預(yù)算),能者速來!>>>
大家好,最近項(xiàng)目中使用springboot+logback日志記錄信息,我采用的是統(tǒng)一的異常處理機(jī)制,在拋出的方法中記錄 log.info(e.toStrong()),記錄的信息很少,怎么能記錄信息的報(bào)錯(cuò)信息呢?還有統(tǒng)一的異常處理信息只能是接受controller拋出的異常嗎?
HDC調(diào)試需求開發(fā)(15萬預(yù)算),能者速來!>>>
%d{HH????ss.SSS} %contextName [%thread] %-5level %logger{36} - %msg%n UTF-8 ERROR DENY ACCEPT ${logback.logdir}/info.${logback.appname}.log ${logback.logdir}/info.${logback.appname}.%d{yyyy-MM-dd}.log 90 %d{HH????ss.SSS} %contextName [%thread] %-5level %logger{36} - %msg%n error ${logback.logdir}/error.${logback.appname}.log ${logback.logdir}/error.${logback.appname}.%d{yyyy-MM-dd}.log 90 UTF-8 %d [%thread] %-5level %logger{36} %line - %msg%n 以上是我的配置文件,日志 分為兩個(gè)。
然后,控制臺打印運(yùn)行時(shí)異常,
但是這個(gè)異常輸出不到,error.islife.log里面。
目前我有一個(gè)解決辦法,就是統(tǒng)一處理一下異常,然后log.error("",e);這樣可以打印到error.log 文件中。
但是,我是就是想問下,大神們,就不能自己,記錄到日志文件里面嗎?
HDC調(diào)試需求開發(fā)(15萬預(yù)算),能者速來!>>>
@Liuzh_533 你好,想跟你請教個(gè)問題:
我現(xiàn)在正在使用mapper-3.3.9,發(fā)現(xiàn)當(dāng)logback版本是1.0.13時(shí),控制臺能打印出SQL語句
而logback化成1.1.8時(shí),則無法打印SQL語句,這是什么原因?qū)е碌哪兀?
另外,我試驗(yàn)了下,logback.xml近似空白的情況下,logback1.0.13仍然能打印出SQL語句。具體配置如下(在這種配置下,仍然能打印出SQL語句):
logback.xml配置:
%d{HH????ss.SSS} %-5level %logger{80} - %msg%n HDC調(diào)試需求開發(fā)(15萬預(yù)算),能者速來!>>>
一、logback配置文件如下 src/main/resources/config/log/logback-spring.xml
${CONTEXT_NAME} %d{yyyy-MM-dd HH????ss.SSS} %-5level [%15.15thread] %logger{36}:%L - %msg%n UTF-8 ${LOG_PATH}/apps.log ${LOG_PATH}/apps.log.%d{yyyy-MM-dd}.%i 30 1024MB %d{yyyy-MM-dd HH????ss.SSS} %-5level [%thread] %logger{0}:%L- %msg%n UTF-8 ${LOG_PATH}/apps-warn-30dt.log ${LOG_PATH}/apps-warn-30dt.log.%d{yyyy-MM-dd}.%i 30 1024MB %d{yyyy-MM-dd HH????ss.SSS} [%thread] %-5level %logger{50} - %msg%n UTF-8 WARN ACCEPT DENY ${LOG_PATH}/apps-error-30dt.log ${LOG_PATH}/apps-error-30dt.log.%d{yyyy-MM-dd}.%i 30 1024MB %d{yyyy-MM-dd HH????ss.SSS} [%thread] %-5level %logger{50} - %msg%n UTF-8 ERROR ACCEPT DENY 二、application配置文件spring.profiles.active=dev logging.config=classpath:config/log/logback-spring.xml #logging.path=/var/log/webapps/dragon #logging.level.root=INFO #logging.level.com.mzw.dragon=INFO #logging.level.org.apache=INFO #logging.level.root.springframework=INFO ############################### VELOCITY TEMPLATES (VelocityAutoConfiguration) spring.velocity.charset=UTF-8 spring.velocity.properties.input.encoding=UTF-8 spring.velocity.properties.output.encoding=UTF-8 spring.velocity.properties.parser.pool.size=100 spring.velocity.properties.velocimacro.library=/velocityTemplates/macros/macros.vm spring.velocity.properties.velocimacro.library.autoreload=false spring.velocity.cache=false spring.velocity.content-type=text/html;charset=UTF-8 spring.velocity.date-tool-attribute=date spring.velocity.number-tool-attribute=number spring.velocity.prefix=/velocityTemplates spring.velocity.suffix=.vm spring.velocity.resourceLoaderPath=classpath:/velocityTemplates spring.velocity.toolbox-config-location=/config/velocity/velocity-toolbox.xml spring.mvc.view.prefix=/velocityTemplates spring.mvc.view.suffix=.vm 三、啟動(dòng)類文件package com.mzw.dragon; import com.mzw.dragon.configuration.DragonConfiguration; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer; import org.springframework.boot.web.support.SpringBootServletInitializer; import org.springframework.context.annotation.Import; /** * Created by victor.min on 2016/9/9. */ @SpringBootApplication @Import({DragonConfiguration.class}) public class BootStrap extends SpringBootServletInitializer implements EmbeddedServletContainerCustomizer { private static Logger logger = LoggerFactory.getLogger(BootStrap.class); public static void main(String[] args) throws Exception { // System.setProperty("spring.profiles.active", "dev"); logger.info("--------------------------------------------"); logger.info("------------------application start--------------------------"); SpringApplication.run(BootStrap.class, args); logger.info("-------------------application end-------------------------"); logger.info("--------------------------------------------"); } @Override public void customize(ConfigurableEmbeddedServletContainer configurableEmbeddedServletContainer) { logger.info("--------------------------------------------"); logger.info("------------------customize start--------------------------"); configurableEmbeddedServletContainer.setPort(8088); logger.info("-------------------customize end-------------------------"); logger.info("--------------------------------------------"); } @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { logger.info("--------------------------------------------"); logger.info("------------------configure start--------------------------"); return builder.sources(BootStrap.class); } }
不論在IDEA 里面直接RUN還是使用maven spring-boot:run啟動(dòng),日志都可以被正確的記錄,但是當(dāng)打成war包放到外部tomcat下時(shí),日志就不能被記錄了……
求大大們幫下忙呀~~
看了下面的兩篇文章,好像那樣也不行呀~~
http://www.cnblogs.com/zb38/p/5411701.html
http://www.cnblogs.com/puroc/p/5049222.html
HDC調(diào)試需求開發(fā)(15萬預(yù)算),能者速來!>>>
如下是logback 配置,實(shí)現(xiàn)每個(gè)線程1個(gè)文件,并且每天切換文件和壓縮、清理。
目前問題是,只有默認(rèn)的biz-0.log 會進(jìn)行壓縮和清理,其他的biz-1.log、biz-2.log 不會進(jìn)行壓縮和清理。
上述問題如何解決。
THREAD_ID
0
../logs/%d{yyyyMMdd}/biz-${THREAD_ID}.log.gz
10
true
false
${pattern}
true
HDC調(diào)試需求開發(fā)(15萬預(yù)算),能者速來!>>>
我想按照不同的訪問用戶分文件,每個(gè)用戶一個(gè)文件夾,下面按照年、月、日分三級文件夾,再在最底層文件夾中按照等級(debug,info,wrian,erorr)分成多個(gè)log文件。
因?yàn)槲业姆?wù)器是長連接,還有可能要按照接收的消息和發(fā)送的消息打印到不同文件中。
HDC調(diào)試需求開發(fā)(15萬預(yù)算),能者速來!>>>
spring4 + logback
用spring3中添加監(jiān)聽的方法不能執(zhí)行
嚴(yán)重: Exception sending context initialized event to listener instance of class org.springframework.util.LogbackConfigListener
java.lang.IllegalStateException: Cannot set web app root system property when WAR file is not expanded
at org.springframework.web.util.WebUtils.setWebAppRootSystemProperty(WebUtils.java:143)
在4中spring支持logback了嗎?用3的方法添加logback-extensions并不好用
HDC調(diào)試需求開發(fā)(15萬預(yù)算),能者速來!>>>
GetWindowRect(hwnd, lpRect)不是把坐標(biāo)存入RECT結(jié)構(gòu)嗎?
lpRect一直是NULL,根本沒數(shù)據(jù)
HDC調(diào)試需求開發(fā)(15萬預(yù)算),能者速來!>>>
求幫做文字轉(zhuǎn)圖片的程序!
輸入:鍵盤輸入默認(rèn)字號默認(rèn)字體的一組漢字
輸出:默認(rèn)字號默認(rèn)字體的單字對應(yīng)的圖片,并按順序編號
例如:輸入10個(gè)漢字,輸出10張圖片。肉眼看上去,圖文一模一樣
HDC調(diào)試需求開發(fā)(15萬預(yù)算),能者速來!>>> void make2Darray(T **&x ,int numofrow,int numofcol){ x=new T *[numofrow]; for(int i=0;i}
標(biāo)記紅色的地方 為什么需要使用&符號,表示什么意思?
HDC調(diào)試需求開發(fā)(15萬預(yù)算),能者速來!>>> typedef struct { int data[10000 * 10000]; int length; }SqList; SqList* p = new SqList; delete p; 能把里面數(shù)組的空間釋放掉嗎?
HDC調(diào)試需求開發(fā)(15萬預(yù)算),能者速來!>>>
寫了個(gè)簡單的ping檢測dll導(dǎo)出了ping函數(shù)供其他程序調(diào)用,但是現(xiàn)在源碼中導(dǎo)出了函數(shù)卻無法使用,檢查發(fā)現(xiàn)dll文件沒有導(dǎo)出任何函數(shù)。源碼vs2008正常編譯求解
// iping.cpp : Defines the entry point for the DLL application. // #include "stdafx.h" #include "ping.h" extern "C" _declspec(dllexport) int _cdecl ping(char ip,int latency); extern "C" __declspec(dllexport) int TestFuction(int nType,char *strPath,std::vector &vecData) { ////do anything here//// return 0; } BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) { return TRUE; } ping(char ip,int latency) { int a; a=-1; a=icmping((const char *)ip,latency); return a; }
源碼打包: http://pan.baidu.com/s/1c2IAo2O
HDC調(diào)試需求開發(fā)(15萬預(yù)算),能者速來!>>> 請教各位大俠: 我用opencv(3.0版)的SVM進(jìn)行分類時(shí),svm->(traindata, ROW_SAMPLE, labels)函數(shù)進(jìn)行分類時(shí),traindata的數(shù)據(jù)格式必須是CV_32FC1,且labels的數(shù)據(jù)格式為CV_32SC1,換成其他數(shù)據(jù)格式,則運(yùn)行錯(cuò)誤,這是為什么?此外,數(shù)據(jù)格式按照上面的要求定義后,為什么使用response=svm->predict(testMat)進(jìn)行分類時(shí),response的值往往不是預(yù)期的類型,而是絕對值很大的整數(shù)或負(fù)數(shù),如1.07794e+009,跪求解答。全部代碼如下所示: #include #include #include #include #include using namespace std; using namespace cv; using namespace cv::ml; int main(){ // step 1: //訓(xùn)練數(shù)據(jù)的分類標(biāo)記,即4類 float labels[16] = { 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0, 3.0, 4.0, 4.0, 4.0, 4.0 }; Mat labelsMat = Mat(16, 1, CV_32SC1, labels); //訓(xùn)練數(shù)據(jù)矩陣 float trainingData[16][2] = { { 0, 0 }, { 4, 1 }, { 4, 5 }, { -1, 6 }, { 3, 11 }, { -2, 10 }, { 4, 30 }, { 0, 25 }, { 10, 13 }, { 15, 12 }, { 25, 40 }, { 11, 35 }, { 8, 1 }, { 9, 6 }, { 15, 5 }, { 20, -1 } }; Mat trainingDataMat = Mat(16, 2, CV_32FC1, trainingData); //------------設(shè)置支持向量機(jī)的參數(shù)--------------------- // opencv3.0 Ptr svm = ml::SVM::create(); svm->setType(SVM::C_SVC); svm->setKernel(SVM::RBF); svm->setC(100); svm->setGamma(1); svm->setTermCriteria(TermCriteria(TermCriteria::MAX_ITER, (int)1e7, 1e-6));//終止準(zhǔn)則函數(shù):當(dāng)?shù)螖?shù)達(dá)到最大值時(shí)終止 // -----訓(xùn)練------- printf("\n-----------------starting to train data by SVM----------------\n" ; svm->train(trainingDataMat, ROW_SAMPLE, labelsMat); // step 4: //使用訓(xùn)練所得模型對新樣本進(jìn)行分類測試 for (int i = -5; i<15; i++) { for (int j = -5; j<15; j++) { float a[] = { i, j }; Mat sampleMat = Mat(1, 2, CV_32FC1, a); cout << "sampleMat = " << sampleMat << endl; float response = svm->predict(sampleMat); cout << response << " "; } cout << endl; } return 0; }
HDC調(diào)試需求開發(fā)(15萬預(yù)算),能者速來!>>>
在一個(gè)晚上,我在思考如何讓計(jì)算機(jī)像人一樣下象棋。不說現(xiàn)在的程序是怎么實(shí)現(xiàn)的,我把人思考的過程細(xì)細(xì)想了一下,人們會為了將死對方而用不同方法和策略,而現(xiàn)在將死的那一步還很遠(yuǎn),現(xiàn)在需要考慮的是先完成這一步。簡單說就是,有一個(gè)事情需要解決,而條件不滿足,我們就需要先解決這個(gè)條件,依次類推,直到找到解決方法。 這時(shí)候我們會發(fā)現(xiàn)我們需要學(xué)會的很少,只是很基本的幾樣?xùn)|西,但是組合在一起就可以解決很多的問題。(這點(diǎn)跟計(jì)算機(jī)與函數(shù)類似。 )我想計(jì)算機(jī)能自動(dòng)調(diào)用組合合適的函數(shù)應(yīng)該能實(shí)現(xiàn)智能吧(這是我一直堅(jiān)持的,偶爾也對此迷惑),但是它怎么知道該調(diào)用哪個(gè)函數(shù)呢,難道把各個(gè)函數(shù)的作用標(biāo)出來,參數(shù)標(biāo)出來嗎,那參數(shù)從什么地方來。對此我設(shè)計(jì)了 一個(gè)函數(shù)索引表和一個(gè)邏輯數(shù)據(jù)庫,函數(shù)就用現(xiàn)成的。因?yàn)楸救四芰τ邢?有許多細(xì)節(jié)沒有寫出來,代碼更是一行沒寫呢。
對此方法我稱之為智能平臺,區(qū)別以往的只能算智能算法。
我本來想一個(gè)人先開發(fā)一個(gè)模型的,但是有許多基礎(chǔ)性問題沒法獨(dú)立解決,可惜。歡迎大家交流。
HDC調(diào)試需求開發(fā)(15萬預(yù)算),能者速來!>>> 老師讓根據(jù)龔建偉的Visual C++串口通信編程實(shí)踐做接收串口發(fā)送的數(shù)據(jù),我可以收到串口發(fā)送的數(shù)據(jù),但是要根據(jù)協(xié)議處理數(shù)據(jù),我不會。我可以收到這些數(shù)據(jù)FF FA 11 00 00 00 00 00 00 00 00 00 09 AC 07 3E BE 33。FF是幀頭,之后一直到09 AC是溫度值,07是濕度值。我怎么樣可以只將09 AC顯示成整形數(shù)的值?
HDC調(diào)試需求開發(fā)(15萬預(yù)算),能者速來!>>> 就是關(guān)于如何用c++實(shí)現(xiàn)類似于chrome安裝那樣的在線安裝升級功能,畢業(yè)設(shè)計(jì)要做的東西。。但是到現(xiàn)在一頭霧水,不知道如何下手,有沒有大神推薦一下這方面的書或者是指個(gè)方向。。萬分感謝
HDC調(diào)試需求開發(fā)(15萬預(yù)算),能者速來!>>>
這個(gè)程序我只能輸入一組數(shù)據(jù)就結(jié)束了,求教怎么輸入多組數(shù)據(jù),新人求教。
#include #include#include using namespace std; class zb { public: void set(); void getline(zb); private: double x,y; }; void zb::set() { cin>>x>>y; } void zb::getline(zb p2) { double d; d=sqrt((x-p2.x)*(x-p2.x)+(y-p2.y)*(y-p2.y)); cout<<"("<
HDC調(diào)試需求開發(fā)(15萬預(yù)算),能者速來!>>>
PAT的1002寫出這個(gè)數(shù)的解析有些看不懂,題目是這樣子的
解析里面的兩句看不懂,新人求救。
定義變量的時(shí)候?yàn)槭裁从玫氖嵌S數(shù)組?
【char data2[10][5]={"ling","yi","er","san","si","wu","liu","qi","ba","jiu"};】
中間的continue起了什么作用? if(temp[i]==0 && j==0 && i!=2) continue;
解析
#include
#include
char data[100]={0};
int temp[3]={0};
char data2[10][5]={"ling","yi","er","san","si","wu","liu","qi","ba","jiu"};
int main(int argc, char *argv[])
{
int len=0,sum=0,i=0,j=0;
for(i=0;i<100 && (data[i]=getchar())!='\n';i++)
{
if(data[i]>47 && data[i]<58)
sum+=data[i]-48;
}
temp[0]=sum/100;
temp[1]=(sum-temp[0]*100)/10;
temp[2]=sum-temp[0]*100-temp[1]*10;
for(i=0,j=0;i<3;i++)
{
if(temp[i]==0 && j==0 && i!=2) continue;
else
{
j=1;
printf("%s",data2[temp[i]]);
}
if(i!=2)
printf(" ");
else
printf("\n");
}
return 0;
}
HDC調(diào)試需求開發(fā)(15萬預(yù)算),能者速來!>>>
上圖中左邊是C++, 右邊是C#, C#會自動(dòng)選中第一個(gè)代碼提示, 這樣再按回車或空格就會輸入了, 左邊的C++沒有選中第一行的代碼提示, 要想輸入第一個(gè), 就得多按一個(gè)鍵或者直接按Tab鍵. 但是就算是按Tab也會很不舒服, 因?yàn)楹芏嗳耸怯沂至?xí)慣, 多用右手按Enter, 少用左手按Tab, 才會省力. 所以有辦法把這個(gè)Tab快捷鍵換行Enter快捷鍵嗎? 或者有辦法讓VS自動(dòng)選中第一行嗎? 或者有什么其他好辦法啊?
HDC調(diào)試需求開發(fā)(15萬預(yù)算),能者速來!>>>
如題,是否支持#include?
若不支持,怎樣讓vs2008支持互斥鎖?
(暫時(shí)不考慮換成vs2013等高版本)
HDC調(diào)試需求開發(fā)(15萬預(yù)算),能者速來!>>> 近期想做一個(gè)簡單的增刪改查管理系統(tǒng) 在校學(xué)生課設(shè)作業(yè) 有什么新穎點(diǎn)的題目嗎 網(wǎng)上都是做圖書管理啊 倉庫管理啊 學(xué)生管理啊 會員管理啊 爛大街了 我想做個(gè)新穎點(diǎn)的 別人沒做過的 想不出有什么比較新穎而且符合管理系統(tǒng)的要求 大家給提點(diǎn)意見啊 跪謝出主意
HDC調(diào)試需求開發(fā)(15萬預(yù)算),能者速來!>>>
我寫了代碼 ,然后思路參考 這里。。 http://blog.csdn.net/talk_8/article/details/46385919
代碼如下 ,有錯(cuò),請 大神指點(diǎn)!
//進(jìn)制轉(zhuǎn)換 CharArray HexConvertion(int a,int baseNum) { int b=a/baseNum; int c=a%baseNum; CharArray ch=NULL; ch=(struct BaseChar*)malloc(sizeof(struct BaseChar)); ch->data=(char)malloc(sizeof(char)); if(baseNum==2) { int temp=1; while (temp!=0) { ch->data=c; temp=b; b=temp/baseNum; c=temp%baseNum; ch->next=(struct BaseChar*)malloc(sizeof(struct BaseChar)); ch=ch->next; } return ch; } //if(baseNum==8) //{ // //} //if(baseNum==16) //{ // //} } void PrintCharArray(CharArray arr) { while (arr->next!=NULL) { printf_s("%c ",arr->data); arr=arr->next; } }
int _tmain(int argc, _TCHAR* argv[]) { CharArray array=HexConvertion(9,2); PrintCharArray(array); system("pause"); return 0; }
請大神指點(diǎn)!謝謝,小弟C語言新手!編譯環(huán)境VS2012
HDC調(diào)試需求開發(fā)(15萬預(yù)算),能者速來!>>> 是不是用visualC++能夠?qū)崿F(xiàn)的功能 pyqt也能夠?qū)崿F(xiàn)??
HDC調(diào)試需求開發(fā)(15萬預(yù)算),能者速來!>>>
在使用spring data jpa 做查詢的時(shí)候,我出現(xiàn)了如下錯(cuò)誤:
這是我的Repository接口:
這個(gè)是測試能不能查詢的,自定義查詢語句是沒有問題用的原生sql,但是如果不是自定義的,是jpa自帶的那么就會出現(xiàn)問題,報(bào)上面的錯(cuò)誤。
這個(gè)是實(shí)體類映射:
可以幫忙看看是什么原因嗎?為什么默認(rèn)的查詢就不行了呢?非要指定sql?
HDC調(diào)試需求開發(fā)(15萬預(yù)算),能者速來!>>>
最近遇到一個(gè)項(xiàng)目,需要輸出的條形碼是紅色的, 請問zxing是否可以設(shè)置條形碼的顏色?如果不可以,java是否有其他辦法可以實(shí)現(xiàn)?
HDC調(diào)試需求開發(fā)(15萬預(yù)算),能者速來!>>> 最近想搞個(gè)二維碼的功能,網(wǎng)上找些資料看到有兩個(gè)開源插件,barcode4j和zxing,現(xiàn)在想問問哪個(gè)好用,各有什么優(yōu)缺點(diǎn),有用過的大神給解釋下
HDC調(diào)試需求開發(fā)(15萬預(yù)算),能者速來!>>>
識別率偏低,微信能識別,但zxing無法識別
純java后臺方式
HDC調(diào)試需求開發(fā)(15萬預(yù)算),能者速來!>>> 有人知道微信用的是什么掃碼庫嗎?zxing?zbar?怎么對焦那么快,識別那么叼?
HDC調(diào)試需求開發(fā)(15萬預(yù)算),能者速來!>>> jdk1.5的環(huán)境,使用zxing生成二維碼,報(bào)錯(cuò) java.lang.UnsupportedClassVersionError: Bad version number in .class file。哪版zxing在1.5下好使呢?Q Rcode也試了,在1.5環(huán)境下,也有問題。 求大神解答!~
HDC調(diào)試需求開發(fā)(15萬預(yù)算),能者速來!>>> zxing源碼demo運(yùn)行在安卓4.2+500W攝像頭的開發(fā)板上,結(jié)果發(fā)現(xiàn)掃描的時(shí)候并沒有出現(xiàn)那幾個(gè)定位的小黃點(diǎn),導(dǎo)致無法掃描,log如下,那個(gè)箭頭指向的是啥意思- =;導(dǎo)致這個(gè)BUG的原因是啥,求大神解答
HDC調(diào)試需求開發(fā)(15萬預(yù)算),能者速來!>>> 我要知道如何調(diào)用zxing解析二維碼的方法(方法名),如何獲得解析結(jié)果。網(wǎng)上找不到詳細(xì)說明。求解!
HDC調(diào)試需求開發(fā)(15萬預(yù)算),能者速來!>>> Zxing是怎么區(qū)分碼制的?比如在識讀的時(shí)候怎么區(qū)分條碼是PDF417還是QR?
HDC調(diào)試需求開發(fā)(15萬預(yù)算),能者速來!>>>
我現(xiàn)在只能搞出這種圖片
但是我想要的是下面這種
誰知道用zxing怎么給這玩意兒下面添加數(shù)字,別叫我換barcode4j 只喜歡zxing
HDC調(diào)試需求開發(fā)(15萬預(yù)算),能者速來!>>>
今天要做個(gè)二維碼和一維碼,想在同一張圖片上同時(shí)存放二維碼和條形,并且要可以解析的,
誰知道用google的zxing要怎么才能完成我的愿望呢,
PS:最討厭回復(fù)廢話的盆友,請有能力的大神最好能給demo,或者幫忙吧思路寫清晰一下
HDC調(diào)試需求開發(fā)(15萬預(yù)算),能者速來!>>>
一張圖片一個(gè)二維碼的已經(jīng)實(shí)現(xiàn).
可是如何在一張圖片N張二維碼的情況下. 解碼出所有的二維碼呢 ?
通過單純的zxing可以實(shí)現(xiàn)嗎 ? 請高手解釋下.
還是說:先通過類似于opencv的方法,把圖片分成N個(gè)小圖片,每個(gè)圖片擁有自己的二維碼,然后進(jìn)行一張一張的解碼 ?
HDC調(diào)試需求開發(fā)(15萬預(yù)算),能者速來!>>> 因?yàn)檫@個(gè)接口是文件路徑,但是做網(wǎng)站不能這樣讀取,想直接從內(nèi)存流中讀取,求教大神應(yīng)該這么做?~~~public void testDecode() { String filePath = "k://zxing.png"; BufferedImage image; try { image = ImageIO.read(new File(filePath)); LuminanceSource source = new BufferedImageLuminanceSource(image); Binarizer binarizer = new HybridBinarizer(source); BinaryBitmap binaryBitmap = new BinaryBitmap(binarizer); Map hints = new HashMap(); hints.put(DecodeHintType.CHARACTER_SET, "UTF-8"); Result result = new MultiFormatReader().decode(binaryBitmap, hints);// 對圖像進(jìn)行解碼 JSONObject content = JSONObject.fromObject(result.getText()); System.out.println("圖片中內(nèi)容: "); System.out.println("author: " + content.getString("author")); System.out.println("zxing: " + content.getString("zxing")); System.out.println("圖片中格式: "); System.out.println("encode: " + result.getBarcodeFormat()); } catch (IOException e) { e.printStackTrace(); } catch (NotFoundException e) { e.printStackTrace(); } }
HDC調(diào)試需求開發(fā)(15萬預(yù)算),能者速來!>>> 代碼如下:現(xiàn)在的問題是,它一直在掃描,始終不執(zhí)行handleDecode()方法。 public class ScanCodeActivity extends Activity implements Callback { private CaptureActivityHandler handler ; private ViewfinderView viewfinderView ; private boolean hasSurface ; private Vector decodeFormats ; private String characterSet ; private InactivityTimer inactivityTimer ; private MediaPlayer mediaPlayer ; private boolean playBeep ; private static final float BEEP_VOLUME = 0.10f ; private boolean vibrate ; @Override public void onCreate (Bundle savedInstanceState) { super .onCreate(savedInstanceState) ; setContentView(R.layout. activity_scan_code ) ; ButterKnife. bind ( this ) ; //初始化 CameraManager CameraManager. init (getApplication()) ; viewfinderView = (ViewfinderView) findViewById(R.id. viewfinder_view ) ; hasSurface = false; inactivityTimer = new InactivityTimer( this ) ; } //返回 @OnClick ({R.id. back_btn , R.id. back_img }) void scanCodeBack () { this .finish() ; } @Override protected void onResume () { super .onResume() ; SurfaceView surfaceView = (SurfaceView) findViewById(R.id. preview_view ) ; SurfaceHolder surfaceHolder = surfaceView.getHolder() ; if ( hasSurface ) { initCamera(surfaceHolder) ; } else { surfaceHolder.addCallback( this ) ; surfaceHolder.setType(SurfaceHolder. SURFACE_TYPE_PUSH_BUFFERS ) ; } decodeFormats = null; characterSet = null; playBeep = true; AudioManager audioService = (AudioManager) getSystemService( AUDIO_SERVICE ) ; if (audioService.getRingerMode() != AudioManager. RINGER_MODE_NORMAL ) { playBeep = false; } initBeepSound() ; vibrate = true; } @Override protected void onPause () { super .onPause() ; if ( handler != null ) { handler .quitSynchronously() ; handler = null; } CameraManager. get ().closeDriver() ; } @Override protected void onDestroy () { inactivityTimer .shutdown() ; super .onDestroy() ; } private void initCamera (SurfaceHolder surfaceHolder) { try { CameraManager. get ().openDriver(surfaceHolder) ; } catch (IOException ioe) { return; } catch (RuntimeException e) { return; } if ( handler == null ) { handler = new CaptureActivityHandler( this, decodeFormats , characterSet ) ; } } @Override public void surfaceChanged (SurfaceHolder holder , int format , int width , int height) { } @Override public void surfaceCreated (SurfaceHolder holder) { if (! hasSurface ) { hasSurface = true; initCamera(holder) ; } } @Override public void surfaceDestroyed (SurfaceHolder holder) { hasSurface = false; } public ViewfinderView getViewfinderView () { return viewfinderView ; } public Handler getHandler () { return handler ; } public void drawViewfinder () { viewfinderView .drawViewfinder() ; } public void handleDecode (Result result , Bitmap barcode) { inactivityTimer .onActivity() ; playBeepSoundAndVibrate() ; String resultString = result.getText() ; Log. i ( "resultString=" , "" +resultString) ; if (resultString.equals( "" )) { Toast. makeText (ScanCodeActivity. this, "掃碼失敗,請重試!" , Toast. LENGTH_SHORT ).show() ; } else { Intent resultIntent = new Intent() ; Bundle bundle = new Bundle() ; bundle.putString( "result" , resultString) ; bundle.putParcelable( "bitmap" , barcode) ; resultIntent.putExtras(bundle) ; this .setResult( RESULT_OK , resultIntent) ; } //ScanCodeActivity.this.finish(); } private void initBeepSound () { if ( playBeep && mediaPlayer == null ) { setVolumeControlStream(AudioManager. STREAM_MUSIC ) ; mediaPlayer = new MediaPlayer() ; mediaPlayer .setAudioStreamType(AudioManager. STREAM_MUSIC ) ; mediaPlayer .setOnCompletionListener( beepListener ) ; AssetFileDescriptor file = getResources().openRawResourceFd( R.raw. beep ) ; try { mediaPlayer .setDataSource(file.getFileDescriptor() , file.getStartOffset() , file.getLength()) ; file.close() ; mediaPlayer .setVolume( BEEP_VOLUME , BEEP_VOLUME ) ; mediaPlayer .prepare() ; } catch (IOException e) { mediaPlayer = null; } } } private static final long VIBRATE_DURATION = 200L ; private void playBeepSoundAndVibrate () { if ( playBeep && mediaPlayer != null ) { mediaPlayer .start() ; } if ( vibrate ) { Vibrator vibrator = (Vibrator) getSystemService( VIBRATOR_SERVICE ) ; vibrator.vibrate( VIBRATE_DURATION ) ; } } private final OnCompletionListener beepListener = new OnCompletionListener() { public void onCompletion (MediaPlayer mediaPlayer) { mediaPlayer.seekTo( 0 ) ; } } ; }
HDC調(diào)試需求開發(fā)(15萬預(yù)算),能者速來!>>> winForm,一張圖片上有多個(gè)一維條碼,通過一次掃描全部解析出來