2007年5月21日星期一

1) assign a password to the root user:
bin/mysqladmin -u root password 'jackie' // 'jackie' quoted password tells mysql to encrypt the password that follows.
2) change the root user's password:
bin/mysqladmn -u root -p password 'newpassword'

如何在Ubuntu上安装RealPlayer(How to install RealPlayer on Ubuntu) 本来在Ubuntu上安装RealPlayer应该是很容易的,就是直接在终端中键入
sudo apt-get install realplayer
就可以了的,但是我如此操作只能得到

正在读取软件包列表... 完成
正在分析软件包的依赖关系树
Reading state information... 完成
现在没有可用的软件包 realplayer,但是它被其它的软件包引用了。
这可能意味着这个缺失的软件包可能已被废弃,
或者只能在其他发布源中找到
E: 软件包 realplayer 还没有可供安装的候选者
我已经用了官方的源和LupaWorld的源都是如此。于是准备自己手动安装RealPlayer。
先到RealPlayer官方网站上下载:
http://www.real.com/linux/?src=020923home_cn_cn
将文件RealPlayer10GOLD.bin保存到主文件夹中,即/home/[yourusername]文件夹下。
然后打开终端,进行如下操作:
$chmod +x RealPlayer10GOLD.bin
$sudo ./RealPlayer10GOLD.bin
当终端显示

Welcome to the RealPlayer (10.0.8.805) Setup for UNIX
Setup will help you get RealPlayer running on your computer.
Press [Enter] to continue...
时按下回车键,进入下一步:

Enter the complete path to the directory where you want
RealPlayer to be installed. You must specify the full
pathname of the directory and have write privileges to
the chosen directory.
Directory: [/home/shixinyu/RealPlayer]:
这里默认安装到用户的主文件夹下的RealPlayer目录下,如果你想要安装到别处,就在此处输入路径,否则直接回车即可。

You have selected the following RealPlayer configuration:

Destination: /home/shixinyu/RealPlayer

Enter [F]inish to begin copying files, or [P]revious to go
back to the previous prompts: [F]: F
安装程序会提示最后确定信息,如果都确定了,按下F键后回车。
当提示

Copying RealPlayer files...configure system-wide symbolic links? [Y/n]:
时按下Y键回车即可,后面基本上就没有需要用户操作的地方了,通常到这里基本上就安装好了,你可以到“应用程序,影音”下找到RealPlayer10来运行了,首次运行会有一段安装协议需要同意。

注:如果在跟着上述步骤完成安装操作之后到应用程序菜单下的“影音”中单击RealPlayer无反应,并且你的Ubuntu安装的是SCIM输入法,那么很可能是SCIM与RealPlayer的冲突,你还需要进行下面操作:
$sudo gedit /home/[yourid]/RealPlayer/realplay \[yourid]指你的主文件夹名
在打开的文本编辑器的首行添加下面一行
export GTK_IM_MODULE=xim

之后保存文本编辑器,然后再次执行RealPlayer应该就正常了。

如果你是新手,
sudo gedit /etc/apt/sources.list
添加源
deb http://archive.canonical.com/ubuntu dapper-commercial main
保存退出
sudo atp-get update

sudo apt-get install realplay

就可以安装成功了。

GNU C compiler uses the asm keyword to denote a section of source code that is written in assembly language:

asm("asm code");

in vc: __asm{asm code}

if more than one instruction, add "tn" to separate them.

ex: asm("movl $1,%eaxntmovl $0, %ebxntint $0x80");

more readable ==>asm("movl $1,%eaxnt"

"movl $0, %ebxnt"

"int $0x80"

)

** for ansi c the keyword is __asm__

only global C varials can be used within the basic inline asm code.

Ex:

#include <stdio.h>

int a=10;

int b=20;

int result;

int main(){

asm("pushant"

"movl a, %eaxnt" // not $a

"movl b, %ebxnt"

"imull %ebx,%eaxnt"

"movl %eax, resultnt"

"popa");

printf("the answer is %dn",result);

return 0;

}

attn: the global value are used as memory locations within the asm language code, not as immediate data values.

** asm volatile("asm code");

for ansi c=> __asm__ __volatile__("asm code");

to indicate that no optimization is desired on that section of code.

Extended ASM format

asm("asm code " : output location : input operands : changed registers);

1) asm code : the inline asm code using the same syntax used for the basic asm format;

2) Output locations: A list of registers and memory locations that will contain the output values from the inline asm code;

3) Input operands: A list of registers and memory locations that contain input values for the inline asm code;

4) Changed registers: A list of any additional registers that are changed by the inline code.

"constraint"(variable):

the constraint is a single-char code:

a: use the %eax,%ax,%al registers;

b: use the %ebx, %bx, %bl registers;

c: use the %ecx, %cx, %cl registers;

d: use the %edx, %dx, %dl registers;

S: use the %esi, %si registers;

D: use the %edi, %di registers;

r: use any available general-purpose register

q: use either the %eax,%ebx,%ecx,%edx register

A: use %eax and the %edx register for a 64 bits value

f: use a floating-point register

t: use the first(top) floating-point register

u: use the second floating-point register

m: use the variable's memory location

o: use an offset memory location

V: use only a direct memory location

i : use an immediate integer value

n: use an immediate integer value with a known value

g: use any register or memory location available

Output Modifier:

+: the operand can be read from and written to;

=: the operand can only be written to;

%: the operand can be switched with the next operand if necessary

&: the operand can be delete and reused before the inline functions complete

Using floating-point values:

f : references any available floating-point register;

t : references the top floating-point register;

u : references the second floating-point register.

2007年5月12日星期六

In addition, the carry flag is set when the addition result is too large of the positive value for the data size used to hold the operands. obviously, with subtraction, the problem arises when the subtraction result becomes too large of a negative value for the data size.

example:

.section .text
.globl _start
_start:
movl $5, %eax
movl $2, %ebx
subl %eax, %ebx
jc under
movl $1, %eax
int $0x80
under:
movl $1, %eax
movl $0, %ebx
int $0x80

the carry flag is used to determine when substrating unsigned integers products a negative result.
as with adding signed integers, if you are substracting signed integers, the carry flag is not useful, as the result can often be negative. instead you must rely on the overflow flag to tell you when you have reached the data size.