Time of Update: 2018-12-05
同步線程的一種經典設計模式。public class Test { public static void main(String[] args) { Quene q = new Quene(); Producter producter = new Producter(q); Customer customer = new Customer(q); producter.start(); customer.start(); }}//生產者public class Producter
Time of Update: 2018-12-05
最近在做一個監控項目的時候要求在監控的時候可以採用聲音警示,如果用的是VS那麼直接調用Media player好了,可惜自己用的是#Develop做為開發環境。居然不支援com組件的引用。我倒~於是參照MS API寫了下面這個簡單的播放類 /* * Created by SharpDevelop. * User: root * Date: 2006-8-16 * Time: 15:44 * * To change this template use Tools | Options |
Time of Update: 2018-12-05
早幾天的時候一直對XSP支援中文的問題耿耿於懷。想重新編譯XSP來修正對中文支援的問題,可惜功力不夠只能夠重新編譯但編譯後的exe卻無法響應Http的訪問.....(如果誰成功編譯過請指教)於是今天想了想如果從資料庫讀來的資料包含中文情況會怎麼樣。於是隨便寫了個測試代碼:資料庫使用的是 MySql 4.1很簡單的一個表+---------+-----------+-----------+| user_id | user_name | user_pass |+---------+---------
Time of Update: 2018-12-05
1、首先開啟myeclipse,建一個Java Project,匯入Hibernate所需要的jar包及mysql資料庫驅動的jar; 需要的jar請參考博文 http://blog.csdn.net/spring292713/article/details/8119159 建立資料庫 Hibernate。2、建立 POJO類,Student.java package com.hibernate._0100_introduce;public class
Time of Update: 2018-12-05
先安裝netbeans的 j2me開發外掛程式之後添加 "JAVA平台管理" -> J2ME -> 定製J2ME平台 模擬器 (翻譯過來就這個含義) 之後添加 BB模擬器的路徑然後填寫一些基本資料(略過) 下一步之後,移除除開net_rim_api.jar的所有jar包(只保留net_rim_api.jar一個) 然後建立J2ME項目修改預設的build.xml<?xml version="1.0" encoding="UTF-8"?><!-- You may
Time of Update: 2018-12-05
google到一篇講const 與 static readonly的文章 還不錯~草譯一下The difference is that the value of a static readonly field is set at run time, and can thus be modified by the containing class, whereas the value of a const field is set to a compile time constant. 被
Time of Update: 2018-12-05
July 27th 2006 Posted in C++ __declspec(dllexport)的作用,它就是為了省掉在DEF檔案中手工定義匯出哪些函數的一個方法。當然,如果你的DLL裡全是C++的類的話,你無法在DEF裡指定匯出的函數,只能用__declspec(dllexport)匯出類。但是,MSDN文檔裡面,對於__declspec(dllimport)的說明讓人感覺有點奇怪,先來看看MSDN裡面是怎麼說的:不使用 __declspec(dllimport)
Time of Update: 2018-12-05
在代碼中引入第3方函數/動態連結程式庫能增強我們自己編寫的程式的功能和節省時間.MS .Net在處理中通過DLLImport 來描述.同樣的Mono也如同MS .Net一樣,下面是一段示範代碼: [DLLImport ("libc.so")] private static extern int getpid ();當然別忘了添加名稱空間:System.Runtime.InteropServices 當執行這段代碼時候,.Net/Mono Runtime
Time of Update: 2018-12-05
In the unmanaged world, it was quite common to intercept Win32 messages as they were plucked off the message queue. In that rare case in which you wish to do so from a managed Windows Forms application, your first step is to build a helper class
Time of Update: 2018-12-05
想在現有的web工程中打包部分類的時候進行代碼混淆。由於採用的是maven來管理所以google了一把發現已經有類似外掛程式了。只要下回外掛程式並添加相應的設定檔即可。本文僅是做下相關記錄1.修改pom.xml添加外掛程式<plugin><groupId>com.pyx4me</groupId><artifactId>proguard-maven-plugin</artifactId><executions><exec
Time of Update: 2018-12-05
設定一對一雙向外部索引鍵關聯關係,通過Husband可以找到Wife,也能通過Wife找到Husband1、編寫Husband類,並在Husband中添加Wife的引用 ; 使用Annotation時,將實體類進行註解,@Entity 、@Id;同時添加註解,設定關聯關係為@OneToOne ; package com.hibernate._0700_one2one_bi_fk;import javax.persistence.Entity;import
Time of Update: 2018-12-05
1、修改MyEclipse建立jsp的預設編碼: window -> 搜尋jsp ->修改Encoding 的取值,可以選 GB13080 或 utf-8等 。2、修改MyEclipse預設的jsp編輯器: Windows->Preferences->General->Editors->File Associations. 在檔案關聯對話方塊中,可以看到File
Time of Update: 2018-12-05
用來儲存計算最終結果的資料庫是整個資訊系統的重要組成部分,技術也相對成熟。然而,對於所有資料庫而言,除了記錄正確的處理結果之外,也面臨著一些挑戰:如何提高處理速度,資料可用性、資料安全性和資料集可擴性。將多個資料庫聯在一起組成資料庫叢集來達到上述目標應該說是一個很自然的想法。 叢集(Cluster)技術是使用特定的串連方式,將價格相對較低的硬體裝置結合起來,同時也能提供高效能相當的任務處理能力。
Time of Update: 2018-12-05
<SELECT> 是一個很常用的HtmlUI互動元素,其中它裡面的可選項由<option>元素來決定在DWR中的DWRUtil包中提供了2個Method專門用於真對<SELECT>操作,使得<SELECT>可以很容易實現Ajax操作這2個方法是:DWRUtil.removeAllOptions(p1);//p1 is select element idDWRUtil.addOptions(p1, p2);//p1 is select
Time of Update: 2018-12-05
環境說明: 在win7下,jdk版本是1.7,tomcat版本是7.0在安裝tomcat7時,填寫了username和password,但是發現登陸Web管理介面失敗,具體報錯如:重點查看被標記的,可以知道解決方案。 在tomcat的安裝目錄下的conf/tomcat-users.xml配置: 1. 配置 <role rolename="manager-status" /> 這個只能登陸到 Status 介面 : 2. 配置 <role
Time of Update: 2018-12-05
前台jsp:【1】<head> <title><s:text name="title"/></title> <link href="css/index.css" type="text/css" rel="stylesheet" /> <link href="css/front.css" type="text/css" rel="stylesheet" /> <script
Time of Update: 2018-12-05
一:動態修改jqGrid傳遞給伺服器參數。var attrV={ "mtrl.code":code, "mtrl.name":name, "mtrl.spec":spec, "startDate":startDate, "endDate":endDate }
Time of Update: 2018-12-05
從後台取出的文章標題太長,一行顯示不下原本想到幕後處理,但懶得寫代碼。就找了個在前台用css處理的辦法完整代碼如下:<div style="width:300px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;"> <a target="_blank" href="/cms/jeecms/tag/article/ArtiContent.do?artiId=<s:property
Time of Update: 2018-12-05
InnoDB和MyISAM是許多人在使用MySQL時最常用的兩個表類型,這兩個表類型各有優劣,視具體應用而定。基本的差別為:MyISAM類型不支援交易處理等進階處理,而InnoDB類型支援。MyISAM類型的表強調的是效能,其執行數度比InnoDB類型更快,但是不提供事務支援,而InnoDB提供事務支援已經外部鍵等進階資料庫功能。 MyIASM是IASM表的新版本,有如下擴充: ·二進位層次的可移植性。 ·NULL列索引。 ·對變長行比ISAM表有更少的片段。 ·支援大檔案。
Time of Update: 2018-12-05
下面介紹一下在eclipse中使用Selenium測試的指令碼編寫環境的搭建-Junit、確定你已經安裝好了jdk和eclipse。1、首先下載所需要的檔案 從網上下載好Selenium-RC所需要的jar包,可從官網http://seleniumhq.org/download/下載,也可以從網上下載。我下載的是 selenium-remote-control-1.0.3.zip : http://download.csdn.net/detail/spring292713/445