1 / 3
Caption Text
2 / 3
Caption Two
3 / 3
Caption Three margin testing

Tuesday, June 30, 2009

Access Windows NTFS Partition from Xubuntu 9.04


Install ntfs-config

sudo apt-get install ntfs-config

or:
use Add/Remove ...

then start it:

sudo ntfs-config

or:
Go to Applications -> System ->NTFS Configuration Tool

Tick the appropriate boxes and restart.

Use Gigolo to Access Remote Filesystem

Open resources in Thunar on Xfce 4.4 and 4.6

Start Gigolo by going to Xubuntu's menu Application -> System -> Remote Filesyste.

By default, Gigolo uses gvfs-open to open the connected remote resources. On some systems this will either result in an error or open the wrong file manager because gvfs-open uses the mime types to determine which application it should launch and those mime types are often not configured properly.

First, you need to install the gvfs-fuse backend for GVFS and fuse-utils so that GVfs mounts the remote resources in ~/.gvfs. Make sure that your user is in the fuse group or this will not work. The easiest way to do add your user to the fuse group is to run the following command as root:

sudo aptitude install gvfs-fuse fuse-utils
sudo gpasswd -a username fuse

Obviously, you should replace username by your actual used username.

Then, you may need to add the following lines to your ~/.local/share/applications/defaults.list so that Thunar is used to open folders by gvfs-open:

x-directory/gnome-default-handler=Thunar.desktop
inode/directory=Thunar.desktop
x-directory/normal=Thunar.desktop

Note: It may be necessary to relaunch your session after those modifications especially when you added your user to the fuse group.

Saturday, June 27, 2009

Install Xubuntu 9.04 on NEC VERSA S800 with Trident Video Card

[ubuntu] HOWTO: Get proper video resolution with trident video card and Ubuntu 8.04 - Page 5 - Ubuntu Forums

After installation, everything seems fine except the display, can't get the max resolution 1024x768 and there is a large black border around the edge. To fix this problem I edited the config file: /etc/X11/xorg.conf.

Here's my currently up-to-date xorg.conf file:

Section "Device"
Identifier "Trident Microsystems CyberBladeXP"
Driver "trident"
BusID "PCI:1:0:0"
EndSection

Section "Monitor"
Identifier "Generic Monitor"
Option "DPMS"
HorizSync 28-51
VertRefresh 43-60
Modeline "1024x768_60.00" 64.11 1024 1080 1184 1344 768 769 772 795 -HSync +Vsync
Option "PreferredMode" "1024x768_60.00"
EndSection

Section "Screen"
Identifier "Default Screen"
Monitor "Generic Monitor"
Device "Trident Microsystems CyberBladeXP"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "1024x768_60.00" "800x600"
EndSubSection
EndSection

Logout and login, display is right now.

Thursday, June 25, 2009

国内外DNS服务器地址列表

国内外DNS服务器地址列表-月光博客

港澳台DNS服务器地址

  香港:
  205.252.144.228
  208.151.69.65
  202.181.202.140
  202.181.224.2

  澳门:
  202.175.3.8
  202.175.3.3

  台湾:
  168.95.192.1
  168.95.1.1

  国外DNS服务器地址

  美国:
  208.67.222.222
  208.67.220.220
  165.87.13.129
  165.87.201.244
  205.171.3.65
  205.171.2.65
  198.41.0.4
  198.41.0.4
  198.32.64.12
  192.33.4.12
  192.203.230.10
  192.5.5.241
  192.112.36.4
  192.36.148.17
  192.58.128.30
  192.9.9.3
  193.0.14.129
  128.9.0.107
  128.8.10.90
  66.33.206.206.
  208.96.10.221
  66.33.216.216
  205.171.3.65
  205.171.2.65
  165.87.13.129
  165.87.201.244

  加拿大:
  209.166.160.36
  209.166.160.132

  英国:
  193.0.14.129

  日本
  202.12.27.33
  202.216.228.18

  韩国:
  164.124.101.31
  203.248.240.31
  168.126.63.60
  168.126.63.61

  新西兰:
  202.27.184.3

  泰国:
  209.166.160.132
  202.44.8.34
  202.44.8.2

  印度:
  202.138.103.100
  202.138.96.2

  国内各省市DNS服务器地址

  北京:
  202.96.199.133
  202.96.0.133
  202.106.0.20
  202.106.148.1
  202.97.16.195
  202.138.96.2

  深圳:
  202.96.134.133
  202.96.154.15

  广州:
  61.144.56.100
  61.144.56.101

  广东:
  202.96.128.86
  202.96.128.143

  上海:
  202.96.199.132
  202.96.199.133
  202.96.209.5
  202.96.209.133

  天津:
  202.99.96.68
  202.99.104.68

  广西:
  202.96.128.68
  202.103.224.68
  202.103.225.68

  河南:
  202.102.227.68
  202.102.245.12
  202.102.224.68

  河北:
  202.99.160.68

  福建:
  202.101.98.54
  202.101.98.55

  厦门:
  202.101.103.55
  202.101.103.54

  湖南:
  202.103.0.68
  202.103.96.68
  202.103.96.112

  湖北:
  202.103.0.68
  202.103.0.117
  202.103.24.68

  江苏:
  202.102.15.162
  202.102.29.3
  202.102.13.141
  202.102.24.35

  浙江:
  202.96.102.3
  202.96.96.68
  202.96.104.18

  陕西:
  202.100.13.11
  202.100.4.16
  202.100.4.15
  202.100.0.68

  山东:
  202.102.154.3
  202.102.152.3
  202.102.128.68
  202.102.134.68

  山西:
  202.99.192.68
  202.99.198.6

  四川:
  202.98.96.68
  61.139.2.69

  重庆:
  61.128.128.68

  成都:
  202.98.96.68
  202.98.96.69

  辽宁:
  202.98.0.68
  202.96.75.68
  202.96.75.64
  202.96.69.38
  202.96.86.18
  202.96.86.24

  安徽:
  202.102.192.68
  202.102.199.68
  10.89.64.5

  吉林:
  202.98.5.68
  202.98.14.18
  202.98.14.19

  江西:
  202.101.224.68
  202.109.129.2
  202.101.240.36

  新疆:
  61.128.97.74
  61.128.97.73

  贵州:
  202.98.192.68
  10.157.2.15

  云南:
  202.98.96.68
  202.98.160.68

  黑龙江:
  202.97.229.133
  202.97.224.68
  219.150.32.132

  海南:
  202.100.192.68
  202.100.199.8

  宁夏:
  202.100.0.68
  202.100.96.68

  甘肃:
  202.100.72.13

  内蒙古:
  202.99.224.68

  青海:
  202.100.128.68

  全球路由DNS服务器

  全球只有13台路由DNS服务器(Route Server),在13台路由服务器中,名字分别为"A"至"M",其中10台设置在美国,另外各有一台设置于英国、瑞典和日本。下表是这些机器的管理单位、设置地点及最新的IP地址。

  名称  管理单位及设置地点    IP地址
  A INTERNIC.NET(美国,弗吉尼亚州) 198.41.0.4
  B 美国信息科学研究所(美国,加利弗尼亚州) 128.9.0.107
  C PSINet公司(美国,弗吉尼亚州) 192.33.4.12
  D 马里兰大学(美国马里兰州) 128.8.10.90
  E 美国航空航天管理局[NASA](美国加利弗尼亚州) 192.203.230.10
  F 因特网软件联盟(美国加利弗尼亚州) 192.5.5.241
  G 美国国防部网络信息中心(美国弗吉尼亚州) 192.112.36.4
  H 美国陆军研究所(美国马里兰州) 128.63.2.53
  I Autonomica公司(瑞典,斯德哥尔摩) 192.36.148.17
  J VeriSign公司(美国,弗吉尼亚州) 192.58.128.30
  K RIPE NCC(英国,伦敦) 193.0.14.129
  L IANA (美国,弗吉尼亚州) 198.32.64.12

