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

          2006年8月4日

          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)編輯 收藏
           
          用構(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)色代碼實現(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)編輯 收藏
           
          做個查詢,字段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)編輯 收藏
           
          ...
          posted @ 2006-12-19 23:00 ljwiie 閱讀(228) | 評論 (1)編輯 收藏
           
          <%@ page isThreadSafe="true|false" %>
          默認(rèn)值為true

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

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

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

          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)編輯 收藏
           

          --商品價格信息表
          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)編輯 收藏
           
          修改開機(jī)畫面和聲音:
          進(jìn)入\ HKEY_LOCAL_MACHINE\SOFTWARE\HTC\StartUpAnim
          Audio Video 的值都改成: *none*,如果沒有該鍵值,自己創(chuàng)建。
          (原Audio值為:\Windows\startup-WAVE.WAV
          (原Video值為:\Windows\startup-GIF240.gif.mfb

          關(guān)機(jī)畫面及聲音:
          進(jìn)入\HKEY_CURRENT_USER\ControlPanel\Sounds\Shutdown
          Image、SoundWave的值都改成:*none*,如果沒有該鍵值,自己創(chuàng)建
          (原 Image 值為:\Windows\shutdown.gif
          (原 Sound 值為:\Carrier_Boot.mid
          (原 Wave 值為:\Windows\shutdown.wav

          修改其他聲音:
          進(jìn)入\HKEY_CURRENT_USER\ControlPanel\Sounds\
          進(jìn)入相應(yīng)的聲音類別,修改Sound即可
          posted @ 2006-10-14 12:35 ljwiie 閱讀(297) | 評論 (1)編輯 收藏
           
          struts學(xué)習(xí)筆記
          posted @ 2006-09-17 22:29 ljwiie 閱讀(168) | 評論 (0)編輯 收藏
           

          添加表注釋
          comment on table 表名 is '表注釋'
          添加字段注釋
          comment on column 表名.字段名 is '字段名注釋'

          查詢表注釋
          select * from user_tab_comments
          查詢字段注釋
          select * from user_col_comments

          查詢以TAB_開頭的表的注釋
          where table_name like 'TAB/_%' escape '/'
          由于下劃線在數(shù)據(jù)庫中代表任意單個字符,所以需要轉(zhuǎn)義
          單引號由單引號字符轉(zhuǎn)換

          posted @ 2006-09-14 16:39 ljwiie 閱讀(1546) | 評論 (2)編輯 收藏
           

          Hustle & Flow 川流熙攘
          影片講述一個皮條客進(jìn)軍嘻哈樂界的“傳奇”故事。
          主角是一位夢想成為說唱樂手的黑人無業(yè)青年,為了實現(xiàn)自己的理想,他克服了許多艱難險阻,刻苦的練習(xí)說唱。

          其中有首歌:It's hard out here for a pimp

          [Chorus 2X: Shug - singing] + (Djay)
          You know it's hard out here for a pimp (you ain't knowin)
          When he tryin to get this money for the rent (you ain't knowin)
          For the Cadillacs and gas money spent (you ain't knowin)
          [1] Because a whole lot of bitches talkin shit (you ain't knowin)
          [2] Will have a whole lot of bitches talkin shit (you ain't knowin)

          [Djay]
          In my eyes I done seen some crazy thangs in the streets
          Gotta couple hoes workin on the changes for me
          But I gotta keep my game tight like Kobe on game night
          Like takin from a ho don't know no better, I know that ain't right
          Done seen people killed, done seen people deal
          Done seen people live in poverty with no meals
          It's fucked up where I live, but that's just how it is
          It might be new to you, but it's been like this for years
          It's blood sweat and tears when it come down to this shit
          I'm tryin to get rich 'fore I leave up out this bitch
          I'm tryin to have thangs but it's hard fo' a pimp
          But I'm prayin and I'm hopin to God I don't slip, yeah

          [Chorus]

          [Djay]
          Man it seems like I'm duckin dodgin bullets everyday
          Niggaz hatin on me cause I got, hoes on the tray
          But I gotta stay paid, gotta stay above water
          Couldn't keep up with my hoes, that's when shit got harder
          North Memphis where I'm from, I'm 7th Street bound
          Where niggaz all the time end up lost and never found
          Man these girls think we prove thangs, leave a big head
          They come hopin every night, they don't end up bein dead
          Wait I got a snow bunny, and a black girl too
          You pay the right price and they'll both do you
          That's the way the game goes, gotta keep it strictly pimpin
          Gotta have my hustle tight, makin change off these women, yeah

          [Chorus]

          posted @ 2006-09-06 18:08 ljwiie 閱讀(236) | 評論 (0)編輯 收藏
           

          ||?字符連接
          initcap 首字母大寫
          lower 轉(zhuǎn)換為小寫字符
          upper 轉(zhuǎn)換為大寫
          lpad 左填充
          rpad 右填充
          ltrim 去除左邊的空格
          rtrim 去除右邊的空格
          alltrim 去除兩邊的空格
          replace 替換
          translate 轉(zhuǎn)換
          ascii 求ASC碼
          chr asc碼變字符
          substr 字符截取函數(shù)
          instr 測試字符串出現(xiàn)的位置
          length 字符串的長度

          sysdate 系統(tǒng)時間
          add_months 添加月份,得到一個新的日期
          trunc 截取年月日
          last_day 某月的最后一天
          months_between 兩個日期之間的月數(shù)

          to_char 把日期或數(shù)字類型變?yōu)樽址?br />to_number 把字符串變成數(shù)字
          to_date 把字符串變成日期

          ceil 不小于x的最小整數(shù)
          floor 不大于x的最大整數(shù)
          round 四舍五入
          trunc 舍去尾數(shù)
          mod(x,n) x除以n以后的余數(shù)
          power(x,y)? x的y次方

          greatest 求最大值
          least 求最小值
          nvl 空值轉(zhuǎn)換函數(shù)

          decode (if...elseif...elseif...else結(jié)構(gòu))

          sign(x) 判斷正負(fù)
          ?x是正? 1
          ?x是負(fù) -1
          ?x是0?? 0
          ???????????
          rownum 行號,必須使用<=的關(guān)系比較運(yùn)算符???????????

          posted @ 2006-08-18 13:53 ljwiie 閱讀(246) | 評論 (0)編輯 收藏
           

          類集接口
          Collection
          ----List(ArrayList,LinkedList,Vector,Stack)
          ----Set(HashSet)
          --------SortedSet(TreeSet)
          映射接口
          Map(HashMap,Hashtable)
          ----SortedMap(TreeMap)

          其中的Vector,Stack,Hashtable是Java2以前就有的類
          它們都是線程同步的

          工具類
          Collections
          Arrays
          都可進(jìn)行查找,排序等操作,
          其中Collections可以實現(xiàn)集合于映射的同步機(jī)制,如:
          List list = Collections.synchronizedList(new ArrayList());

          posted @ 2006-08-18 13:42 ljwiie 閱讀(184) | 評論 (0)編輯 收藏
           
          工欲善其事必先利其器.
          posted @ 2006-08-18 12:58 ljwiie 閱讀(130) | 評論 (0)編輯 收藏
           
          I?can do it.
          I?can do it well.
          ^_^ ,給自己打打氣!
          posted @ 2006-08-14 14:59 ljwiie 閱讀(94) | 評論 (0)編輯 收藏
           
          Servlet中doGet方法與doPost方法的區(qū)別

          執(zhí)行時間:
          當(dāng)form框里面的method為get時,執(zhí)行doGet方法
          當(dāng)form框里面的method為post時,執(zhí)行doPost方法
          當(dāng)直接在瀏覽器地址欄輸入servlet地址時,執(zhí)行doGet方法
          posted @ 2006-08-10 10:21 ljwiie 閱讀(1244) | 評論 (1)編輯 收藏
           
          今天安裝了Fedora Core 5
          下面是安裝過程的一些記錄,其中有很多地方都是經(jīng)過了很多次的實驗才安裝成功的,真的可以說來之不易啊!下面把安裝過程簡單的記錄了下來。(說明:我是以root用戶進(jìn)行下面的操作的,網(wǎng)上并不推薦用超級用戶)
          我的環(huán)境:
          #uname -a
          Linux LJWIIE 2.6.17-1.2157_FC5 #1 Tue Jul 11 22:55:46 EDT 2006 i686 athlon i386 GNU/Linux


          1. Install Kernel Source

          首先通過yum update kernel升級內(nèi)核,內(nèi)核升級為2.6.17-1.2157_FC5
          然后去網(wǎng)站下載kernel-source的rpm包,kernel-2.6.17-1.2157_FC5.src.rpm
          #rpm -ivh kernel-2.6.17-1.2157_FC5.src.rpm
          #cd /usr/src/redhat/SPECS
          #rpmbuild -bp --target $(uname -m) kernel-2.6.spec
          然后/usr/src/redhat/BUILD/目錄下面生成了一個kernel-2.6.17目錄
          #cd ../BUILD/kernel-2.6.17/linux-2.6.17.i686/
          #cp configs/kernel-2.6.17-i686 .config
          #make oldconfig
          #make

          2. Install Nvidia Driver
          首先去Nvidia官方網(wǎng)站獲取驅(qū)動,NVIDIA-Linux-x86-1.0-8762-pkg1.run
          然后修改/etc/inittab文件,把id:5:initdefault:改為id:3:initdefault:(不加載圖形模式)
          接著修改/etc/sysconfig/selinux,把SELINUX=enforcing改為SELINUX=disabled(禁用SELinux)
          安裝kernel-devel: #yum install kernel-devel
          重啟#init 6,進(jìn)入nvidia驅(qū)動目錄
          #sh ./NVIDIA-Linux-x86-1.0-8762-pkg1.run --kernel-name=2.6.17-1.2157_FC5 --kernel-sourth-path=/usr/src/redhat/BUILD/kernel-2.6.17/linux-2.6.17.i686
          #startx 進(jìn)入圖形界面,如果出現(xiàn)nvidia標(biāo)志的界面,說明安裝成功

          在安裝顯卡驅(qū)動的時候遇到的困難最多
          其中最常見的是
          安裝過程中:
          ?? ?顯卡驅(qū)動于內(nèi)核版本不匹配,這個可以通過--kernel-name=2.6.17-1.2157_FC5來解決
          ?? ?沒有設(shè)置內(nèi)核源碼路徑,這個可以通過--kernel-sourth-path=/usr/src/redhat/BUILD/kernel-2.6.17/linux-2.6.17.i686來解決,但是前提要先安裝內(nèi)核源碼,極有可能安裝了kernel-devel之后,就不會出現(xiàn)這個問題。
          startx后:
          ?? ?cannot restore segment prot after reloc: Permission denied,這個是由于SELinux引起的權(quán)限問題,最有效最簡單但不是最好的方法就是禁用SELinux


          3. Install Mplayer
          安裝圖形界面的mplayer
          首先還是下載源代碼
          MPlayer-1.0pre8.tar.bz2?? ?--mplayer源碼
          essential-20060611.tar.bz2?? ?--解碼文件
          font-arial-iso-8859-1.tar.bz2?? ?--gui字體文件
          plastik-2.0.tar.bz2 --皮膚文件
          解壓tar.bz2型的文件命令:bzip2 -dc *.tar.bz2 | tar xvf -
          把解碼文件拷貝到/usr/local/lib/codecs/
          #./configure --enable-gui
          #make
          #make install
          把字體文件拷貝到/usr/local/share/mplayer/font/
          把皮膚文件拷貝到/usr/local/share/mplayer/skins/default
          運(yùn)行播放器: mplayer 文件名
          圖形模式: gmplayer

          4.Install J2SE
          獲取軟件jdk-1_5_0_06-linux-i586.bin
          #cp jdk-1_5_0_06-linux-i586.bin /opt/
          #cd /opt/
          #./jdk-1_5_0_06-linux-i586.bin
          修改/root/.bash_profile,增加一行
          export JAVA_HOME=/opt/jdk-1_5_0_06

          5.Install LumaQQ
          獲取軟件lumaqq_2006M2-linux_gtk2_x86_no_jre.tar.gz
          #cp lumaqq_2006M2-linux_gtk2_x86_no_jre.tar.gz /opt/
          #cd /opt/
          #tar -zxvf lumaqq_2006M2-linux_gtk2_x86_no_jre.tar.gz
          #cd /LumaQQ/
          #./lumaqq 啟動LumaQQ界面

          6. Install Ntfs for linux
          獲取軟件kernel-module-ntfs-2.6.17-1.2157_FC5-2.1.27-0.rr.10.5.i686.rpm
          #rpm -ivh kernel-module-ntfs-2.6.17-1.2157_FC5-2.1.27-0.rr.10.5.i686.rpm
          以后就可以用mount掛載ntft分區(qū)了




          posted @ 2006-08-06 16:27 ljwiie 閱讀(625) | 評論 (2)編輯 收藏
           
          ollie時滑板運(yùn)動中最基本的動作,是滑板入門的必學(xué)動作

          下面是摘自網(wǎng)絡(luò)上的how to ollie
          posted @ 2006-08-04 13:58 ljwiie 閱讀(130) | 評論 (0)編輯 收藏
           
          ls??????????列出文件清單
          chown??改變文件所有權(quán)限
          chgrp????改變文件所屬的用戶組
          chmod??改變文件訪問權(quán)限模式
          cp?????????拷貝文件
          mv????????移動文件和對文件更名
          ln??????????建立文件的鏈接
          fine???????查找文件
          dd????????轉(zhuǎn)換拷貝的文件
          gzip,gunzip???文件壓縮和解壓工具
          mknod???建立特殊文件
          mkdir???? 建立目錄?
          rmdir??????刪除目錄
          pwd?????? 顯示當(dāng)前的工作目錄
          tar??????????文件歸檔
          cat?????????合并文本文件和顯示文本文件
          more??????分屏顯示
          which?????查找命令所存放的位置
          whereis???查找命令保存的位置
          posted @ 2006-08-04 11:34 ljwiie 閱讀(164) | 評論 (0)編輯 收藏
           
          <html>
          <head>
          <meta?http-equiv="Content-Type"?content="text/html;?charset=gb2312"?/>
          <title>JS對象</title>
          <script?language="javascript">
          ????function?print(){
          ????????document.write("書名為:"?+?this.name?+?"<br>");
          ????????document.write("作者為:"?+?this.author?+?"<br>");
          ????}
          ????
          ????function?book(name,author){
          ????????this.name?=?name;
          ????????this.author?=?author;
          ????????this.print?=?print;?//沒有括號
          ????}????
          </script>

          </head>

          <body>
          <script?language="javascript">
          ????var?c?=?new?book("C語言","譚浩強(qiáng)");
          ????c.print();
          ????document.write("<br>");
          ????
          ????for(var?prop?in?c){
          ????????document.write(prop?+?":"?+?c[prop]?+?"<br>");
          ????}????????
          ????document.write("<br>");
          ????
          ????book.prototype.price?=?10;
          ????for(var?prop?in?c){
          ????????document.write(prop?+?":"?+?c[prop]?+?"<br>");
          ????}????
          </script>

          </body>
          </html>
          posted @ 2006-08-04 11:33 ljwiie 閱讀(135) | 評論 (0)編輯 收藏
           

          王力宏 - 在梅邊
          周傳雄 - 寂寞沙洲冷

          posted @ 2006-08-04 11:29 ljwiie 閱讀(141) | 評論 (0)編輯 收藏
           
          哈哈,今天剛申請的blog!
          posted @ 2006-08-04 11:15 ljwiie 閱讀(69) | 評論 (0)編輯 收藏
          CALENDER
          <2006年8月>
          303112345
          6789101112
          13141516171819
          20212223242526
          272829303112
          3456789

          常用鏈接

          留言簿(1)

          隨筆分類

          隨筆檔案

          相冊

          收藏夾

          朋友blog

          最新評論


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

          Contact ljwiie QQ:122050271
          主站蜘蛛池模板: 岚皋县| 惠来县| 宝丰县| 屏东县| 达日县| 平定县| 十堰市| 长海县| 和政县| 屯昌县| 盐池县| 瓦房店市| 新密市| 会泽县| 阿勒泰市| 海安县| 穆棱市| 吉林市| 沧州市| 安徽省| 沁水县| 南宫市| 昭通市| 社旗县| 翁牛特旗| 保亭| 福泉市| 达拉特旗| 岑巩县| 乐清市| 筠连县| 海宁市| 信宜市| 离岛区| 岱山县| 枣庄市| 宜君县| 昆明市| 宣汉县| 建宁县| 邛崃市|