Wednesday, 4 December 2013

Don't let the code drag your mind

Don't let the source code drag your mind. The master of your mind is yourself. Use the domain and system interaction knowledge to find out what you want to know about the new system.

Monday, 7 October 2013

Group Leadership( From Wiki)



According to the National School Boards Association (USA):[74]
These Group Leaderships or Leadership Teams have specific characteristics:
Characteristics of a Team
  • There must be an awareness of unity on the part of all its members.
  • There must be interpersonal relationship. Members must have a chance to contribute, and learn from and work with others.
  • The members must have the ability to act together toward a common goal.
Ten characteristics of well-functioning teams:
  • Purpose: Members proudly share a sense of why the team exists and are invested in accomplishing its mission and goals.
  • Priorities: Members know what needs to be done next, by whom, and by when to achieve team goals.
  • Roles: Members know their roles in getting tasks done and when to allow a more skillful member to do a certain task.
  • Decisions: Authority and decision-making lines are clearly understood.
  • Conflict: Conflict is dealt with openly and is considered important to decision-making and personal growth.
  • Personal traits: members feel their unique personalities are appreciated and well utilized.
  • Norms: Group norms for working together are set and seen as standards for every one in the groups.
  • Effectiveness: Members find team meetings efficient and productive and look forward to this time together.
  • Success: Members know clearly when the team has met with success and share in this equally and proudly.
  • Training: Opportunities for feedback and updating skills are provided and taken advantage of by team members.

Saturday, 13 July 2013

Some good study material link about JMS/ActiveMQ(Chinese)

http://www.360doc.com/content/10/0913/14/2795334_53325069.shtml
 http://blog.csdn.net/wangdongsong1229/article/details/8219536

What I tried is,
1. cd $ACTIVE_MQ$/example/
2. ant producer
3. ant consumer

4. Then try the configuration by different values
    <property name="topic" value="false" />
    <property name="durable" value="true" />
in build.xml.

5. Check the status in MQ by http://localhost:8161/admin/.
 

Friday, 12 July 2013

Some Thoughts about New Feature Integration

Now I am working on new features implementation based on existing system. How to reduce the impact on the system?

Just thinking of SOA, How about defining the services provided in the running system? And then considering the interaction between the new features and the services?

Based on this, you view your system as a service provider. If the service is not declared clearly, then add them.

After this, go through the scenarios by the messaging flow and enhance the flow progressively. 

The idea above is, talking about high level design. The next thing is, to decide the implementation. I find the common practice is to have a messaging mechanism. It is quite natural to map to service request and response. It will become powerful enough to implement most of the complex logic if providing timing functionality.

Within the process level, the new features can use a queue and a frequent checking to communicate with the services. The checking can be put either in a standalone thread or in the main loop.

Within the system level, the new features can communicate with other components in the same system by network/share memory, so call inter-process communication. The exchanged information is embedded in the messages.

Overall, the idea is simple. Define the services you are relying on. Based on them, check the communication flows whether it can accomplish the domain logic you want. The rest just to decide how the interactions are passed through.

Monday, 8 July 2013

Training Program Design

It is quite interesting in considering a training as a project.

It needs a clear scope; Break the tasks into a more clear sub tasks; Define the performing time, review time and make evaluation plan.

Thursday, 4 July 2013

Some useful Python function in daily work

It is a very good script language and I start to learn it for system integration purpose. For example, packaging automation, system administration and process monitoring.

Below are some useful functions for memo: 

1. Parameter checking:

if(len(sys.argv) != 2):
        print 'COMMAND: ERROR'
        sys.exit(1)
sys.argv[1]

2. File existence

if(os.path.exists(path) == False):
        print "ERROR: %s doesn't exist." %(path)
        sys.exit(1)

3. System Call

os.system("cd " + path + "; cvs update -d -P; cd -;")

if(subprocess.call(["tar", "-czvf", tar_package, "sys", "app"]) != 0):
        print "ERROR: fail to tar the package %s" %(tar_package)
        sys.exit(1)

It seems subprocess is preferable due to portability.



4. Print

print 'copy %s to %s' %(src, dest)

