XFCE 4.2.1 Released

Jan 发表于 2005-03-17 14:47:04

今天还真是黄道吉日,最喜欢的两个桌面环境相继发布新的版本。
http://www.xfce.org/index.php?page=download


Source code :
Xfce 4 released versions :
All Xfce modules are available in one single tarball from our SourceForge repository, and from several mirrors (in one single tarball or separate tarballs) :

http://xfce.sourceforge.net
http://www.xfce.org/archive/xfce-4.2.1/
http://spuriousinterrupt.org/projects/xfce4/files/mirror/xfce-4.2.1/
http://public.fh-wolfenbuettel.de/~luedickj/xfce4/xfce-4.2.1/
http://hannelore.f1.fhtw-berlin.de/mirrors/xfce4/xfce-4.2.1/
You can download the graphical installer provided by os-cillation from here.
Xfce 4 development versions :
You can get source code directly from CVS using the method described here.
You can browse the WebCVS too.


Binaries and contributed packages :
The Xfce 4 project officially only release source code for the desktop environment.
However, binary packages may have been contributed by other people for your OS distribution. Please note that the contributed version is not always the latest released version.

Redhat/Fedora/Fedora x86_64 : http://sf.net/projects/xfce/files
http://www.us.xfce.org/archive/xfce-4.2.1/
http://hannelore.f1.fhtw-berlin.de/mirrors/xfce4/xfce-4.2.1/
Debian Testing/Unstable : http://www.os-cillation.com/article.php?sid=37
Suse 8.2 : http://ftp.gwdg.de/pub/linux/suse/apt/SuSE/8.2-i386/RPMS.suser-ollakka/ (apt4rpm)

Suse 9.1 : http://www.students.oamk.fi/~olilju00/xfce4/4.2/
http://ftp.gwdg.de/pub/linux/suse/apt/SuSE/9.1-i386/RPMS.suser-ollakka/ (apt4rpm)

Suse 9.2 : http://turing.fh-landshut.de/~bwalle/xfce/
http://ftp.gwdg.de/pub/linux/suse/apt/SuSE/9.2-i386/RPMS.suser-ollakka/ (apt4rpm)
Mandrake 10.1 : http://www.eslrahc.com/



Alpha : ftp://kcnetwork.net/linux-related/desktop/xfce-4/xfce-4.0.6/rpm/ (Xfce 4.0.6 for Alpha EV56 cpu or better)
Xfce 4 is available in Gentoo, Lunar Linux, Cobind, Morphix, Source Mage, Arch Linux, FreeSBIE, Debian testing/unstable...

Many thanks to the following people for providing Xfce 4 packages or xfce.org mirrors :
Ilkka Ollakka, Bachman Kharazmi, Bernhard Walle, Charles Edwards, Martti Kuparinen, Daniel Ciaglia, Tom Newsom, Martin Loschwitz, Todd Slater, Oliver Lehmann, James Earl, Chris Greenman, Craig Betts, Polkan García, Chuck Mead, Scott Jones, Paul Puschmann, Matt Lancereau, Marcus Moeller, Will L G...



Xfce4-goodies :
Have a look at our Xfce-Goodies project page to discover and download additional software and artwork that is related to the Xfce 4 desktop environment.
If this server is down, a mirror is available here or here.
收藏: QQ书签 del.icio.us 订阅: Google 抓虾

Linux Rules Supercomputers

Jan 发表于 2005-03-17 14:45:36

你知道世界上性能最高的一组计算机是用的什么操作系统么? 虽然官方的TOP 500列表没有给出这些计算机所使用的操作系统的描述, 但是Hans Werner Meuer告诉我们说: 维护这张列表的科学家们私下保留了这些计算机所用的操作系统的记录。统计结果表明,在世界上性能最好的500组计算机系统中,301台使用的是 Linux, 189使用的是正统UNIX, 2台使用FreeBSD, 还有1台使用Windows. (另外有7台使用的是其它系统)。

Supercomputer选择Linux的最大原因是它的开源,使得科学家们可以为他们自己的系统定制出最优化的解决方案,商业化的操作系统是不可能做到这一点的。

NEW YORK - The homegrown Linux operating system has come a long way from its origins as a college kid's pet project and computer hobbyist favorite. Refined in recent years by professional computer programmers at IBM, Hewlett-Packard, Novell and Red Hat, Linux now has become so technically powerful that it lays claim to a prestigious title--it runs more of the world's top supercomputers than any other operating system.

A group that keeps track of the top 500 supercomputers in the world estimates that Linux powers 60% of those machines, displacing Unix, which used to be the most popular operating system for high-performance computing.

The official Top 500 list, available at www.top500.org, does not contain operating system statistics. But the scientists who maintain the list privately keep track of what operating systems are running on the computers, says Hans Werner Meuer, a computer science professor at the University of Mannheim, in Germany, who has been publishing the Top 500 list twice a year since 1993.

One caveat: Meuer says (via e-mail) that his statistics are only an estimate, since some supercomputer Web sites won't report what operating system they use.

"There are many classified and commercial sites where we have to guess which operating system they are using," says Meuer, who is also managing director of Prometeus GmbH, a consulting firm in Daisbach, Germany, that hosts the Top 500 list.

So Meuer may be off by a few machines. Even so, Linux clearly is by far the top choice for high-performance computing. Meuer reckons Linux powers 301 of the 500 top machines, compared to 189 on Unix, two on FreeBSD, a Unix variant, and one on Microsoft's (nasdaq: MSFT - news - people ) Windows. (Seven machines are categorized as "other.")

"Linux has dominated the marketplace for high-performance computing," says Mark Seager, assistant department head for advanced technologies at the Lawrence Livermore National Laboratory in Livermore, Calif., which operates ten machines on the Top 500 list, including Blue Gene/L, the world's most powerful supercomputer, and Thunder, which ranks fifth.

Both of those machines run Linux, as do several other Lawrence Livermore supercomputers. Lawrence Livermore shifted to Linux a few years ago as an alternative to AIX, the IBM (nyse: IBM - news - people ) version of Unix.

Seager says the lab chose Linux partly because it is "open source," meaning users can change the code to suit their needs. Also, they can use Linux without paying a licensing fee.

Moreover, Seager says Linux outguns popular Unix operating systems like AIX and Solaris from Sun Microsystems (nasdaq: SUNW - news - people ) because those systems contain features that make them great for commercial users but add a lot of system overhead that ends up limiting overall performance. One example: a "virtualization" feature in AIX lets many applications share the same processor but "just hammers performance," Seager says.

Linus Torvalds, who created Linux in his college dorm room in 1991, says (via e-mail) that Linux has caught on in part because while typical Unix versions run on only one or two hardware architectures, Linux runs on more than 20 different hardware architectures including machines based on Intel (nasdaq: INTC - news - people ) microprocessors as well as RISC-based computers from IBM and HP (nyse: HPQ - news - people ).

"Of course, of those 20, only a handful are relevant for high-performance computing, but it's still a big advantage," says Torvalds, who oversees Linux development from the Open Source Development Labs, a non-profit organization in Beaverton, Ore. "Linux is easy to get, has no licensing costs, has all the infrastructure in place, and runs on pretty much every single relevant piece of hardware out there."
收藏: QQ书签 del.icio.us 订阅: Google 抓虾

Linux Kernel Development, Second Edition

Jan 发表于 2005-03-17 14:36:58

没有什么比一本好书更能让人兴奋的了,而这本书绝对是精品中的精品,不过中国似乎还没有卖... 考虑办张卡以后直接从Amazon订购了. 原价书还真是贵的可以,只能等工作以后考虑了.

GNU/Linux is increasingly being seen as a viable, economical alternative to proprietary operating systems, and its market penetration, especially on servers, is increasing. To continue to grow Linux's importance as a secure, low cost kernel, much more serious programmers are needed not only to keep improving it, but to develop stable drivers and most importantly to help continue the rapid Linux march to the Desktop.  
There is where Robert Love's new book comes in, Linux Kernel Development, 2nd edition, to introduce experienced programmers into the world of the Linux Kernel. The author is a very experienced Linux Kernel engineer, working for Novell.

This second edition is up to date, with just over 400 pages. It is easy to read, and might I dare say, even quite pleasant at some points. The book explains in detail all the major components of the current Linux Kernel (2.6) and in several cases compares it with older versions or other systems. It starts gently with some history and basic details and then dives into advanced topics such as scheduling of multiple programs on multiple processors, the interrupt system, and continues to memory management and the file system and various other interesting subjects, including debugging. At the end it has three appendixes and a very detailed index.

