常用firefox插件列表

如题,以下是firefox经常使用的插件列表,方便下次firefox安装时查找。
1、firebug
2、flashbug for firebug
3、Weave for Bookmarks(以前是用xmarks,说实施xmarks用得很,最近不知道是什么原因无法使用,将就用Weave代替吧)
4、All-in-one Gesture      鼠标导航控制
5、Adblock Plus   广告过滤
6、Noscript  脚本禁用
7、Net Notes 在线网页收藏备注
8、IE Tab 
9、Tab Mix Plus

10、foxtab

create and examine loaded Flex Modules

收藏自:lowpitch.com/blog/iflexmodulefactory-create-and-examine-loaded-flex-modules/

In an earlier post I described how you can load in flex modules using the ModuleManager class and the IModuleInfo interface, but I didn’t really mention IflexModuleFactory which is pretty fundamental to the whole process.

The factory is responsible for knowing how to create an instance of the module, and also provides access to certain properties of the module. It can get a little more complicated as the methods exposed by the factory become available at different stages of the load process, so you have to be careful not to try and retrieve information before it is available.

The factory is retrieved used by accessing the factory property of the IModuleInfo object, returned by ModuleManager.getModule (). For more information on this, see the previous post. The factory will be of type IFlexModuleFactory, which behind the scenes is implemented by mx.managers.SystemManager. You don’t really need to worry about this detail though, it’s enough to know about the two public methods exposed by the factory.

They are:

  • IFlexModuleFactory.create – This is really the most important method, and provides the mechanism for creating an instance of your loaded module. When enough of the module has been downloaded for this method to be called, the IModuleInfo object will dispatch a ModuleEvent.READY event, and the public property IModuleInfo.ready will return true. The method allows you to optionally pass in one or more parameters, using the “…rest” mechanism. These parameters are passed to your module’s constructor. Calling this method will create a new instance of your module, and the new instace of the method will be returned. The return type is specified as Object, so you will need to manually cast the returned object to the correct type in order to work with it.
  • IFlexModuleFactory.info – This module allows you to find out a bit of information about the module which is being loaded. When enough of the module has been downloaded for this method to be called, the IModuleInfo object will dispatch a ModuleEvent.SETUP event, and the public property IModuleInfo.setup will return true. The method returns an Object, containing a variety of name/value pairs providing bits of information about the module. Examples of the kind of information that can be contained in the object includes width, height, a list of mixins used by the module, a list of RSLs used by the modules, a list of fonts embedded within the module, and information about the modules Main class name. The method can be useful for finding out the module’s layout information before you create an instance of it and add it to the display list.
  • Just to mention a quick ‘gotcha’ that I encountered when first working with Modules… If you find that the call to IModuleData.factory.create for some reason returns null, or at some point in the process you get an Error #1009, most likely your module is using some classes which for some reason are not accessible once the SWFs have been compiled and optimised. A simple fix for this can be to reference the offending classes in some way in the main application to force them to be compiled. Common offenders are the ‘manager’ classes, for example DragManager, PopupManager and SystemManager.

 

loading Flex Modules dynamically

收藏自:lowpitch.com/blog

When you’re working with flex Modules, most of the time the ModuleLoader component will be enough to get you up and running. It will quickly and easily let you load your Modules and add them to the display list, it’ll even dispatch an event to let you know when the Module is ready. Lovely stuff. It’s very similar to the SWFLoader component with some added Module-related goodness thrown in.

However, there may be times when the ModuleLoader component may not be appropriate for your needs, and you’ll have to get your hands dirty and get involved with the lower-level ModuleManager class. Some examples of when ModuleLoader might not be suitable include:

  • Your Module is entirely non-visual, and therefore shouldn’t be added to the display list
  • Performance is really important to your application, and the extra overhead of the ModuleLoader container is something you need to remove to try and speed things up. (ModuleLoader essentially wraps your Module’s content in an extra container, incurring a slight performance hit).
  • You need greater control over how and when your modules are loaded and unloaded.

How does ModuleManager work?

ModuleManager maintains a map of modules, indexed by each module’s URL. Information about the module is stored as an object implementing IModuleInfo, and is retrieved by calling the ModuleManager.getModule method, passing in the module’s URL as the method’s only parameter. Once you’ve retrieved the IModuleInfo object, you can call its load method to starting loading in the module. While the module is loading, you can monitor the load progress using a variety of different events (of type ModuleEvent). Finally, when the module is loaded and available, you can create an instance of that module using someModuleInfo.factory.create ().

 

IModuleInfo in more detail

As mentioned above, ModuleManager maintains a mapping of URLs to modules. When you call ModuleManager’s static getModule method, it returns an object of type IModuleInfo. If you dig around within the ModuleManager class, you’ll see that this interface is implemented internally. It’s useful to know a little bit more about how you can interact with the ModuleInfo, what methods it exposes, and what events it dispatches.

There are four read-only public Boolean properties which offer information about the current state of the module. They can briefly be described:

  • IModuleInfo.error – This’ll be true if there was an error during loaded. You’re also notified of such an error by the ModuleEvent.ERROR event.
  • IModuleInfo.loaded – This will be true if you’ve previously called the IModuleInfo.load method. Note: It does not necessarily signify that the module has been loaded, just that the module load has begun.
  • IModuleInfo.setup – When enough of the module has loaded to be able to call the factory.info () method, this flag will be true. When this point in the load has been reached, a ModuleEvent.SETUP event will be dispatched.
  • IModuleInfo.ready – When enough of the module has been loaded for you to be able to instantiate an instance of the module using the factory.create () method, this flag will be true. At this stage, a ModuleEvent.READY event will be dispatched. This property will typically become true at some point after the IModuleInfo.setup becomes true.

There are some additional properties which can also be useful:

  • IModuleInfo.url fairly obviously returns the URL associated with the IModuleInfo object. This could be useful if you’re using one event handler to listen out for the events from multiple modules – the event.currentTarget.url property could be used to identify which module had sent out the event.
  • IModuleInfo.data is an object which you can use to associate data with a particular module. The data will be shared across all instances of a particular module, so this property comes in handy if you want to share state, or user information between multiple instances of the same dynamically loaded module.
  • IModuleInfo.factory is pretty important. Once the the module is ‘ready’ (after the ModuleEvent.READY event has been dispatched, or when IModuleInfo.ready returns true), you can create an instance of your module by calling the IflexModuleFactory.create method. Additionally, once the module has been ’setup’ (after ModuleEvent.SETUP has fired, or when IModuleInfo.setup returns true), you can query the IflexModuleFactory.info method to find out a little more about the module that has been loaded.

