如何架构Linux的远程桌面
对Windows的远程桌面一定情有独钟吧,其实Linux和可以非常方便的使用类似的功能。
实现的技术细节就是使用VNC系统,软件当然首选Open Source的软件,这才符合Linux的要求:)。我选择TightVNC,使用GPL的License。
由于我使用的是Debian/Ubuntu系统,所以我也已这两个系统来举例。
1.在Linux端安装TightVNC,由于Debian/Ubuntu中都包含已经编译好的二进制程序包,我们只需简单输入apt-get install tightvncserver (root权限安装),系统会自动帮我们安装配置好TightVNC的服务器端。
2.在服务器的桌面选择Desktop/Preferences/Remote Desktop。

3. 在弹出的Remote Desktop设定窗口中进行相关配置设定

- Allow other users to view your desktop:这个选项不容质疑地必须被选中,否则客户端是无法连接上Tight SVN Server端的。
- Allow other users to control your desktop:是否让远端用户可以控制你的桌面,如何不选,则远端用户只能看到你的桌面,而鼠标、键盘等操作都是无效的,(有点像远程教育)
- Ask you for confirmation:这个选项默认时是选上的,这样任何一个远端用户的链接时都会弹出一个确认对话框,让你确认。
- Require the user to enter this password:使用密码认证。
个人比较喜欢使用密码认证,而取消Ask you for confirmation。必须大多数远端桌面都是应用在Linux服务器的链接控制,这时怎么可能一直到Linux Server端去确认链接呢。
4. 安装客户端,从http://www.tightvnc.com/download.html下载相应的操作系统的程序包,安装时可以只选择安装Viewer,在VNC Server输入框中打入服务器的机器名称或者IP地址,点击Connect按钮即可。
现在就可以享受和Windows Remote Desktop的一样的便利了。
Flash中Display控件常用属性及方法
1. 坐标 x, y
ball.x =3 ball.y = 4
2. 宽和高
ball.height = 100 ball.weight = 200
3.宽高比例
ball.scaleX = 2 ball.scaleY = 0.5
按比例宽扩大2倍,高缩小一半。
4. 透明度
ball.alpha = 0.5
alpha 可以0-1中任意数值,数值越小透明度越高
5.旋转
ball.rotation = 45
旋转45度
6.numChildren
取得子控件的总数
7.z-index
getChildIndex(ball1) //取得ball1子控件的z-index位置 setChildIndex(ball1, numChildren-1); //把ball1子控件放到当前控件的最前面(top) swapChildren(ball2, ball3); //交换ball2和ball3的z-index位置 swapChildrenAt(0, 2); //交换z-index位置0和2上的子控件
如何实现查寻关键词的高亮显示
查寻功能是每个网站都有的基本功能,最简单的实现方法当然就是使用SQL的like操作符来匹配用户输入的关键字。
以一个简单的CMS系统举例,检索栏位可能包括有Title(主题)和Content(内容),具体的SQL语句撰写如下:
SELECT * FROM cms WHERE title LIKE '%{$name}%' OR content LIKE '%{$name}%')";
SQL语句中%xxx%可以检索出任何包含xxx的字符串的主题或内容作为符合条件的资料。如xxx为test,那么test、contest、testable等等都是符合的结果。
现在我们就已经完成了一半的功能,接着如何实现高亮显示呢?其实其中最复杂的是如何做到英文的整词选择,最简单方法当然是使用正则表达式来进行替换。PHP代码撰写如下:
$content = preg_replace("/\b(\w*$highlight\w*)\b/",
"<spanstyle=\"background-color:#369;\">$1</span>" ,
$content);
其中正则表达式:\b(\w*test\w*)\b,\b就是来定位整词的,\w代表任意的ascii字符。如需考虑一些符号的情况,如“-”,只需要把\w修改成[\w-]即可。通过以上的正则表达式,我们就可以高亮显示以下的字符串中的关键字了,其中搜索的关键字为test。
test home run contest a test
Core Display Classes Illustration in Flash CS3
插图为Flash CS3 的核心Display 类的继承关系的图。
- DisplayObject: At the top of the hierarchy, this class provides the basic properties for all visual items in the display list, such as x, y, width, and height. Everything in the display list is an instance of one of the classes that extends the DisplayObject class, either directly or indirectly.
- InteractiveObject: This class adds various properties, methods, and events that allow users to interact with display objects using the mouse and keyboard. You’ll learn more about events and how to allow users to interact with display objects.
- DisplayObjectContainer: This class gives display objects the ability to contain other display objects, which can be manipulated using methods like addChild() and removeChild(). Other display list classes allow a specific number of child display objects. A good example is SimpleButton, which allows you to specify a different display object for each of the button states, but only DisplayObjectContainer instances allow you to have an open-ended number of child display objects.
- Sprite: This is a new type of object available with ActionScript 3.0, and there is no equivalent in the IDE. Basically, it is like a movie clip without a timeline, so it doesn’t contain any of the timeline controlling ActionScript necessary with MovieClip instances. You can still draw into it, add new display objects to it, and code for interactivity, but it is lighter weight in memory than a movie clip. It is the best bet if you are programmatically creating interactive graphics in your applications.
- MovieClip: This class adds the concept of frames, frame labels, and scenes, with all the properties and methods you need to query and manipulate the playhead. Note that while you can create MovieClip objects programmatically, you cannot add frames, labels, or scenes with ActionScript code.
以上说明摘录至【Foundation ActionScript 3.0 with Flash CS3 and Flex】
ActionScript 3.0 基础数据类型
String: 字符或者字符串 A single character or sequence of characters
Boolean: 布尔类型 只有真和假 true or false values
int: 带符号整型,ActionScript 3.0新增类型 Positive and negative whole numbers (new in the actionscript 3.0)
uint: 无符号整型,ActionScript 3.0新增类型 Positive whole numbers (new in the actionscript 3.0)
Number: 浮点数类型 Positive and negative whole and real (i.e., fractional) numbers
Note:
int and uint are actually low-level numeric types that are a subtypes of Integer (which does not exist in ActionScript), and the lowercase denotes this and also follows syntax shared by other languages like Java, C++, and C#.
何韵诗《Goomusic Collection (2004-2008 新曲+精选)》
Denise_Ho-Goomusic_Collection_2k4_To_2k8_New_And_Best_Selection-2CD-CPOP-2008-COCMP3
专辑名称:Goomusic Collection (2004-2008 新曲+精选)
演唱歌手:何韵诗
唱片公司:东亚唱片
发行时间:2008年04月02日
专辑语种:粤语专辑2CD
曲目列表:
Disk 1
- 剑雪 – 何韵诗/郑秀文 (新歌)
- 韵律泳 (新歌)
- 满地可 (新歌)
- 万花筒 (新歌)
- 光明会
- 艳光四射 (美艳到不行)
- 花见
- 明目张胆
- 十八相送
- 你是八十年代
- 花迷恋
- 幽默感
- 叹息桥
- 木纹 (Wooden Heart Mix)
- 劳斯·莱斯
Disk 2
- 艳光四射 (Marching Version)
- 花见 (Big Band Version)
- 劳斯·莱斯 (Blues Version)
- 你是八十年代 (Disco Version)
- 光明会 (明教教主版)
- 满城尽带黄金甲
- 愿我可以学会放低你
- 大红袍
- 汽水樽里的咖啡
- 第三身
- 化蝶
- 如无意外
- 圆满
- 英雄心
- 伤城秘密
专辑简介
何韵诗在年初香港乐坛颁奖典礼中凭“木纹”一曲获取不少奖项,成绩骄人。继去年年底与郑秀文同为“第6届亚洲游戏展2007”担任代言人,并为大会合 唱摇滚主题曲“剑雪”后,阿诗于4月1日起特别在香港举行个人回顾展览 (2004-2008) ,并以自家音乐品牌“Goo Music”的名义,推出精选碟《Goomusic Collection》,而全新三首主打歌“韵律泳”、“满地可”及“万花筒” 亦分别派上台。黄伟文填词的新作,以“韵律泳”来描写泳手合拍才会表演成功,就像爱情世界一样情侣合拍才能一起走下去。
这张《Goomusic Collection》新曲加精选以2CD和卡拉OK DVD发行,为阿诗由2004年至2008年在东亚唱片时期的音乐成绩作一总结。碟内收录了她为纪念已故师傅梅艳芳而唱出的“艳光四射”、“你是八十年 代”,以及人气主打歌“光明会”、“叹息桥”、“劳斯.莱斯”等连同五首混音共逾20首精选歌曲,另加两首Bonus Track:《伤城》主题曲“伤城秘密”和“英雄心”。至于DVD内则辑录了阿诗四年来的精彩MV 16首,当中包括“剑雪”和“韵律泳”最新MV。
PSP and eBook
这几天迷上了用PSP来看电子书。上周一个偶然的机会,从同事哪里获知原来PSP上还有PDF的阅读软件Bookr,下载装了一个,试用了一下,阅读英文的PDF的效果非常不错。虽然这个软件也宣称支持中文,不过试了半天,对中文的支持实在不敢恭维,猜想可能和PDF中使用的各种不同的中文字体有关系。
除了Bookr,另一个xReader也可以阅读简单HTML和Text文件。由于是国产软件对中文支持非常不错,不过从稳定性上来讲Bookr比这个xReader应该强多了,其中最不稳定的就是MP3播放功能,xReader中所带的MP3功能简直就是鸡肋,一个播放列表操作起来非常不便。不过有总比没有好,偶尔当作背景音乐放放还能凑合。还有个eReader的阅读器,功能基本和xReader相同,不过xReader可以支持高版本内核的PSP系统。
为了能读一些免费的书籍,当然还需要一些辅助的PC软件,现在向你推荐一个-小说下载阅读器。它的功能挺强大的,可以从各大知名的eBook网站直接帮你把电子书籍下载下来。同时值得推荐的网站就是book.sina.com.cn,好书还真的不少,你可以非常方便用这个软件把你喜欢的书下载下来,转成txt格式或者直接复制下载的html,这样就可以使用xReader在地铁中看书了。
Gnash vs Flash
Gnash?没听说过吧。不过在Linux的世界中,它可是已经大名鼎鼎了,它的作用就是在Linux的环境下实现Flash。原因非常的简单,Flash是Commercial Software,和Linux的Open Source 的概念有了一定的冲突。
Gnash 是GNU 下的一个Project,不过现在的功能还是比较弱些,只能完全兼容SWF 7.0 & Actionscript 2.0的所有功能。如果想使用Flex和Actionscript 3.0可能还需要在等待一段时间。
如果想做Windows下也尝试一下,当然也没问题,已经有编译集成的版本,可以在getgnash网站下载。跨平台可能是GNU的拿手好戏。
期待有一天我新写的Flex程序可以运行在Gnash上。
相关网址:
- Gnash官方网站: http://www.gnu.org/software/gnash
- Gnash package release : http://getgnash.org/packages/releases