Wednesday, June 24, 2009

How to Recover password under Ubuntu

How-To Recover password under Ubuntu | Ubuntu Geek

If you forgot you password for your ubuntu system you can recover using the following steps

Turn your computer on.

Press ESC at the grub prompt.

Press e for edit.

Highlight the line that begins kernel ………, press e

Go to the very end of the line, add rw init=/bin/bash

press enter, then press b to boot your system.

Your system will boot up to a passwordless root shell.

Type in passwd username

Set your password.

Type in reboot

Google Posted its Own List of Performance Best Practices

Google issues call to make the Web faster
June 24, 2009 12:58 PM ET

Network World - Google Inc. called on the Web development community to improve the speed of Web pages, posted its own list of performance best practices, and declared that protocols such as TCP/IP and HTML need to be updated or even replaced.

Google's official blog said that protocols such as HTML and TCP/IP were created "when broadband and rich interactive web apps were in their infancy."

In the past 20 years, Google notes, networks have become much faster, more able to handle heavy-duty Web applications and video, and in the past 10 years, JavaScript speed has improved a hundredfold.

For an example of the performance enhancements it has in mind, Google pointed to the recently proposed HTML 5, which has been heralded as a potential game-changer in Web application development. Some HTML 5 features have shown up in browsers, but it could take years to fully implement.

In a video, Google Performance Evangelist Steve Souders said, "If we could come up with changes, enhancements or even alternatives to TCP/IP or HTTP, that might have a significant impact."

Google acknowledged that, while it is a major player on the Internet, it cannot implement changes on its own, and expressed that it would continue to work through standards bodies.

At the same time, Google advocated that Web sites take smaller steps to improve performance today. The company laid out its best practices for Web developers at a new site, as well as a Google Group to open the discussion to the community.

Tuesday, June 23, 2009

Open Source Could Cut Costs for Federal, State and Local Government

Open Source Could Cut Costs for Federal, State and Local Government (Opinion)
From Government Technology - Solutions for state and local government in the information age
Jun 22, 2009, By Bill Vass

The public sector, especially the federal government, has been slow to embrace what may be the single most important innovation sweeping the technology world -- open source software. It holds the "keys to the kingdom" in making government more efficient in conducting its business, serving citizens securely and better managing tax dollars spent on technology.

Open source technology enables both equal access and the freedom to distribute a technology's source code -- in essence the "language" on which it's built. It includes an accepted set of standards that allow a business or government the freedom to move its critical data and IT services on, off and in-between products from different companies, whenever it chooses.

Think about your car. In the U.S. we've agreed to drive on the right-hand side of the road. We've agreed on traffic rules and signals. The gas pedal goes on the right and the brake goes on the left. These are our "open standards" for driving. Still, we're free to purchase any car from any car company we wish. And if we're not happy with the car we bought, or we don't think the price is fair, we're free to shop around. We don't need a new driver's license or to invest time and money learning to drive a different type of car.

It's the same with the global commercial open source movement. And the first major benefit the government can realize from this freedom and openness is reduced costs. Commercial open source technologies cost less than closed, proprietary technologies. Open source software can typically be downloaded for free. And open source technology and open standards allow multiple vendors to compete fairly for the government's business. Such competition brings more choices, better products and lower prices.

The cost savings are astounding. In the UK, where the government recently announced it will accelerate the use of commercial open source software, it's estimated that the move away from proprietary technologies could save £600 million a year. Here in the U.S., a recent report from MeriTalk estimates federal IT savings could reach "$3.7 billion from open source." These cost savings can't be ignored, especially when taxpayer dollars are footing the bill.

Think, if you will, about government procurement scandals of the past involving unexamined purchases that led to disclosures of $10,000 toilet seats and wastebaskets and other irresponsible spending. Proprietary software is this decade's procurement scandal waiting to happen with government agencies wasting millions on proprietary technologies when equivalent open source technologies are available for just thousands of dollars, or in some cases, free. Creating a formal policy around open source use and procurement brings more transparency and a level playing field to the government technology bidding process.

The second major consideration is security. Ensuring the security and integrity of our government's sensitive data and critical IT systems is crucial. Commercial open source technologies provide more security than their proprietary counterparts because open development means hidden breaches aren't buried in the code. They are ferreted out more quickly and efficiently, and rigorous testing ensures three-letter agency security levels.

Finally, open technologies enable every citizen to better communicate with our government, do business with government agencies, receive government services and access public data. This happens when all government and "citizen-owned" content share common standards and don't require the use of proprietary technologies (word processors and spreadsheets, Web browsers or e-mail clients) to access it.

By no means is open source a new idea. Open source technologies and solutions such as Java, Linux, Solaris, MySQL, Apache and OpenOffice are well established and well proven the world over -- literally billions of people are using them. Some of the world's most successful companies -- like Google and Facebook -- run their businesses on them.

There are a few success stories in the U.S government as well, yet we still lag behind the rest of the world in making use open source. Governments in the UK, Brazil, Denmark, the Netherlands, China and Germany -- just to name a few -- have all engaged in formal, wide-scale deployments of open source technology, with many having articulated specific policy on open source. Without its own open source policy in place, the United States risks widening economic and technological competitive gaps between itself and the rest of the world.

In the end the best performing, most cost-effective technology is always the right technology for the job -- whether it's open source or proprietary. But I do believe our government needs to embrace open source technologies and develop a formal policy for their use. Open source supports many of the new federal administration's stated goals; better security, faster deployment, open government, and more responsible spending.

The time is now for the United States to capitalize on open source technology.

Bill Vass is the president and chief operating officer of Sun Microsystems Federal Inc. and the chief technology officer of Sun's Global Accounts and Industry organization. Vass focuses on providing the U.S. government and elite global accounts with open, secure and efficient solutions to solve unique IT challenges for large-scale organizations.


MJ

喝酒脸红背后的健康隐患

VOA News

A wine-tasting near Beijing, China
A wine-tasting near Beijing, China
Finally, a listener in Taiwan wrote to ask why his face turns red when he drinks alcohol. This effect called facial flushing is a common reaction to alcohol among East Asians. It affects an estimated thirty-six percent of Japanese, Chinese and Koreans.

For many people, even a little alcohol can cause unpleasant effects. Most commonly, their face, neck and sometimes their whole body turns red. People might also feel sick to their stomach and lightheaded. They might experience a burning sensation, increased heart rate, shortness of breath and headaches.

The cause is a genetic difference that some people are born with. It prevents their bodies from processing alcohol the way other people do. But the effects might be more serious than just a red face. Researchers have warned of a link between this condition and an increased risk of cancer of the esophagus from drinking alcohol.

A report about facial flushing appeared recently in PLoS Medicine, a publication of the Public Library of Science. The report says the more alcohol that persons with this deficiency drink, the greater their risk. It estimates that at least five hundred forty million people have the deficiency.

Esophageal cancer is one of the deadliest cancers. It can be treated when found early. But once it grows the chances of survival drop sharply.

Philip Brooks is a researcher at America's National Institute on Alcohol Abuse and Alcoholism. Doctor Brooks says it is important to educate people about the link between the alcohol flushing effect and esophageal cancer. He says doctors should ask East Asian patients about their experiences with facial flushing after drinking alcohol. Those with a history of it should be advised to limit their alcohol use. They should also be warned that cigarette smoking works with the alcohol in a way that further increases the risk of esophageal cancer.