Next we should look at some of the methods exposed by an IModuleInfo:

  • IModuleInfo.load – This is the method you’ll call to start loading a module. You can optionally pass in information about the current ApplicationDomain and SecurityDomain if necessary. When the module is loading, events will be dispatched along the way as detailed below. Quite a nice feature here is that if the module has already been loaded, and you attempt to reload it, it’ll still dispatch the “setup” and “ready” events, meaning that you can use one set of event listener methods without needing to worry about whether the module is loading for the first time, or if it already exists in local memory. Snazzy…
  • IModuleInfo.release – This method will release the current reference to the module. Internally, when this method is called, a reference counter will be decremented. If no references to the module exist after this method has been called, it will automatically be unloaded.
  • IModuleInfo.unload – This triggers the unload of the module. It’s worth noting that if any references to the module exist, it will not be garbage collected. Also, calling this method won’t remove your module from the display list, you’ll have to do that too.

Lastly, let’s look at the events dispatched… All the events listed here are instances of ModuleEvent, and for some of the events you’ll be able to access information about the load progress through the event’s bytesLoaded and bytesTotal properties.

  • ModuleEvent.ERROR – Rather obviously, this is dispatched when an error occurs during loading. This will also be indicated by the IModuleInfo.error property returning true.
  • ModuleEvent.PROGRESS – This event is dispatched periodically during the load, giving you the chance to display a visual indication of load progress if you want. This is one of the events where the bytesLoaded and bytesTotal properties will be set.
  • ModuleEvent.SETUP – This event is dispatched when enough of the module has downloaded for you to call the IModuleInfo.factory.info method. At this point, IModuleInfo.setup will also return true. This event does not allow you to access load progress through the bytesLoaded and bytesTotal properties.
  • ModuleEvent.READY – This event is dispatched when enough of the module has downloaded for you to create an instance of the module through the IModuleInfo.factory.create method. From then on, IModuleInfo.ready will also return true. Apparently, this event is one where the bytesLoaded and bytesTotal properties should be set, although I’ve noticed that this isn’t always the case. I reckon it’s safer just to use the ModuleEvent.PROGRESS information for displaying progress information.
  • ModuleEvent.UNLOAD – This event is dispatched when the module has been unloaded. No progress information is available through the event object with this event.

A simple example

First, a basic module, SimpleModule, which does nothing more than display a label within a panel.

SimpleModule.mxml
XML/HTML代码
  1. <?xml version="1.0" encoding="utf-8"?>  
  2. <mx:Module xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">  
  3.     <mx:TitleWindow x="10" y="10" width="120" height="100" layout="absolute">  
  4.         <mx:Text text="SimpleModule!" />  
  5.     </mx:TitleWindow>  
  6. </mx:Module>  

The the main application, which will load in this module and attach instances to a Tile control.

Shell.mxml

XML/HTML代码
  1. <?xml version="1.0" encoding="utf-8"?>  
  2. <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"  
  3.     applicationComplete="initApp()">  
  4.     <mx:Script>  
  5.         <![CDATA[ 
  6.             import mx.modules.Module; 
  7.             import mx.events.ModuleEvent; 
  8.             import mx.modules.ModuleManager; 
  9.             import mx.modules.IModuleInfo; 
  10.   
  11.           protected var _moduleInfo:IModuleInfo; 
  12.              
  13.             private function initApp():void { 
  14.                addToLog ("Application initialised"); 
  15.                // create the module - note, we're not loading it yet 
  16.                 _moduleInfo = ModuleManager.getModule("SimpleModule.swf"); 
  17.                // add some listeners 
  18.                _moduleInfo.addEventListener(ModuleEvent.READY, onModuleReady); 
  19.                _moduleInfo.addEventListener(ModuleEvent.SETUP, onModuleSetup); 
  20.                _moduleInfo.addEventListener(ModuleEvent.UNLOAD, onModuleUnload); 
  21.                _moduleInfo.addEventListener(ModuleEvent.PROGRESS, onModuleProgress); 
  22.             } 
  23.             
  24.             protected function getModuleInfo () : IModuleInfo { 
  25.                // return the module info 
  26.                return _moduleInfo; 
  27.             } 
  28.             
  29.             /** 
  30.              * Adds output to the log 
  31.              **/ 
  32.             protected function addToLog (msg:String) : void { 
  33.                 log.text += msg + "\n"; 
  34.                 // scroll to the bottom on the next frame 
  35.                 callLater(scrollToBottom); 
  36.                 
  37.             } 
  38.             
  39.             protected function scrollToBottom () : void { 
  40.                 // scroll to the bottom 
  41.                 log.verticalScrollPosition = log.maxVerticalScrollPosition; 
  42.             } 
  43.             
  44.             /** 
  45.             * Called when the "load" button is pressed 
  46.             * 
  47.             * Starts loading the module - when the module has been 
  48.             * loaded, an instance of the module will be created 
  49.             * and added to the tile control 
  50.             * 
  51.             **/ 
  52.             private function loadModule () : void { 
  53.                 addToLog ("Loading module"); 
  54.                 // load the module 
  55.                 getModuleInfo().load(); 
  56.             } 
  57.     
  58.             /** 
  59.              * Called when the "unload" button is pressed 
  60.              * 
  61.              * Removes all the instances of the module from the 
  62.              * tile control, then unloads the module 
  63.              * 
  64.              */ 
  65.             private function unloadModule () : void { 
  66.                 addToLog ("Unloading module"); 
  67.                 // clear out all the the instances 
  68.                 // of the module from the tile 
  69.                 tile.removeAllChildren(); 
  70.                 // unload the module 
  71.                 getModuleInfo().release(); 
  72.                 //getModuleInfo().un 
  73.             } 
  74.              
  75.             /** 
  76.             * Handler for the ModuleEvent.PROGRESS event 
  77.             **/ 
  78.             protected function onModuleProgress (e:ModuleEvent) : void { 
  79.                 addToLog ("ModuleEvent.PROGRESS received: " + e.bytesLoaded + " of " + e.bytesTotal + " loaded."); 
  80.             } 
  81.              
  82.             /** 
  83.             * Handler for the ModuleEvent.SETUP event 
  84.             **/ 
  85.             private function onModuleSetup (e:ModuleEvent) : void { 
  86.                 addToLog ("ModuleEvent.SETUP received"); 
  87.                 // cast the currentTarget 
  88.                 var moduleInfo:IModuleInfo = e.currentTarget as IModuleInfo; 
  89.                 addToLog ("Calling IModuleInfo.factory.info ()"); 
  90.                 // grab the info and display information about it 
  91.                 var info:Object = moduleInfo.factory.info(); 
  92.                 for (var each:String in info) { 
  93.                     addToLog ("     " + each + " = " + info[each]); 
  94.                 } 
  95.                 
  96.             } 
  97.              
  98.             /** 
  99.             * Handler for the ModuleEvent.READY event 
  100.             **/ 
  101.             private function onModuleReady (e:ModuleEvent):void { 
  102.                 addToLog ("ModuleEvent.READY received"); 
  103.                 // cast the currentTarget 
  104.                 var moduleInfo:IModuleInfo = e.currentTarget as IModuleInfo; 
  105.                 // Add an instance of the module’s class to the 
  106.                 // display list. 
  107.                 addToLog ("Calling IModuleInfo.factory.create ()"); 
  108.                 tile.addChild( moduleInfo.factory.create () as SomeModule); 
  109.                 addToLog ("SomeModule instance created and added to Display List"); 
  110.             } 
  111.              
  112.             /** 
  113.             * Handler for the ModuleEvent.UNLOAD event 
  114.             **/ 
  115.             public function onModuleUnload (e:ModuleEvent) : void { 
  116.                 addToLog ("ModuleEvent.UNLOAD received"); 
  117.             } 
  118.              
  119.         ]]>  
  120.     </mx:Script>  
  121.      
  122.     <mx:HBox width="100%" height="100%">  
  123.         <mx:Tile id="tile" width="100%" height="100%" />  
  124.            <mx:TextArea id="log" width="100%" height="100%"/>  
  125.     </mx:HBox>  
  126.      
  127.      
  128.     <mx:ApplicationControlBar>  
  129.         <mx:Button label="Load" click="loadModule ()" />  
  130.         <mx:Button label="Unload" click="unloadModule ()"/>  
  131.     </mx:ApplicationControlBar>  
  132.      
  133. </mx:Application>  

