原创 connect by prior... start with的使用

假設我們現在有如下結構的數據(T_Topic) TopicID ParentID TopicTitle   1           null          請教Oracle 選取樹狀數據 2            1     

原创 Problem32

We shall say that an n-digit number is pandigital if it makes use of  all the digits 1 to n exactly once; for example,

原创 Problem 28

 Starting with the number 1 and moving to the right in a clockwise  direction a 5 by 5 spiral is formed as follows:21 2

原创 Problem 29

package cn.javass.mytest.java.euler; import java.util.Set; import java.util.TreeSet; /** * a(b) 表示 a的b次方 * * Cons

原创 有關rowNum

對於rownum來說它是oracle系統順序分配爲從查詢返回的行的編號, 返回的第一行分配的是1,第二行是2,依此類推,這個僞字段可以用於限制查詢返回的總行數,而且rownum不能以任何表的名稱作爲前綴。 所以上面幾條能夠查到記錄。 s

原创 Project euler 34

原題:145 is a curious number, as 1! + 4! + 5! = 1 + 24 + 120 = 145.Find the sum of all numbers which are equal to the sum

原创 Project Euler 36

原題: The decimal number, 585 = 1001001001 (binary), is palindromic in both bases. Find the sum of all numbers, less than

原创 組合、聚合和關聯的關係

組合和聚合是有很大區別的,這個區別不是在形式上,而是在本質上: 比如A類中包含B類的一個引用b,當A類的一個對象消亡時,b這個引用所指向的對象也同時消亡(沒有任何一個引用指向它,成了垃圾對象),這種情況叫做組合,反之b所指向的對象還會有另

原创 Project Euler 35

原題: The number, 197, is called a circular prime because all rotations of the digits:   197, 971, and 719, are themselve

原创 struts1與struts2的比較

一.MVC的特點:— 多個視圖可以對應一個模型。按MVC設計模式,一個模型對應多個視圖,可以減少代碼的複製及代碼的維護量,一旦模型發生改變,也易於維護。 — 模型返回的數據與顯示邏輯分離。模型數據可以應用任何的顯示技術,例如,使用JSP頁

原创 Problem58

原題: Starting with 1 and spiralling anticlockwise in the following way, a square spiral with side length 7 is formed. 3

原创 創建高性能索引(高性能mysql讀書筆記二)

1、索引類型 (1)B-Tree索引(MyISAM、InnoDB使用)           所有值按照順序排放           每一個葉子節點到根節點的距離相同           樹的深度和表的大小相關           (說明

原创 Tomcat6.0配置及分析

 Tomcat6.0 連接池的配置 1.本人當前使用的Tomcat版本爲:6.0.20,oracle爲穩定的9i版本 2.下文爲方便起見,依習慣以%Tomcat_Home%表示Tomcat安裝的目錄,本人安裝目錄爲“E:\Program

原创 執行計劃中參數解析

id:SELECT識別符。這是SELECT的查詢序列號。 select_type:SELECT類型。 1、SIMPLE: 簡單SELECT(不使用UNION或子查詢) 2、PRIMARY: 最外面的SELECT 3、UNION

原创 Schema與數據優化(高性能mysql讀書筆記一)

 1、數據類型的選擇 1)儘量使用能夠存儲數據的最小類型 2)儘量使用Mysql提供的數據類型存儲相應的結構,例如用date存儲時間,用int unsigned來存儲ip e.g. SELECT INET_ATON ('192.168