Every chapter explains in detail how a Kernel subsystem works, sometimes using very nice examples. While it contains many source examples, practically one per page, it is not swamped in source code.

The author succeeds in making even the most complicated subjects like multiprocessing synchronization, locking and the dreaded deadlocks, easy to understand using simple and nice examples. I found most topics clear and easy to digest.

But nothing is perfect in this world, so I have a few criticisms, for this otherwise well written book. It would be nice if it had more actual examples in some areas. For instance, it explains in great detail so much about Bottom Halves and how they work, even how they used to work, but beyond the theory I would like to see some actual examples of Bottom Halves, or even a list of common Bottom Halves in Linux, etc. Generally, maybe I'm asking too much but it would give a more complete picture in some chapters, if after the lengthy detailed theory of how a mechanism works and how the reader can make their own, it had more actual examples of the existing mechanisms built-in to Linux. Also it would be great if some comparisons on all these internal operations were made to the market leader, Microsoft Windows XP.

The Linux Kernel is a huge subject, without underestimating the great job the author has put in these 400 pages, I would expect a book for the Linux kernel to be around 700-800 pages including a reference list or chart on all parts of the Kernel and their file names. Maybe in the next edition? Also, although this is not a specialized driver-writing book, it should have at least one chapter about drivers, as it is such an important subject.

On the other hand, this is a very good book, a good addition to a programmer's bookshelf, it succeeds in describing the Linux Kernel in good detail, but in not too much detail. I am a newcomer to the Linux world, but have extensive experience on other operating systems. This book gave me quickly a good understanding of how the Linux Kernel works in detail, without boring me with endless source code or being too abstract. In other words it is well balanced in the level of detail it provides on its various subjects.

This is a serious book about a serious deep subject, if you are an experienced programmer wanting to enter the depths of the Linux Kernel or just you want to see how really does this Linux thing work, then I personally strongly recommend this book to you, as it was an enjoyable and quite thought provoking read for me.
收藏: QQ书签 del.icio.us 订阅: Google 抓虾

KDE 3.4 Relessed

Jan 发表于 2005-03-17 14:30:03

Gentoo上很早就放出了ebuild, 但是今天才是KDE 3.4正式发布的日子。我已经使用了一段日子了,感觉非常好。KDE加油~

Announcing KDE 3.4
DATELINE MARCH 16, 2005

The KDE Project ships a new major release of their leading Open Source desktop environment.


March 16, 2005 (The Internet) - After more than a half year of development the KDE Project is happy to be able to announce a new major release of the award-winning K Desktop Environment. Among the many new features that have been incorporated, the improvements in accessibility are most remarkable.

One of the milestones in this new release will be the advanced KDE Text-to-speech framework. It integrates into KDE's PDF-viewer, editor, webbrowser and into the new speaker-tool KSayIt. It also allows to read out notifications from all KDE applications. Especially partially-sighted people and speech-impaired users will benefit, but it should also prove a fun desktop experience overall.

For people with low vision, several high contrast themes including a complete monochrome icon set have been added. Other accessibility applications have been improved. KMouseTool which can click the mouse for people with, for example, carpal tunnel syndrome or tendinitis; KMouth to allow the computer to speak for the speech impaired; and KMagnifier to magnify sections of screen for partially-sighted users. Standard accessibility features including "Sticky Keys", "Slow Keys" and "Bounce Keys" are also available and are now more easily accessed via keyboard gestures. All of these features combine to open the world of computing to a much wider audience and to a section of the population that is often overlooked. The KDE project will continue its close cooperation with the accessibility community to reach even more people in the future.

Another milestone will be the improvements of KDE's personal information management suite Kontact and of KDE's instant messenger Kopete. Kontact has improved usability including a new message composer and start screen, and its support for the free software groupware solution Kolab has been updated to Kolab 2.0. This means that KDE has now a complete groupware solution including an open-source server interoperable with proprietary MS Windows Outlook clients. Other supported groupware servers include eGroupware, GroupWise, OpenGroupware.org and SLOX. Kopete features an improved contact list showing contact photos, improved Kontact integration and supports AIM, Gadu-Gadu, GroupWise, ICQ, IRC, Jabber, Lotus Sametime, MSN, Yahoo, and the sending of SMS.

With KDE being based on an international community there are more than 49 translations available and even more to be expected for future service packs of KDE 3.4. This is why KDE serves best the needs of today's world wide Linux community.

KDE 3.4 is available for free under Open Source licenses and boasts eighteen packages of optional applications including accessibility, development, games, PIM, network, utilities, administration, edutainment, multimedia, graphics and more.

Reactions from the accessibility community
"With each new release, KDE continues to enhance its support for people with disabilities", Janina Sajka, chair of the Accessibility Workgroup of the Free Standards Group, said. "This is making KDE more and more attractive to more persons with disabilities. And, it's also helping KDE meet various social inclusion objectives worldwide, such as the Sec. 508 requirements of the U.S. Government."

Lars Stetten from the Accessibility User Group Linaccess said about the release: "The new accessibility features in KDE 3.4 are an important step for the future, to enable disabled people to get to know the KDE desktop and to join its community."

Highlights at a glance
Text-to-speech system with support built into Konqueror, Kate, KPDF and the standalone application KSayIt
Support for text to speech synthesis is integrated with the desktop
Completely redesigned, more flexible trash system
Kicker with improved look and feel
KPDF now enables you to select, copy & paste text and images from PDFs, along with many other improvements
Kontact supports now various groupware servers, including eGroupware, GroupWise, Kolab, OpenGroupware.org and SLOX
Kopete supports Novell Groupwise and Lotus Sametime and gets integrated into Kontact
DBUS/HAL support allows to keep dynamic device icons in media:/ and on the desktop in sync with the state of all devices
KHTML has improved standard support and now close to full support for CSS 2.1 and the CSS 3 Selectors module
Better synchronization between 2 PCs
A new high contrast style and a complete monochrome icon set
An icon effect to paint all icons in two chosen colors, converting third party application icons into high contrast monochrome icons
Akregator allows you to read news from your favourite RSS-enabled websites in one application
Juk has now an album cover management via Google Image Search
KMail now stores passwords securely with KWallet
SVG files can now be used as wallpapers
KHTML plug-ins are now configurable, so the user can selectively disable ones that are not used. This does not include Netscape-style plug-ins. Netscape plug-in in CPU usage can be manually lowered, and plug-ins are more stable.
more than 6,500 bugs have been fixed
more than 1,700 wishes have been fullfilled
more than 80,000 contributions with several million lines of code and documentation added or changed
For a more detailed list of improvements since the KDE 3.3 release, please refer to the KDE 3.4 Feature Plan.


Getting KDE 3.4
Full information on how to download and install KDE 3.4 is available on our official website at http://www.kde.org/info. Being free and open source software, it is available for download at no cost. If you use a major Linux distribution then precompiled packages may be available from your distributions website or from http://download.kde.org. The source code can also be downloaded from there. Both ArkLinux and Kubuntu have targeted a release including KDE 3.4 right after the 3.4 release. If you prefer to build KDE from source you should consider using Konstruct, a tool that automatically downloads, configures and builds KDE 3.4 for you.

Many more KDE applications are freely available from KDE-Apps.org and different look and feel improvents can be downloaded from KDE-Look.org.

Supporting KDE
KDE is an open source project that exists and grows only because of the help of many volunteers that donate their time and effort. KDE is always looking for new volunteers and contributions, whether its help with coding, bug fixing or reporting, writing documentation, translations, promotion, money, etc. All contributions are gratefully appreciated and eagerly accepted. Please read through the Supporting KDE page for further information.
We look forward to hearing from you soon!

About KDE
KDE is an independent project of hundreds of developers, translators, artists and other professionals worldwide collaborating over the Internet to create and freely distribute a sophisticated, customizable and stable desktop and office environment employing a flexible, component-based, network-transparent architecture and offering an outstanding development platform. KDE provides a stable, mature desktop, a full, component-based office suite (KOffice), a large set of networking and administration tools and utilities, and an efficient, intuitive development environment featuring the excellent IDE KDevelop. KDE is working proof that the Open Source "Bazaar-style" software development model can yield first-rate technologies on par with and superior to even the most complex commercial software.


--------------------------------------------------------------------------------

Trademark Notices. KDE and K Desktop Environment are trademarks of KDE e.V. Linux is a registered trademark of Linus Torvalds. UNIX is a registered trademark of The Open Group in the United States and other countries. All other trademarks and copyrights referred to in this announcement are the property of their respective owners.


--------------------------------------------------------------------------------

