可以在系统--首选项---键盘快捷键    里面设置快捷键,大家可以编写自己的脚本然后把它设置成一个快捷键

Alt + F1 类似Windows下的Win键,在GNOME中打开"应用程序"菜单(Applications)
Alt + F2 类似Windows下的Win + R组合键,在GNOME中运行应用程序
Ctrl + Alt + D 类似Windows下的Win + D组合键,显示桌面
Ctrl + Alt + L 锁定桌面并启动屏幕保护程序
Alt + Tab 同Windows下的Alt + Tab组合键,在不同程序窗口间切换
PrintScreen 全屏抓图
Alt + PrintScreen 当前窗口抓图
Ctrl + Alt + → / ← 在不同工作台间切换
Ctrl + Alt + Shift + → / ← 移动当前窗口到不同工作台
Ctrl+Alt+Shift+Fn 终端N或模拟终端N(n和N为数字1-6)
Ctrl+Alt+Shift+F7 返回桌面
Ctrl+Alt+Shift+F8 未知(终端或模拟终端)

[编辑] 窗口操作快捷键
Alt + F4 关闭窗口
Alt + F5 取消最大化窗口 (恢复窗口原来的大小)
Alt + F7 移动窗口 (注: 在窗口最大化的状态下无效)
Alt + F8 改变窗口大小 (注: 在窗口最大化的状态下无效)
Alt + F9 最小化窗口
Alt + F10 最大化窗口
Alt + Space 打开窗口的控制菜单 (点击窗口左上角图标出现的菜单)

[编辑] 应用程序中的常用快捷键
(注: 并不适用于所有程序)
Ctrl+N 新建窗口
Ctrl+X 剪切
Ctrl+C 复制
Ctrl+V 粘贴
Ctrl+Z 撤销上一步操作
Ctrl+Shift+Z 重做刚撤销的一步操作
Ctrl+S 保存

谢谢支持:文章来自http://05td.cn/blog
[编辑] 文件浏览器(部分)
Ctrl+H 显示隐藏文件(切换键)
Ctrl+T 新建标签
Ctrl+Page Up 上一个标签
Ctrl+Page Down 下一个标签
Alt+N 切换到第N个标签(N为数字)
[编辑] 在Ubuntu中自定义快捷键
访问“System>Preferences>Keyboard Shortcuts”,选定想要设置的项目,然后键入快捷键即可生效。

