随笔:25 文章:1 评论:8 引用:0
BlogJava 首页 发新随笔
发新文章 联系 聚合管理

2006年8月6日

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 阅读(148) | 评论 (0)编辑 收藏
 
用构造函数定义属性,用原型定义方法
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);
};
在此例子中,继承机制由两行突出显示的蓝色代码实现。在第一行突出显示的代码中,在 ClassB 构造函数中,用对象冒充继承 ClassA 类的 sColor 属性。在第二行突出显示的代码中,用原型链继承 ClassA 类的方法。由于这种混合方式使用了原型链,所以 instanceof 运算符仍能正确运行。

下面的例子测试了这段代码:
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 阅读(194) | 评论 (1)编辑 收藏
 
做个查询,字段1值除3,如果=1,就用字段2值-20,如果=2,字段2 值-30,将差值大于0的数据选出来 

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 阅读(291) | 评论 (0)编辑 收藏
 
...
posted @ 2006-12-19 23:00 ljwiie 阅读(219) | 评论 (1)编辑 收藏
 
<%@ page isThreadSafe="true|false" %>
默认值为true

isThreadSafe=false模式表示它是以Singleton模式运行。
     该模式implements了接口SingleThreadMode,
     该模式同一时刻只有一个实例,不会出现信息同步与否的概念。
     若多个用户同时访问一个这种模式的页面,
     那么先访问者完全执行完该页面后,后访问者才开始执行。

isThreadSafe=true模式表示它以多线程方式运行。
    该模式的信息同步,需访问同步方法(用synchronized标记的)来实现。
    一般格式如下:
    public synchronized void syncmethod(...){
      if(...) {
         wait();
      }
      notifyAll();
    }