常见中文分词开源项目

中文分词和TF-IDF-月光博客

  中文分词(Chinese Word Segmentation)指的是将一个汉字序列切分成一个一个单独的词。中文分词是文本挖掘的基础,对于输入的一段中文,成功的进行中文分词,可以达到电脑自动识别语句含义的效果。

  TF-IDF(term frequency–inverse document frequency)是一种用于信息搜索和信息挖掘的常用加权技术。在搜索、文献分类和其他相关领域有广泛的应用。

  TF-IDF的主要思想是,如果某个词或短语在一篇文章中出现的频率TF高,并且在其他文章中很少出现,则认为此词或者短语具有很好的类别区分能力,适合用来分类。TF词频(Term Frequency)指的是某一个给定的词语在该文件中出现的次数。IDF反文档频率(Inverse Document Frequency)的主要思想是:如果包含词条的文档越少,IDF越大,则说明词条具有很好的类别区分能力。

  使用TF*IDF可以计算某个关键字在某篇文章里面的重要性,因而识别这篇文章的主要含义,实现计算机读懂文章的功能。

  常见中文分词开源项目:

  SCWS

  Hightman开发的一套基于词频词典的机械中文分词引擎,它能将一整段的汉字基本正确的切分成词。采用的是采集的词频词典,并辅以一定的专有名称,人名,地名,数字年代等规则识别来达到基本分词,经小范围测试大概准确率在 90% ~ 95% 之间,已能基本满足一些小型搜索引擎、关键字提取等场合运用。45Kb左右的文本切词时间是0.026秒, 换算完毕大概是 1.5MB文本/秒。支持PHP4he PHP 5。

  ICTCLAS:  

  这可是最早的中文开源分词项目之一,ICTCLAS在国内973专家组组织的评测中活动获得了第一名,在第一届国际中文处理研究机构SigHan组织的评测中都获得了多项第一名。ICTCLAS3.0分词速度单机996KB/s,分词精度98.45%,API不超过200KB,各种词典数据压缩后不到3M.ICTCLAS全部采用C/C++编写,支持Linux、FreeBSD及Windows系列操作系统,支持C/C++、C#、Delphi、Java等主流的开发语言。

  庖丁解牛分词

  Java 提供lucence 接口,仅支持Java语言。

  CC-CEDICT

  一个中文词典开源项目,提供一份以汉语拼音为中文辅助的汉英辞典,截至2009年2月8日,已收录82712个单词。其词典可以用于中文分词使用,而且不存在版权问题。Chrome中文版就是使用的这个词典进行中文分词的。

Monday, June 22, 2009

说真话说假话?

令人"心神不宁"的网络-月光博客

  著名学者钱理群先生曾在一次讲座上说,人说话应该有底线,这些底线依此是:一,力图说真话;二,不能说真话则应保持沉默;三,无权保持沉默而不得不说假话时则不应伤害他人。钱先生补充说,无权保持沉默而不得不说假话,若这种假话并未伤害他人,这种人可成为奴隶,尚有可同情处;但若为伤害他人而说假话,则只能称奴才,不可原谅。

Saturday, June 20, 2009

How To Run Windows Apps In Linux

How To Run Windows Apps In Linux - Washingtonpost.com

Keir Thomas, PC World
PC World
Saturday, June 20, 2009 12:19 AM

Wine is an open source project that, on the face of it, seems to offer something wondrous: the ability to run Windows applications under Linux (or any other open source OS). It does this by attempting to recreate the Windows API layer in open source.

Finally! A chance to run those Windows programs for which there are no open source analogs: Quicken, or Flash CS. And all those games!

Sadly, the reality is a little more complicated. Yes, Wine is pretty good at running some Windows software and games. But to get the most out of it, you need to hack. Often, getting Wine to deliver is a black art, and not for novices.

Luckily, there are several ready-made installation wizards that help get around problems. These are scripts written by people who have done the hacking for you. There are four projects in particular that are worthy of mention: CrossOver, Cedega, Wine-Doors, and PlayOnLinux.

CrossOver comes in Game and standard versions, and is a proprietary and commercial project created by the same developers behind Wine. As such, it's simply the best choice for a fuss-free life. It'll cost you, but some of the money goes into sponsoring Wine developers.

Cedega is another proprietary and commercial project, this time primarily for gamers. By most accounts, it's the best choice if you simply want to play games, and the Cedega developers hack the Wine code significantly for better results. It will cost you, however, and works on a subscription basis rather than one-off licensing fee.

Wine-Doors and PlayOnLinux are both open source, and free-of-charge, so you may as well try each to find which suits your needs best. I take a quick look at both below. These instructions are for Ubuntu 9.04.

Preparation

Before installing any Wine application, it's a good idea to install the Microsoft Core Web fonts. These are the usual font suspects in a typical Windows install (Arial, Times New Roman etc.) and many Windows applications expect to find them in place. Things will probably look odd without them.

You can install them by either copying the .ttf files from a Windows installation, or by installing the msttcorefonts package. Fonts that are not supplied as part of this package, but which some applications might need, include Tahoma and MS Sans. You can find these around the web if you search. You can install them by creating a folder called .fonts in your/home directory and placing them there.

If you want to import directly from a Windows installation, you'll find the fonts in the C:\windows\fonts directory. Copy all the .ttf files to a USB stick, create a new folder in your/home directory called .fonts (note the period before the word fonts!), and place them there. And that's it. The fonts will now be available in all your applications.

PlayOnLinux

To install PlayOnLinux, you'll need to add a new repository and install a software package from it. Open a terminal window (Applications, Accessories, Terminal) and type the following:

Once the program has installed, you'll find it on the Applications, Games menu (it's worth mentioning that PlayOnLinux is ? as its name suggests--primarily designed to allow the installation of Windows games, but it also features scripts for many popular applications).

When the program is run for the first time, you'll have to complete a setup wizard. Click Forward to work your way through. This will download the latest versions of the install scripts from the PlayOnLinux server.

Once things have finished, click the Install button on the toolbar. In the Window that appears, click a category on the left relating to the type of software you want to install, and then select the application on the right. Most free-of-charge applications, like Internet Explorer, can be downloaded on demand, but you'll need the install CD for commercial applications.

Once you've made your choice, click the Apply button. The wizard will then start and walk you through installation, including making any necessary downloads. Bear in mind that, eventually, the program's own installation wizard may start, and you'll have to work through this as usual too. Don't close the PlayOnLinux's wizard, however! Leave it open until it finishes of its own accord.

Often a specific older version of Wine, known to work with the application, will need to be downloaded. This will happen automatically.

Once installed, the Windows program will be found on the Applications> Wine menu. Note that there's a slight issue with Ubuntu 9.04 (Jaunty) whereby desktop shortcuts created by third-party applications don't work. To fix this, you need to make them executable. This can be done by using the chmod command. For example, the following will fix a desktop shortcut for the Safari Web browser once it's been installed:

All desktop shortcuts created in this way have a .desktop file extension, and this should help you identify them.

***safari.jpg

Wine-Doors

To install Wine-Doors, you can once again add a new software repository. Open System> Administration> Software sources, and click the Third Party Tab in the window that appears. Click the Add button and type (or cut and paste) the following line:

Click the Close button and refresh the repository listings when prompted. Then use Synaptic to install the wine-doors package.

(Note that you can install the GPG key if you wish, which will avoid any harmless errors about unsigned packages.)

Once Wine-Doors has installed, you'll find it on the Applications> Wine menu, which is where you'll also find any Windows applications you install in future.