What’s going on here? Well… when the app is created, initApp is called and the IModuleInfo object is created, and various event listeners are setup. When the user clicks the load button, the module is loaded. It doesn’t matter whether this is the first time the module is loaded, or if the module is already loaded and ready, the ModuleEvent.READY event will be dispatched to let us know that the module is ready, and that we can now create an instance of it. Within the handler for the ModuleEvent.READY event, we call IModuleInfo.factory.create () and add the instance of the module to our Tile control.

When the user clicks the unload button, all instances of the Module that we’ve added to the Tile control are removed, and we call IModuleInfo.unload to unload the module. A log message from within the handler for ModuleEvent.UNLOAD demonstrates that this is happening.

Additionally, within the event handler for ModuleEvent.SETUP we show an example of the IModuleInfo.factory.info method – this’ll give you an example of the kind of information you can retrieve about the module, and from looking at the log messages you’ll be able to see the order in which these events are dispatched.

Lastly, here’s the finished example:

 (Update: I’ve explained the IFlexModuleFactory class in a little more detail here.)

myeclipse 7.5 keygen 源代码

转自http://blog.csdn.net/shadowkiss/archive/2009/07/30/4393610.aspx

 

Java代码
  1. import java.text.DecimalFormat;  
  2. import java.text.NumberFormat;  
  3. import java.text.SimpleDateFormat;  
  4. import java.util.Calendar;  
  5.   
  6. /** 
  7.  * myeclipse blue 7.5 keygen 
  8.  *  
  9.  * @author bona shen 
  10.  *  
  11.  */  
  12. public class Crack {  
  13.     public static final void main(String[] args) {  
  14.         String id = "bona"// 可更给为您的名字  
  15.         String num = "999";// 许可证数量  
  16.         System.out.println(getSerial(id, "100", num, false));  
  17.     }  
  18.   
  19.     public static String getSerial(String userId, String version,  
  20.             String licenseNum, boolean selected) {  
  21.         Calendar cal = Calendar.getInstance();  
  22.         cal.add(110);  
  23.         cal.add(6, -1);  
  24.         NumberFormat nf = new DecimalFormat("000");  
  25.         licenseNum = nf.format(Integer.valueOf(licenseNum));  
  26.         String verTime = selected ? (new StringBuffer("-")).append(  
  27.                 (new SimpleDateFormat("yyMMdd")).format(cal.getTime())).append(  
  28.                 "0").toString() : "-1012310";  
  29.         String type = "YE3MB-";  
  30.         String need = (new StringBuffer(String.valueOf(userId.substring(01))))  
  31.                 .append(type).append(version).append(licenseNum)  
  32.                 .append(verTime).toString();  
  33.         String dx = (new StringBuffer(String.valueOf(need)))  
  34.                 .append(  
  35.                         "Decompiling this copyrighted software is a violation of both your license agreement and the Digital Millenium Copyright Act of 1998 (http://www.loc.gov/copyright/legislation/dmca.pdf). Under section 1204 of the DMCA, penalties range up to a $500,000 fine or up to five years imprisonment for a first offense. Think about it; pay for a license, avoid prosecution, and feel better about yourself.")  
  36.                 .append(userId).toString();  
  37.         int suf = decode(dx);  
  38.         String code = (new StringBuffer(String.valueOf(need))).append(  
  39.                 String.valueOf(suf)).toString();  
  40.         return change(code);  
  41.     }  
  42.   
  43.     private static int decode(String s) {  
  44.         int i = 0;  
  45.         char ac[] = s.toCharArray();  
  46.         int j = 0;  
  47.         for (int k = ac.length; j < k; j++)  
  48.             i = 31 * i + ac[j];  
  49.         return Math.abs(i);  
  50.     }  
  51.   
  52.     private static String change(String s) {  
  53.         byte abyte0[] = s.getBytes();  
  54.         char ac[] = new char[s.length()];  
  55.         int i = 0;  
  56.         for (int k = abyte0.length; i < k; i++) {  
  57.             int j = abyte0[i];  
  58.             if (j >= 48 && j <= 57)  
  59.                 j = ((j - 48) + 5) % 10 + 48;  
  60.             else if (j >= 65 && j <= 90)  
  61.                 j = ((j - 65) + 13) % 26 + 65;  
  62.             else if (j >= 97 && j <= 122)  
  63.                 j = ((j - 97) + 13) % 26 + 97;  
  64.             ac[i] = (char) j;  
  65.         }  
  66.         return String.valueOf(ac);  
  67.     }  
  68. }  

