Time of Update: 2018-12-05
代碼:--------------------------------------------------------------------------------<?xml version="1.0" encoding="utf-8"?><mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" ><mx:Script> <![CDATA[ import
Time of Update: 2018-12-05
log4j的強大功能無可置疑,但實際應用中免不了遇到某個功能需要輸出獨立的記錄檔的情況,怎樣才能把所需的內容從原有日誌中分離,形成單獨的記錄檔呢?其實只要在現有的log4j基礎上稍加配置即可輕鬆實現這一功能。 先看一個常見的log4j.properties檔案,它是在控制台和myweb.log檔案中記錄日誌:log4j.rootLogger=DEBUG, stdout,
Time of Update: 2018-12-05
freemarker 入門Header.ftl檔案代碼 <#macro title color="red"> <font color="${color}" size="16px"><#nested></font></#macro><#assign version = "1.0"><html><head> <title>Hello World
Time of Update: 2018-12-05
//傳入你的ResultSetpublic static void printRS(ResultSet rs) throws SQLException{//檢索此 ResultSet 對象的列的編號、類型和屬性。ResultSetMetaData rsmd = rs.getMetaData();//得到當前的列數int colCount = rsmd.getColumnCount();while(rs.next()) { //while控制行數for(int i = 1; i <=
Time of Update: 2018-12-05
Hibernate的動態模型為我們動態改動表結構帶來了方便, 個人認為這一點非常有價值, 現在的企業級應用系統越來越強調使用者可定製性, hibernate的這一點使使用者自訂欄位或自訂表格成為可能 .Hibernate也支援動態模型 (在運行期使用Map的Map)和象DOM4J的樹模型那 樣的實體表示。使用這種方法,你不用寫持久化類,唯寫對應檔就行了。在對應檔中用entity-name看一個例子xml 代碼<hibernate-mapping>
Time of Update: 2018-12-05
今天配置CAS,在向用戶端傳遞更多屬性時候,遇到中文亂碼問題,百度一把,找到的都是說使用URLEncoder來相互轉碼,這也太暴力了吧,我想CAS沒有那麼撮。1)在服務端修改casServiceValidationSuccess.jsp檔案,增加<%@ page pageEncoding="UTF-8"%>,我增加了居然還是亂碼,通過下一步可以解決2)在研究了一下用戶端驗證配置的時候,發現一個名叫encoding參數,很熟悉是不是,配置上,設定為UTF-8,和熟悉的中文出現了。
Time of Update: 2018-12-05
#include <cstdio>#include <iostream>using namespace std;const int maxn = 50;int father[maxn * maxn + 100];char mat[maxn + 5][maxn + 5];int n, m;int get_father(int a) { //return father[a] == -1 ? (father[a] = a) : (father[a] =
Time of Update: 2018-12-05
必要參數:casServerLoginUrl :定義CAS伺服器的登入URL地址,例如: https://localhost:8443/cas/loginservice or serverName:service :發送到CAS伺服器的service URL地址,例如https://localhost:8443/yourwebapp/index.htmlserverName:CAS用戶端的伺服器名稱,Service URL使用這個名稱動態組裝,例如:http://localhost:8080 (
Time of Update: 2018-12-05
1.統計 bug統計時,要統計“待處理”,“處理中”,“已處理”這3個在某個excle中的出現次數,那麼在統計個數的框內輸入函數: =COUNTIF(K3:K101,M2) 其中,K3:K101是從K列第3行到K列第101行的內容進行統計,M2是統計的是M2這個儲存格內的字(待處理,處理中,已處理這些寫在M2裡面)2.替換 要把某一列中的“3"替換成"發送成功"。選中這一列--》ctrl+h
Time of Update: 2018-12-05
這是一道結論題:求具有外接圓的四邊形ABCD的面積: p = (a + b + c + d) / 2;S = sqrt((p-a) * (p-b) * (p-c) * (p-d));形象解釋:就像吹氣球一樣,如果要想盡量吹多一些,就要更加“圓”一些。猜想:是不是對於五邊形也有同樣的道理???請大神指點。考慮:從公式來看,為什麼和abcd的安排順序無關???請大神指點。#include <cstdio>#include <cmath>#include
Time of Update: 2018-12-05
renew - specifies whether renew=true should be sent to the CAS server. Valid values are either "true" or "false" (or no value at all).gateway - specifies whether gateway=true should be sent to the CAS server. Valid values are either "true" or "false"
Time of Update: 2018-12-05
在Myeclipse中,預設的編輯器的tab鍵縮排都是4個空格,一般根據個人喜好可能要想設定為2個. 對於Java: Window -> Preferences -> Java -> Code Style -> Formatter 選中一個profile,點show,顯示其模板定義,在Indentation中有一個Tab size…… 對於JSP(包括其他格式檔案); Window -> Preferences -> General ->
Time of Update: 2018-12-05
#include <cstdio>#include <cstring>#include <iostream>using namespace std;const int maxn = 1e6;const int maxm = 6;int price[maxm] = {100, 50, 10, 5, 2, 1};int dp[maxn + 100];void run_dp() { fill(dp, dp + maxn, (1 << 30));
Time of Update: 2018-12-05
Flex DataGrid儲存格顯示資料有多種方式。1.預設的是截模數式,就是對於顯示不下的內容進行自動截取,會被下一列所遮蓋。看:2. 但是有時候我們需要能夠方便的顯示所有內容,但又不希望這一列變得很寬。有一個方法就是自動隱藏該單元的內容,對於資料量大的自動在後面加...,當滑鼠移動到該儲存格上時,能夠以ToolTip的形式完全顯示該單元的內容,這個我們可以採用將Label作為該列的itemRenderer辦法,具體效果如下:3. 有時候我們需要DataGrid的每行內容能夠顯示全所有的內容,
Time of Update: 2018-12-05
伺服器,在返回給用戶端使用者資訊時,預設只返回使用者名稱(我們已經修改成ID).但有時我們需要更多的屬性資訊,如使用者名稱。則應做如下修改:使用者登入成功以後,CAS使用一個credentialsToPrincipalResolvers將credentials轉成Principal對象,此對象只有一個實作類別如下.SimplePrincipal的構造方法接收兩個參數,一個是使用者的id,一個為使用者的其他屬性。使用者的ID預設為使用者登入時使用的使用者名稱,前面第4點已經講過如何將使用者的nam
Time of Update: 2018-12-05
一般來說,在一個XmlBeanFactory中,定義一個bean時,採用的是<bean id="XX" class="XX">的樣式,如<bean id="helloBean" class="javamxj.HelloBean">。這裡id的命名格式必須符合XML ID屬性的命名規範,例如,不能以數字開頭,“222”就不是合法的id值。為瞭解決這個問題,可以使用name屬性指定一個和多個id(用逗號或者分號隔離)。 HelloBean.javapackage
Time of Update: 2018-12-05
#include<iostream>#include<cstdlib>#include<vector>#include<map>#include<cstring>#include<string>#include<algorithm>#include<ctype.h>#include<fstream>#include<string.h>#include<stdio.h>
Time of Update: 2018-12-05
設定檔persistence.xml<persistence> <persistence-unit name="example"> <jta-data-source>java:/DefaultMySqlDS</jta-data-source> <properties> <property name="hibernate.hbm2ddl.auto" value="create-drop"/> &
Time of Update: 2018-12-05
例子1、import flash.ui.ContextMenu;import flash.ui.ContextMenuItem;import flash.events.ContextMenuEvent;// 為滑鼠右鍵添加關閉當前瀏覽器視窗的菜單var contextMenu : ContextMenu = new ContextMenu();contextMenu.hideBuiltInItems(); // 隱藏一些內建的滑鼠右鍵功能表項目var contextMenuItem :
Time of Update: 2018-12-05
/*收穫:貪心 + 交換*/#include<iostream>#include<cstdlib>#include<vector>#include<map>#include<cstring>#include<string>#include<algorithm>#include<sstream>#include<ctype.h>#include<fstream>#include&