隨筆:25 文章:1 評論:8 引用:0
          BlogJava 首頁 發(fā)新隨筆
          發(fā)新文章 聯(lián)系 聚合管理

          2010年5月22日

          for a C++ program converts true and false to 1 and 0 where integer values are expected, and it converts 0 to false and nonzero to true where bool values are expected.
          posted @ 2010-05-22 00:23 ljwiie 閱讀(158) | 評論 (0)編輯 收藏

          2010年5月6日

          用構(gòu)造函數(shù)定義屬性,用原型定義方法
          function ClassA(sColor) {
              this.color = sColor;
          }

          ClassA.prototype.sayColor = function () {
              alert(this.color);
          };

          function ClassB(sColor, sName) {
              ClassA.call(this, sColor);
              this.name = sName;
          }

          ClassB.prototype = new ClassA();

          ClassB.prototype.sayName = function () {
              alert(this.name);
          };
          在此例子中,繼承機(jī)制由兩行突出顯示的藍(lán)色代碼實(shí)現(xiàn)。在第一行突出顯示的代碼中,在 ClassB 構(gòu)造函數(shù)中,用對象冒充繼承 ClassA 類的 sColor 屬性。在第二行突出顯示的代碼中,用原型鏈繼承 ClassA 類的方法。由于這種混合方式使用了原型鏈,所以 instanceof 運(yùn)算符仍能正確運(yùn)行。

          下面的例子測試了這段代碼:
          var objA = new ClassA("blue");
          var objB = new ClassB("red", "John");
          objA.sayColor(); //輸出 "blue"
          objB.sayColor(); //輸出 "red"
          objB.sayName(); //輸出 "John"

          摘自http://www.w3school.com.cn/js/pro_js_inheritance_implementing.asp
          posted @ 2010-05-06 23:57 ljwiie 閱讀(202) | 評論 (1)編輯 收藏

          2007年1月11日

          做個查詢,字段1值除3,如果=1,就用字段2值-20,如果=2,字段2 值-30,將差值大于0的數(shù)據(jù)選出來?

          SELECT col1, col2,?
          CASE?
          ???WHEN col1 / 3 = 1 THEN col2 - 20?
          ???WHEN col1 / 3 = 2 THEN col2 - 30
          END AS difference
          FROM price
          WHERE (
          CASE?
          ???WHEN col1 / 3 = 1 THEN col2 - 20?
          ???WHEN col1 / 3 = 2 THEN col2 - 30
          END > 0)
          posted @ 2007-01-11 10:26 ljwiie 閱讀(301) | 評論 (0)編輯 收藏

          2006年12月19日

          ...
          posted @ 2006-12-19 23:00 ljwiie 閱讀(228) | 評論 (1)編輯 收藏

          2006年12月18日

          <%@ page isThreadSafe="true|false" %>
          默認(rèn)值為true

          isThreadSafe=false模式表示它是以Singleton模式運(yùn)行。
          ???? 該模式implements了接口SingleThreadMode,
          ???? 該模式同一時刻只有一個實(shí)例,不會出現(xiàn)信息同步與否的概念。
          ???? 若多個用戶同時訪問一個這種模式的頁面,
          ???? 那么先訪問者完全執(zhí)行完該頁面后,后訪問者才開始執(zhí)行。

          isThreadSafe=true模式表示它以多線程方式運(yùn)行。
          ??? 該模式的信息同步,需訪問同步方法(用synchronized標(biāo)記的)來實(shí)現(xiàn)。
          ??? 一般格式如下:
          ??? public?synchronized void syncmethod(...){
          ??????if(...)?{
          ?????????wait();
          ??????}
          ??????notifyAll();
          ??? }
          posted @ 2006-12-18 17:39 ljwiie 閱讀(2420) | 評論 (0)編輯 收藏

          2006年12月13日

          1. <iframe id=""?name=""width="0" height="0" src=""></iframe>
          ??????parent.window.location.reload();

          2.? window.open( [sURL] [, sName] [, sFeatures] [, bReplace])
          ??????window.opener.location.reload();

          3. window.showModalDialog(sURL [, vArguments] [, sFeatures])
          ??????
          vArguments 用 window表示,代表該window對象
          ??????
          window.dialogArguments.location.reload();
          posted @ 2006-12-13 12:28 ljwiie 閱讀(415) | 評論 (0)編輯 收藏

          2006年12月10日

          當(dāng)子類繼承了父類之后,之類初始化順序如下:

          1.父類static變量,或程序塊
          2.子類static變量,或程序塊
          3.父類成員變量
          4.父類構(gòu)造函數(shù)
          5.子類成員變量
          6.子類構(gòu)造函數(shù)

          posted @ 2006-12-10 11:30 ljwiie 閱讀(217) | 評論 (0)編輯 收藏

          2006年12月3日

          去年的今天我買了我的第一塊滑板,boiling 2005款。
          posted @ 2006-12-03 23:27 ljwiie 閱讀(221) | 評論 (0)編輯 收藏

          2006年10月26日

          oracle里面round為四舍五入,絕對值四舍五入后加符號

          java里面的
          Math.round(a): (long)Math.floor(a + 0.5d)
          Math.floor(a): 不大于a的最大整數(shù)

          posted @ 2006-10-26 10:08 ljwiie 閱讀(894) | 評論 (0)編輯 收藏

          2006年10月24日

          --商品價格信息表
          create table GOODS(
          ?ID NUMBER,
          ?NAME VARCHAR2(10),
          ?PRICE NUMBER(10,2),
          ?AREA VARCHAR2(10)
          );
          --添加主鍵
          alter table GOODS
          add constraint PK_GOODS primary key (ID);
          --添加注視
          comment on table GOODS? is '商品信息表';
          comment on column GOODS.ID is '商品編號';
          comment on column GOODS.NAME is '商品名稱';
          comment on column GOODS.PRICE is '商品價格';
          comment on column GOODS.AREA is '銷售地區(qū)';

          --添加數(shù)據(jù)
          insert into GOODS values(11,'蘋果','2.5','成都1');
          insert into GOODS values(12,'蘋果','3.5','成都2');
          insert into GOODS values(13,'蘋果','1.5','成都3');
          insert into GOODS values(14,'蘋果','2.0','成都4');

          insert into GOODS values(21,'香蕉','1.7','成都1');
          insert into GOODS values(22,'香蕉','1.5','成都2');
          insert into GOODS values(23,'香蕉','1.6','成都3');
          insert into GOODS values(24,'香蕉','2.0','成都4');

          --查詢某種商品平均價
          select NAME,avg(PRICE) from GOODS group by NAME;

          --將商品價格更新為同種商品(名稱相同)的平均價格
          update GOODS A
          set A.PRICE =
          (
          ?select avg(PRICE) from GOODS where NAME = A.NAME
          );

          --執(zhí)行環(huán)境oracle

          posted @ 2006-10-24 10:36 ljwiie 閱讀(228) | 評論 (0)編輯 收藏
          CALENDER
          <2025年6月>
          25262728293031
          1234567
          891011121314
          15161718192021
          22232425262728
          293012345

          常用鏈接

          留言簿(1)

          隨筆分類

          隨筆檔案

          相冊

          收藏夾

          朋友blog

          最新評論


          Powered By: 博客園
          模板提供滬江博客

          Contact ljwiie QQ:122050271
          主站蜘蛛池模板: 阿坝县| 遂溪县| 江华| 龙海市| 绍兴市| 拉孜县| 庄浪县| 兴化市| 祥云县| 平谷区| 灌云县| 德江县| 阜康市| 桂林市| 榆中县| 曲松县| 南皮县| 康平县| 赤峰市| 涿鹿县| 泾阳县| 礼泉县| 英德市| 浮梁县| 望奎县| 根河市| 富民县| 吉安县| 同德县| 泸定县| 凌源市| 苍梧县| 荃湾区| 凤台县| 石阡县| 大关县| 黔南| 湖州市| 阳谷县| 大方县| 太保市|