运行就产生序列号。

如果不想动手可以用这个。

Subscriber: bona

Subscription:oLR8ZO-655444-65678656903184204

Subscription Detail:

Subscriber: bona
Product ID: E3MB (MyEclipse Blue Subscription)
License version: 1.0
Full Maintenance Included
Subscription expiration date (YYYYMMDD): 20101231
Number of licenses: 999

中远舟山船厂移交新造散装货船

远投资昨日透露,中远造船厂的另一子公司——中远舟山船厂(cosco (Zhousan) Shipyard),移交了一艘载重5万7000吨的新造散装货船给客户——中国远洋控股(China cosco Holdings)的一家子公司。

  另一方面,中远投资(cosco)的子公司中远大连船厂(COSCO (Dalian) Shipyard)已同意一家欧洲船主的请求,把5艘载重各9万2500吨的散装货船(bulk carrier)的移交日期,延后15至23个月。

  中远投资表示,这5艘货船的合同是在2007年10月24日签署,现在最后一艘移交的日期,将改为2012年12月,而不是原先的2011年9月。中远大连船厂是中远投资的51%子公司中远造船厂(Cosco Shipyard)的子公司。

FDT 3.5 beta 破解

目前FDT已经发布了3.5beta版,下面是新功能的介绍EN版的。

What’s new in FDT 3.5

With version 3.5 of FDT we are introducing great new features for both MXML and ActionScript editor. While we are focused on bringing you the best MXML editor for flex development at this time, we are continually improving FDT.

There will be two beta testing phases before final release.

The public beta of FDT 3.5 Beta 1 is released since august 27th. Public beta release for FDT 3.5 Beta 2 is scheduled for the next weeks.

Update: Mac Snow Leopard users should update to the latest beta Version 3.5 Build 1033, FDT provides full support in this version.

Features and Improvements of FDT 3.5 beta 1

Autocompletion for MXML Tags

Autocompletion for event types

Watch that feature in action

Improved Quick Outline

Autocompletion for constant convention

Watch that feature in action

Semantic Highlighting and Autocompletion for inline XML

Watch that feature in action

New Quick Fixes

Watch that feature in action

Brand new Debugger

Variable folding and XML Preview are the new features in the debugger

Features and Improvements of FDT 3.5 beta 2

  • Autocompletion for ActionScript in MXML files
  • Search and Find References in MXML files

安装有两种方式,一种是all in one,一种是eclipse plugin。

FDT 3.5 beta for Windows

How to install FDT 3.5 beta in Eclipse?

  1. Install Eclipse (www.eclipse.org)
  2. Open Eclipse
  3. Select "Help->Software Updates->Find and install…"
  4. Select "Search for new features to install" and press next
  5. Press "New Remote Site…"
  6. Insert FDT into Name and "http://fdt.powerflasher.com/update_beta/" into URL
  7. Press finish

点击下载此文件

解压后放在eclipse plugin\安装目录com.powerflasher.fdt.core_3.5.0.1040文件夹中。

破解后的效果如下:

如何让马喝水

“激励员工”而不了解员工,肯定是缘木求鱼,所以这一讲,我们就来补这一课。

员工的动力来自何方?

在我的“有效激励员工”的培训课上,我第一个讨论的问题是:请判断如下的论述是否正确,“食物激励老鼠寻觅食物",这个看似简单的问题引起了很大的争论。

人们的第一个直觉,认为这个论述更定是对的,但深入思考后,我们会发现,并不是食物使老鼠千方百计去觅食,而是饥饿,饥饿是最基本的生理需要之一,正是饥饿驱使老鼠去寻求解决方案,最后发现只有食物才能解决老鼠的饥饿问题。

同样,“员工的动力来自何方?”,员工的动力来自于你-经理吗?答案也是肯定的,但会让很多人吃一惊,员工的动力来自于他自己,而不是经理,尽管所有的经理都想让员工很有动力地工作。

这些动力,包括,更好的收入让家庭的生活更美好、更体面的工作让他在朋友或亲友前更有面子、更轻松的工作、更好的工作环境等等。

那么,如果员工的动力来自于他自己,那么我们经理人的角色是什么呢?

马口渴吗?

一个销售员面对又一个月销售为零的记录,无可奈何地对经理说,“我可以把马拉到河边,我也可以把马头按到水里,但我无法让它喝水。”

“什么?”经理大吃一惊,看着销售员,“你的工作不是把马拉到河边,也不是把马头按到水里,你的工作是让马感到口喝!!!”

这是我最喜欢的关于“激励”的故事,经理在这里的角色,

-强化他的内在需求;

-把“努力工作”与“内在需求”联系起来,让员工了解,“努力工作”是解决“内在需求”的一种重要方法;

这里的潜台词是,第一步是让员工口渴,第二步是告诉员工“努力工作”可以解决口喝的问题。

内在需求的表面化

这里有一个需要解决的问题是,员工的“内在需求”是非常主观的、模糊的、易变的,因此,你要锁定员工的“内在需求”,并把这些“内在需求”表面化、可视的、可衡量的。

例如,“更好的收入让家庭的生活更美好!”,我们需要把这个“内在需求”翻译成更理性的语言,当然如何翻译,就是各个经理的手段了,可以有不同的版本,

-承担更多的工作,就可以学到更多的东西,就有更多的升职可能;

-更高级别职位,就意味着更高的收入;