When Wine-Doors starts for the first time, you'll need to fill in your name and company details. These will be used when installing Windows applications. You can optionally tick the ?I Have a Windows License? button. This is needed in order to install certain Windows system components that facilitate the smooth running of Windows applications, as well as certain Windows add-ons whose EULAs demand a Windows license. Obviously, you shouldn't tick this box if you don't actually have a Windows license (i.e. a Windows installation on one of your computers).

When you click the Proceed button, Wine-Doors will update itself with the latest list of installation scripts. It's worth mentioning that hosting these scripts isn't cheap, and recently they had to be taken offline because of a funds shortfall

Once it's done, you'll be shown a list of applications and games. Simply click the install link alongside any in the list you wish to install, and then click the Apply button. Installation will then proceed, including the download of any necessary add-on software.

With any Wine installation, you'll find your applications in the directory of your folder (i.e. ). This is effectively a recreation of the Windows file system.

Friday, June 19, 2009

China Disables Some Google Functions

China Disables Some Google Functions - NYTimes.com
Published: June 19, 2009

BEIJING — The Chinese government disabled some search functions on the Chinese-language Web site of Google Friday, saying the site was linking too often to pornographic and vulgar content. Government officials met with managers of the Chinese operations of Google on Thursday afternoon to warn them that the company would be punished if the Web site was not purged of the offending material, according to a report Friday by Xinhua, the state news agency.

Earlier on Thursday, a government-supported Internet watchdog group, the China Internet Illegal Information Reporting Center, had criticized the search engine for its erotic content and threatened punishment from the government. The group had said that Google had already been warned twice, in January and April, about its content.

On Friday evening, it appeared that the associative-word feature of the Web site had been disabled. That is the function that displays a drop-down menu of words related to a search word that is typed into the search engine. The previous evening, reporters on China Central Television, the state television network, showed how typing in the Chinese word for son, erzi, could pull up associated terms that have lewd connotations.

State news organizations also reported that the ability to use Google's Chinese site to search overseas Web sites was supposed to be disabled, but that feature was still working on Friday evening.

Google released a statement saying it was making greater efforts to clean up its Chinese Web site. "We have been continually working to deal with pornographic content, and material that is harmful to children, on the Web in China," the statement said.

Though Google dominates the search engine market in the United States, it is struggling here to unseat Baidu, which has long been the most popular Chinese search engine.

Recent efforts by the Chinese government to limit access to the Internet have been met with outrage by Chinese computer users. The strongest reaction has been to the government's plan to force computer makers to install Internet censorship software on all computers sold in China after July 1. Critics say the software, called Green Dam-Youth Escort, could be used to censor Web sites with content deemed politically unacceptable, even though the government says the main use of the software will be to block access to pornography.

Computer experts also say the software can make a computer vulnerable to infiltration by hackers. This week, developers said they had found fixes to the problems. But on Friday, J. Alex Halderman, a computer science professor at the University of Michigan, said that a patched version of Green Dam had a security problem that was just as serious as the original one.

In a paper posted on the Internet, Mr. Halderman said it had taken him and his research team only one hour to find the new problem.

"This suggests that the security problems in Green Dam will be harder to fix than the government has suggested," he said in an e-mail message. "It's probably going to be impossible to make the software safe enough ahead of the July 1 deadline."

Andrew Jacobs contributed reporting, and Huang Yuanxi contributed research.

Thursday, June 18, 2009

How to Install Tuxonice in Ubuntu

How to Install Tuxonice in Ubuntu | Ubuntu Geek

"TuxOnIce is most easily described as the Linux equivalentof Windows' hibernate functionality, but better. It saves the contents of memory to disk and powers down. When the computer is started up again, it reloads the contents and the user can continue from where they left off. No documents need to be reloaded or applications reopened and the process is much faster than a normal shutdown and start up." – tuxonice.net

Tuxonice is an alternative way to hibernate your machine than the standard ubuntu power manager way. It generally claims to be more configurable and flexible than the standard method, with faster hibernate and resume times.

How to Fix a Running Toilet

How to Fix a Running Toilet - wikiHow

Replace the flapper. If the toilet stops filling and then starts again intermittently, you have a slow leak. Try this to be certain. Place a dye tablet or a few drops of food coloring in the tank. Your local hardware store may have free dye tablets for this purpose. If, after an hour or two without flushing, you see this dye in the bowl, you have a slow leak, a small amount of water running into the bowl. The most common cause of slow leaks is a leaky flapper. Over time, this inexpensive rubber part decays, or minerals build up on it. Cleaning may work to remove mineral buildup, but it's usually best just to replace the whole part. There are a few standard kinds. Take your old one with you to the hardware store if you want the comparison to get the right size.

Close this valve by turning it clockwise, as you would a faucet.
Close this valve by turning it clockwise, as you would a faucet.
  • To perform the replacement, simply close the valve sticking out of the wall under your toilet tank.
  • Flush the toilet. If the valve is completely closed, the tank will not refill and you will not hear water running after the tank empties.
  • Pop the old flapper off its hinges, disconnect it from the chain, and pop the new one into place.
  • Run a finger carefully around the rim where the flapper seats. Remove any uneven buildup of minerals that might cause a leak.
  • Don't forget to open the valve all the way when you're ready for water again.
  • Try flushing a few times to make sure the chain is the right length for the new flapper. It should open when you push the handle and then drop closed all the way when the tank empties. You may have to trim and adjust the chain by trial and error. Also, make sure that the flapper aligns properly with the opening.

Wednesday, June 17, 2009

A Gateway to Your Local Newspaper

A Gateway to Your Local Newspaper

Pick a U.S. state, pick a Canadian city, pick an international country or city and find the local newspaper home page. Great way to keep informed of news in small towns as well as large cities around the world.

Monday, June 15, 2009

Sphinx - a free open-source SQL full-text search engine

Sphinx: Search Outside the Box | Linux Magazine

For many years, the only easy way to add decent search capability to a MySQL-backed web site was to use its full-text index support. It was fast, efficient, and reasonably configurable. But as more and more sites began to deal with larger datasets and moved from MyISAM to InnoDB, they found that it was harder to support their search needs. InnoDB does not provide full-text indexing, so that often meant keeping around a set of slaves that still ran MyISAM for the sole purpose of handling full-text search requests.

Sphinx is a powerful, free full-text search engine that works extremely well with MySQL.

Sphinx was a project born out of the need for something better than MySQL’s full-text search for sites already using MySQL. It’s available both as a MySQL storage engine and as a stand-alone daemon. There are pros and cons to both deployment methods, but I’m going to focus mainly on the stand-alone daemon for this article. Not only is it what I’m most familiar with, I believe it to be far more powerful and flexible.

A related article: Build a custom search engine with PHP

Sunday, June 14, 2009

New Online Tool Extracts Vocabulary

New Online Tool Extracts Vocabulary