posted @ 2006-12-18 17:39 ljwiie 阅读(2409) | 评论 (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 阅读(402) | 评论 (0)编辑 收藏
 

当子类继承了父类之后,之类初始化顺序如下:

1.父类static变量,或程序块
2.子类static变量,或程序块
3.父类成员变量
4.父类构造函数
5.子类成员变量
6.子类构造函数

posted @ 2006-12-10 11:30 ljwiie 阅读(208) | 评论 (0)编辑 收藏
 
去年的今天我买了我的第一块滑板,boiling 2005款。
posted @ 2006-12-03 23:27 ljwiie 阅读(215) | 评论 (0)编辑 收藏
 

oracle里面round为四舍五入,绝对值四舍五入后加符号

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

posted @ 2006-10-26 10:08 ljwiie 阅读(863) | 评论 (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 '销售地区';

--添加数据
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
);

--执行环境oracle

posted @ 2006-10-24 10:36 ljwiie 阅读(217) | 评论 (0)编辑 收藏
 
修改开机画面和声音:
进入\ HKEY_LOCAL_MACHINE\SOFTWARE\HTC\StartUpAnim
Audio Video 的值都改成: *none*,如果没有该键值,自己创建。
(原Audio值为:\Windows\startup-WAVE.WAV
(原Video值为:\Windows\startup-GIF240.gif.mfb

关机画面及声音:
进入\HKEY_CURRENT_USER\ControlPanel\Sounds\Shutdown
ImageSoundWave的值都改成:*none*,如果没有该键值,自己创建
(原 Image 值为:\Windows\shutdown.gif
(原 Sound 值为:\Carrier_Boot.mid
(原 Wave 值为:\Windows\shutdown.wav

修改其他声音:
进入\HKEY_CURRENT_USER\ControlPanel\Sounds\
进入相应的声音类别,修改Sound即可
posted @ 2006-10-14 12:35 ljwiie 阅读(282) | 评论 (1)编辑 收藏
 
struts学习笔记
posted @ 2006-09-17 22:29 ljwiie 阅读(157) | 评论 (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 '/'
由于下划线在数据库中代表任意单个字符,所以需要转义
单引号由单引号字符转换

posted @ 2006-09-14 16:39 ljwiie 阅读(1518) | 评论 (2)编辑 收藏
 

Hustle & Flow 川流熙攘
影片讲述一个皮条客进军嘻哈乐界的“传奇”故事。
主角是一位梦想成为说唱乐手的黑人无业青年,为了实现自己的理想,他克服了许多艰难险阻,刻苦的练习说唱。

其中有首歌: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 阅读(229) | 评论 (0)编辑 收藏
 

|| 字符连接
initcap 首字母大写
lower 转换为小写字符
upper 转换为大写
lpad 左填充
rpad 右填充
ltrim 去除左边的空格
rtrim 去除右边的空格
alltrim 去除两边的空格
replace 替换
translate 转换
ascii 求ASC码
chr asc码变字符
substr 字符截取函数
instr 测试字符串出现的位置
length 字符串的长度

sysdate 系统时间
add_months 添加月份,得到一个新的日期
trunc 截取年月日
last_day 某月的最后一天
months_between 两个日期之间的月数

to_char 把日期或数字类型变为字符串
to_number 把字符串变成数字
to_date 把字符串变成日期

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

greatest 求最大值
least 求最小值
nvl 空值转换函数

decode (if...elseif...elseif...else结构)

sign(x) 判断正负
 x是正  1
 x是负 -1
 x是0   0
           
rownum 行号,必须使用<=的关系比较运算符           

posted @ 2006-08-18 13:53 ljwiie 阅读(238) | 评论 (0)编辑 收藏
 

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

其中的Vector,Stack,Hashtable是Java2以前就有的类
它们都是线程同步的

工具类
Collections
Arrays
都可进行查找,排序等操作,
其中Collections可以实现集合于映射的同步机制,如:
List list = Collections.synchronizedList(new ArrayList());

posted @ 2006-08-18 13:42 ljwiie 阅读(178) | 评论 (0)编辑 收藏
 
工欲善其事必先利其器.
posted @ 2006-08-18 12:58 ljwiie 阅读(126) | 评论 (0)编辑 收藏
 
I can do it.
I can do it well.
^_^ ,给自己打打气!
posted @ 2006-08-14 14:59 ljwiie 阅读(90) | 评论 (0)编辑 收藏
 
Servlet中doGet方法与doPost方法的区别

执行时间:
当form框里面的method为get时,执行doGet方法
当form框里面的method为post时,执行doPost方法
当直接在浏览器地址栏输入servlet地址时,执行doGet方法
posted @ 2006-08-10 10:21 ljwiie 阅读(1209) | 评论 (1)编辑 收藏
 
今天安装了Fedora Core 5
下面是安装过程的一些记录,其中有很多地方都是经过了很多次的实验才安装成功的,真的可以说来之不易啊!下面把安装过程简单的记录了下来。(说明:我是以root用户进行下面的操作的,网上并不推荐用超级用户)
我的环境:
#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升级内核,内核升级为2.6.17-1.2157_FC5
然后去网站下载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官方网站获取驱动,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,进入nvidia驱动目录
#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 进入图形界面,如果出现nvidia标志的界面,说明安装成功

在安装显卡驱动的时候遇到的困难最多
其中最常见的是
安装过程中:
    显卡驱动于内核版本不匹配,这个可以通过--kernel-name=2.6.17-1.2157_FC5来解决
    没有设置内核源码路径,这个可以通过--kernel-sourth-path=/usr/src/redhat/BUILD/kernel-2.6.17/linux-2.6.17.i686来解决,但是前提要先安装内核源码,极有可能安装了kernel-devel之后,就不会出现这个问题。
startx后:
    cannot restore segment prot after reloc: Permission denied,这个是由于SELinux引起的权限问题,最有效最简单但不是最好的方法就是禁用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
运行播放器: 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分区了




posted @ 2006-08-06 16:27 ljwiie 阅读(580) | 评论 (2)编辑 收藏
CALENDER
<2006年8月>
303112345
6789101112
13141516171819
20212223242526
272829303112
3456789

常用链接

留言簿(1)

随笔分类

随笔档案

相册

收藏夹

朋友blog

最新评论


Powered By: 博客园
模板提供沪江博客

Contact ljwiie QQ:122050271