Press Contacts
Africa
Uwe Thiem
P.P.Box 30955
Windhoek
Namibia
Phone: +264 - 61 - 24 92 49
info-africa kde.org
Asia
Sirtaj S. Kang
C-324 Defence Colony
New Delhi
India 110024
Phone: +91-981807-8372
info-asia kde.org  
Europe
Matthias Kalle Dalheimer
Rysktorp
S-683 92 Hagfors
Sweden
Phone: +46-563-540023
Fax: +46-563-540028
info-europe kde.org  North America
George Staikos
889 Bay St. #205
Toronto, ON, M5S 3K5
Canada
Phone: (416)-925-4030
info-northamerica kde.org

Oceania
Hamish Rodda
11 Eucalyptus Road
Eltham VIC 3095
Australia
Phone: (+61)402 346684
info-oceania kde.org
South America
Helio Chissini de Castro
R. José de Alencar 120, apto 1906
Curitiba, PR 80050-240
Brazil
Phone: +55(41)262-0782 / +55(41)360-2670
info-southamerica kde.org
收藏: QQ书签 del.icio.us 订阅: Google 抓虾

kalman's filter

Jan 发表于 2005-03-17 14:10:09

http://www.vchelp.net/cndevforum/subject_view.asp?subject_id=121383

来这里几个月,发现有些问题很多人都很感兴趣。所以在这里希望能尽自己能力跟大家讨论一些力所能及的算法。现在先讨论一下卡尔曼滤波器,如果时间和能力允许,我还希望能够写写其他的算法,例如遗传算法,傅立叶变换,数字滤波,神经网络,图像处理等等。
因为这里不能写复杂的数学公式,所以也只能形象的描述。希望如果哪位是这方面的专家,欢迎讨论更正。


卡尔曼滤波器 - Kalman Filter

1.    什么是卡尔曼滤波器
(What is the Kalman Filter?)

在学习卡尔曼滤波器之前,首先看看为什么叫"卡尔曼"。跟其他著名的理论(例如傅立叶变换,泰勒级数等等)一样,卡尔曼也是一个人的名字,而跟他们不同的是,他是个现代人!

卡尔曼全名Rudolf Emil Kalman,匈牙利数学家,1930年出生于匈牙利首都布达佩斯。1953,1954年于麻省理工学院分别获得电机工程学士及硕士学位。1957年于哥伦比亚大学获得博士学位。我们现在要学习的卡尔曼滤波器,正是源于他的博士论文和1960年发表的论文《A New Approach to Linear Filtering and Prediction Problems》(线性滤波与预测问题的新方法)。如果对这编论文有兴趣,可以到这里的地址下载: http://www.cs.unc.edu/~welch/media/pdf/Kalman1960.pdf。

简单来说,卡尔曼滤波器是一个"optimal recursive data processing algorithm(最优化自回归数据处理算法)"。对于解决很大部分的问题,他是最优,效率最高甚至是最有用的。他的广泛应用已经超过30年,包括机器人导航,控制,传感器数据融合甚至在军事方面的雷达系统以及导弹追踪等等。近年来更被应用于计算机图像处理,例如头脸识别,图像分割,图像边缘检测等等。

2.卡尔曼滤波器的介绍
(Introduction to the Kalman Filter)

为了可以更加容易的理解卡尔曼滤波器,这里会应用形象的描述方法来讲解,而不是像大多数参考书那样罗列一大堆的数学公式和数学符号。但是,他的5条公式是其核心内容。结合现代的计算机,其实卡尔曼的程序相当的简单,只要你理解了他的那5条公式。

在介绍他的5条公式之前,先让我们来根据下面的例子一步一步的探索。

假设我们要研究的对象是一个房间的温度。根据你的经验判断,这个房间的温度是恒定的,也就是下一分钟的温度等于现在这一分钟的温度(假设我们用一分钟来做时间单位)。假设你对你的经验不是100%的相信,可能会有上下偏差几度。我们把这些偏差看成是高斯白噪声(White Gaussian Noise),也就是这些偏差跟前后时间是没有关系的而且符合高斯分配(Gaussian Distribution)。另外,我们在房间里放一个温度计,但是这个温度计也不准确的,测量值会比实际值偏差。我们也把这些偏差看成是高斯白噪声。

好了,现在对于某一分钟我们有两个有关于该房间的温度值:你根据经验的预测值(系统的预测值)和温度计的值(测量值)。下面我们要用这两个值结合他们各自的噪声来估算出房间的实际温度值。

假如我们要估算k时刻的是实际温度值。首先你要根据k-1时刻的温度值,来预测k时刻的温度。因为你相信温度是恒定的,所以你会得到k时刻的温度预测值是跟k-1时刻一样的,假设是23度,同时该值的高斯噪声的偏差是5度(5是这样得到的:如果k-1时刻估算出的最优温度值的偏差是3,你对自己预测的不确定度是4度,他们平方相加再开方,就是5)。然后,你从温度计那里得到了k时刻的温度值,假设是25度,同时该值的偏差是4度。

由于我们用于估算k时刻的实际温度有两个温度值,分别是23度和25度。究竟实际温度是多少呢?相信自己还是相信温度计呢?究竟相信谁多一点,我们可以用他们的covariance来判断。因为Kg^2=5^2/(5^2+4^2),所以Kg=0.78,我们可以估算出k时刻的实际温度值是:23+0.78*(25-23)=24.56度。可以看出,因为温度计的covariance比较小(比较相信温度计),所以估算出的最优温度值偏向温度计的值。

现在我们已经得到k时刻的最优温度值了,下一步就是要进入k+1时刻,进行新的最优估算。到现在为止,好像还没看到什么自回归的东西出现。对了,在进入k+1时刻之前,我们还要算出k时刻那个最优值(24.56度)的偏差。算法如下:((1-Kg)*5^2)^0.5=2.35。这里的5就是上面的k时刻你预测的那个23度温度值的偏差,得出的2.35就是进入k+1时刻以后k时刻估算出的最优温度值的偏差(对应于上面的3)。

就是这样,卡尔曼滤波器就不断的把covariance递归,从而估算出最优的温度值。他运行的很快,而且它只保留了上一时刻的covariance。上面的Kg,就是卡尔曼增益(Kalman Gain)。他可以随不同的时刻而改变他自己的值,是不是很神奇!

下面就要言归正传,讨论真正工程系统上的卡尔曼。

3.    卡尔曼滤波器算法
(The Kalman Filter Algorithm)

在这一部分,我们就来描述源于Dr Kalman 的卡尔曼滤波器。下面的描述,会涉及一些基本的概念知识,包括概率(Probability),随即变量(Random Variable),高斯或正态分配(Gaussian Distribution)还有State-space Model等等。但对于卡尔曼滤波器的详细证明,这里不能一一描述。

首先,我们先要引入一个离散控制过程的系统。该系统可用一个线性随机微分方程(Linear Stochastic Difference equation)来描述:
X(k)=A X(k-1)+B U(k)+W(k)
再加上系统的测量值:
Z(k)=H X(k)+V(k)
上两式子中,X(k)是k时刻的系统状态,U(k)是k时刻对系统的控制量。A和B是系统参数,对于多模型系统,他们为矩阵。Z(k)是k时刻的测量值,H是测量系统的参数,对于多测量系统,H为矩阵。W(k)和V(k)分别表示过程和测量的噪声。他们被假设成高斯白噪声(White Gaussian Noise),他们的covariance 分别是Q,R(这里我们假设他们不随系统状态变化而变化)。

对于满足上面的条件(线性随机微分系统,过程和测量都是高斯白噪声),卡尔曼滤波器是最优的信息处理器。下面我们来用他们结合他们的covariances 来估算系统的最优化输出(类似上一节那个温度的例子)。

首先我们要利用系统的过程模型,来预测下一状态的系统。假设现在的系统状态是k,根据系统的模型,可以基于系统的上一状态而预测出现在状态:
X(k|k-1)=A X(k-1|k-1)+B U(k) ........... (1)
式(1)中,X(k|k-1)是利用上一状态预测的结果,X(k-1|k-1)是上一状态最优的结果,U(k)为现在状态的控制量,如果没有控制量,它可以为0。

到现在为止,我们的系统结果已经更新了,可是,对应于X(k|k-1)的covariance还没更新。我们用P表示covariance:
P(k|k-1)=A P(k-1|k-1) A'+Q ......... (2)
式(2)中,P(k|k-1)是X(k|k-1)对应的covariance,P(k-1|k-1)是X(k-1|k-1)对应的covariance,A'表示A的转置矩阵,Q是系统过程的covariance。式子1,2就是卡尔曼滤波器5个公式当中的前两个,也就是对系统的预测。