5. File Copy

shutil.copy2(src, dest)

6. Variable Declaration

dev_path = '../..'

7. Environment Variable

os.environ['PLATFORM']

8. File Path Join

os.path.join(path, os.environ['PLATFORM'], "binary")

9. Find file Name with Pattern
files = glob.glob(os.path.join(gui + '/resource/') + '*.' + format)
        for file in files:
                shutil.copy(file, target_resource)

10. File System Visit Support
It is a very good design to make it flexible to define customized operations on folder.

def remove_CVS(arg, dirname, names):
        (head, tail) = os.path.split(dirname)
        if(tail == "CVS"):
                shutil.rmtree(dirname)
                print "%s is removed. " %(dirname)

os.path.walk(package_sys, remove_CVS, "")




Saturday, 15 June 2013

Find the product position in the market

1. Understand the market and devise some dimensions;
2. To reduce the dimension, stat analysis can be used to form a simpler matrix like
             Principal Components Analysis
             Factor Analysis Method;
3. find out the product position from the matrix.

Friday, 17 May 2013

SMART原则(转自MBA智库百科)

SMART原则一 S(Specific)——明确性

所谓明确就是要用具体的语言清楚地说明要达成的行为标准。明确的目标几乎是所有成功团队的一致特点。很多团队不成功的重要原因之一就因为目标定的模棱两可,或没有将目标有效的传达给相关成员。
  示例:目标——“增强客户意识”。这种对目标的描述就很不明确,因为增强客户意识有许多具体做法,如:减少客户投诉,过去客户投诉率是3%,现在把它减低到1.5%或者1%。

SMART原则二 M(Measurable)——衡量性

衡量性就是指目标应该是明确的,而不是模糊的。应该有一组明确的数据,作为衡量是否达成目标的依据。
 
  比方说,“为所有的老员工安排进一步的管理培训”。进一步是一个既不明确也不容易衡量的概念,到底指什么?是不是只要安排了这个培训,不管谁讲,也不管效果好坏都叫“进一步”?
  改进一下:准确地说,在什么时间完成对所有老员工关于某个主题的培训,并且在这个课程结束后,学员的评分在85分以上,低于85分就认为效果不理想,高于85分就是所期待的结果。这样目标变得可以衡量。
  实施要求:目标的衡量标准遵循“能量化的量化,不能量化的质化”。使制定人与考核人有一个统一的、标准的、清晰的可度量的标尺,杜绝在目标设置中使用形容词等概念模糊、

SMART原则三 A(Attainable)——可实现性

实施要求:目标设置要坚持员工参与、上下左右沟通,使拟定的工作目标在组织及个人之间达成一致。既要使工作内容饱满,也要具有可达性。可以制定出跳起来“摘桃”的目标,不能制定出跳起来“摘星星”的目标。

SMART原则四 R(Relevant)——相关性

目标的相关性是指实现此目标与其他目标的关联情况。如果实现了这个目标,但对其他的目标完全不相关,或者相关度很低,那这个目标即使被达到了,意义也不是很大。
  因为毕竟工作目标的设定,是要和岗位职责相关联的,不能跑题。

SMART原则五 T(Time-based)——时限性

目标特性的时限性就是指目标是有时间限制的。例如,我将在2005年5月31日之前完成某事。5月31日就是一个确定的时间限制。没有时间限制 的目标没有办法考核,或带来考核的不公。

六顶思考帽(Six Thinking Hats)(转载MBA智库百科)