-如果服务年限越长,公司给予的福利项目就越多;

-如果销售业绩上去了,销售提成就越高;

-工作能力提高了,就能找到薪水更高的工作;

-公司如果上市了,每个人都能成为百万富翁;

可以看见,同一种“内在需求”,我们可以把它强化成不同的表象,当然也会引导员工向不同的方向上努力。

那作为经理的你,应该选择什么呢?这就要问你,“你了解你的员工吗?”

你了解你的员工吗?

 所以,“了解你的员工”就成为激励员工的第一步,你可以通过不同的方法来了解你的员工,了解他到底想要什么?什么对于他而言是重要的?为什么是重要的?等等。

 一旦,你了解了,你就需要把这些内在的东西显现出来,然后,你提供解决方案来满足这些内在需求。

在这个过程中,你可以观察到你的员工充满着“动力”,而你所做就称为“激励”。

开始吧!开始你的发现之旅。

自定义 Tree Data descriptor

在做开源供应链管理系统的时候,会用到很多树形的描述,需要用到mx.controls.Tree来展现,而数据库表定义时,表内有相关联如下:

SQL代码

create table "materialStock"."dbo"."MaterialType"(
"autoId" _autoId not null,
"parentId" _autoId null,
"unit" _unit(20) null,
"name" _name(20) null,
constraint "XPKMaterialType" primary key ("autoId")
)
go

alter table "materialStock"."dbo"."MaterialType"
add constraint "R_6"
foreign key ("parentId")
references "materialStock"."dbo"."MaterialType"("autoId")
go
create unique index "XPKMaterialType" on "materialStock"."dbo"."MaterialType"("autoId")
go

通过JPA就自动生成如下JAVA代码:
Java代码

package com.csgjs.mm.model.domain;

import …

/**
* AbstractMaterialType entity provides the base persistence definition of the
* MaterialType entity.
*
* @author MyEclipse Persistence Tools
*/
@MappedSuperclass
public abstract class AbstractMaterialType implements java.io.Serializable {

// Fields

private Integer autoId;
private MaterialType materialType;
private String unit;
private String name;
private Set<MaterialType> materialTypes = new HashSet<MaterialType>(0);

// Constructors

…

public void setMaterialType(MaterialType materialType) {
this.materialType = materialType;
}

…

@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "materialType")
public Set<MaterialCatalog> getMaterialCatalogs() {
return this.materialCatalogs;
}

@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "materialType")
public Set<MaterialType> getMaterialTypes() {
return this.materialTypes;
}

public void setMaterialTypes(Set<MaterialType> materialTypes) {
this.materialTypes = materialTypes;
}

}

再由granite data service自动生成如下AS3类:

ActionScript代码

public class AbstractMaterialTypeBase implements IExternalizable {

private var __initialized:Boolean = true;
private var __detachedState:String = null;

private var _autoId:Number;
private var _materialType:MaterialType;
private var _materialTypes:ListCollectionView;
private var _name:String;
private var _unit:String;

meta function isInitialized(name:String = null):Boolean {
if (!name)
return __initialized;

var property:* = this[name];
return (
(!(property is AbstractMaterialType) || (property as AbstractMaterialType).meta::isInitialized()) &&
(!(property is IPersistentCollection) || (property as IPersistentCollection).isInitialized())
);
}

public function set autoId(value:Number):void {
_autoId = value;
}
public function get autoId():Number {
return _autoId;
}

public function set materialType(value:MaterialType):void {
_materialType = value;
}
public function get materialType():MaterialType {
return _materialType;
}

public function set materialTypes(value:ListCollectionView):void {
_materialTypes = value;
}
public function get materialTypes():ListCollectionView {
return _materialTypes;
}

public function set name(value:String):void {
_name = value;
}
public function get name():String {
return _name;
}

public function set unit(value:String):void {
_unit = value;
}
public function get unit():String {
return _unit;
}

public function readExternal(input:IDataInput):void {
__initialized = input.readObject() as Boolean;
__detachedState = input.readObject() as String;
if (meta::isInitialized()) {
_autoId = function(o:*):Number { return (o is Number ? o as Number : Number.NaN) } (input.readObject());
_materialType = input.readObject() as MaterialType;
_materialTypes = input.readObject() as ListCollectionView;
_name = input.readObject() as String;
_unit = input.readObject() as String;
}
else {
_autoId = function(o:*):Number { return (o is Number ? o as Number : Number.NaN) } (input.readObject());
}
}

public function writeExternal(output:IDataOutput):void {
output.writeObject(__initialized);
output.writeObject(__detachedState);
if (meta::isInitialized()) {
output.writeObject(_autoId);
output.writeObject(_materialType);
output.writeObject(_materialTypes);
output.writeObject(_name);
output.writeObject(_unit);
}
else {
output.writeObject(_autoId);
}
}
}
}

当调用远程服务返回的数据是一个ArrayCollection,包含所有的MaterialType的数据集合。

但是Tree的默认的dataDescriptor是查找children属性,可是MaterialType中没有,只有 materialTypes包含子node.

所以在mx.controls.treeClasses.DefaultDataDescriptor继承新类重载getChildren和 isBranch两个方法。

代码如下:

ActionScript代码