现在我们有了现在状态的预测结果,然后我们再收集现在状态的测量值。结合预测值和测量值,我们可以得到现在状态(k)的最优化估算值X(k|k):
X(k|k)= X(k|k-1)+Kg(k) (Z(k)-H X(k|k-1)) ......... (3)
其中Kg为卡尔曼增益(Kalman Gain):
Kg(k)= P(k|k-1) H' / (H P(k|k-1) H' + R) ......... (4)

到现在为止,我们已经得到了k状态下最优的估算值X(k|k)。但是为了要另卡尔曼滤波器不断的运行下去直到系统过程结束,我们还要更新k状态下X(k|k)的covariance:
P(k|k)=(I-Kg(k) H)P(k|k-1) ......... (5)
其中I 为1的矩阵,对于单模型单测量,I=1。当系统进入k+1状态时,P(k|k)就是式子(2)的P(k-1|k-1)。这样,算法就可以自回归的运算下去。

卡尔曼滤波器的原理基本描述了,式子1,2,3,4和5就是他的5 个基本公式。根据这5个公式,可以很容易的实现计算机的程序。

下面,我会用程序举一个实际运行的例子。。。
4.    简单例子
(A Simple Example)

这里我们结合第二第三节,举一个非常简单的例子来说明卡尔曼滤波器的工作过程。所举的例子是进一步描述第二节的例子,而且还会配以程序模拟结果。

根据第二节的描述,把房间看成一个系统,然后对这个系统建模。当然,我们见的模型不需要非常地精确。我们所知道的这个房间的温度是跟前一时刻的温度相同的,所以A=1。没有控制量,所以U(k)=0。因此得出:
X(k|k-1)=X(k-1|k-1) ........... (6)
式子(2)可以改成:
P(k|k-1)=P(k-1|k-1) +Q ......... (7)

因为测量的值是温度计的,跟温度直接对应,所以H=1。式子3,4,5可以改成以下:
X(k|k)= X(k|k-1)+Kg(k) (Z(k)-X(k|k-1)) ......... (8)
Kg(k)= P(k|k-1) / (P(k|k-1) + R) ......... (9)
P(k|k)=(1-Kg(k))P(k|k-1) ......... (10)

现在我们模拟一组测量值作为输入。假设房间的真实温度为25度,我模拟了200个测量值,这些测量值的平均值为25度,但是加入了标准偏差为几度的高斯白噪声(在图中为蓝线)。

为了令卡尔曼滤波器开始工作,我们需要告诉卡尔曼两个零时刻的初始值,是X(0|0)和P(0|0)。他们的值不用太在意,随便给一个就可以了,因为随着卡尔曼的工作,X会逐渐的收敛。但是对于P,一般不要取0,因为这样可能会令卡尔曼完全相信你给定的X(0|0)是系统最优的,从而使算法不能收敛。我选了X(0|0)=1度,P(0|0)=10。

该系统的真实温度为25度,图中用黑线表示。图中红线是卡尔曼滤波器输出的最优化结果(该结果在算法中设置了Q=1e-6,R=1e-1)。
收藏: QQ书签 del.icio.us 订阅: Google 抓虾

Torsmo [*]

Jan 发表于 2005-03-15 13:07:20

写完了感觉意犹未尽,加一个外传, 不喜欢eye-candy的geeks不用看了...

desktop applets是一个很重要的东西,至少在衡量一个wm或者enviorment的时候经常被用
来作为feature之一列出来(blackbox的新版本似乎因为没有这个而受到诘难?)。基本上主
流的wm都有自己独特的applets来满足各自fans的要求。我想从我的感受来说说各自的区别
。总分6颗*

Gnome: Gdesklets
依赖的库太多,第一次装的时候估计会用到很多东西,gnome/xfce的用户可以考虑,其它
的还是免了。它的sensor/display模式也常常让新手感到无从下手,比较郁闷。优点在于
资源丰富,以gdesklets.gnomedesktop.org为依托,拥有强大的社区支持。所用到的脚本
基本上是python写的,所以会比较慢(不过我也不知道perl和python的速度有多少区别)。
有很多外观漂亮的applet可供选择。最近的版本增加了GUI的配置中心,比以前的纯命令
行版本好用了不少,启动以后可以最小化到托盘。

定制性: ***
外观:   *****
速度:   **
易用性: ****

KDE: Karamba/Superkaramba
依赖的库似乎比gdesklets少一点 Superkaramba是Karamba的一个前端,如果要用的话
建议用这个。对于KDE的用户来说这是个比较好的选择。Karamba同样资源丰富,在
kde-look.org上拥有强大的支持, 它所采用的.theme/script模式也要比gdesklets简单
不少,至少对于新手会亲近许多。.theme用来控制基本外观,script用来提取/处理/显示
信息。大部分script也是用python来写的。整体来说karamba似乎比gdesklets快一点。

定制性: ***
外观:   *****
速度:   ***
易用性: *****

WindowMaker : Docklet?
可用资源还是比较丰富的, 但是远不如前两位。界面还是可以接受的,但是远不如前两位
优点是速度和与WindowMaker的完美配合。底层用的似乎不是脚本语言,不过我没有用过多
久的windowmaker, 所以也无法提供更多的信息。但是从网站上提供的资源来看,功能主要
限制在简单的系统信息显示上。

定制性: **
外观:   ****
速度:   ****
易用性: ****

Enlightenment: Epplet/???
epplets和docklets感觉非常相似,无论从外观功能还是速度上来说都是半斤八两。一定要
分个高下的话还是docklets功能强大一些。但是我想说的是epplet绝对不是enlightment
上的最佳选择... e17的工程过半,网站上也早就放出来许多新东西。e17在视觉效果上的
功力绝对是无人能及,而依托于???(不好意思寝室不能上外网,想不起来那个库的名字了)
的新一代epplets(暂且允许我这样叫吧)也是让人期待。官方网站上放出了两个: erss和
engage.erss是用来阅读rss新闻的, 文字渲染效果真是无与伦比,人见人爱。engage是一
个模拟OS X dockbar的东西,是我见过的最好的模拟软件(甚至支持openGL渲染...,
gdesklets和karamba上的模拟就差太多了)
但是配置也是我见过的软件里面最繁琐的。总之,请期待e17给我们带来更多惊喜吧

[最值得期待新人奖]
定制性: *
外观:   ******
速度:   ****
易用性: *

???: gkrellm
gkrellm是独立于任何wm的。感觉上和docklets有几分相似,但是出了运行速度之外没有其
他任何长处... 也许易用性能勉强算一个吧,毕竟只要一条命令就可以启动了

定制性: *
外观:   ***
速度:   ****
易用性: ****

torsmo:
地球上最轻捷快速的applet了,因为它是用c写的,用的也只是X的库而没有其他任何乱七
八糟的依赖关系。这也使得torsmo是唯一一个不会覆盖桌面的applet.(你可以试着在
torsmo上面单击鼠标右键,桌面菜单依然会弹出来.)配置文件中有许多注释,即使是新手也

迅速掌握。内嵌的指令非常灵活,也可以和各种脚本配合,充分降低学习成本。外观没有太
多自由度,属于简洁的那一种,当然高手也可以通过纯色块的搭配来营造出炫目的效果。

定制性: ******
外观:   ****
速度:   *****
易用性: ****
收藏: QQ书签 del.icio.us 订阅: Google 抓虾

Automate Perl Module Deployment

Jan 发表于 2005-03-14 17:54:29

Perl原来有个这么好用的module, 用来从CPAN上下载module并且编译安装。这篇文章还教你怎么管理一个计算机群来为他们安装perl modules, 即使他们使用的是不同的计算机系统。


Automate Perl module deployment  
 


Scripts go beyond CPAN to ease network installations
Level: Introductory


Martin C. Brown (questions@mcslp.com)
Freelance writer and consultant
08 Mar 2004

If you run Perl across many different computers of any sort, you know how frustrating it can be to install Perl extension modules across those machines. The administrative process is even worse if you have a Web server farm and need to keep each machine up to date with a set suite of extension modules for your installation. CPAN helps, but there are issues with CPAN that make it an unwieldy solution for use on a network. This article provides possible solutions before covering the final system. The main goals are a unified installation/module set, a single download, and a guaranteed unified set of version numbers across all the computers in the network.
Perl module installation
As soon as you install Perl, you start to realize just how many modules make up the "base" installation of the language. As time goes on, you install more and more modules to extend and improve the functionality of your Perl installation. Installing modules is not a difficult process. Most modules are packaged as a simple compressed tarball. The tarball contains the necessary files -- including C/C++ source code to integrate with a third-party library, if necessary.