“六顶思考帽”思维方法使 我们将思考的不同方面分开,这样,我们可以依次对问题的不同侧面给予足够的重视和充分的考虑。

  黑色思考帽:。思考中有什么错误?这件事可能的结果是什么?黑帽思维有许多检查的功能,我们可以用它来检查证据、逻辑、可能性、影响、适用性和缺点。

  白色思考帽:白色是中立而客观的,使用白帽思维时 将注意力集中在平行地排列信息上,要牢记三个问题:我们现在有什么信息?我们还需要什么信息?我们怎么得到所需要的信息?这些信息的种类包括确凿的事实、 需要验证的问题,也包括坊间的传闻以及个人的观点等等。如果出现了意见不一致的情况,可以简单地将不同的观点平行排列在一起。

  红色思考帽:红色思维可以帮你做到:你的情感与直觉是什么样,你就怎么样将它们表达出来。在使用红帽思维时,将思考时间限制在30秒内就给出答案。红帽的问题是:我对此的感觉是什么?

  黄色思考帽:黄色思维追求的是利益和价值,是寻求解决问题的可能性。在使用黄色思维时,要时刻想到以下问题:有哪些积极因素?存在哪些有价值的方面?这个理念有没有什么特别吸引人的地方?这样可行吗?
 
  蓝色思考帽:蓝色是天空的颜色,有纵观全局的气概。蓝色思维是“控制帽”,掌握思维过程本身,被视为“过程控制”;蓝色思维常在思维的开始、中间和结束是使用。要时刻想到下列问题:我们的议程是怎样的?我们下一步怎么办?我们现在使用的是哪一种帽子?我们怎样总结现有的讨论?我们的决定是什么?

  绿色思考帽:绿色思维不需要以逻辑性为基础;允许人们做出多种假设。使用绿色思维 时,要时刻想到下列问题:我们还有其他方法来做这件事吗?我们还能做其他什么事情吗?有什么可能发生的事情吗?什么方法可以克服我们遇到的困难?绿色思维 可以帮助寻求新方案和备选方案,修改和去除现存方法的错误;为创造力的尝试提供时间和空间。
  


一个典型的六顶思考帽团队在实际中的应用步骤:
  • 1、陈述问题事实(白帽)
  • 2、提出如何解决问题的建议(绿帽)
  • 3、评估建议的优缺点:列举优点(黄帽);列举缺点(黑帽)
  • 4、对各项选择方案进行直觉判断(红帽)
  • 5、总结陈述,得出方案(蓝帽)

Porter's generic strategies

commonly used by businesses to achieve and maintain competitive advantage.

Cost Leadership Strategy

Differentiation Strategy

Segmentation Strategy

 

商科、留学、工作鄙视链《转》

Seems interesting...



转自 http://www.newsmth.net/nForum/#!article/WorkLife/390101

学科鄙视链:
商科 > 法学/医科 > 工科 > 理科 > 社科 > 文科 > 艺术
 
专业鄙视链:
理科:数学/物理 > 统计/心理 > 生物/化学
工科:计算机/EE > 其他工科
商科:金融 > 管理 > 会计 > MKT > 其他
社科:经济学 > 公共管理/政治 > 社会学 > 其他
文科:哲学 > 新闻 > 历史 > 语言 > 文学
 
行业鄙视链:
HF/Prop Shop/PE/VC > Mutual Fund > Investment Bank > Consulting > IT/互联网 > FMCG > Commercial Bank > Big 4 > Others
 
工作鄙视链:
Fund Manager > Trader/IBanker > Sales > Quant > Consultant/Business Analyst/Research Analyst/Developer/IB Mid Office > Big 4民工 > IB Back Office > 码工 > 码农
 
项目鄙视链:
MBA > MFE > MSF > Econ/MSA/MPA/MIS/MKT > OR/Stat/SCM/Hospitality/HR/Management...
 
学位鄙视链:
PHD/JD/MD > MBA > Undergrad > Masters > Certificate
 
地区鄙视链:
U.S. East Coast (NYC>Boston/Chicago>Philadelphia>Others) > California > Elsewhere in U.S. > HK/UK > Elsewhere in Europe > Singapore > Canada > Mainland China > Aussie > Elsewhere in the World
 
英美校鄙视链:
HYPSM > Penn/Columbia/Oxbridge/Williams/Swarthmore/Amherst > Duke/Chicago/Berkeley > Dartmouth/Cornell/Brown/Northwestern/JHU/UCLA/LSE/IC/LBS/top LAC > WUSTL/ND/Vandy/Emory (typical top20)/Umich/UVA/NYU/CMU/top Regional(Villanova etc.) > UCL/Warwick/Kings(top10 U.K.) > U.S. top 50 > top 100 > top 200 > rest
Caltech > All above
 
