public class B extends Object{
                  
          static{System.out.println("Load B");
              }

              
          public B(){
                  System.out.println(
          "Create B");
              }

          }

          public class A extends B{
              
          static {
                  System.out.println(
          "Load A");
              }

              
          public A(){
                  System.out.println(
          "Create A");
              }

          }

          public class testClass {
              
          public static void main(String[] args){
                  
          new A();
              }


          }
          寫出程序運行結果:

          Load B
          Load A
          Create B
          Create A

          歡迎大家留言發散討論

          posted @ 2009-09-26 18:38 Robert Su 閱讀(630) | 評論 (1)編輯 收藏

          在 myeclipse 的 preferences-屬性 中搜索 javascript,搜到以后把它的Editing files 下的 Encoding 改為 Chinese,National Standard 就好了 也就是 GB18030

          posted @ 2009-09-07 17:03 Robert Su 閱讀(809) | 評論 (1)編輯 收藏

          an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session)

          session出錯下次使用的時候報錯


          這個bug解決方法還沒搞清楚

          posted @ 2009-09-07 11:28 Robert Su 閱讀(3250) | 評論 (0)編輯 收藏

          問題描述:
          網上關于extjs的comboTree已經層出不窮了
          利用tpl顯示tree不是問題
          關鍵是combo的顯示值
          網上的例子多是

          comboxWithTree.setValue(node.id);
          但是這樣的顯示跟post值不一樣

          tree1.on('click',function(node){
                 
                  var Record = Ext.data.Record.create(
                      {name: 'id', mapping: 'id'},
                      {name: 'text', mapping: 'text'}
                 ) ;
                 var t = new Record({
                      id: node.id,
                      text: node.text
                      }
                 )
               
                 comboxWithTree.getStore().add(t);
                 console.debug(comboxWithTree.getStore().data);
                 comboxWithTree.setValue(node.id);
                 comboxWithTree.collapse();
              });

          posted @ 2009-09-01 18:18 Robert Su 閱讀(1484) | 評論 (0)編輯 收藏

          把 WordPress 作為 CMS 來使用在2.1版本變得更加容易,只需5個簡單的步驟并且不需去修改復雜的代碼就能實現。

          1. 創建一個頁面并命名為 home 作為開始頁面,并給其 page order(頁面順序)為0。
          2. 創建一個空的頁面并命名為 weblog 并給其 page order(頁面順序) 為99。
          3. 在管理界面,選擇 option(選項) > reading(閱讀),將上面創建的 home 作為 front page(開始頁) 和 weblog 作為 posts page(文章列表頁面)。
          4. 通過這個函數 wp_list_pages(’sort_column=menu_order&title_li=’) 創建網站菜單。
          5. 使用一個插件使得頁面也能夠被搜索。
            可以選用 Search Everything 這個插件。

          當為你的 CMS 創建頁面的時候,確定頁面順序必須在0和99之間。這樣的話,菜單中的第一個就是 home,最后的是 weblog,當然你可以根據你自己的需求更改。

          posted @ 2009-08-26 22:22 Robert Su 閱讀(143) | 評論 (0)編輯 收藏

          瀏覽主頁都不行

          建設中

          您想要查看的站點當前沒有默認頁。可能正在對它進行升級和配置操作。

          請稍后再訪問此站點。如果您仍然遇到問題,請與網站的管理員聯系。


          如果您是網站的管理員,并且認為您是由于錯誤才收到此消息,請參閱 IIS 幫助中的"啟用和禁用動態內容"。

          要訪問 IIS 幫助
          1. 單擊開始,然后單擊運行
          2. 打開文本框中,鍵入 inetmgr。將出現 IIS 管理器。
          3. 幫助菜單,單擊幫助主題
          4. 單擊Internet 信息服務

          posted @ 2009-08-25 23:16 Robert Su 閱讀(188) | 評論 (0)編輯 收藏

          youku為什么不推出類似ipod itouch之類的播放器?

          個人認為這樣的播放器+ PC客戶端管理(流媒體到播放器)工具是很有市場的

          蘋果的成功經驗已經有了,要做的只是  UI設計+工業設計

          估計youku現在沒上市缺錢,上市之后會有此類開發計劃吧。

          土豆的UI簡直就是對人眼的摧殘。

          posted @ 2009-08-17 09:05 Robert Su 閱讀(300) | 評論 (0)編輯 收藏

              public List findByInstance(IInsInfo instance) {
                  log.debug(
          "finding IInsInfo instances with given IInsInfo instance");
                  
          try {
                      Criteria crit 
          = getSession().createCriteria(instance.getClass());
                      Criterion iname 
          = null, gdfield = null, kind = null, property = null;
                      Conjunction conjunction 
          = Restrictions.conjunction();// 合取
                      
          //
                      if (instance.getIname() != null)
                          
          if (!instance.getIname().equals(null)) {
                              iname 
          = Restrictions.like("iname""%"
                                      
          + instance.getIname() + "%");
                              conjunction.add(iname);
                          }
                      
          if (instance.getGdfield() != null)
                          
          if (!instance.getGdfield().equals("")) {
                              gdfield 
          = Restrictions.eq("gdfield", instance.getGdfield());
                              conjunction.add(gdfield);
                          }
                      
          if (instance.getKind() != null)
                          
          if (!instance.getKind().equals("")) {
                              kind 
          = Restrictions.eq("kind", instance.getKind());
                              conjunction.add(kind);
                          }
                      
          if (instance.getProperty() != null)
                          
          if (!instance.getProperty().equals("")) {
                              property 
          = Restrictions.eq("property", instance
                                      .getProperty());
                              conjunction.add(property);
                          }

                      crit.add(conjunction);
                      
          return crit.list();
                  } 
          catch (RuntimeException re) {
                      log.error(
          "find by IInsInfo instance failed", re);
                      
          throw re;
                  }
              }

          posted @ 2009-08-16 11:14 Robert Su 閱讀(664) | 評論 (0)編輯 收藏

          Ext.Ajax.request({
                      url : '../../topicInfo/topicInfoNode.htm',
                      success : getTopicInfoArray,
                      method : 'post'
                  });

          function getTopicInfoArray(response, options) {
              topicInfo_arr = eval(response.responseText);
              Ext.onReady(renderAll);
          }

          也可以用Ext.util.JSON.decode()方法搞定

          posted @ 2009-08-06 10:28 Robert Su 閱讀(354) | 評論 (0)編輯 收藏

          SELECT b.id, b.name, a. COUNT
          FROM (SELECT adminlevel, COUNT(*) AS [count]
                  FROM hrdc.i_ins_info
                  GROUP BY adminlevel) a, hrdc.b_adminlevel b
          WHERE a.adminlevel =* b.id

          或者寫成

          SELECT b.id, b.name, a. COUNT
          FROM (SELECT gdfield, COUNT(*) AS [count]
                  FROM hrdc.i_ins_info
                  GROUP BY gdfield) a RIGHT JOIN
                hrdc.b_field b ON a.gdfield = b.id


          這是右連接的一個例子

          inner join(等值連接) 只返回兩個表中聯結字段相等的行
          left join(左聯接) 返回包括左表中的所有記錄和右表中聯結字段相等的記錄
          right join(右聯接) 返回包括右表中的所有記錄和左表中聯結字段相等的記錄
          on 指定表間聯結字段及其關系的等號 "=" 表達式, 返回 true 或 false. 當表達式返回 true 時, 則查詢中包含該記錄.



          7.5.2

           程序代碼
          Update (ctarticle AS a LEFT JOIN ctclass AS c ON a.classid = c.classid) LEFT JOIN cttag AS b ON a.articleid = b.articleid
          SET tag=tag+' ', b.articleid=a.articleid, b.classid=a.classid, b.nclassid=a.nclassid
          Where a.classid=23 AND a.nclassid=0 AND tagid is not null


          7.5.1

           程序代碼
          Update (ctarticle AS a LEFT JOIN (ctnclass AS c LEFT JOIN ctclass AS d ON c.classid = d.classid) ON a.nclassid = c.nclassid AND a.classid = c.classid) LEFT JOIN cttag AS b ON a.articleid = b.articleid SET tag=d.class+' '+c.nclass, b.articleid=a.articleid, b.classid=a.classid, b.nclassid=a.nclassid Where a.classid=23 AND a.nclassid=197;


          7.5 更新操作

          74.5 左連接中數據的篩選

           程序代碼
          Insert INTO cttag(articleid,classid,nclassid) Select a.articleid,a.classid,a.nclassid from ctarticle a left join cttag b on a.articleid=b.articleid where b.articleid is null

          //本語句功能為, 顯示主表的全部內容, 插入數據到副表中沒有的數據
          //主要作用為: 讓數據減少冗余

          7.4.4.1 上例中的延續

           程序代碼
          Select a.*, b.*, c.*, d.*
          FROM cttag as d left join ((ctarticle AS a LEFT JOIN ctclass AS b ON a.classid=b.classid) LEFT JOIN ctnclass AS c ON a.nclassid=c.nclassid) on d.articleid=a.articleid;


          7.4.4 顯示文章表中的全部, 調用類別表中的欄目

           程序代碼
          select a.*, b.*, c.* from (ctarticle a left join ctclass b on a.classid=b.classid) left join ctnclass c on a.nclassid=c.nclassid

          //作用, 有時在文章表中包含了在個別類別表中沒有的數據, 用這個語法可以讀出文章表的全部數據
          //a 為 文章表, b 為主類別, c 為子類別

          7.4.3 同上例, 選擇追加數據時加上空格

           程序代碼
          Insert INTO cttag(articleid,classid,nclassid,tag)
          Select a.articleid,a.classid,a.nclassid,d.class+' '+c.nclass
          FROM (ctarticle AS a left join (ctnclass c left join ctclass d on c.classid=d.classid) on a.classid=c.classid and a.nclassid=c.nclassid) LEFT JOIN cttag AS b ON a.articleid = b.articleid where a.classid=4 and a.nclassid=154;


          7.4.2 連接N個表, 并追加數據到其中一個表, N=4

           程序代碼
          Insert INTO cttag(articleid,classid,nclassid,tag)
          Select a.articleid,a.classid,a.nclassid,d.class+c.nclass
          FROM (ctarticle AS a left join (ctnclass c left join ctclass d on c.classid=d.classid) on a.classid=c.classid and a.nclassid=c.nclassid) LEFT JOIN cttag AS b ON a.articleid = b.articleid where a.classid=1 and a.nclassid=1;

          //解讀
          插入到 表2(欄1,欄2,欄3,欄4)
          選擇 別名a.欄1, 別名a.欄2, 別名a.欄3, 別名d.欄4 加上 別名c.欄5
          從 (表1 別名a 左連接 (表3 別名c 左連接 表4 別名d 在 別名c.欄2 等于 別名d.欄2) 在 別名a.欄2 等于 別名c.欄2 和 別名a.欄3=別名c.欄3) 左連接 表2 別名b 在 別名a.欄1 等于 別名b.欄1 在那里 別名a.欄2=1 和 別名a.欄3=1

          7.4.1 連接兩個表, 并追加數據到其中一個表

           程序代碼
          Insert INTO cttag(articleid,classid,nclassid)
          Select a.articleid,a.classid,a.nclassid
          FROM ctarticle AS a LEFT JOIN cttag AS b ON a.articleid = b.articleid where a.classid=1 and a.nclassid=1;

          //解讀
          插入到 表2(欄1,欄2,欄3)
          選擇 別名a.欄1, 別名a.欄2, 別名a.欄3
          從 表1 別名a 左連接 表2 別名b 在 別名a.欄1 等于 別名b.欄1 在那里 別名a.欄4=1 和 別名a.欄5=1

          7.4. 左連接

          7.3.1 同步兩表的數據

           程序代碼
          Update ctarticle a INNER JOIN cttag b ON a.articleid = b.articleid SET b.classid=a.classid, b.nclassid=a.nclassid;

          //解讀
          更新 表1 別名a 聯接 表2 別名2 在 別名a.欄1 等于 別名b.欄1 設置 別名b.欄2 更新為 別名a.欄2, 別名b.欄3 更新為 別名a.欄3

          7.3 右外連接

           程序代碼
          select a.*, b.* from bunclass a right join ctclass b on a.classid=b.classid where a.nclassid=20

          查詢別名 a,b 表, 只匹配 b 表中的內容.

          7.2.3 添加數據到連接表之一

           程序代碼
          Insert INTO cttag ( tag, articleid ) Select top 1 b.tag, a.articleid FROM ctarticle AS a left JOIN cttag AS b ON a.articleid = b.articleid Where a.articleid order by a.articleid desc;


          7.2.2 變通中的用法二

           程序代碼
          Insert INTO bureply
          Select b.*, a.classid, a.nclassid
          FROM article AS a INNER JOIN reply AS b ON a.articleid = b.articleid
          Where classid=50;


          7.2.1 實際應用中的變通

           程序代碼
          Insert INTO butag ( tag, articleid, classid, nclassid)
          Select b.tag, a.articleid, a.classid, a.nclassid
          FROM article AS a INNER JOIN tag AS b ON a.articleid = b.articleid
          Where classid=24;


          7.2 添加數據到其他表

           程序代碼
          Insert INTO butag ( tag, articleid )
          Select b.tag, a.articleid
          FROM article AS a INNER JOIN tag AS b ON a.articleid = b.articleid
          Where a.articleid<>False;

          //解讀
          添加到 接收表(列1,列2)
          選擇 別名b.列1, 別名a.列2
          從 表1 表名a 聯接 表2 表名b 在 別名a.列c 等于 別名b.列c
          在哪里 別名a.列c 不等于 沒有

          7.1.1 實際應用中的變通

           程序代碼
          Select b.tag, a.articleid, a.classid, a.nclassid
          FROM article AS a INNER JOIN tag AS b ON a.articleid = b.articleid
          Where a.classid=24;


          7.1 查詢

           程序代碼
          Select b.tag, a.articleid
          FROM article AS a INNER JOIN tag AS b ON a.articleid = b.articleid
          Where a.articleid<>False;

          //解讀
          選擇 別名b.列, 別名a.列
          從 表1 別名a 聯接 表2 別名b 在 別名a.列c = 別名b.列c
          在哪里 別名a.列c 不等于 沒有
          注: as 不是必要

          7. 外連接——交叉查詢

          posted @ 2009-07-26 16:12 Robert Su 閱讀(244) | 評論 (0)編輯 收藏

          僅列出標題
          共11頁: 上一頁 1 2 3 4 5 6 7 8 9 下一頁 Last 

          posts - 103, comments - 104, trackbacks - 0, articles - 5

          Copyright © Robert Su

          主站蜘蛛池模板: 八宿县| 邯郸市| 德保县| 杭州市| 玉屏| 青海省| 阆中市| 英吉沙县| 吕梁市| 崇文区| 文登市| 加查县| 康保县| 新乐市| 侯马市| 浑源县| 沽源县| 府谷县| 高州市| 洪雅县| 富阳市| 罗平县| 芦溪县| 浦江县| 巨鹿县| 武强县| 井研县| 巴林右旗| 偃师市| 和田县| 同江市| 彭州市| 读书| 江永县| 定州市| 伊金霍洛旗| 海南省| 梁平县| 阳江市| 芦山县| 理塘县|