Most Perl modules use the MakeMaker system -- another Perl module installed with the base Perl installation -- which provides information about the Perl installation as well as a mechanism for building and installing components in the right place. MakeMaker works by translating a simple configuration file into a standard makefile that can be used with the familiar make command.

Using CPAN
If you don't know the Comprehensive Perl Archive Network (CPAN) already, refer to the main page that comes with each installation. CPAN can work in two ways -- either through an interactive shell or through a series of functions that can be used as part of a wider Perl script-based solution. At its simplest, you can use CPAN to install a module simply by typing perl -MCPAN -e "install modulename", where modulename is the name of the package, bundle, or full Perl module you want to install. CPAN will do the rest for you.

Automating CPAN
Most people are familiar with CPAN as an interactive shell for building and installing Perl modules. What many don't realize is that the CPAN module that provides this functionality is actually just a wrapper around an internal application program interface (API). For example, to generate a list of installed modules that are out of date compared with the versions available on CPAN, you can simply call CPAN::Shell->r. Listing 1 provides an example of the command and its output.

Listing 1. Code to generate a list of outdated modules
$ perl -MCPAN -e 'CPAN::Shell->r'CPAN: Storable loaded okGoing to read /export/build/solaris/cpan/Metadata  Database was generated on Sun, 25 Jul 2004 02:10:00 GMTPackage namespace         installed    latest  in CPAN fileB::Assembler                   0.06      0.07  N/NW/NWCLARK/perl-5.8.5.tar.gzCwd                            2.19      2.20  K/KW/KWILLIAMS/Cwd-2.20.tar.gzDBD::mysql                   2.9003    2.9004  R/RU/RUDY/DBD-mysql-2.9004.tar.gzDateTime                     0.2101      0.22  D/DR/DROLSKY/DateTime-0.22.tar.gzDateTime::TimeZone             0.27      0.28  D/DR/DROLSKY/DateTime-TimeZone-0.28.tar.gzFile::Scan                     1.23      1.25  H/HD/HDIAS/File-Scan-1.25.tar.gzFile::Spec                     0.87      0.88  K/KW/KWILLIAMS/File-Spec-0.88.tar.gzImage::Magick                 5.5.7       6.0  J/JC/JCRISTY/PerlMagick-6.02.tar.gzMail::ClamAV                   0.08      0.11  S/SA/SABECK/Mail-ClamAV-0.11.tar.gzModule::CoreList               1.94      1.95  R/RC/RCLAMP/Module-CoreList-1.95.tar.gzPOE                          0.2802      0.29  R/RC/RCAPUTO/POE-0.29.tar.gzXML::RSS::Parser               2.11      2.15  T/TI/TIMA/XML-RSS-Parser-2.15.tar.gzhtmlop                       v0.2.6      0.26  J/JA/JANL/w3mir-1.0.10.tar.gz5 installed modules have a version number of 0890 installed modules have no parseable version number


To install these modules automatically so that you are up to date, embed the call to CPAN::Shell->r in a call to the CPAN::Shell->install function:

$ /usr/local/bin/perl -MCPAN -e 'CPAN::Shell->install(CPAN::Shell->r)'
This code dumps the information you see in Listing 1, then installs each module to bring it up to date.

Automating CPAN across a network
CPAN is an excellent tool, but the system has its limitations. One major drawback is that it's a single-system solution, which is fine if you want to manage your Perl installations on a single-computer basis. But if you have a set of Perl modules spread across your Web server farm or even across your lab on a range of platforms, trying to keep up to date across all the computers can be a time-consuming process -- even if you use the automation techniques I discussed above.

CPAN also consumes a lot of Internet bandwidth in that for each computer on which you use CPAN, CPAN expects to download a copy of the files from one of the central CPAN repositories. CPAN also relies on a configuration that has to be tailored to each computer: You can copy a configuration file, which resides in /perlinstalldirectory/CPAN/Config.pm, only if you can configure your platforms identically.

An obvious route to take when using CPAN is to use the autobundle function. This function generates a list of every installed module in a Perl installation, then dumps the list into a format that you can execute to re-install the selection either on the same computer (after an update to the latest Perl version) or onto another computer. The code in Listing 2 shows you how to create a new bundle.

Listing 2. Code to create a CPAN autobundle
$ perl -MCPAN -e autobundle...Package namespace         installed    latest  in CPAN fileAnyDBM_File                    1.00      1.00  N/NW/NWCLARK/perl-5.8.5.tar.gzApache::ASP                    2.57      2.57  C/CH/CHAMAS/Apache-ASP-2.57.tar.gzApache::ASP::ApacheCommon     undef     undef  C/CH/CHAMAS/Apache-ASP-2.57.tar.gzApache::ASP::Application      undef     undef  C/CH/CHAMAS/Apache-ASP-2.57.tar.gzApache::ASP::CGI              undef     undef  C/CH/CHAMAS/Apache-ASP-2.57.tar.gzApache::ASP::CGI::Table       undef     undef  C/CH/CHAMAS/Apache-ASP-2.57.tar.gzApache::ASP::CGI::Test        undef     undef  C/CH/CHAMAS/Apache-ASP-2.57.tar.gzApache::ASP::Collection       undef     undef  C/CH/CHAMAS/Apache-ASP-2.57.tar.gzApache::ASP::CollectionItem     undef     undef  C/CH/CHAMAS/Apache-ASP-2.57.tar.gzApache::ASP:ate             undef     undef  C/CH/CHAMAS/Apache-ASP-2.57.tar.gz...Wrote bundle file /export/build/solaris/cpan/Bundle/Snapshot_2004_08_08_00.pm


The file that is generated is created within your CPAN installation directory. You can copy it from that location or, if you're upgrading to a later version of Perl, you can simply run the bundle module to re-install everything:

$ perl -MCPAN -e 'install Bundle::Snapshot_2004_08_08_00'
Although the bundle function works fine, I have to admit that I'm not a huge fan of the bundling system as a network solution for a few reasons. First, bundling relies on having an identical configuration on each computer, which is fine if everything is identical. But if you have different platforms and environments, you can easily run into problems. Second, because the autobundle feature lists every module installed, it lists multiple packages (individual packages may contain multiple modules). However, the feature can also list references to later versions of Perl (as the source for some module updates).

The final problem, however, is that bundling relies on having a single computer responsible for containing the latest version of all the modules. You can't use the feature to upgrade a standard suite up to the latest versions -- whatever they may be -- and this stipulation makes the system complex to use in a network environment.

if you want to build a custom solution, two are available. You can use a central CPAN installation directory, or you can use a central CPAN source directory.

Use a central CPAN installation directory
A relatively straightforward way of configuring CPAN across a network -- and one that works well if all your computers are identical -- is to create a single CPAN directory that is shared over Network File System (NFS), copy the CPAN/Config.pm file onto each computer, then use the CPAN::Shell techniques discussed earlier to install the modules on each computer. You install the "base" module set on the main computer (usually the one sharing the CPAN directory over NFS). For every other computer, the process of building and installing each required module should be quick, because the source tarballs already exist. Therefore, you don't need to download the tarball again, saving precious Internet bandwidth and significant time.

The main problem with this technique is that for computers that are in all other ways identical, it's wasteful on processor time: You've already compiled it once, and it's wasteful to compile it all again. You also run into a dangerous situation in which the same build directory is being used for multiple computers, which really isn't a good idea because different computers could be compiling the source at the same time, causing a combination of timing errors and, in a cross-platform environment, bad object files when linking.

Use a central CPAN source directory
An adaptation of the previous solution is to use the same source directory and basic CPAN configuration but manually change the configuration file so that the bulk of the configuration information for each host is host-specific. In this way, you solve the build directory problem but still use a local (that is, on your network) cached version of the tarballs. Listing 3 provides such a configuration file.