大陆校鄙视链:
PKU/THU/USTC > FDU/SJTU/ZJU > NJU/RUC > top regional/CUFE/UIBE/SHUFE > other Econ&Finance/regional > 普通一本 > 二本 > 三本 > 民办/专科/West Pacific/家里蹲/克莱登
蓝翔 > All above
 
公司鄙视链:
GS <> MS > Other BB > GSGH/UBSS/CICC/MSHX > CITICS/RBS/Nomura/Other MM > Other top券商 > top Boutique > 中小券商
*货币战争粉丝:Rothschild > All above
 
部门鄙视链:
IBD <> S&T > AM/PWM > ECM/DCM/Research > Other Mid office > Back Office/营业部
 
职位鄙视链:
Chairman/President <> CXO/MD <> ED <> D <> VP <> Asso <> Analyst <> Intern
 
MBA鄙视链:
H/S > Wharton > CBS/Kellogg/Sloan/Booth/LBS > U.S. Top16/INSEAD/IMD etc. > Tepper/McCombs/UNC/Marshall/Kelley etc. > CEIBS/HKUST/CKG** > U.S. Top 50 > 清北复交人。。。
 
注:“<>”为相互鄙视

AutoMatic Variables in Makefile

Take it from

http://www.jfranken.de/homepages/johannes/vortraege/make_inhalt.en.html

 Automatic variables

$@ The name of the target.
$% The target member name, when the target is an archive member.
$< The name of the first (or only) prerequisite.
$? The names of all the prerequisites that are newer than the target, with spaces between them.
$^
$+
The names of all the prerequisites, with spaces between them. The value of $^ omits duplicate prerequisites, while $+ retains them and preserves their order.
$* The stem with which an implicit rule matches.
$(@D)
$(@F)
The directory part and the file-within-directory part of $@
$(*D)
$(*F)
The directory part and the file-within-directory part of $*
$(%D)
$(%F)
The directory part and the file-within-directory part of $%
$(<D)
$(<F)
The directory part and the file-within-directory part of $<
$(^D)
$(^F)
The directory part and the file-within-directory part of $^
$(+D)
$(+F)
The directory part and the file-within-directory part of $+
$(?D)
$(?F)
The directory part and the file-within-directory part of $?

Thursday, 2 May 2013

Balanced scorecard

This concept is introduced by reading one article trying to explain how to analyze the business impact on one company.

Just take four perspective for reference from wiki:

http://en.wikipedia.org/wiki/Balanced_scorecard
  • Financial: encourages the identification of a few relevant high-level financial measures. In particular, designers were encouraged to choose measures that helped inform the answer to the question "How do we look to shareholders?"
  • Customer: encourages the identification of measures that answer the question "How do customers see us?"
  • Internal business processes: encourages the identification of measures that answer the question "What must we excel at?"
  • Learning and growth: encourages the identification of measures that answer the question "How can we continue to improve, create value and innovate?".

Why I feel so impressed because I have brought some ideas how to evaluate the value of new technology and tools. In the balanced scorecard, we can evaluate in a more broad way not only from financial perspective. it makes clear about one organization road map.

It is still critical to find bottleneck inside one organization or explore highest leverage value-added market. Without the ability of estimation and foreseeing, there will be too many goals that one organization can not optimize its resource to the most-wanted area.

It may not be so important how to measure accurately  comparing to the process setup sometimes. Here I just take one statement from VaR(Value at Risk) Measure in wiki.

 “A risk-taking institution that does not compute VaR might escape disaster, but an institution that cannot compute VaR will not.”


boost::property_tree

property tree can be used for configuration.

example:

Configuration file:

/**
 * <config>
 *    <date begin="20030110" end="20050505" backtest_period="50" rebalance_period="5"/>
 *    <portfolio>
 *        <symbol>IBM</symbol>
 *        <symbol>MSFT</symbol>
 *        <symbol>APPL</symbol>
 *    </portfolio>
 *    <benchmark method="SP500">
 *    </benchmark>
 * </config>
 */