Thinkmap Visual Thesaurus has launched a new tool called VocabGrabber (http://vocabgrabber.com) that helps teachers and students target the key vocabulary from a text within seconds. VocabGrabber extracts words from any document and demonstrates how those words are used in context. It's intended for language arts teachers, students of English at all levels of proficiency, or anyone who wants fresh insights into how language works.

VocabGrabber compares how often words appear in the text with the frequency of these words in standard written English overall. Grabbing the vocabulary from the United States Bill of Rights, for instance, highlights significant legal terms like probable cause and cruel and unusual punishment. Grabbing the opening of the Charles Dickens classic Oliver Twist, meanwhile, will quickly zero in on words like workhouse, gruel, and pauper.

Teachers and students can use VocabGrabber to highlight vocabulary specific to a subject area -- focusing on just the science-related words from the latest news coverage about swine flu, or just the artistic and literary terms in an article about the history of poetry. Additionally, VocabGrabber can be used to select only those words that are typically taught in vocabulary instruction, useful for students preparing for local standardized tests, or national tests like the SAT, ACT, GMAT, GRE, and TOEFL.

For more information, visit VocabGrabber and The Visual Thesaurus.

Saturday, June 13, 2009

Introducing Cairngorm

Introducing Cairngorm | Adobe Developer Connection

This document is from the authorized Flex curriculum written by Adobe Customer Training.

In this document, you will learn the basics of building Flex applications using the Cairngorm framework. You will:

  • Understand the basics of Cairngorm
  • See how Cairngorm is used in Flex RIAs
  • Implement the ModelLocator
  • Implement the ServiceLocator
  • Implement Cairngorm events
  • Implement Commands
  • Implement the FrontContoller
  • Implementing Delegates
  • Use the Cairngorm components

This chapter has a PDF document which has content and walkthrough steps. The walkthroughs are hands-on activities that you complete in Flex. These walkthroughs are key to learning and should be done as you encounter them in the text. The files used in the walkthroughs are contained in the ZIP file. Follow the instructions in the document to unzip and install the files. This chapter assumes you have installed Flex Builder 3.

Requirements

In order to make the most of this article, you need the following software and files:

Flex Builder 3

Prerequisites

Moderate experience writing applications in Flex.

Download the lesson file and sample code

Sample files:

Installation instructions

The installation instructions are part of the first walkthrough on Page 8 of the document.

About the author

This document is authored by the Adobe Customer Training/Partner Enablement Group, with major portions of the content written by Thomas Burleson of Universal Mind, the Delegates content written by Leo Shuman of Adobe Customer Training, under the guidance of Matt Boles.

Friday, June 12, 2009

How do I learn Flex?

Sean Moore - Flex Developer, AIR Developer, ActionScript Programmer

The world of Flex development is pretty big and it's expanding all the time. There are many types of applications that can be built with Flex from dashboards to widgets, media playback utilities to Enterprise RIAs and don't forget interactive kiosks and Internet aware desktop applications. One of the most common questions that I get asked is: How/Where do I learn Flex? I think one of the keys to mastery is a successful learning path. I also think that a solid foundation goes a long way. We've all heard the phrase: "crawl, walk, run…"

Here are some resources that helped me learn Flex. They are organized in a somewhat sequential fashion.


Beginner

Lynda.com

O'Reilly Programming Flex 3

Adobe.com

DClick Adobe Flex Coding Guidelines

CFlex, Community Flex

Using ASDoc


Intermeditate

AtTest (practice exam engine for Adobe Flex Developer Certification)

Flex Certification

Flexlib (open source user interface components)

Flex Unit

Subversion

Creating Flex components

Developing Flex RIAs with Cairngorm (Steven Webster, Adobe Consulting)

David Tucker

Mate Framework

Adobe Flex Community Expert program

Papervision / Away3D

MXMLC

Flex and SWC files

Degrafa


Advanced

Livecycle

Flash Media Server

Flex Charting

ILog Charts

Particle Systems

Flint (more particles)

Paul Ortchanian (scripted 3D, particles, bezier)

Flex Modules

Flex Profiler

Flex Ant Tasks

BlazeDS

Misc. Resources:

Mike Chambers blog

Ryan Stewart blog

Kevin Hoyt

Eric Feminella blog

Ted Patrick blog

Lee Brimelow blog

Flex Show

Adobe Developer Connection

Adobe Edge Magazine

Flex.org

Adobe Feeds

Flex Camp

Farata Systems Training

Comtaste (Flex training)

Beyond Flex

Spring

Hibernate

MySQL

Oracle

JPA

Ant

Java

Design Patterns: Elements of Reusable Object-Oriented Software

VTC - Design Patterns videos

Continuous Integration

Agile software development

SCRUM

UML

TDD

Test Driven Development by Example

How To Design A Good API and Why it Matters

Choosing a Flex Architectural Framework

Bill Gloff » Cairngorm
Friday, January 30th, 2009

If you're working on a moderate to complex Flex/Air application I hope you are using some kind of MVC style framework to help with organizing your components and the interactions between them. If you do not use a framework, you will unknowingly be creating your own. This, consequently, makes it harder for others to get up to speed with any maintenance that will need to be completed, and you will be on the hook to create all the related documentation. Also, why re-invent the wheel when pre-existing frameworks, such as Cairngorm, PureMVC, Swiz, or Mate, already implement best practices and are field-tested? All you need to do is set aside a little time to learn them.

I'm currently working on a greenfield project where I have a Flex/AIR front-end talking to RESTful services provided by Groovy on Grails. I'm a few weeks into the project, but my latest challenge has been deciding on what MVC ActionScript/Flex framework to use. Let me attempt to tell you a little about my process thus far, in case you're going through this yourself.

If you've done any Flex at all I'm sure you've heard about the market-leading framework Cairngorm. It's currently the most popular choice for enterprise worthy applications. It took its inspirations from the Sun J2EE Blueprint Catalog and implemented all the Java based patterns in ActionScript (AS). Some of these well-known patterns are the Command, Front Controller, MVC, Singleton, Value Object, and the Delegate. I believe some reasons for the success of Cairngorm is because AS is very similar to Java with a little mix of JavaScript thrown in for good measure. Then, you add the fact that Adobe (and previously Macromedia) likes targeting server-side Java guys (LiveCycle Data Services anyone?), which should make them comfortable with Cairngorm once they get up to speed on Flex and AS. Since it's been around for a long time there's quite a bit of documentation on it (in blogs, as well as books), and even code generators, which attempt to speed up development time. In Flex Builder 4, which will be released later this year, Adobe will be integrating Cairngorm support into Flex Builder out of the box. Very appealing indeed!

I know PureMVC is getting a lot of hype lately as it enforces a strict MVC and has been ported to a lot of different platforms such as Java, AS, and even Objective C and Ruby. I haven't used it, but I read up on it quite a bit. It seems a little awkward to me since it doesn't take advantage of Flex binding. I know this is because it remains a language/platform independent framework that focuses on giving you a way to do MVC. I'm sure PureMVC has its merits though, and I believe I would enjoy it if a project I was working on already had it… same for Cairngorm. The only things I would look to add to each of those would be some good ole Inversion of Control Prana style (now called Spring ActionScript) to spice things up, and simplify some of the code.

The next framework I read up on was Swiz. This seems like a great combination of MVC and IOC, and it's the only framework to use AS3 Metadata to wire up all your components. It is a very innovative approach with the only concern being maturity compared to Cairngorm and PureMVC. I probably would look into this one a bit more if it wasn't for my first choice…

I started my project thinking that I'll go with Cairngorm, but as you probably figured out, I changed my mind. This happened after I saw a demo of a Flex-based framework called Mate. In my opinion, Mate is one of the more lightweight frameworks out there. I say lightweight because it attempts to use native Flex events whereas in Cairngorm you are forced to have your events implement a Cairngorm interface. This is a dependency I do not care much for. Mate's philosophy is to make your views oblivious to what is going on in the backend… from getting some data from your server to injecting those values into your model. You can have all your custom components be free of any references to any Mate related classes, which is a good sign for an MVC oriented framework. Mate has a concept that none of the other frameworks have that I find intriguing… maybe because its different from the J2EE inspired frameworks, and I am digging how it takes advantage of MXML, whereas the others use more ActionScript. Basically, the main concept of Mate is to define an Event Map, which is just a switchboard of what actions to invoke when a specific event is fired. This is where most of your server calls come into play and injecting the values into your Managers which are singleton based models for your views and also take advantage of bindings. This Event Map is all tag based, which I like, but since it's all AS under the covers, you probably can implement your Event Map in a regular class if you prefer.

I've just begun really using Mate and I'm enjoying the process of wiring everything together. It seems well thought out and simple, but also elegant. I'm also enjoying the fact that I'm programming in more of an event-based language, which these frameworks promote, especially Mate. As I get further into my project I'll try to give updates about how my experiences with Mate are transgressing.

To get a better comparison of these frameworks you should read the 5 part article "FrameworkQuest 2008". It's a great read seeing how Tony Hillerson went and developed the same Twitter application using these 4 different frameworks and discusses the benefits and weaknesses of each.

So go and find yourself a framework to use. I'm sure whichever one you pick will work out for the best… if not, well then there's other options as you can see.

Top Ten Flex Tools and Resources

Sean Moore - Flex Developer, AIR Developer, ActionScript Programmer

When developing Flex and/or AIR applications there are a handful of tools that really make the difference between a good project and a great project. They are all very valuable and provide stability and clarity for the RIA development process; or at least they have for me. From Unit Testing to SVN utilities to frameworks and libraries I've found the following ten items to be very useful and helpful. I'd even go so far as to say these are critical for quality Flex RIA development; but as Les says: "It's just a matter of opinion." ;)