Listing 3. Example of a CPAN::Config file
# This is CPAN.pm's systemwide configuration file. This file provides# defaults for users, and the values can be changed in a per-user# configuration file. The user-config file is being looked for as# ~/.cpan/CPAN/MyConfig.pm.$CPAN::Config = {  'build_cache' => q[200],  'build_dir' => q[/export/build/solaris/cpan/build],  'cache_metadata' => q[1],  'cpan_home' => q[/export/build/solaris/cpan],  'dontload_hash' => {  },  'ftp' => q[/usr/bin/ftp],  'ftp_proxy' => q[proxy.mcslp.pri:8080],  'getcwd' => q[cwd],  'gpg' => q[],  'gzip' => q[/usr/bin/gzip],  'histfile' => q[/export/build/solaris/cpan/histfile],  'histsize' => q[100],  'http_proxy' => q[proxy.mcslp.pri:8080],  'inactivity_timeout' => q[0],  'index_expire' => q[1],  'inhibit_startup_message' => q[0],  'keep_source_where' => q[/export/build/solaris/cpan/sources],  'lynx' => q[],  'make' => q[/usr/local/bin/make],  'make_arg' => q[-j3],  'make_install_arg' => q[UNINST=1],  'makepl_arg' => q[],  'ncftp' => q[],  'ncftpget' => q[],  'no_proxy' => q[],  'pager' => q[/usr/bin/less],  'prerequisites_policy' => q[follow],  'scan_cache' => q[atstart],  'shell' => q[/usr/local/bin/bash],  'tar' => q[/usr/local/bin/tar],  'term_is_latin' => q[1],  'unzip' => q[/usr/bin/unzip],  'urllist' => [q[ftp://cpan.etla.org/pub/CPAN], q[ftp://cpan.teleglobe.net/pub/CPAN],    q[ftp://ftp.demon.co.uk/pub/CPAN/], q[ftp://ftp.flirble.org/pub/languages/perl/CPAN/],    q[ftp://ftp.mirror.ac.uk/sites/ftp.funet.fi/pub/languages/perl/CPAN/],    q[ftp://ftp.mirror.anlx.net/CPAN/], q[ftp://ftp.plig.org/pub/CPAN/],    q[ftp://usit.shef.ac.uk/pub/packages/CPAN/], q[http://cpan.hambule.co.uk/]],  'wget' => q[],};1; __END__


You'll need to change all the configuration directory parameters to something local on each computer -- for example, change the line 'build_dir' => q[/export/build/solaris/cpan/build], to point to a directory on the local machine. Meanwhile, share the CPAN source directory on your main computer, then change the keep_source_where parameter to point to this NFS-mounted directory.

Unfortunately, a few issues remain with this solution. First, you have no way of conveniently recording which modules you want to install on each computer. You also run into the problem of keeping the information in the source directory (and the rest of the CPAN directories) correct and current without updating or downloading a newer version of the tarball and upsetting the status quo among computers. This issue can lead to minor but nearly fatal differences between the installed versions of the modules on each system, which is the key issue that we are trying to resolve.

Use CPAN to create a rigid installation
The problem with both of the previous solutions is that they rely on using CPAN and some manipulation of the configuration file to get CPAN to do the work. CPAN is not an ideal solution within a local area network (LAN), even with the above tricks. Therefore, you need to bypass those system limitations. To do so, I'll show you how to configure the master distribution, create an installation set for each platform, and then run the installation on each computer.

Configure the master distribution
For this first step, you're going to use some of the elements we've already covered. Begin by configuring one computer to use CPAN as normal and setting up your default set of modules. Next, use NFS to set up a shared directory that you'll use to distribute the necessary files to the other computers in the network. Now, edit the $destdir variable you see in Listing 4, then run the Listing 4 script. This script does three things:

Identifies the modules
Downloads the source files
Copies the source files to the distribution directory
The first stage determines the list of installed modules by examining the content of the perllocal.pod file. This file is updated each time a module is installed using the MakeMaker system. By using this file rather than the built-in modules in CPAN, you get a list of third-party modules installed with your base Perl installation. The second stage uses CPAN to download the source tarball by whatever methods are configured within CPAN itself before finally copying the tarball or .zip file. As part of that process, you also create a list of the modules that were copied, which you'll use when you install the files on the other computers.

Listing 4. Code to create a base distribution
use CPAN;use Config;use File::Copy;use File::Spec::Functions;# Set up the directories to store the module packagesmy $basedestdir = catfile('export','cpaninst');mkdir($basedestdir);my $destdir = catfile($basedestdir,'srcs');mkdir($destdir);# Extract a list of the third party modules installed on this machinemy $files = {};my $podfile = catfile($Config{'archlibexp'},'perllocal.pod');open(DATA,$podfile) or die "Can't open module list ($podfile): $!";while(){    if (m/.*C L<(.*)>/)    {        my ($module) = split /\|/,,0;        my $mod = expand('Module',$module);        next unless $mod;        $mod->get(); #Make sure to download the version again, in case we no                        #longer have it locally        $files->{$mod->{RO}->{CPAN_FILE}} = 1; #Save the location of the file    }}close(DATA);# Now copy each source installer to the source destination directory# We save a copy of the module file, for reference, as part of the processmy $modulelist = catfile($basedestdir,'modules.lst');open(DATA,">$modulelist") or die "Can't open the module list file ($modulelist): $!";foreach my $file (keys %{$files}){    my $src = catfile($CPAN::Config->{'keep_source_where'},$file);    my ($vol,$path,$filename) = splitpath($file);    my $dest = catfile($destdir,$filename);    copy($src,$dest) or warn "Copy of $src failed: $!\n";    print DATA "$filename\n";}close(DATA);


You now have a directory containing all the source installation packages that you can use to build a suite of ready-compiled distributions for each platform to which you need to distribute the corresponding Perl module. How you proceed from there will depend on your environment. If you have a homogeneous environment, you need to perform the next stage just once for your entire network. If, however, you have a heterogeneous network with a variety of different platforms, you'll need to repeat the next step for each different environment.

Create an installation set for each platform
For each platform, you need to extract the source file, run MakeMaker, then run the installer. To perform this task automatically, use the script in Listing 5. Unfortunately, not all MakeMaker installations are completely automatic, so you'll need to follow the interactive systems -- for example, to set directory locations or default options -- each time you build the distribution.

Listing 5. Code to build the modules on each platform
srcdir="/export/cpan"srcfile="$srcdir/module.lst"platformdir="/export/cpan/solaris-x86"for file in `cat $srcfile`  do    cd $platformdir    tar zxf $srcdir/$file    dir=`echo $file|sed -e "s/\.tar\.gz//g"`    cd $dir    perl Makefile.PL    makedone


Run the installation on each computer
When the script in Listing 5 has run, you'll have a single directory that contains all the "ready-to-install" modules for a given platform. To install these modules on any other computer using the same platform, simply change into each directory and run make install. Again, you can use a script such as the one in Listing 6 for this process.

Listing 6. Code to install the files on each host
srcdir="/export/cpan"srcfile="$srcdir/module.lst"platformdir="/export/cpan/solaris-x86"for file in `cat $srcfile`  do    cd $platformdir    tar zxf $srcdir/$file    dir=`echo $file|sed -e "s/\.tar\.gz//g"`    cd $dir    make installdone


Conclusions
Despite the functionality provided by Perl, CPAN, and the MakeMaker system, you can't completely automate the installation and distribution of Perl modules. But you can make the process simpler across a range of computers. Individual modules have their own configurations, and individual platforms have their own nuances making them more complex than they need to be. By using the scripts in this article, you can eliminate much of the hardship while reducing the time overhead that might normally be associated with the process.

Not all issues are covered by this solution. For example, third-party modules often make use of third-party libraries that are not installed using this method. See my other developerWorks articles for help here.

Resources

"Automate your build and distribution process" (developerWorks, September 2004) shows you how to simplify the installation of any open-source software project.


If you're interested in squeezing more performance from your Perl code, read "Optimize Perl" (developerWorks, October 2004).


Perl has long been an important scripting tool for Linux developers, and developerWorks has an extensive collection of Perl articles to pick from.


Comprehensive Perl Archive Network is the home of the CPAN network system.


Find more resources for Linux developers in the developerWorks Linux zone.


Get involved in the developerWorks community by participating in developerWorks blogs.


Purchase Linux books at discounted prices in the Linux section of the Developer Bookstore.


Order the no-charge SEK for Linux, a two-DVD set containing the latest IBM trial software for Linux from DB2&reg;, Lotus&reg;, Rational&reg;, Tivoli&reg;, and WebSphere&reg;.


Innovate your next Linux development project with IBM trial software, available for download directly from developerWorks.

About the author
Martin C. Brown is a former IT Director with experience in cross-platform integration. A keen developer, he has produced dynamic sites for blue-chip customers, including HP and Oracle, and is the Technical Director of Foodware.net. Now a freelance writer and consultant, MC (as he is better known) works closely with Microsoft as an SME, is the LAMP Technologies Editor for LinuxWorld magazine, is a core member of the AnswerSquad.com team, and has written several books on topics as diverse as Microsoft certification, iMacs, and open source programming. Despite his best attempts, he remains a regular and voracious programmer on many platforms and numerous environments. Contact MC at questions@mcslp.com or through his Web site.