package org.bona.controls
{
import flash.utils.Dictionary;

import mx.collections.ArrayCollection;
import mx.collections.ICollectionView;
import mx.collections.XMLListCollection;
import mx.controls.treeClasses.DefaultDataDescriptor;
import mx.controls.treeClasses.ITreeDataDescriptor;

public class TreeDataDescriptor extends DefaultDataDescriptor implements ITreeDataDescriptor
{
/**
*  Constructor.
*/
public function TreeDataDescriptor(children:String=null)
{
super();
childrenField=children;
//trace(‘TreeDataDescriptor Constructor, ’ + childrenField);
}

/**
*  @private
*/
private var ChildCollectionCache:Dictionary=new Dictionary(true);

[Bindable]
public var childrenField:String=null;

override public function getChildren(node:Object, model:Object=null):ICollectionView
{
//          trace(node);
var childrenCollection:ICollectionView=super.getChildren(node, model);
var children:*;
if (childrenCollection != null)
{
//              trace(’super.getChildren =’, childrenCollection);
return childrenCollection;
}
children=node[childrenField];
//          trace(children);

//then wrap children in ICollectionView if necessary
if (children is ICollectionView)
{
childrenCollection=ICollectionView(children);
}
else if (children is Array)
{
var oldArrayCollection:ArrayCollection=ChildCollectionCache[node];
if (!oldArrayCollection)
{
childrenCollection=new ArrayCollection(children);
ChildCollectionCache[node]=childrenCollection;
}
else
{
childrenCollection=oldArrayCollection;
//ArrayCollection(childrenCollection).mx_internal::dispatchResetEvent=false;
ArrayCollection(childrenCollection).source=children;
}

}
else if (children is XMLList)
{
var oldXMLCollection:XMLListCollection=ChildCollectionCache[node];
if (!oldXMLCollection)
{
// double check since XML as dictionary keys is inconsistent
for (var p:*in ChildCollectionCache)
{
if (p === node)
{
oldXMLCollection=ChildCollectionCache[p];
break;
}
}
}

if (!oldXMLCollection)
{
childrenCollection=new XMLListCollection(children);
ChildCollectionCache[node]=childrenCollection;
}
else
{
childrenCollection=oldXMLCollection;

//We don’t want to send a RESET type of collectionChange event in this case.
//XMLListCollection(childrenCollection).mx_internal::dispatchResetEvent=false;
XMLListCollection(childrenCollection).source=children;
}
}
else
{
var childArray:Array=new Array(children);
if (childArray != null)
{
childrenCollection=new ArrayCollection(childArray);
}
}
return childrenCollection;
}

/**
*  Tests a node for termination.
*  Branches are non-terminating but are not required to have any leaf nodes.
*  If the node is XML, returns <code>true</code> if the node has children
*  or a <code>true isBranch</code> attribute.
*  If the node is an object, returns <code>true</code> if the node has a
*  (possibly empty) <code>children</code> field.
*
*  @param node The node object currently being evaluated.
*  @param model The collection that contains the node; ignored by this class.
*
*  @return <code>true</code> if this node is non-terminating.
*/
override public function isBranch(node:Object, model:Object=null):Boolean
{
var branch:Boolean = super.isBranch(node,model);
if (branch)return branch;
if (node == null)
return false;
if (node is Object)
{
try
{
if (node[childrenField] != undefined)
{
branch=true;
}
}
catch (e:Error)
{
}
}
return branch;
}

}

}

在应用程序模块中如下应用:

MXML代码


<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:tdd="org.bona.controls.*" creationComplete="{initData();}" viewSourceURL="srcview/index.html">
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
[Bindable]
private var datas:ArrayCollection = new ArrayCollection();
[Bindable]
private var selectedItem:MaterialType;

private function initData():void{
var mt:MaterialType = generateMaterialType(‘level top -1′);
generateMaterialType(‘level 2-1′,mt);
generateMaterialType(‘level 2-2′,mt);
generateMaterialType(‘level 2-3′,mt);
datas.addItem(mt);
mt = generateMaterialType(‘level top -2′);
datas.addItem(mt);
}

private function generateMaterialType(name:String,parent:MaterialType=null):MaterialType{
var mt :MaterialType = new MaterialType();
mt.name = name;
if(parent !=null){
if(parent.materialTypes==null){
parent.materialTypes = new ArrayCollection();
}
parent.materialTypes.addItem(mt);
}
return mt;
}

private function selected(e:Event):void{
selectedItem = Tree(e.target).selectedItem as MaterialType;
}

]]>
</mx:Script>
<mx:HDividedBox width="100%" height="100%">
<mx:Tree dataProvider="{datas}" labelField="name" height="100%" width="100%" change="selected(event);">
<mx:dataDescriptor>
<tdd:TreeDataDescriptor childrenField="materialTypes"/>
</mx:dataDescriptor>
</mx:Tree>
<mx:VBox width="100%" height="100%">
<mx:Label text="selected material type:"/>
<mx:TextArea width="100%" height="100%" text="{selectedItem.name}"/>
</mx:VBox>

</mx:HDividedBox>

</mx:Application>

这样就可以自定义childrenField来描述自己的结构。

查看在线Demo

自己写的AIR小程序 for Adoble workflowlab(WL)

如题,下载了adobe workflowLab AIR软件,做系统开发流程的设计规划,还是挺有意思的,后来看了看他的tool列表全是adobe公司自己的产品,你想在任务中标识产品工具就是不行,找到他的安装目录发现有个XML文件.

一般是这个路径:C:\Program Files\WorkflowLab\assets\tools\adobe\tools_en_US.xml.

内容大致如下:

XML/HTML代码
  1. <tools>  
  2.   <tool name="Adobe Media Encoder CS4" type="Adobe" version="CS4" icon="media_encoder_16.png" link=""/>  
  3.   <tool name="Adobe Reader 9" type="Adobe" version="9" icon="acrobatReader_16.png" link="http://www.adobe.com/go/EN_US-H-GET-READER"/>  
  4.   <tool name="Adobe Photoshop CS4" type="Adobe" version="CS4" icon="photoshop_16.png" link="http://www.adobe.com/go/tryphotoshop"/>  
  5.   <tool name="Adobe Illustrator CS4" type="Adobe" version="CS4" icon="illustrator_16.png" link="http://www.adobe.com/go/tryillustrator"/>  
  6.   <tool name="Adobe Fireworks CS4" type="Adobe" version="CS4" icon="fireworks_16.png" link="http://www.adobe.com/go/tryfireworks"/>  
  7.  。。。。  

 

所以就写了一个小工具实现对该文件的编辑。

保存后再打开ADOBE WL程序:

To install this application you will need the Adobe Flash Player

Adding multiple sets of visual children to custom

Problem

You can not use children visual components inside base MXML component to extend, and you can not add children into MXML component which already has children.

Solution

You can use states inside base MXML component to build UI and that component you can easily extend or use as container.

Detailed explanation

If you try to use a custom component that contains visual components (typically, the container) as the base class for the new component, you get the error performance.


Custom component.
BaseComponent.mxml:

 

XML/HTML代码
  1. <?xml version="1.0" encoding="utf-8"?>  
  2.   
  3. <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml">  
  4.   
  5.       <mx:Label text="Top"/>  
  6.   
  7.       <mx:Label text="Bottom"/>  
  8.   
  9. </mx:VBox>  