Cairngorm
Cairngorm is the lightweight micro-architecture for Rich Internet Applications built in Flex or AIR. A collaboration of recognized design patterns, Cairngorm exemplifies and encourages best-practices for RIA development advocated by Adobe Consulting, encourages best-practice leverage of the underlying Flex framework, while making it easier for medium to large teams of software engineers deliver medium to large scale, mission-critical Rich Internet Applications.
http://opensource.adobe.com/wiki/display/cairngorm/Cairngorm

Download:
http://download.macromedia.com/pub/opensource/cairngorm/cairngorm2_2_1-bin.zip

Flex Unit
FlexUnit is a unit testing framework for Flex and ActionScript 3.0 applications and libraries. It mimics the functionality of JUnit, a Java unit testing framework, and comes with a graphical test runner.
http://opensource.adobe.com/wiki/display/flexunit/FlexUnit

Download:
http://download.macromedia.com/pub/opensource/flexunit/flexunit0_9.zip

Subclipse
Subclipse is an Eclipse Team Provider plug-in providing support for Subversion within the Eclipse IDE. The software is released under the Eclipse Public License (EPL) 1.0 open source license.
http://subclipse.tigris.org/

Eclipse update site URL:
http://subclipse.tigris.org/update_1.6.x

Eclipse
Eclipse is a multi-language software development platform comprising an IDE and a plug-in system to extend it. It is written primarily in Java and is used to develop applications in this language and, by means of the various plug-ins, in other languages as well - C, C++, COBOL, Python, Perl, PHP and more.
http://www.eclipse.org

Download:
http://www.eclipse.org/downloads/

ASDoc
ASDoc is a command-line tool that you can use to create API language reference documentation as HTML pages from the classes in your Adobe® Flex® application. The Adobe Flex team uses the ASDoc tool to generate the Adobe Flex Language Reference.
http://livedocs.adobe.com/flex/3/html/help.html?content=asdoc_1.html

Flex Ant Tasks
The Adobe® Flex® Ant tasks provide a convenient way to build your Flex projects using an industry-standard build management tool. If you are already using Ant projects to build Flex applications, you can use the Flex Ant tasks to replace your exec or java commands that invoke the mxmlc and compc compilers. If you are not yet using Ant to build your Flex applications, you can take advantage of these custom tasks to quickly and easily set up complex build processes for your Flex applications.
http://livedocs.adobe.com/flex/3/html/help.html?content=anttasks_1.html

Installation:
http://livedocs.adobe.com/flex/3/html/help.html?content=anttasks_2.html#224215

Degrafa
Degrafa is a declarative graphics framework open source licensed under MIT.
http://www.degrafa.org

Download:
http://www.degrafa.org/code/

as3corelib
The corelib project is an ActionScript 3 Library that contains a number of classes and utilities for working with ActionScript 3. These include classes for MD5 and SHA 1 hashing, Image encoders, and JSON serialization as well as general String, Number and Date APIs.
http://code.google.com/p/as3corelib/

Download:
http://as3corelib.googlecode.com/files/as3corelib-.92.1.zip

Flex SDK coding conventions and best practices
Coding standards for writing open-source Flex framework components in ActionScript 3. Adhering to these standards makes the source code look consistent, well-organized, and professional.
http://opensource.adobe.com/wiki/display/flexsdk/Coding+Conventions

Flex Language Reference
The Flex 3.3 Language Reference provides syntax and usage information for every element in the ActionScript™ language. It documents all elements in Adobe® Flash® Player and Adobe® AIR™ that are officially supported by Adobe.
http://livedocs.adobe.com/flex/3/langref/

Wednesday, June 10, 2009

Using packages for code organization - Flex best practices

Flex best practices – Part 1: Setting up your Flex project | Adobe Developer Connection

Follow the best practices below on using packages for code organization:

checkmarkUse packages to organize and structure your projects codebase.

Packages are the standard for OOP-based applications. Packages represent logical groupings of related ActionScript and MXML files in the form of classes. The use of packages and classes is fundamental to object-oriented programming.

To continue with community standards, use the following practices for naming your packages:

checkmarkUse lowerCamelCase.

For example: com.seantheflexguy.stringUtils

checkmarkBegin the package name with the top-level domain (TLD) of the application's owner:

for example, com, net, us;

then use the application owner's name:

for example: seantheflexguy, adobe;

then the project name:

for example: burrow;

then the logical grouping of related code files:

for example: utils, components, or whatever is appropriate.

Here's an example of a package name using this convention:

com.seantheflexguy.burrow.view

Integrating unit testing - Flex best practices

Flex best practices – Part 2: Development practices | Adobe Developer Connection

Unit testing can ensure the quality of your codebase. Writing test cases can lead to more reliable and better code. Testing your code will help find errors and save debugging time. Here are a few best practices that can be applied when implementing unit testing.

checkmark Test behavior instead of testing methods

Writing code to test private methods is not always needed. This should be evaluated on a case by case basis. Write code to test against an object's public API. Typically private methods are used internally by a class to support its public API.

checkmark Apply the "too simple to break" rule

Don't over test the codebase. If the method is a very simple one line method, like a getter method, don't worry about writing a test case for it.

checkmark Use standard OOP best practices in test cases

Follow the same OO methodology you use to write the rest of your application. Refactor test cases to move common functionality into base classes as appropriate.

checkmark Use clear and concise test method names

Follow the same method naming conventions used elsewhere in the application's codebase. Avoid generic names for test case methods. This helps other developers easily understand the relationship, responsibility, and purpose of the method.

checkmark Write simple test case methods

Keep test cases simple and limit the decisions that are made within them.

checkmark Use static values in the assertion method calls when possible

This reduces the chances for error in your test cases and improves the maintainability and understandability of the test code.

checkmark Document the test code

Add comments that explain what is being tested and why. Also, outline any special circumstances regarding the test.

checkmark Create independent unit tests

Each unit test should execute a single behavior for each method.

checkmark Limit assertions to one per test case

Multiple assertions in a single test case can lead to performance issues. In addition, if one assertion fails the other assertions will not be executed until the first assertion passes.

Application development frameworks - Flex best practices

Flex best practices – Part 2: Development practices | Adobe Developer Connection

Using a framework you will greatly increase your chances of success, especially if your application contains a substantial amount of source code.

checkmark Consider using an application development framework