收藏: QQ书签 del.icio.us 订阅: Google 抓虾

Torsmo [IV]

Jan 发表于 2005-03-14 12:49:20

我用到的脚本都贴完了,下面说说怎么让这些东西和torsmo配合起来。

gmail.pl/forecast.sh/bloglines.sh这三个脚本是用来从网站上获取信息的。我把它们
放在crontab里面:

# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.XXXXYMA4TZ installed on Tue Mar  8 01:04:34 2005)
# (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp $)
SHELL=/bin/bash
MAILTO=XXX

21 * * * * $HOME/.torsmo/forecast.sh
0-59/4 * * * * $HOME/.torsmo/gmail.pl
0-59/5 * * * * $HOME/.torsmo/bloglines.sh

这样每隔一段时间我们的linux就会自动从相应的网站读取信息, 并且保存在.torsmo文件
夹中相应的文件中(参考脚本内容)。

得到了信息以后就需要处理了,torsmo是无法利用这些原始信息的。gmail_extract.pl/
bloglines.pl/forecast.pl就是用来处理信息的。下面是我的.torsmorc里面的相关部分:

GMAIL:
$stippled_hr
${color grey}Status      : $color${execi 300 perl ~/.torsmo/gmail_extract.pl
status}
${color grey}Messages    : $color${execi 300 perl ~/.torsmo/gmail_extract.pl
totalmessages}
${color grey}New         : $color${execi 300 perl ~/.torsmo/gmail_extract.pl
newmessages}

$color${execi 300 perl ~/.torsmo/gmail_extract.pl newsubjects}

Bloglines:
$stippled_hr
${color grey}Updated time: $color${execi 420 perl ~/.torsmo/bloglines.pl time}

$color${execi 420 perl ~/.torsmo/bloglines.pl news}

FORECAST:
$stippled_hr
${color grey}Updated     : $color${execi 1685 perl ~/.torsmo/forecast.pl
updated}
${color grey}Location    : $color${execi 1690 perl ~/.torsmo/forecast.pl dnam}
${color grey}Sunrise     : $color${execi 1695 perl ~/.torsmo/forecast.pl sunr}
${color grey}Sunset      : $color${execi 1700 perl ~/.torsmo/forecast.pl suns}
${color grey}Day         : $color${execi 1705 perl ~/.torsmo/forecast.pl 0 t}
${color grey}High        : $color${execi 1710 perl ~/.torsmo/forecast.pl 0 hi} C
${color grey}Low         : $color${execi 1715 perl ~/.torsmo/forecast.pl 0 low}
C
${color grey}Day Cond.   : $color${execi 1720 perl ~/.torsmo/forecast.pl 0
condday}
${color grey}Night Cond. : $color${execi 1725 perl ~/.torsmo/forecast.pl 0
condnight}

${color grey}Day         : $color${execi 1730 perl ~/.torsmo/forecast.pl 1 t}
${color grey}Temp.(H/L)  : $color${execi 1735 perl ~/.torsmo/forecast.pl 1 hi}C
/ $color${execi 1740 perl ~/.torsmo/forecast.pl 1 low}C
${color grey}Cond.(D/N)  : $color${execi 1745 perl ~/.torsmo/forecast.pl 1
condday}/$color${execi 1750 perl ~/.torsmo/forecast.pl 1 condnight}

${color grey}Day         : $color${execi 1755 perl ~/.torsmo/forecast.pl 2 t}
${color grey}Temp.(H/L)  : $color${execi 1760 perl ~/.torsmo/forecast.pl 2 hi}C
/ $color${execi 1765 perl ~/.torsmo/forecast.pl 2 low}C
${color grey}Cond.(D/N)  : $color${execi 1770 perl ~/.torsmo/forecast.pl 2
condday}/$color${execi 1775 perl ~/.torsmo/forecast.pl 2 condnight}

${color grey}Day         : $color${execi 1780 perl ~/.torsmo/forecast.pl 3 t}
${color grey}Temp.(H/L)  : $color${execi 1785 perl ~/.torsmo/forecast.pl 3 hi}C
/ $color${execi 1790 perl ~/.torsmo/forecast.pl 3 low}C
${color grey}Cond.(D/N)  : $color${execi 1795 perl ~/.torsmo/forecast.pl 3
condday}/$color${execi 1800 perl ~/.torsmo/forecast.pl 3 condnight}

具体的我就不解释了,参考torsmo的文档吧

如果有自己的特殊需要,可以参考这个模式来满足。我归纳如下:
1. 确定需求
2. 查阅网站的API(或者其它接口)
3. 编写获取信息的脚本
4. 编写处理信息的脚本
5. 交给torsmo调用
关键词(Tag): gentoo
收藏: QQ书签 del.icio.us 订阅: Google 抓虾

Amarok 1.2.x

Jan 发表于 2005-03-14 12:35:24

amarok 1.2发布以来我就抛弃了bmp和xmms, 它是迄今为止linux下最漂亮的一款音乐播放器,同时也有很好的中文tag支持,并且可以在播放的时候最小化到托盘。它的JukeBox也做得非常得好。今天看到有位同志还发表了长篇来论证amarok好在何处,blog于此.



AmaroK is a step up for Linux audio players
Friday March 11, 2005 (03:01 PM GMT)
By: Michael Mitton
With the release of amaroK 1.2 last month, I finally found the Linux music player I've been wanting. When I moved to Linux full-time about two years ago, the only software that I missed from Windows was a quality audio player. Linux audio players lacked features like cover downloads, smart playlists, or easy burning to CD. Even worse, with a large collection of more than 10,000 tracks, the Linux players generally locked up when I tried to load them all, or at least slowed to an unbearable crawl. AmaroK has all of the basic features of modern Windows audio players, and some features that I haven't seen in any other player.


The name "amaroK" was taken from an album by composer Mike Oldfield. Developer Mark Kretschmann said, "I've been a long-time fan of Mr. Oldfield's work and thought the name sounded nice, so I chose it for the application." Of course, it doesn't hurt that the name already has a "K" in it. The word means "wolf" in Inuit, which explains the various amaroK logos.

The keystone of any audio player is the database it keeps of your collection. AmaroK allows you to create file trees using artist, album, year, or genre in any order. So to find, say, all the albums that were released in a particular year, sort by year first and then by album, and a file tree opens that lists all the years in the first level, and all the albums in the second. There's also a simple search filter to find something particular. I have four different versions of The Left Banke's "Walk Away Renee," and I can quickly find them all by typing that song title in the search box. The ability to structure the file tree in a number of different ways and to search it easily is amaroK's single most important usability feature.

AmaroK's interface is split into two different panes. The right pane always holds the current playlist along with the standard player controls. This is also the easiest place to batch edit ID3v1 tags, which contain information like artist and album and are embedded within the music file. If an album by Ken Stringfellow has been mis-tagged as being by Kevin Stringfellow, simply select all the tracks from the album, right-click, choose to edit the meta-information, and then enter in the correct name. The information for all the tracks is immediately updated.

The left pane of amaroK has five different "browsers." One is the display of your collection database. Another, Media Device, is a tool to transfer music to an iPod. As I don't have an iPod, I couldn't test this feature, but there didn't seem to be any serious complaints on the amaroK forums. A third browser is a utility to search files and play and rip CDs.

While listening to music, the most important browser is Context, which is where amaroK displays information about the current track. There are three tabs within the Context browser. The home tab lists a few favorite, newest, and least played tracks. With a large collection, these lists never seem interesting, but they're there if you like them. The second tab displays information on the current track, including the cover image, and the other albums by the current artist. Though this tab includes a link to the Musicbrainz entry for the current song, I'd be happier if it could link to a Web site with more information, like the All Music Guide.

The final tab in the Context browser fetches lyrics of the current song from lyrc.com.ar. Lyrics are only available for the current song, and due to licensing restrictions, they can't be stored locally. It's hard to tell how successful amaroK is at finding lyrics, but in my collection, it seems to find lyrics for about a quarter of my songs. That ratio should improve over time if lazy people like me actually submit some lyrics to that site once in a while. Still, amaroK's developers should give it the capability to search more than one lyric site.

The fifth and final browser holds the playlists. In addition to manually constructing playlists, amaroK includes smart-playlists, like "Favorite Tracks," "Never Played," or "100 Random Tracks." It's also easy to create your own smart-playlists based on a number of criteria, such as year, album, and the last date a track was modified. For example, it took me 30 seconds to create a playlist that included all albums I added to my collection in 2005, but are not albums published in 2005.