Extending component.
ExtendedComponent.mxml:

 

XML/HTML代码
  1. <?xml version="1.0" encoding="utf-8"?>  
  2.   
  3. <BaseComponent xmlns="*" xmlns:mx="http://www.adobe.com/2006/mxml"  
  4.   
  5.       width="400"  
  6.   
  7.       height="300"  
  8.   
  9.       horizontalAlign="center">  
  10.   
  11.       <mx:Label text="Center"/>  
  12.   
  13. </BaseComponent>  

Execution of this code will throw this error:

Error: Multiple sets of visual children have been specified for this component (base component definition and derived component definition).

Even when use meta-tag [DefaultProperty]

BaseComponent.mxml:

 

XML/HTML代码
  1. <?xml version="1.0" encoding="utf-8"?>  
  2.   
  3. <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml">  
  4.   
  5.       <mx:Metadata>  
  6.   
  7.             [DefaultProperty("contentChild")]  
  8.   
  9.             [DefaultProperty("contentChildren")]  
  10.   
  11.       </mx:Metadata>  
  12.   
  13.       <mx:Script>  
  14.   
  15.             <![CDATA[ 
  16.  
  17.                   import mx.core.UIComponent; 
  18.  
  19.                   public function set contentChild(value:UIComponent):void{ 
  20.  
  21.                         this.addChild(value); 
  22.  
  23.                   } 
  24.  
  25.                   public function set contentChildren(list:Array):void{ 
  26.  
  27.                         for each(var p:* in list) this.addChildAt(p, 0); 
  28.  
  29.                   } 
  30.  
  31.             ]]>  
  32.   
  33.       </mx:Script>  
  34.   
  35.       <mx:Label text="Top"/>  
  36.   
  37.       <mx:Label text="Bottom"/>  
  38.   
  39. </mx:VBox>  

As a result, the same error.

But in this case, in the extending component, you can use the state /states. If you specify default state and all visual components will be added through this state, they will be added without error. Using states will allow user to extend components many times as you like. States, although slow program, but sometimes very useful.

BaseComponent.mxml:

 

XML/HTML代码
  1. <?xml version="1.0" encoding="utf-8"?>  
  2.   
  3. <mx:VBox initialize="initializeHandler(event)" xmlns:mx="http://www.adobe.com/2006/mxml">  
  4.   
  5.       <mx:Script>  
  6.   
  7.             <![CDATA[ 
  8.  
  9.                   protected function initializeHandler(event:Event):void{ 
  10.  
  11.                         this.currentState = 'defaultState'; 
  12.  
  13.                   } 
  14.  
  15.             ]]>  
  16.   
  17.       </mx:Script>  
  18.   
  19.       <mx:states>  
  20.   
  21.             <mx:State name="defaultState">  
  22.   
  23.                   <mx:AddChild relativeTo="{this}" position="firstChild">  
  24.   
  25.                         <mx:Label text="Top"/>  
  26.   
  27.                   </mx:AddChild>  
  28.   
  29.                   <mx:AddChild relativeTo="{this}" position="lastChild">  
  30.   
  31.                         <mx:Label text="Bottom"/>  
  32.   
  33.                   </mx:AddChild>  
  34.   
  35.             </mx:State>  
  36.   
  37.       </mx:states>  
  38.   
  39. </mx:VBox>  

ExtendingCustomMXMLComponents.zip
[Example flex Builder project]

DesignView 类似于flex builder设计界面的flex程序

Preview
Download AIR Version
Project Home

flashDevelop已经将其封装成插件,到这面可以下载。

flex Design View maximus3D (Design View)

xMCNUGGETx (FD Wrapper)

xmcnuggetx.com forum thread Editor for mxml files in an integrated design view like flex Builder

Installation Instructions(安装方法)
Open FlashDevelop
Goto Tools>Application Files..
This will open an explorer window (note the path)//这一步要注意,一般插件只需要Copy 安装目录的plugins中就可以。
Close FlashDevelop
Extract .zip to location noted earlier

PureMVC for ActionScript框架的理解

1、ApplicationFacade
    initializeController()//初始化控制器
    registerCommand()     //注册控制器
    registerProxy()       //注册模型
    registerMedatior()     //注册视图介子

一般情况下:
registerProxy()、registerMedator()由StartupCommand来完成

2、Mediator
    a)与Proxy、Command之间主要方法
    override public function listNotificationInterests():Array
    //通过这个方法声明视图介子对什么样的消息感兴趣
    override public function handleNotification( note:Inotification ):void
    //处理Facade发送来的自己感兴趣的消息,一般处理视图的数据和视图效果,通常通过note.getName()判断消息类型,通过note.getBody()获取传递的数据。
    b)与Component之间主要是通过侦听Component的EVENT事件再通过Facade.sendNotification发Proxy、Command发送消息

3、Command
    可以将他看作控制器,其是无状态的,当Facade有相关消息时自动创建并调用
Command实例的override public function execute( notification:INotification ):void方法,主要是用来处理业务逻辑。通常调用facade.retrieveProxy方法来获取Proxy实例,操作数据。

4、Proxy
    主要是用来进行数据逻辑层面的操作,一般拥有ValueObject。如果是采用RemoteObject、HttpService、WebService等方法进行远程数据交换时,通常是封装在Proxy中。当有数据更新完成时通过Facade.sendNotification发送相关消息给其他订阅者。

点击下载此文件

Samuel Asher Rivello在adobe 网站发布An introduction to PureMVCfor adobe Flash and flex 讲得比较清楚,有两个图清晰介绍了PureMVC。

10 tips for working with PureMVC