进入你的音乐文件夹执行如下代码:
mid3iconv -e GBK *.mp3
或者用这个命令可以一次转换所有的mp3文件
find . -iname “*.mp3” -execdir mid3iconv -e GBK {} \;
有可能系统会提示 python-mutagen没有安装((archlinux下面叫做mutagen)。
sudo apt-get install python-mutagen
然后重新导入rhythmbox,OK!
mid3iconv 命令主要是将原来mp3音乐文件的ID3信息转换成了Unicode并用ID3v2的格式存回文件中。
ps
1.必要时有的命令请加sudo权限
2.改过后在windows中和mp3播放器中可能又是乱码了,注意。
3.相信现在大陆绝大多数能找到的 mp3 标签都是以 GBK/GB18030 编码,使用 -e gbk 来处理就够了,当然你也可以使用 -e gb18030 来处理。
4.-e gbk 参数是代表把 GBK 编码的标签转换为 Unicode 编码,本身是 Unicode 编码的就不转换。如果需要转换其他编码的文件可以自行修改,如改为 Big5。
5. 经测试,转换后为 2.4 版的 ID3v2,编码格式为 uft-16
6.不过它会同时用 Unicode 编码填满 D3v1, ID3v2, APEv2 标签,但是 ID3v1 又不支持中文的 Unicode 编码,所以转换后的 ID3v1 标签全是问号。所以最好加上 –remove-v1 参数,转换后删除 ID3v1 标签。
mid3iconv -e gbk –remove-v1 *.mp3

下面我们来分析下原因:(可以不看)
1、了解 mp3 标签类型和使用的编码

首先说 mp3 标签类型和编码,大家应该知道目前主要存在这几种标准,ID3v1, ID3v2 2.3, ID3v2 2.4, APEv2,ID3v1 只支持 ISO-8859-1 编码 (编码集参考),严格的说它是不支持中文的 (并不代表它不能储存中文信息,目前中文 mp3 的 ID3v1 标签都使用这个字段来储存 GBK/GB18030 编码的中文信息),而第二版 (ID3v2) 支持的格式增加了 utf-16,直到 2.4 版才开始支持 uft-8,但 ID3v2 标准没有统一标签内容的编码,例如 2.4 版的 ID3v2 你可以使用 ISO-8859-1 编码,也可以使用 utf-16/uft-8 这种 Unicode 编码格式。做得最好的是 APEv2,它不但有很好的扩展性,而且还把编码格式统一为 utf-8,这样一来只要支持 APEv2 读取的播放器播放带有 APEv2 标签的 mp3 就不会存在乱码问题。

2、了解各种播放器对 mp3 标签读取情况

接下来研究的就是各种播放器对这几种标准的标签支持程度,测试的播放器有:gnome 自带的 Rhythmbox 0.10.0, Listen 0.5, Banshee 0.12.1+dfsg-3, Quod Libet 0.24, Exaile! 0.2.8, GMPC 0.13.0, Audacious 1.2.2。

测试的方法很简单,用一个 mp3 文件,分别写入不同类型的标签 (排列组合下来共 20 多种),在 ID3v1 和 ID3v2 2.3/2.4 中分别使用不同的编码写入中文信息 (如 GBK 编码),然后用这些播放器去读取,得到其结果。从这次的测试结果来看,Rhythmbox 对各种 mp3 的标签支持最好,这主要归功于它支持 APEv2 标签的读取。而 Banshee 和剩下的播放器完全一样,都不支持 APEv2 的读取,这个就能很好的解释为什么一些 mp3 在 Rhythmbox 上正常,在其他播放器上就会乱码。原因是现在很多 mp3 为了兼容,都同时使用了 ID3v1 和 APEv2 标签,Rhythmbox 读取 ID3v1 一样会乱码,但它优先读取了 APEv2 标签,而 Banshee 这些播放器不支持 APEv2 就只能读取 ID3v1,当然会乱码了。

他们的共同特点就是,所依赖的 libid3tag 库完全按照 ID3 标准来读取标签内容。不管使用何种标准的标签,只要是读取以 Unicode 编码的中文内容,肯定没有问题,遇到 GBK/GB18030 编码的中文内容时,还是把它当成 ISO-8859-1 编码来读取,不乱才怪。

ps: Vista 上的 WMP 不支持 ID3v2 2.4 和 APEv2 标签的读取,但它很聪明不能读取就用文件名代替,千千静听支持全系列标签的读取,但不支持以 ID3v2 2.4 标准的写入,不知道即将发布的 5.0 有变化没有。foobar2000 v0.9.4.3 支持全系列标签的读取,默认使用 ID3v2 2.4 ( utf-8 ) 写入,不愧被誉为经典。

使用Ubuntu一段时间后,就会发觉由于自动升级,系统里安装了很多内核。

uname -a
使用这个命令可以查看当前系统使用的内核。

首先就是使用如下命令,列出所有安装的内核,下表中,带有image的就是内核文件。
从中选择要卸载的包,用apt-get来卸载

[tc@ibm:~]$ dpkg –get-selections|grep linux
libselinux1                                     install
linux-386                                      install
linux-image-2.6.15-23-386                    install
linux-image-2.6.15-27-386                    install
linux-image-2.6.15-27-686                    install
linux-image-2.6.15-28-386                    install
linux-image-2.6.15-28-686                    deinstall
linux-image-386                               install
linux-kernel-headers                           install
linux-restricted-modules-2.6.15-23-386        install
linux-restricted-modules-2.6.15-27-386        install
linux-restricted-modules-2.6.15-27-686        install
linux-restricted-modules-2.6.15-28-386        install
linux-restricted-modules-2.6.15-28-686        deinstall
linux-restricted-modules-386                   install
linux-restricted-modules-common               install
linux-sound-base                               install
util-linux                                       install
 
具体的卸载方法为
sudo apt-get remove linux-image-2.6.15-23-386
这样就可以实现自动删除内核文件了,还可以释放磁盘空间。

 

不知道吧?你的电脑还可以这样
javascript:R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300; y4=200; x5=300; y5=200; DI=document.images; DIL=DI.length; function A(){for(i=0; i-DIL; i++){DIS=DI[ i ].style; DIS.position=’absolute’; DIS.left=Math.sin(R*x1+i*x2+x3)*x4+x5; DIS.top=Math.cos(R*y1+i*y2+y3)*y4+y5}R++}setInterval(‘A()’,5); void(0);

 

输入你的IE地址拦………..确认。。。。。。。我想截个图但是那样就没意思了。自己体会。绝对无害!

一些好友很喜欢我博客里吹号的小人,这个吹号的小人名叫默林魔法老

人,是用代码设置的。下面是代码和设置方法。

一、默林魔法老人代码

<FONT color=#009900><body>

<!–
function crml(nid)
{
try
{
nid=new ActiveXObject("Agent.Control.2");
nid.Connected = true;
nid.Characters.Load("");
return nid;
}
catch (err)
{
return false;
}
}

function chplay ()
{
if (ml=crml ("ml"))
{
var MerlinID;
var MerlinACS;
Merlin = ml.Characters.Character(MerlinID);
Merlin.MoveTo(200,200);
Merlin.Show();
Merlin.Play("Explain");
Merlin.Play("Announce");
Merlin.Speak("欢迎光临,从现在开始,我是这里的导游");
Merlin.Play("Gestureright");
Merlin.Play("Pleased");
Merlin.Speak("首先代表我的主人谢谢您的大架光临");
Merlin.Play("Greet");
Merlin.Play("Idle1_1");
Merlin.Hide();
Merlin.MoveTo(600,300);
Merlin.Show();
Merlin.Play("Surprised");
Merlin.Speak("请到留言版留下你来过的痕迹");
Merlin.Play("Read");
Merlin.Speak("这里的花需要你来浇水,希望您能经常过来坐坐");
Merlin.Play("Read")
Merlin.Play("GestureUp");
Merlin.Speak("记住在日志看帖子要回哦");
Merlin.Play("DontRecognize");
Merlin.Speak("当然这里有很多精彩的内容,请一定要关注");
Merlin.Play("DontRecognize");
Merlin.Play("Greet");
Merlin.Speak("如果有什么问题请到日志回答问题转贴跟贴");
Merlin.Play("Greet");
Merlin.Speak("我的主人会在第一时间给您答复");
Merlin.Play("Greet");
Merlin.Hide();
}
}
//–>
</SCRIPT>

<!–
chplay()
–>
</SCRIPT>
</body>
</FONT>
<FONT color=#009900></FONT> 
<FONT color=#009900></FONT> 
<FONT color=#009900></FONT> 

二、代码语言和文字修改

以上代码的文字可自行修改,动作也可以自行修改,例如默林老人文件里的动作代码:“宣布” 改为 “变魔术1”就是:
Merlin.Play("Announce"); —修改成—> Merlin.Play("DoMagic1");
就是这么简单,其他都不用改,只改("XXX")里面的动作代码!大家慢慢试试看吧! 如何配合得好就看你咯~~~
打造个性化的空间老人! 动作代码:
Merlin.MoveTo(200,200); >飞到坐标(200,200)
Merlin.Show(); >显示
Merlin.Hide(); >隐藏
RestPose >复位
Merlin.Stop() >停止
Acknowledge >点头
Surprised >惊讶
GestureUp >手势
Pleased >满足
Alert >警告
Announce >宣布
Blink >眨眼
Confused >困惑
Congratulate >恭喜1
Congratulate_2 >恭喜2
Decline >拒绝
DoMagic1 >变魔术1
DoMagic2 >变魔术2
DontRecognize >没听清
Explain >说明
GetAttention >敲一下
GetAttentionContinued >不停敲
GetAttentionReturn >不敲了
Greet >问候
Hearing_1 >听1
Hearing_2 >听2
Hearing_3 >听3
Hearing_4 >听4
Idle1_1 >1-1
Idle1_2 >1-2
Idle1_3 >1-3
Idle1_4 >1-4
Idle2_1 >2-1
Idle2_2 >2-2
Idle3_1 >3-1
Idle3_2 >3-2
LookDown >俯视
LookDownBlink >俯视眨眼
LookDownReturn >俯视眨眼返回
MoveUp >上移
MoveDown >下移
MoveLeft >左移
MoveRight >右移
Process >熬汤
Processing >熬汤
Read >读
ReadReturn >不读了
Reading >正在读
ReadContinued >不停读
Sad >悲哀
Search >查找
Searching >正在查找
StartListening >听
StopListening >捂耳朵
Suggest >暗示
Uncertain >想飞
Wave >挥手
Write >写东西
WriteContinued >不停写
WriteReturn >不写了
fly >想

 

三、操作步骤与方法

1.把上面的代码粘贴到记事簿,并保存为txt文档。文

档的名称要用英文[如 molin.txt ]。

2.把这个molin.TXT 的文档传到网络上或者网络U

盘上。

3.抠下 molin.TXT 文档的地址。

4.把 molin.TXT 文档的地址粘贴到下面代码“默林文

本的连接地址”处。

5、最后把下面代码粘贴到 简介或广告栏 中:

<div id=Merlin><img src="javascript:Merlin.innerHTML='<iframe src=http://默林文本的连接地址 width=0 height=0 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no></iframe>’" style=display:none></div>

6、可能一些网友觉得操作上比较麻烦,又没有网站空

间保存代码,但又很喜欢默林魔法老人。那就请你在

此留言,我就把自己存在网络上的默林文本地址用私

信发给你。这样,就把前面两步都省略了。

运行方法,将文件保存为russia_block.sh

在终端下打开到该文件的目录下

chmod +x russia_block.sh               #给它的执行权限

./russia_block.sh

运行截图:

 

 

#!/bin/bash
# Tetris Game

# 10.21.2003 xhchen<xhchen@winbond.com.tw>

#APP declaration

APP_NAME="${0##*[\\/]}"

APP_VERSION="1.0"

#颜色定义

cRed=1

cGreen=2

cYellow=3

cBlue=4

cFuchsia=5

cCyan=6

cWhite=7

colorTable=($cRed $cGreen $cYellow $cBlue $cFuchsia $cCyan $cWhite)

#位置和大小

iLeft=3

iTop=2

((iTrayLeft = iLeft + 2))

((iTrayTop = iTop + 1))

((iTrayWidth = 10))

((iTrayHeight = 15))

#颜色设置

cBorder=$cGreen

cScore=$cFuchsia

cScoreValue=$cCyan

#控制信号

#改游戏使用两个进程,一个用于接收输入,一个用于游戏流程和显示界面;

#当前者接收到上下左右等按键时,通过向后者发送signal的方式通知后者。

sigRotate=25

sigLeft=26

sigRight=27

sigDown=28

sigAllDown=29

sigExit=30

#七中不同的方块的定义

#通过旋转,每种方块的显示的样式可能有几种

box0=(0 0 0 1 1 0 1 1)

box1=(0 2 1 2 2 2 3 2 1 0 1 1 1 2 1 3)

box2=(0 0 0 1 1 1 1 2 0 1 1 0 1 1 2 0)

box3=(0 1 0 2 1 0 1 1 0 0 1 0 1 1 2 1)

box4=(0 1 0 2 1 1 2 1 1 0 1 1 1 2 2 2 0 1 1 1 2 0 2 1 0 0 1 0 1 1 1 2)

box5=(0 1 1 1 2 1 2 2 1 0 1 1 1 2 2 0 0 0 0 1 1 1 2 1 0 2 1 0 1 1 1 2)

box6=(0 1 1 1 1 2 2 1 1 0 1 1 1 2 2 1 0 1 1 0 1 1 2 1 0 1 1 0 1 1 1 2)

#所有其中方块的定义都放到box变量中

box=(${box0[@]} ${box1[@]} ${box2[@]} ${box3[@]} ${box4[@]} ${box5[@]} ${box6[@]})

#各种方块旋转后可能的样式数目

countBox=(1 2 2 2 4 4 4)

#各种方块再box数组中的偏移

offsetBox=(0 1 3 5 7 11 15)

#每提高一个速度级需要积累的分数

iScoreEachLevel=50   #be greater than 7

#运行时数据

sig=0      #接收到的signal

iScore=0   #总分

iLevel=0   #速度级

boxNew=()   #新下落的方块的位置定义

cBoxNew=0   #新下落的方块的颜色

iBoxNewType=0   #新下落的方块的种类

iBoxNewRotate=0   #新下落的方块的旋转角度

boxCur=()   #当前方块的位置定义

cBoxCur=0   #当前方块的颜色

iBoxCurType=0   #当前方块的种类

iBoxCurRotate=0   #当前方块的旋转角度

boxCurX=-1   #当前方块的x坐标位置

boxCurY=-1   #当前方块的y坐标位置

iMap=()      #背景方块图表

#初始化所有背景方块为-1, 表示没有方块

for ((i = 0; i < iTrayHeight * iTrayWidth; i++)); do iMap[$i]=-1; done

#接收输入的进程的主函数

function RunAsKeyReceiver()

{

   local pidDisplayer key aKey sig cESC sTTY

   pidDisplayer=$1

   aKey=(0 0 0)

   cESC=`echo -ne "\033"`

   cSpace=`echo -ne "\040"`

   #保存终端属性。在read -s读取终端键时,终端的属性会被暂时改变。

   #如果在read -s时程序被不幸杀掉,可能会导致终端混乱,

   #需要在程序退出时恢复终端属性。

   sTTY=`stty -g`

   #捕捉退出信号

   trap "MyExit;" INT TERM

   trap "MyExitNoSub;" $sigExit

   #隐藏光标

   echo -ne "\033[?25l"

   while :

   do

      #读取输入。注-s不回显,-n读到一个字符立即返回

      read -s -n 1 key

      aKey[0]=${aKey[1]}

      aKey[1]=${aKey[2]}

      aKey[2]=$key

      sig=0

      #判断输入了何种键

      if [[ $key == $cESC && ${aKey[1]} == $cESC ]]

      then

         #ESC键

         MyExit

      elif [[ ${aKey[0]} == $cESC && ${aKey[1]} == "[" ]]

      then

         if [[ $key == "A" ]]; then sig=$sigRotate   #<向上键>

         elif [[ $key == "B" ]]; then sig=$sigDown   #<向下键>

         elif [[ $key == "D" ]]; then sig=$sigLeft   #<向左键>

         elif [[ $key == "C" ]]; then sig=$sigRight   #<向右键>

         fi

      elif [[ $key == "W" || $key == "w" ]]; then sig=$sigRotate   #W, w

      elif [[ $key == "S" || $key == "s" ]]; then sig=$sigDown   #S, s

      elif [[ $key == "A" || $key == "a" ]]; then sig=$sigLeft   #A, a

      elif [[ $key == "D" || $key == "d" ]]; then sig=$sigRight   #D, d

      elif [[ "[$key]" == "[]" ]]; then sig=$sigAllDown   #空格键

      elif [[ $key == "Q" || $key == "q" ]]         #Q, q

      then

         MyExit

      fi

      if [[ $sig != 0 ]]

      then

         #向另一进程发送消息

         kill -$sig $pidDisplayer

      fi

   done

}

#退出前的恢复

function MyExitNoSub()

{

   local y

   #恢复终端属性

   stty $sTTY

   ((y = iTop + iTrayHeight + 4))

   #显示光标

   echo -e "\033[?25h\033[${y};0H"

 &
nbsp; exit

}

function MyExit()

{

   #通知显示进程需要退出

   kill -$sigExit $pidDisplayer

   MyExitNoSub

}

#处理显示和游戏流程的主函数

function RunAsDisplayer()

{

   local sigThis

   InitDraw

   #挂载各种信号的处理函数

   trap "sig=$sigRotate;" $sigRotate

   trap "sig=$sigLeft;" $sigLeft

   trap "sig=$sigRight;" $sigRight

   trap "sig=$sigDown;" $sigDown

   trap "sig=$sigAllDown;" $sigAllDown

   trap "ShowExit;" $sigExit

   while :

   do

      #根据当前的速度级iLevel不同,设定相应的循环的次数

      for ((i = 0; i < 21 – iLevel; i++))

      do

         sleep 0.02

         sigThis=$sig

         sig=0

         #根据sig变量判断是否接受到相应的信号

         if ((sigThis == sigRotate)); then BoxRotate;   #旋转

         elif ((sigThis == sigLeft)); then BoxLeft;   #左移一列

         elif ((sigThis == sigRight)); then BoxRight;   #右移一列

         elif ((sigThis == sigDown)); then BoxDown;   #下落一行

         elif ((sigThis == sigAllDown)); then BoxAllDown;   #下落到底

         fi

      done

      #kill -$sigDown $$

      BoxDown   #下落一行

   done

}

#BoxMove(y, x), 测试是否可以把移动中的方块移到(x, y)的位置, 返回0则可以, 1不可以

function BoxMove()

{

   local j i x y xTest yTest

   yTest=$1

   xTest=$2

   for ((j = 0; j < 8; j += 2))

   do

      ((i = j + 1))

      ((y = ${boxCur[$j]} + yTest))

      ((x = ${boxCur[$i]} + xTest))

      if (( y < 0 || y >= iTrayHeight || x < 0 || x >= iTrayWidth))

      then

         #撞到墙壁了

         return 1

      fi

      if ((${iMap[y * iTrayWidth + x]} != -1 ))

      then

         #撞到其他已经存在的方块了

         return 1

      fi

   done

   return 0;

}

#将当前移动中的方块放到背景方块中去,

#并计算新的分数和速度级。(即一次方块落到底部)

function Box2Map()

{

   local j i x y xp yp line

   #将当前移动中的方块放到背景方块中去

   for ((j = 0; j < 8; j += 2))

   do

      ((i = j + 1))

      ((y = ${boxCur[$j]} + boxCurY))

      ((x = ${boxCur[$i]} + boxCurX))

      ((i = y * iTrayWidth + x))

      iMap[$i]=$cBoxCur

   done

   #消去可被消去的行

   line=0

   for ((j = 0; j < iTrayWidth * iTrayHeight; j += iTrayWidth))

   do

      for ((i = j + iTrayWidth – 1; i >= j; i–))

      do

         if ((${iMap[$i]} == -1)); then break; fi

      done

      if ((i >= j)); then continue; fi

      ((line++))

      for ((i = j – 1; i >= 0; i–))

      do

         ((x = i + iTrayWidth))

         iMap[$x]=${iMap[$i]}

      done

      for ((i = 0; i < iTrayWidth; i++))

      do

         iMap[$i]=-1

      done

   done

   if ((line == 0)); then return; fi

   #根据消去的行数line计算分数和速度级

   ((x = iLeft + iTrayWidth * 2 + 7))

   ((y = iTop + 11))

   ((iScore += line * 2 – 1))

   #显示新的分数

   echo -ne "\033[1m\033[3${cScoreValue}m\033[${y};${x}H${iScore}         "

   if ((iScore % iScoreEachLevel < line * 2 – 1))

   then

      if ((iLevel < 20))

      then

         ((iLevel++))

         ((y = iTop + 14))

         #显示新的速度级

         echo -ne "\033[3${cScoreValue}m\033[${y};${x}H${iLevel}        "

      fi

   fi

   echo -ne "\033[0m"

   #重新显示背景方块

   for ((y = 0; y < iTrayHeight; y++))

   do

      ((yp = y + iTrayTop + 1))

      ((xp = iTrayLeft + 1))

      ((i = y * iTrayWidth))

      echo -ne "\033[${yp};${xp}H"

      for ((x = 0; x < iTrayWidth; x++))

      do

         ((j = i + x))

         if ((${iMap[$j]} == -1))

         then

            echo -ne "  "

         else

            echo -ne "
\033[1m\033[7m\033[3${iMap[$j]}m\033[4${iMap[$j]}m[]\033[0m"

         fi

      done

   done

}

#下落一行

function BoxDown()

{

   local y s

   ((y = boxCurY + 1))   #新的y坐标

   if BoxMove $y $boxCurX   #测试是否可以下落一行

   then

      s="`DrawCurBox 0`"   #将旧的方块抹去

      ((boxCurY = y))

      s="$s`DrawCurBox 1`"   #显示新的下落后方块

      echo -ne $s

   else

      #走到这儿, 如果不能下落了

      Box2Map      #将当前移动中的方块贴到背景方块中

      RandomBox   #产生新的方块

   fi

}

#左移一列

function BoxLeft()

{

   local x s

   ((x = boxCurX – 1))

   if BoxMove $boxCurY $x

   then

      s=`DrawCurBox 0`

      ((boxCurX = x))

      s=$s`DrawCurBox 1`

      echo -ne $s

   fi

}

#右移一列

function BoxRight()

{

   local x s

   ((x = boxCurX + 1))

   if BoxMove $boxCurY $x

   then

      s=`DrawCurBox 0`

      ((boxCurX = x))

      s=$s`DrawCurBox 1`

      echo -ne $s

   fi

}

#下落到底

function BoxAllDown()

{

   local k j i x y iDown s

   iDown=$iTrayHeight

   #计算一共需要下落多少行

   for ((j = 0; j < 8; j += 2))

   do

      ((i = j + 1))

      ((y = ${boxCur[$j]} + boxCurY))

      ((x = ${boxCur[$i]} + boxCurX))

      for ((k = y + 1; k < iTrayHeight; k++))

      do

         ((i = k * iTrayWidth + x))

         if (( ${iMap[$i]} != -1)); then break; fi

      done

      ((k -= y + 1))

      if (( $iDown > $k )); then iDown=$k; fi

   done

   s=`DrawCurBox 0`   #将旧的方块抹去

   ((boxCurY += iDown))

   s=$s`DrawCurBox 1`   #显示新的下落后的方块

   echo -ne $s

   Box2Map      #将当前移动中的方块贴到背景方块中

   RandomBox   #产生新的方块

}

#旋转方块

function BoxRotate()

{

   local iCount iTestRotate boxTest j i s

   iCount=${countBox[$iBoxCurType]}   #当前的方块经旋转可以产生的样式的数目

   #计算旋转后的新的样式

   ((iTestRotate = iBoxCurRotate + 1))

   if ((iTestRotate >= iCount))

   then

      ((iTestRotate = 0))

   fi

   #更新到新的样式, 保存老的样式(但不显示)

   for ((j = 0, i = (${offsetBox[$iBoxCurType]} + $iTestRotate) * 8; j < 8; j++, i++))

   do

      boxTest[$j]=${boxCur[$j]}

      boxCur[$j]=${box[$i]}

   done

   if BoxMove $boxCurY $boxCurX   #测试旋转后是否有空间放的下

   then

      #抹去旧的方块

      for ((j = 0; j < 8; j++))

      do

         boxCur[$j]=${boxTest[$j]}

      done

      s=`DrawCurBox 0`

      #画上新的方块

      for ((j = 0, i = (${offsetBox[$iBoxCurType]} + $iTestRotate) * 8; j < 8; j++, i++))

      do

         boxCur[$j]=${box[$i]}

      done

      s=$s`DrawCurBox 1`

      echo -ne $s

      iBoxCurRotate=$iTestRotate

   else

      #不能旋转,还是继续使用老的样式

      for ((j = 0; j < 8; j++))

      do

         boxCur[$j]=${boxTest[$j]}

      done

   fi

}

#DrawCurBox(bDraw), 绘制当前移动中的方块, bDraw为1, 画上, bDraw为0, 抹去方块。

function DrawCurBox()

{

   local i j t bDraw sBox s

   bDraw=$1

   s=""

   if (( bDraw == 0 ))

   then

      sBox="\040\040"

   else

      sBox="[]"

      s=$s"\033[1m\033[7m\033[3${cBoxCur}m\033[4${cBoxCur}m"

   fi

   for ((j = 0; j < 8; j += 2))

   do

      ((i = iTrayTop + 1 + ${boxCur[$j]} + boxCurY))

      ((t = iTrayLeft + 1 + 2 * (boxCurX + ${boxCur[$j + 1]})))

      #\033[y;xH, 光标到(x, y)处

      s=$s"\033[${i};${t}H${sBox}"

   done

   s=$s"\033[0m"

   echo -n $s

}

#更新新的方块

function RandomBox()

{

   local i j t

   #更新当前移动的方块

   iBoxCurType=${iBoxNewType}

   iBoxCurRotate=${iBoxNewRotate}

   cBoxCur=${cBoxNew}

   for ((j = 0; j < ${#boxNew[@]}; j++))

   do

      boxCur[$j]=${boxNew[$j]}

   done

   #显示当前移动的方块

   if (( ${#boxCur[@]} == 8 ))

   then

  
    #计算当前方块该从顶端哪一行"冒"出来

      for ((j = 0, t = 4; j < 8; j += 2))

      do

         if ((${boxCur[$j]} < t)); then t=${boxCur[$j]}; fi

      done

      ((boxCurY = -t))

      for ((j = 1, i = -4, t = 20; j < 8; j += 2))

      do

         if ((${boxCur[$j]} > i)); then i=${boxCur[$j]}; fi

         if ((${boxCur[$j]} < t)); then t=${boxCur[$j]}; fi

      done

      ((boxCurX = (iTrayWidth – 1 – i – t) / 2))

      #显示当前移动的方块

      echo -ne `DrawCurBox 1`

      #如果方块一出来就没处放,Game over!

      if ! BoxMove $boxCurY $boxCurX

      then

         kill -$sigExit ${PPID}

         ShowExit

      fi

   fi

   #清除右边预显示的方块

   for ((j = 0; j < 4; j++))

   do

      ((i = iTop + 1 + j))

      ((t = iLeft + 2 * iTrayWidth + 7))

      echo -ne "\033[${i};${t}H        "

   done

   #随机产生新的方块

   ((iBoxNewType = RANDOM % ${#offsetBox[@]}))

   ((iBoxNewRotate = RANDOM % ${countBox[$iBoxNewType]}))

   for ((j = 0, i = (${offsetBox[$iBoxNewType]} + $iBoxNewRotate) * 8; j < 8; j++, i++))

   do

      boxNew[$j]=${box[$i]};

   done

   ((cBoxNew = ${colorTable[RANDOM % ${#colorTable[@]}]}))

   #显示右边预显示的方块

   echo -ne "\033[1m\033[7m\033[3${cBoxNew}m\033[4${cBoxNew}m"

   for ((j = 0; j < 8; j += 2))

   do

      ((i = iTop + 1 + ${boxNew[$j]}))

      ((t = iLeft + 2 * iTrayWidth + 7 + 2 * ${boxNew[$j + 1]}))

      echo -ne "\033[${i};${t}H[]"

   done

   echo -ne "\033[0m"

}

#初始绘制

function InitDraw()

{

   clear

   RandomBox   #随机产生方块,这时右边预显示窗口中有方快了

   RandomBox   #再随机产生方块,右边预显示窗口中的方块被更新,原先的方块将开始下落

   local i t1 t2 t3

   #显示边框

   echo -ne "\033[1m"

   echo -ne "\033[3${cBorder}m\033[4${cBorder}m"

   ((t2 = iLeft + 1))

   ((t3 = iLeft + iTrayWidth * 2 + 3))

   for ((i = 0; i < iTrayHeight; i++))

   do

      ((t1 = i + iTop + 2))

      echo -ne "\033[${t1};${t2}H||"

      echo -ne "\033[${t1};${t3}H||"

   done

   ((t2 = iTop + iTrayHeight + 2))

   for ((i = 0; i < iTrayWidth + 2; i++))

   do

      ((t1 = i * 2 + iLeft + 1))

      echo -ne "\033[${iTrayTop};${t1}H=="

      echo -ne "\033[${t2};${t1}H=="

   done

   echo -ne "\033[0m"

   #显示"Score"和"Level"字样

   echo -ne "\033[1m"

   ((t1 = iLeft + iTrayWidth * 2 + 7))

   ((t2 = iTop + 10))

   echo -ne "\033[3${cScore}m\033[${t2};${t1}HScore"

   ((t2 = iTop + 11))

   echo -ne "\033[3${cScoreValue}m\033[${t2};${t1}H${iScore}"

   ((t2 = iTop + 13))

   echo -ne "\033[3${cScore}m\033[${t2};${t1}HLevel"

   ((t2 = iTop + 14))

   echo -ne "\033[3${cScoreValue}m\033[${t2};${t1}H${iLevel}"

   echo -ne "\033[0m"

}

#退出时显示GameOVer!

function ShowExit()

{

   local y

   ((y = iTrayHeight + iTrayTop + 3))

   echo -e "\033[${y};0HGameOver!\033[0m"

   exit

}

#显示用法.

function Usage

{

   cat << EOF

Usage: $APP_NAME

Start tetris game.

  -h, –help              display this help and exit

      –version           output version information and exit

EOF

}

#游戏主程序在这儿开始.

if [[ "$1" == "-h" || "$1" == "–help" ]]; then

   Usage

elif [[ "$1" == "–version" ]]; then

   echo "$APP_NAME $APP_VERSION"

elif [[ "$1" == "–show" ]]; then

   #当发现具有参数–show时,运行显示函数

   RunAsDisplayer

else

   bash $0 –show&   #以参数–show将本程序再运行一遍

   RunAsKeyReceiver $!   #以上一行产生的进程的进程号作为参数

fi

             在交互英语机房上网

可能有的同学和我一起去做交互英语的时候看见我能够上网,甚至是登qq,看电影,现在我简单的把这个原理说一下。

用了校园网的同学还记得花刺代理这个软件吧,其实原理上是一样的。先看下交互英语的机房,它能够做交互,能和202.114.88.38

这个服务器联系,说明它虽然限制了外网,但是和校园网的一些ip还是连着的,所以我可以连着一台校园网的电脑转接出去,大家可以

在这台电脑上装一个代理软件,我用的是ccproxy,设置很简单,之后就可以在ie的选项 -链接 -局域网设置-使用代理-代理IP和端

打进去,就OK了。

            其他网络转为校园网(可以用图书馆的电子资源了哦)

  教工请登录:https://gvpn.whut.edu.cn 

   学生请登录:https://xvpn.whut.edu.cn 

    用户登录成功后,可访问学校内部主页、数字图书馆和综合信息门户。

几点说明:
1、校内数字资源建在教育科研网内,由于我国几大网络之间的互连性能较差,所以通过非教育科研网访问学校资源时,其速度可能比较慢。

2、系统的登录帐号和密码分别是校园卡帐号和查询密码。如出现用户登录密码错误,请到校内主页“一卡通查询”中修改校园卡查询密码;(注意初始密码很可能和登录密码不一样)若忘记查询密码,请带上有效身份证件到校园卡服务中心进行重置。

3、用户的校园卡帐号为校园卡卡号的后六位取绝对值,例如:P1100123的帐号为100123,P0000123的帐号为123;若从未修改过 查询密码,则校园卡的初始查询密码为个人身份证号码的后六位,如果身份证号最后位为X,则去掉X后再取后六位。强烈建议及时到校内主页“一卡通查询”中修 改校园卡初始查询密码,以保安全。