There is some disagreement about whether or not frameworks should be used when developing Flex applications. For enterprise level applications, as well as in teams of developers, frameworks are more generally recommended. My personal preference and recommendation is to use an application development framework. This enables a common language for the architecture of a codebase and provides direction for application development and scalability.

checkmark Use frameworks for team-based development efforts

Frameworks help teams to work together in a unified effort and can reduce the chances of duplicating development efforts.

checkmark Mate

Mate (pronounced "mah-tay") is a tag-based application development framework created for use with Flex. Mate is an unintrusive framework that allows for a loosely coupled codebase.

checkmark Cairngorm

Cairngorm is the de facto standard for Flex application development. If you don't already know Cairngorm you should definitely consider learning it. For more information on Cairngorm, check out this great Introducing Cairngorm article. Adobe Consulting uses Cairngorm and fully stands behind it for their development efforts.

checkmark PureMVC

This is a pure ActionScript 3.0 Model-View-Controller application development framework. Futurescale, the makers of PureMVC, describe it as follows: "PureMVC is a lightweight framework for creating applications based upon the classic Model-View-Controller design meta-pattern… The PureMVC framework has a very narrow main goal: to help you separate your application's coding concerns into three discrete tiers; Model, View and Controller."

checkmark Other frameworks

There are numerous other application development frameworks that can be used in conjunction with Flex or even just straight AS3 projects.

checkmark Know when NOT to use a framework

There are times when a framework is simply overkill for an application. If you are the sole developer of an application and you will be the only developer of the application for its lifetime, then you may not benefit from a framework. If you're developing something very simple, such as a banner ad, you can also skip the framework. The robust feature set offered by an application development framework is often not needed for very simple applications with limited data manipulation and minimal events. For another perspective, see this classic blog post by Steven Webster on the topic of when and when not to use an application development framework.


Application architecture - Flex best practices

Flex best practices – Part 2: Development practices | Adobe Developer Connection

Flex applications are complex systems that greatly benefit from thoughtful planning. Use proven methodologies to ensure the application being built is structurally sound.

checkmark Create use cases

Generate use cases for each goal or task in the application. Define the use cases from the perspective of an Actor. Typically, an Actor is simply a user of the application you are building. A use case can be created around any interaction that a user performs. Actors can also be the application itself, another application, or an outside system such as a web server.

checkmark Consider using UML

Describing the application's main classes and data model using the Unified Modeling Language (UML) can help refine the objects in your application and avoid potential rework to the code later.

checkmark Consider using code generation

There are a number of tools that will generate ActionScript 3.0 source code from UML diagrams. This can save time in some cases. Two tools worth investigating are Enterprise Architect from Sparx Systems and the free Violet ActionScript 3 Generator (VASGen).

checkmark Consider using design patterns

Two great books to have in your library are: Design Patterns: Elements of Reusable Object-Oriented Software and Head First Design Patterns.

Q&A: What’s in a Linux Name?

Q&A: What's in a Linux Name? - Gadgetwise Blog - NYTimes.com

June 9, 2009, 1:49 pm
By J.D. Biersdorfer

Question

Why does Linux seem to have multiple choices in operating systems, such as Ubuntu or Slackware, and where do the names come from?

Answer

First created by the Finnish programmer Linus Torvalds in 1991, Linux still maintains its open-source status today. This means that unlike a closed system (Microsoft Windows, for instance), the underlying source code for Linux is open for programmers to tinker, enhance and improve. With 18 years of programmers fiddling with the system, variations — commonly known as distributions — of Linux have naturally popped up.

The name of a particular distribution comes from its creator, so these can range from serious to silly, depending on who's doing the naming. Ubuntu, a community-developed Linux distribution sponsored by Canonical Ltd., gets its name from the Zulu word that roughly means "humanness" or "a person is a person through other people."

Slackware Linux, originally a side project by its creators, takes its name from the concept of slack as defined by Church of the SubGenius (the "religious" group that satirizes religion, among other things) as a sense of independence, originality and freedom.

Another popular Linux distribution, Debian, gets its moniker from its developer's wife and his own name: Debra + Ian = Debian. At least one blogger has compiled a list of Linux-name origins and sites like DistroWatch and Linux.org have information on the many Linux distributions out there as well.

Open source, digital textbooks coming to California schools

Open source, digital textbooks coming to California schools - Ars Technica

The cash-strapped Golden State has decided that, starting next school year, schools will be able to use open source, digital textbooks for a number of math and science subjects. Ars talked with Brian Bridges, the Director of the California Learning Resources Network, which will be reviewing the texts, to find out more about what the program entails.

Tuesday, June 9, 2009

Google Translator Toolkit

Google Translator Toolkit 是一个基于浏览器的在线计算机辅助翻译系统。

Top 10 Changes in Flex 4

InfoQ: Top 10 Changes in Flex 4

This week, Adobe released their first official beta of Flex 4, codenamed Gumbo. The release includes a number of major changes. This list gives a high level overview of the items that have changed in the latest version of the popular RIA framework.

1. Integration with Adobe Catalyst

The primary focus of the Flex 4 development effort is providing support and integration with Adobe Catalyst - Adobe's new designer tool for creating rich Internet application assets without writing code. Catalyst promises to change the way that developers and designers are able to collaborate in their efforts, as it recognizes that application developers and designers work differently. Thus, it allows each to concentrate on what they are good at, as it enables each to work in the traditional ways they are accustomed to. The majority of the changes on this list have been made in order to facilitate integration between Flex and Catalyst.

Learn more about Adobe Catalyst here.

2. Spark Component Architecture

Each version of Flex includes a full component library with all of the common items needed to build an application, including data grids, buttons, layout containers, etc. In Flex 4, the underlying architecture of the components is known as Spark, where it was known as Halo in Flex 3. A major part of the effort to support Catalyst is in revamping the component model to adhere to a much higher level of separation of concerns.

In the new Spark component model, core logic, skinning, and layout have been broken out so that they are handled independently of one another. The Spark component model is built on top of the Halo component model. Basically, that means that it extends from Halo's core base class UIComponent, allowing Flex4 to be adopted incrementally and Flex 3 components to be used in Flex 4 applications.

In addition to the other changes, effects have been updated in Flex 4. Effects can now animate arbitrary objects and types, allowing for much greater flexibility in their use. Flex 4 effects have been implemented in the new "spark.effects" package. Just like the new component library, the Flex 4 effects have been re-implemented, leaving the Flex 3 effects in place for backwards compatibility. For more information on Gumbo Effects see Chet Haase's article on Flex 4 Effects or his blog.

Read the following white paper to learn more about the Spark architecture

3. MXML 2009

MXML is an XML-based abstraction, built on top of ActionScript 3 - the Flash Player programming language. MXML is used for laying out the view portions of the user interface and supporting tooling, such as the IDE, and now Catalyst. MXML 2009 includes a number of updates to support the decoupling of different behaviors (core, skinning, and layout) and the new component library. The Flex 4 components have been implemented in their own package (spark.components), leaving the Flex 3 components in place. MXML 2009 includes a new namespace to support this.

The following example of an application declaration shows using the namespace and defining both the Spark and Halo component namespace:

<s:Application
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/halo">

Thus, one can use a Flex 4 Button by doing the following:

<s:Button label="My Flex 4 Button" />

And, the following for a Flex 3 Button:

<mx:Button label="My Flex 3 Button" />

Check out the MXML 2009 specification for additional detail on the changes.

4. Improvements to View States

Flex 2 introduced the notion of states to the Flex framework, where changes to a view component can be managed through a simple state change. In Flex 4, view states have been revamped to simplify the syntax and make them easier to use. An example of the simplified syntaxes are the new language attributes includeIn and excludeFrom, which can be set on a component to direct them how to behave on a state change (See below).