Jesse Wardens great article called “10 Tips For Working With Cairngorm” has given me the idea to share 10 tips using PureMVC as well. I’ve been using PureMVC intensively for about six months now and – that’s not a secret – I’m loving it. Anyway, all my following opinions are based on my personal experiences only. ;-)

 

  1. Think in (Pure)MVC

    How do I start using PureMVC? Short answer: Just think in (Pure)MVC! As its named says, PureMVC based on the classic Model-View-Controller design meta-pattern. Using the Facade-pattern you don’t instantiate the core actors directly, but every member of PureMVC has its own and clear defined role:
    – Proxies = Model

    - Mediator and its ViewComponents = View
    – Commands = Controller

  2. Create an API for View Components

    A View Component might be a standard UI component (e.g. DataGrid) or a custom component (e.g. a world within a game) or whatever. Don’t use its public methods directly. In order to change its state or behavior create an API.

    One of the advantage of PureMVC is to be neutral to the technologies being used. An example: I’ve built a “pure” Flash application based on PureMVC without using the flex Framework. The same app will be ported to an AIR application for using AIR’s great File system API. The View Components have to be changed using the flex Framework, but not the Mediators or any other actors of PureMVC.

  3. Use one Mediator for multiple View Components

    To coordinate more than one View Component closely, use one Mediator only. In other words: Not all Views need a Mediator. For example: Assume a ApplicationControlBar containing a TextInput , and a Button or something else. Then create just one Mediator for the ApplicationControlBar called ApplicationControlBarMediator and refer to the missing components casted as a second, third, etc. View Component.

  4. Let’s Events bubble up

    What happens if you don’t want to use multiple View Components within a Mediator? In order to handle user interactions with multiple View Components let’s bubble Events from the nested children of a View Component up.

    For example: Clicking any Button within a View Component will fired up a custom Event which the Mediator is listen to. So the Mediator don’t have to know about the existing Button or about any other child of its View Component, just about the custom Event bubbled up.

  5. Communicate using Notifications as often as possible

    Notifications are the “Events” of PureMVC. For communicating between the three tiers Model, View and Controller use Notifications for the following scenarios as often as possible:

    (communication from -> to)
    – Mediator -> Proxy (via mapped Commands)
    – Proxy -> Mediator
    – Proxy -> Command
    – Commands -> Mediator

    Even if it’s possible to retrieve a Proxy from a Mediator, don’t change the Proxy from a Mediator directly rather than sending a Notification using a mapped Command. It’s a bad practice to change a Proxy (Model) from a Mediator (View) directly without using a Command (Controller).

  6. Use Commands / MacroCommands as often as possible

    Commands are doing the job at the Controller side: Retrieving and interacting Proxies, communicating with Mediators or executing other Commands. Even if a Command used only once or it has only two lines of code, use it as often as possible. To execute a Command once again anywhere or anytime within your application, you have to send just a Notification. In the future it’s easy to enlarge the Command with more complex actions. And – that’s very important – you always know, who the actor for changing the Proxy (Model) is.

    Question: Have you had to execute more than one Command in a particular order? Use MacroCommands to execute multiple SubCommands (which means “simple” Commands) sequentially.

  7. Use Remote Proxy to send and receive server-side data

    To send and receive data between the application tier use Proxies called Remote Proxies. That’s not a special kind of a PureMVC Proxy, just a location based on a Proxy to organize the server calls such as HTTPServices, RemoteObjects or whatever.

    For example: To call a server-side RemoteObject to login a user create Proxy called LoginProxy. The LoginProxy does all the job to communicate with the server-side, which means sending and receiving data. Whenever you’ll change the server-side implementation for the LoginProcess, you’ll have to change one location within your application only – the LoginProxy.

  8. Remove unused Mediators

    In some cases you don’t use a Mediator and its View Components anymore. Then remove the Mediator using facade.removeMediator(MyMediator.NAME); in conjunction with a self created destroy() method to remove the ViewComponent including all listeners, timer, references, etc. for a successful garbage collection.

  9. The Power of VO’s (Value Objects)

    The place to store data within the Model are the Proxies – that’s right. The View Components have no need to know the Facade and the rest of the PureMVC application – that’s right, too. This means that the View Component has no access to the Model data directly.

    To avoid this issue store within the View Component a reference to the data using Value Objects (VO’s). The VO’s are not a core actor of PureMVC and in conjunction with the Data Binding feature of Flex are a powerful way to react changes in the Model data without breaking rules.

  10. Courseware available

  11. Cliff Hall has done an awesome job: You’ll find not only excellent documentations about the “Framework Overview“, “Best Practices” and a “Conceptual Diagram“, also a very, very, very helpful Courseware. Check it out!

日本造船模式的特点

日本造船模式虽然各船厂动作方式存在差异性,但都存在以下规律性的东西:

1、船舶产品通过生产设计,均按区域/类型/阶段进行作业分解

2、按区域/类型/阶段/系统进行组合

3、工程分解的作业类型均以一种中间产品形式体现在各个生产过程中

4、组织造船生产过程中,均体现壳、舾、涂作业的有机结合

5、生产技术准备过程中,均体现设计、生产、管理部门间的有机结合

 

系统、区域、类型和阶段的定义正如:

系统:指产品结构功能或者操作功能,即锚泊系统、燃油系统、照明系统等。

区域:指生产对象,是产品的某一部位(如货舱、上层建筑、机舱等)划分,再划分或组合。区域可大可小。划是一个分段、总段,抑或是船上某一个区域等。

类型:按作业问题的相似性来划分生产的过程,所谓的作业类型为作业特征、数量、质量、工种等,由此可按上述四个类型划分生产过程,如曲面分段或平面分段,单件加工工分道作业线加工等。

阶段:按照生产顺序划分的生产全过程中的一部分,也就是常说的作业阶段或工艺阶段等,如零件加工、小组立、中组立、大组立、结构面舾装、非结构面舾装、青空艇装和船上舾装等。

中间产品完整性要求

造船企业中,中间产品按照不同的制造级可以划分很多种,再加上管理的要求,比如:中组完整性、单元完整性、搭载完整性、下水完整性等等,再按照专业化的分工:分段制造、管件制造、舾装安装、涂装等,在船舶制造的流程线上按照不同阶段、专业种类进行拆分为各类制造中心,这些制造中心制造的成品及中间产品在制造过程中就有增值,而制造中心的成品的完整性就要有一定的要求(中间产品完整性要求)主要表现为:

1、符合设计任务包分解要求

中间产品要完全按照设计的要求进行制造,也就是按照工艺的要求。

2、船东和船检交验合格

船东和船检对其有检验的合格程序、结果,确保中间产品流入下一个中心的质量。

3、按计划派送。

按计划派送就从计划的统筹方面进行了规定,从而使中间产品的制造有一定的节拍。