Finally, amaroK is integrated with K3b, which makes it dead simple to burn any playlist to CD. Right-clicking gives you the option to burn, as either data or audio, selected tracks from a playlist, an album, or a particular artist. The tracks are exported straight into K3b, ready to burn.

The innovations

One interesting innovation with amaroK is that, using the Desktop Communication Protocol (DCOP) for KDE, you can easily incorporate scripts from most languages, including Python, Ruby, and PHP. These scripts add functionality to amaroK in much the same way that extensions add functionality to Mozilla. At the moment there aren't many scripts available, but among the few existing scripts are ones to turn amaroK into an alarm clock, create and upload HTML pages of what you've played, and use text-to-speech to announce track changes. More scripts are planned.

AmaroK is also the first player, on any platform, to include integrated support for Audioscrobbler. After signing up at the Audioscrobbler site, if you enable the feature, amaroK will upload to Audioscrobbler the tracks that you play. Then, at the Audioscrobbler site, it will search for other users who share your tastes. By looking at what your musical "neighbors" are playing, Audioscrobbler can recommend new music to you. I don't know if this is all that helpful for people with mainstream musical tastes, but for those with esoteric tastes, it can be an excellent way to discover new music.

Two final points worth noting: First, amaroK can be configured to use MySQL for its collection database. This simplifies things for anyone who needs access to the database in different settings. Second, the developers have finished a LiveCD that shows off amaroK. A copy of the LiveCD should convince Windows users that Linux has high-quality audio players.

Conclusions

There is very little to complain about with amaroK. Since I started using the final version of 1.2 about two weeks ago, it has crashed on me only once. That's fewer crashes than any of the Windows players I used. It has everything I've come to expect from a modern audio player, and I can think of only a few minor features it's missing, including support for portable devices besides the iPod and the ability to print playlists.

The amaroK developers should be proud of their work -- but they aren't content. Version 1.2.1, released on February 27, fixes a couple of bugs and adds some minor features. And the developer blogs are already looking forward to the 1.3 release. I'll be looking forward to it, too.
收藏: QQ书签 del.icio.us 订阅: Google 抓虾

KDE on the Fray of User-Developer Interaction

Jan 发表于 2005-03-14 12:26:35

太让人失望了... KDE居然和Gnome的态度如此一致,公开声明自己是以开发者为中心而不是以用户为中心。不知道SuSe的那个家伙是不是来捣乱的。
但是KDE 3.4的确做的很不错了。

Following the recent complaints regarding the lack of proper market research in the F/OSS world, KDE users suggested paying money through Bugzilla to see their features/bugfixes done, a proposal that was denied by the core KDE developers. The lengthy discussion comes down to SuSE's Waldo Bastian reply which illustrates once more the developer-centric nature of F/OSS (in contrast to the more user-centric nature of commercial products): "KDE will be able to sustain itself just fine without users, while it will not last a single day without developers. So when it comes to choosing between scaring away developers and scaring away users, the choice is rather easy actually." (2nd reply)
收藏: QQ书签 del.icio.us 订阅: Google 抓虾

'Millipede' small scale MEMS prototype shown at CeBIT

Jan 发表于 2005-03-14 12:15:37

IBM苏黎世实验室在CeBIT上展示了他们的最新技术: Millipede, 基于纳米工艺的存储技术。采用这项技术人们可以在一张普通邮票大小的地方上存储超过1TB的数据,相当于25张dvd的容量。


'Millipede' small scale MEMS prototype shown at CeBIT  


March 12, 2005
Image: "Millipede" small scale MEMS prototype compatible with SD form-factor: MEMS assembly (16.5 mm × 17.5 mm × 1.2 mm) encompassing the 2D cantilever read- and write-array, the micro-scanner, and the polymer medium.

Thousands of extremely fine tips "write" tiny pits representing individual bits into a thin film of highly specific polymer. The principle is comparable with the old punch cards, but now with structural dimensions in the nanometer scale and the ability to erase data and rewrite the medium.

The high storage density of more than a terabit was achieved by using individual silicon tips to create pits approximately 10 nanometers in diameter, i.e. 50,000 times smaller than the period at the end of this sentence. Experimental chips have been designed comprising more than 4,000 of these tips arrayed in a small 6.4 mm x 6.4 mm&sup2;. These dimensions make it possible to pack an entire high-capacity storage system into the SD flash memory format package.

Technical product feasibility in terms of storage density, performance and reliability was demonstrated in recent experiments using the prototype on display. While current storage technologies are gradually approaching fundamental limits, the nanomechanical approach has enormous development potential: storage densities which correspond to the size of molecular structures may even be possible. Moreover, the nanomechanical data medium has been optimized to use a minimum amount of energy. Thus, it is ideally suited for use in mobile devices such as digital cameras, cell phones and USB sticks. Other possible applications include lithography on the nanometer scale, as well as atomic and molecular manipulation.

At CeBIT, a video microscope provides a look inside the storage unit that reveals, for example, how the polymer surface is moved across the tips with the help of a micromechanism (MEMS). An animated illustration shows how the parallel tips of the read and write array operate and how the individual tips work, and thus explains what is happening on the nanometer scale.





Image: The "millipede" concept: For operation of the device, the cantilever tips are brought into contact with the storage medium — a thin film of a specific cross-linked polymer coated on a silicon substrate, which is moved in the x- and y-directions for reading, writing, and erasing. The storage medium is positioned with nanometer-scale accuracy relative to the cantilever array. The tips can independently read, write or erase the bits.

Technological background

At the heart of the "millipede" technology is a two-dimensional array of V-shaped silicon cantilevers, each 70 micrometers (thousandths of a millimeter) long. At the end of each cantilever there is apart from the tip a micrometer-sized sensor for reading as well as a heating resistor above the tip, which is needed for writing. The cone shaped tip is just under one micrometer in length and has a radius of a few nanometers at its apex. The cantilever cells are arranged in the form of an array on a 10 mm x 10 mm chip. One of the recent array designs comprises a total of 4,096 (64 x 64) cantilevers. The MEMS elements are etched out of a silicon single crystal using existing technologies. The actual data medium is a thin polymer film coated on a silicon substrate. The tips can independently read, write or erase the bits.

A sophisticated design ensures that the tips are held level above the storage medium with high precision and that external vibrations and impacts are absorbed. To increase the data rate, read- and write-electronics are used that allow the operation of multiple tips in parallel. Electromagnetic actuation moves the storage medium very precisely in the x and the y-direction so that each tip can read and write within its storage field of 100 micrometers on a side. These short distances are crucial for achieving fast access times.
For the device to perform its reading, writing, erasing or overwriting functions, the tips are brought into contact with the polymer. Bits are written by heating the tip to a temperature above the glass transition temperature of the polymer by means of the heating resistor integrated in the cantilever. The polymer in close proximity to the tip is heated and becomes softer allowing the tip to indent a few nanometers into the film mechanically stressing the material. For reading, the cantilever's reading sensor, which is separate from the tip, is heated slightly. As the polymer film is scanned under the tip, the tip moves in and out of the written indentations. When the tip moves into an indent, it cools down because of the reduced distance to the substrate. This cooling results in a measurable change in electrical conductivity of the sensor. To overwrite data thermo-mechanical effects are used. They cause the stressed polymer material closely around a newly created bit to relax. Thus, existing pits can be erased by creating very close new ones. More than 10,000 writing and overwriting cycles have proved the concept's suitability as a reusable storage medium.

* Micro-electro mechanical system.
收藏: QQ书签 del.icio.us 订阅: Google 抓虾

KPDF 0.4

Jan 发表于 2005-03-13 13:18:42

今天尝试用了KPDF 0.4, 感觉非常好。它最大的优势是支持滚轮 在滚轮鼠标横行的今天,这可以说是一项必须的特性。但是很可惜,linux下所有其它的PDF Viewer都不支持这个功能,也不知道为什么。不仅如此,KPDF的界面非常简洁,必要的功能一应俱全,字体显示效果也非常的好。甚至当你打开一个以前阅读过的文档的时候,kpdf会自动帮你找到最后阅读的位置!!! 在这之前我一直都用 acroread(gpdf, pdfviewer之类的也尝试过,都不如acroread), 现在毫不犹豫的把它抛弃了。KPDF对中文的支持也相当的好。总之我认为目前linux平台上最好的PDF Viewer就是KPDF 0.4。

收藏: QQ书签 del.icio.us 订阅: Google 抓虾