<!-- Given the states A,B,C -->
<m:states>
<m:State name="A"/>
<m:State name="B"/>
<m:State name="C"/>
</m:states>

<!-- This button will appear in only states A and B -->
<Button label="Click Me" includeIn="A, B"/>

<!-- This button will appear in states A and B -->
<Button label="Button C" excludeFrom="C"/>

Look here for more information on the changes to View States.

5. FXG Support

At its core, the Flash Player is a drawing engine. Adobe has leveraged this with the introduction of FXG in Flash Player version 10, and now its introduction to Flex. FXG is a declarative graphics format, which enables portability of assets between tools. That means that designers will be able to create assets in Catalyst or CS4 Illustrator, and the Flex application developer will be able to import them and use them without having to modify them.

Check out the FXG Specification for more details.

6. Skinning Enhancements

The biggest change in the Spark component model was overhauling skins so that they now control all visual aspects of the components and encapsulate their logic outside of the components core. Thus, this allows the visual parts of a component to be modified independently of the underlying core logic.

Let's look at the PanelSkin.mxml skin file, the default skin for the Panel container, for an example:

<?xml version="1.0" encoding="utf-8"?>
<s:SparkSkin xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" alpha.disabled="0.5">

<fx:Metadata>
<![CDATA[
/**
* @copy spark.skins.default.ApplicationSkin#hostComponent
*/
[HostComponent("spark.components.Panel")]
]]>
</fx:Metadata>

<fx:Script>
/* Define the skin elements that should not be colorized.
For panel, border and title backround are skinned, but the content area and title text are not. */
static private const exclusions:Array = ["background", "titleField", "contentGroup"];

/**
* @copy spark.skins.SparkSkin#colorizeExclusions
*/
override public function get colorizeExclusions():Array {return exclusions;}

/* Define the content fill items that should be colored by the "contentBackgroundColor" style. */
static private const contentFill:Array = ["bgFill"];

/**
* @inheritDoc
*/
override public function get contentItems():Array {return contentFill};
</fx:Script>

<s:states>
<s:State name="normal" />
<s:State name="disabled" />
</s:states>

. . . . .

<s:Rect left="1" right="1" top="31" height="1">
<s:fill>
<s:SolidColor color="0xC0C0C0" />
</s:fill>
</s:Rect>

<!-- layer 5: text -->
<!-- Defines the appearance of the PanelSkin class's title bar. -->
<s:SimpleText id="titleField" lineBreak="explicit"
left="10" right="4" top="2" height="30"
verticalAlign="middle" fontWeight="bold">
</s:SimpleText>

<s:Group id="contentGroup" left="1" right="1" top="32" bottom="1">
</s:Group>

</s:SparkSkin>

Since the only job of this skin file is to control the visual appearance of the Panel container, it makes it possible for a designer to modify how the component appears without ever editing the component source code or understanding the internal behavior of the component. More importantly, it allows designers to use Catalyst in a way that is natural to them.

Look here for more information on skinning Gumbo components.

7. Updated Layout Model

Those familiar with Flex development will notice that the majority of the containers used in the Flex 3 developer are not a part of the Gumbo component library. This is because layout has been decoupled and is now handled through delegation. Since most of the Flex 3 containers existed simply to provide different forms of layout (e.g. HBox for horizontal layout, VBox for vertical layout), they are no longer needed.

The following example shows one way that a Flex developer can now define layout. This example uses the Group class to manage the buttons, which is a new Spark class for management content items. The result is the two buttons displayed side-by-side, like it would have with an HBox in Flex 3.

<s:Group width="400" height="400">
<s:layout>
<s:HorizontalLayout paddingLeft="5" paddingTop="5" />
</s:layout>

<s:Button label="Button 1" />
<s:Button label="Button 2" />
</s:Group>

Adobe's Ryan Stewart hosts the following tech talk reviewing the new layout mechanisms: http://blog.digitalbackcountry.com/2009/05/flex-4-layouts-on-tech-talk-with-ryan-stewart/

8. Flash Builder 4

Flash Builder 4, formerly known as Flex Builder, is the latest version of the Eclipse based IDE for application developers. The new version comes with a handful of updates including: conditional debug break points, more refactoring tools, and FlexUnit 4 support. As always, it includes MXML, ActionScript 3, CSS editors, a visual designer, and the Flex performance and memory profiler (profiler only in the Professional version).

In addition, the latest version includes advanced data management features to simplify the development of data-centric applications. This includes client side data management features that handle CRUD operations and scrolling through large collections on your services.

Get more information on the IDE here.

9. Compiler Performance

A major pain point most everyone developing Flex 3 applications has encountered is poor compiler performance. Thus, one of the published goals for Gumbo was to improve compiler performance in Flex 4. At this point, there are not any official benchmarks published from this work. However, Adobe's Peter Donovan did publish some notes on his early efforts, stating that he believed a 25% improvement would be reached without significant restructuring. He also said that to achieve a 3-4 times improvement, a redesign will be required. Certainly everyone developing enterprise Flex applications hopes that this is addressed by the time Flex 4 ships at the end of 2009.

See Peter Donovan's notes for more information.

10. New Text Capabilities

A major knock on Flash based applications (both Flex and non-Flex based) has been the ability to effectively deal with text. In Flash Player 10, Adobe introduced a new text engine to support the demands of rich Internet applications (multi-lingual, print, keyboard short-cuts, etc). Gumbo includes a handful of new text classes (RichText, SimpleText, etc) for more robust text support within the Flex framework. In addition, Adobe is working on their new Text Layout Framework to give all ActionScript 3 developers the ability to harness the power of the Flash Player's text engine. Learn more about the Text Layout Framework at: http://labs.adobe.com/technologies/textlayout/

As you can see with the wide range of changes, Flex 4 represents another step forward for the popular RIA platform. For additional information on the Flex 4 SDK changes, see Matt Chotin's article, What's new in Flex 4 SDK beta.

Author's Bio

Jon Rose is an enterprise software consultant and Flex Practice Director at Gorilla Logic, Inc. located in Boulder, Colorado. He is an editor and contributor to InfoQ.com, an enterprise software community. He is the co-host of DrunkOnSoftware.com, a videocast for those who like booze and bits. He has worked with clients large and small in both the private sector and government. His love of solving problems drives him to build quality software. You can read his blog at: http://ectropic.com.

New Flex Builder Flash Builder 4 and Flash Catalyst

From InfoQ comes news that Adobe has released betas of Flash Builder 4 (the next version of Flex Builder) and Flash Catalyst. These are public betas, so you might want to check them out if you have the interest and the time.

New features added to Flash Builder 4 include:

  • Template support
  • Event handler generation
  • Getter/setter generation
  • ASDoc tooltips
  • States-based code view
  • Package explorer
  • FlexUnit testing
  • Command-line build
Adobe® Flash® Catalyst™ is a new professional interaction design tool for rapidly creating user interfaces without coding.
  • Transform artwork created in Adobe Photoshop® and Adobe Illustrator® into functional user interfaces.
  • Create interactive prototypes with the ability to leverage them in the final product
  • Publish a finished project as a SWF file ready for distribution
  • Work more efficiently with developers who use Adobe Flash Builder™ 4 to create rich Internet applications (RIAs). Designers use Flash Catalyst to create the functional user experience then provide the project file to developers who use Flash Builder to add functionality and integrate with servers and services.

Featured Post

Windows和Ubuntu双系统完全独立的安装方法

http://www.ubuntuhome.com/windows-and-ubuntu-install.html  | Ubuntu Home Posted by Snow on 2012/06/25 安装Windows和Ubuntu双系统时,很多人喜欢先安装windows,然...