Source code:

        pt::ptree ptConfig;
        ifstream fstream(config.c_str());
        pt::xml_parser::read_xml(fstream, ptConfig);

        // get begin and end
        m_sBeginDate = ptConfig.get<string>("config.date.<xmlattr>.begin");
        m_sEndDate = ptConfig.get<string>("config.date.<xmlattr>.end");
       
        m_sBacktestPeriod = ptConfig.get<string>("config.date.<xmlattr>.backtest_period");
        m_sRebalancePeriod = ptConfig.get<string>("config.date.<xmlattr>.rebalance_period");

        // get portfolio symbol
        unsigned int assetIdx = 0;

        BOOST_FOREACH(pt::ptree::value_type &v,
            ptConfig.get_child("config.portfolio"))
        {
            symbols.insert(make_pair(v.second.data(), assetIdx));
            assetIdx++;
        }

        m_benchMethod = ptConfig.get<string>("config.benchmark.<xmlattr>.method");

Wednesday, 24 April 2013

Software Dev Task Priority

It seems quite an old topic but why I feel it becomes important because as the project scope are spreading,  there are lots of exciting targets and goals to be achieved and sometimes it confuses team members what is the next right thing to be.

Below is one priority list

1. Find and list the next right things to do;
2. Software Correctness;
3. Quality-controlled release delivery;
4. Flexibility and maintenance;
5. User Friendly and good User Experience;
6. Performance.

The importance can be different as the project goes on. It requires the leader to realize the status around, holding on the target, pointing out the most possible valuable features to be done or eliminate/resolve the accumulated problems during the previous project stage.

Each progress should pay some credit to refactoring, eg, setup automation QA tools, building progress refinement or interface refactoring.

Anyway, just think you are driving: you have a clear destination, observe the environment around, control the steering wheel and check or fix the flaw in the car before it brings threat to the safety.

Wednesday, 17 April 2013

One refactoring technique

One code like:
Logic 1, logic 2, logic 3 calls super logic. The patch on super logic will impact all of the caller logics. And only logic1 needs to be considered. How to fix?

Flat the super logic on logic 1 and make fix on the flatted underlying super logic. In that case, the fix won't affect logic 2 and 3.

Monday, 15 April 2013

Thursday, 28 March 2013

Code Generation By C Macro

The C Macro Code Generation technique can be found in link http://www.rt-embedded.com/blog/archives/macros-in-the-c-programming-language/

Now C Macro is not only useful for embedded programming, but also Object Oriented Design and Programming.

When talking about OO Design, it can be considered into two level of code reuse:

1. Interface Reuse;  It provides the flexibility and encapsulates the specific logic into subclasses well , however the number of classes can be big in a large system. 

2. Implementation Reuse; Most of the subclasses implementation are the same except some customized class.

So, Programming based on interface is the motivation, and implementation reusing is good code feature of large amounts' class definition auto generation.

See example:

Define the basic operation first:

/**
 *   basic def block
 */
#define LIMIT_BASIC_DEF( limit, param ) \

#undef LIMIT_BASIC_DEF


Define the list:

#define LIMIT_INTEGER_VALUE_GROUP(param) \
    LIMIT_BASIC_DEF(LimitMaxOrdQty, param); \
    LIMIT_BASIC_DEF(EquityBuyQtyLimit, param); \
    LIMIT_BASIC_DEF(EquitySellQtyLimit, param); \


One Behavior:

#define LIMIT_BASIC_DEF(limit, param) \
    LimitCreateClickedProcessorDefaultImpl(limit, param);

LIMIT_INTEGER_VALUE_GROUP(IntegerValueVerifier);

#undef LIMIT_BASIC_DEF


The Other Behavior:

#define LIMIT_BASIC_DEF(limit, param) \
    CreateLimitDialogComboBoxSelectedClickedProcessorDefaultImpl(limit);
LIMIT_INTEGER_VALUE_GROUP(0);

#undef LIMIT_BASIC_DEF



Sunday, 17 March 2013

building boost library

1. run $(BOOST_LIB)/bootstrap, and exe b2 is generated.
2. b2 --toolset=msvc-9.0 --build-type=complete architecture=x86 address-model=64