Thursday, November 29, 2012

My 3rd toastmaster speech

I just finished my 3rd toastmaster speech - "Get to your point".  After a long time break,  finally I got a  chance to practice my speech. This time I tried to reduce my preparation time, because I spent too much time memorizing my notes.

During the speech I think I did well, but I need to have more pause, I spoke too fast,  it took me 5:30 to finish the whole speech, I think it might due to I practiced too much and trying to recite my notes during the speech,  I will try to improve it next time.

I would like to  thank my mentor Robert Fox, he helped me a lot, reviewed my script, which made me rewrite my script almost entirely. I will say without his help, I could not finish my speech successfully.

I also learned from him that it is very important to bring your personal example, since it will bring more connection to the audience,  because people like the concrete examples, and also make it easier to memorize, and more confident for you to tell your own story.

My speech is based on the book "connected"(this is author's video on Ted), and chad fowler's blog post: "be careful of who you work with".

Following is my script.

The power of social network

Birds of a feather flock together, this quote tells us the power of social network.
We all know that networking is important, but how important it is? What is the power behind it?
Today I am going try to answer these questions. 
Mr. Toastmaster, fellow toastmaster, and welcome guests, my name is Steve.

The reason I choose this topic is because I found a good book by chance, it is called - "connected". This is a very inspiring book about social network.

First let me share you a scientific research result coming from the book. The 2 authors studied obesity, and they found that the obesity can spread through the social network, like virus, they give the following striking result:
If your friend is obese, then you have about 45% higher chance to be obese;
If your friend's friends is obese, you have 25% higher chance to be obese, and
If your friend's friend's friend is obese, then  you still have 10% more likely to be obese.

And also obese people are more likely connect to each other, and non-obese people more likely connect to other non-obese people.

This example tells us that human behaviour is contagious, we are so easy to get influenced: if your friend is overweight, you will be overweight, and if your friend is richer, you will be richer; if your friend is happy, and you will be happy.

This is the power of the social network, it shape our lives: it affects our health, wealth and success. it can make you good or bad.

so please choose your friend wisely.

And be careful of who you work with!
Let me share with you my bad work experience, about 10 years ago, I joined a large company,  but I found culture was bad: I saw bureaucracy, favouritism, and ridiculous process, my job was boring and slow moving. I was totally frustrated and not happy, and until one day I decided to leave because I could not stand anymore.
So my lesson is choose your employer carefully, the culture is more important than the salary.

There is another kind of social network we can not ignore, it is the social network over the internet. In the last 5 years, facebook, linkedIn, twitter, become more and more popular, compare to the physical social network, they have some advantages: they spread ideas lot faster and easier, and people are much easier to get influenced. 

For my personal example, I like twitter, I've been using twitter for 3 years, I follow many masters and gurus in the IT industry, I read their tweets, read their books and articles. And the interesting thing is those gurus are usually connected each other, I feel I am in their loops and listen to their conversations, which is definitely helpful for my career. I learned a lot, my mindset was changed, I understand what I need to improve and where I should go in future.

Blog is another powerful tool influenced me a lot, it was a blog post which inspired me to join the toastmaster club, last year this time, I read a blog post, it mentioned if you does not give a good speech, then you are wasting people's time, you are killing people's life! How to make a better public speech? join the toastmaster club, that drive me standing here. 

And I also have my personal blogs, Sometime I got comments and emails from all over the world, thanked me how my articles helped them for their work. Those are very encouraging, which stimulate me to continuing writing blogs. In the internet you never know how much influence you can have, how much help you can give other people!

In conclusion, the social network shapes our lives,it can make you good or bad. We get benefit from a good social network, it is also our responsibility to make it better. It helped me me, and I am sure if can help you as well.

I like to share a quote from this book:"When you smile, the world smiles with you".

Mr. Toastmaster

Wednesday, October 24, 2012

gzip compression/decompression in Ruby

Recently I did some investigation compression and decompression in gzip format using Ruby. Here I posted my ruby code:

Sunday, October 21, 2012

How to render JSON in rhodes mobile framework

Currently I am using Rhodes framework to build mobile applications. Recently I just figured out how to request an Ajax call from view, and controller how to render a JSON object and return it to the view.

Sample code
Ajax call to request json object using jQuery:

code of rending json in controller


I found this solution in the Rhomobile launchpad forum, it works perfectly.
This exactly looks like render json behaviour in Ruby on Rails.

Sunday, September 23, 2012

Using alias_method to implement AOP in Ruby

This week I just realize the power of ruby alias_method, you use alias_method to intercept the existing method, and modify its behaviour,  this is exactly what AOP does the jobs.

The following code example tell you how to use the alias_method, to add a logging logic to the exit() method.

This reminds me the javaasist framework, I used before, which is a powerful tool to do bytecode manipulation, it can intercept the method by renaming the existing method to another method,  and modifying the existing method, which is the exactly similar strategy.
the code example:
Now when you compare two solution, you will tell how easy to do it in Ruby!

Resource
1. alias_method API document
2. IBM Javaassist tutorial 
3. Spring AOP document

Saturday, September 15, 2012

Fix the iOS code signing issue when using Jenkins


This week I setup the Jenkins on my Mac and try to build iOS applications. unfortunately I got the code signing issues, either I use xcode plugin or xcode command line tool. Through a couple days of googling and I could not find any solution that works for me, but I finally solve this issue by myself through different try out, and the solution is such an easy, now I would like to share with my solution.

The core reason is Jenkins is running as daemon mode in Mac, just assume it is a different user - "Jenkins", so it will not have access to the keychain or provision profile as a you login using your credentials, which cause the code signing issue.
I found I have following 2 errors

1. "Code Sign error: There are no valid certificate/private key pairs in the default keychain"
Solution: Copy your iPhone developer certificate from "login" keychain to "System" keychain.
Detailed steps:
  open the "Keychain Access" application, click the login tab, right click the certificate like "iPhone Developer: your_name (XXXXXXX)", choose copy, then click the "System" tab, right click mouse, choose "Paste 2 items"; you might need to do the same thing with the certificate like "iPhone Distribution: your_name".

After doing this, you will get the second error.
2. "Code Sign error: Provisioning profile 'xxxxx-xxxx-xxxx-xxxxx' can't be found"
Solution: Copy the provision profile to Jenkins user folder.
The provision profile is under in the folder
/YourUserName/Library/MobileDevice/Provisioning Profiles,
for example in my machine, the provision profile files are under /Users/steve/Library/MobileDevice/Provisioning Profiles
In the mac, the Jenkins will be in /Users/Shared/Jenkins, create the following folder:
/Users/Shared/Jenkins/Library/MobileDevice/Provisioning Profile,  then copy the .mobileprovision file to this folder.

After doing this, the code signing issues will be fixed. Hope my finding will be helpful to other Jenkins users.

Sunday, August 19, 2012

Book review for "An Agile Adoption and Transformation Survival Guide"


Recently I read an ebook about agile called An Agile Adoption and Transformation Survival Guide from infq.com, it is written by Michael Sahota. It is really a good book, bring lots of useful insights and information.

What I learned most is the author provides the concept of adoption and transformation for agile.
  • Adoption is about "doing agile", treats agile as a process or product;
  • Transformation is about "being agile", which means we has the agile mindset.
So I learned that adopting agile without agile mindset transformation is doomed to failure. That would explain why Scrum is so difficult to implement in many companies, because most of them just adopt the Scrum practices, but did not transform the agile mindset.

Quote from the author: "Agile is not a Process – it Defines a Culture, Agile Culture is about Collaboration and Cultivation" So we need to create a culture to help us adopt and transform the agile.

This is a very important concept, culture is more important than the practices. Before I learned that agile is not enough just by following its practices, we need to do something more. This time the author explicitly pointed out the concept of transformation, and concept of culture. We can not treat agile as a set of tools, we can just pick one of them like buffet, the more importantly, we need agile mindset change and culture change.

To help you transform from the existing culture to the agile culture, the author provides different paths, patterns and models, that is the reason why it is called "Survival guide".

Another reason I like this book is it brings you lots of useful models, I already know some of them, but I did not realize the author could integrate them such nicely. I just list some of them:
  • Schneider culture Model 
  • chasm
  • hype and disillusionment
  • Fearless change
  • ADAPT
  • Containers, Differences and Changes(CDE)
Summary
This book has lots of information, I highly recommend any serious agile practitioner to read it, you will learn a lot.To make agile successfully, We definitely need change from 'doing agile' to 'being agile'.

Resource
  1. Book download link from infoq.com
  2. The author's blog about this book
  3. The author's web site: agilitrix.com

Sunday, June 10, 2012

New job, new thoughts


Now I am working in my new job for a week, my new employer is called Complete Innovations, it is in Markham, it is .NET house, I am working in a mobile team, we are using mobile web technologies, such as HTML5, Knockout framework, Kendo UI, and Sencha, ... all those are pretty new for me. I have a lot to learn. And most importantly, this company follows the Scrum/Kanban agile process, which is what I am really interested. And finally it is located in Markham, which is only 10 minutes drive from my house, this is a big plus. During a week's working I feel I have a lot stuff need to learn and catch up, very exciting to me.

My last job was working in Grapple Mobile, I've been working there for more than 2 years, before Grapple, I worked in QuickPlay Media for 4 and half years. Two years ago when I decided to leave QuickPlay, I heard of the mobile Web technologies, like PhoneGap framework, since then I feel that javascript will be the future trend to develop mobile apps. And then I heard of Grapple mobile, it acquired a small startup company called Cascada, which provides a solution to develop mobile apps using HTML/CSS and javascript, and they were doing that since 2005, a lot before iPhone/Android came out, even long before the PhoneGap. I really admired them, so I decide to join the company. At that moment, their not many company heard of PhoneGap or see the trends of javascript, I feel I was complacent with what I was doing in Grapple.

But things changed, when last month I got the bad news that Grapple will shut down the Toronto office and move the whole team to UK, which means I was laid off. So I started to look for new jobs. During the interview, I feel I fell behind the trend during this two years, almost every company I was interviewed are using or knowing PhoneGaps, and they are also using HTML5 and javascript framework, like Sencha, jQuery Mobile. Some of them I plan to investigate, like jQuery and HTML5,  and some of them I never heard of before, like Sencha, I even have an idea to build a MVC framework using javascript, which is exactly Sencha already provides!

And one more thing is I found embarrassing is my iOs skills is not strong as I expected, but the market for iOs is so hot. I got many recruiters email or phone calls looking for iOs developer. If my iOs skills is strong enough, I definitely can easily find a new contractor job.

So why I fell behind? One would be I am over confident about myself, and maybe arrogant; and I stop tracking the mobile world news and technologies; I did not prioritize well: I spend too much time on Agile/Lean/Kanban, they are good, but I should focus more on the technology side; I ignore the importance of iOs developing, when I realize its importance, it is just too late; and most importantly I seldom contact with other mobile developers, like my previous colleagues, to exchange ideas.

Last Thursday night, we had a party with my colleagues in QuickPlay,They are all very cool guys, compare to them I feel I am far behind, they are all good, and they are so young, I feel so lucky that I have those friends.

These are what I learned from the party:
- Keep humble, always keep an eye on the trends;
- Manage focus, focus more on iOs and mobile web, especially HTML5, javascript, jQuery, phoneGap, etc;
- My problem is I spend too much on learning and thinking, but less time on doing, I need to do some stuff.
- Last and most important, try to use your network, keep in touch with friends, and try to get update as much as possible.

This laid off is very good opportunity to know my situation, and I know what I need to improve myself. Now the most important for me is always having a beginner's mind, keep humble, handle my current job first. Then next year I will review my situation again.

Sunday, April 29, 2012

My worst performance review


Recently my current company started the quarterly performance review. This reminds me my last performance review two years ago in my former company - QuickPlay Media Inc. I believe that was my worst performance review in my life, because of that reason I left that company.

The whole process was terrible, some time when I recalled it, I still feel angry, ridiculous, and nonsense. I will try to write it down because I want to remove it from my mind.

 I remembered 2 years ago in QuickPlay, my performance review  process was terrible: the review was totally depends on manager, there was no quarterly checkup, no objective metrics, each employee's performance is relies on the manager's impression. If she likes you and give you a good project, then you will get a better performance, on the other side, if you work on a project which is outside the scope of your boss, then you are doomed, because he/she did not know how you worked. This is totally unfair game, and for each employee it is the only time you have a chance to get promoted or salary increase.
 My manager's name was Donna, unfortunately I did not work on her project, and also she did not like the way I was working, I am not the guy always say YES to the boss, I have my own brain and I have my own principles. I know that I might not get a better rate, but I did not expect that my final rate was so worse.

I can feel her bad attitude at the beginning, because my meeting was cancelled and rescheduled so many time, finally it was delayed for 3 months! This was totally unprofessional for a manager, and she never show some apology to me for that.

During the performance review, I can feel she did not like me, the meeting is one way instead of 2 ways. She controlled the talking, most of the time she was talking and I was listening, actually I would say she was announcing, and did not give me any chance to explain. I prepared lots of my thoughts, but none of them were discussed. She tried to give me a low rate for every check point based on her bias, she tried to prove I am a bad developer. because I did not follow her order just once, and she wanted to punish me. It looked like she collected all my mistakes quietly in the behind, save them for one year, then presented all of them to me. Is this a good way for a manager? This is totally wrong, a manager's job is try to improve her team members, once she found an issue, she should take action right away, either criticize him or help him to realize his problem, help him to fix the problem. A manager's job is to correct developer's mistakes, not collecting mistakes. Manager is not like police, her job is just issuing an parking ticket. She need to figure out why the employee made an mistake, provide solution, and make sure the employee is improved. We are human and easy to make mistakes, that is the reason why we need managers.

The main issue she mentioned was I got negative attitude, because I report a issue of my colleagues quite angry. I agree I did not have good attitude at that moment, but so what? You should focus on the issue first.  I found very bad issues and I feel I need to stand out and want manager to fix it. I exposed the problem in the team, and this is a good chance to fix them. My manager should ask why I had a bad attitude, because she need to find the root cause and fix it, I believe the manager's job is to fix the issue among the developers. I don't think hiding/cover up the issue to your colleague is good, avoiding conflict is teamwork, and just focus on remaining the surface of agreement is a healthy team. Unfortunately my manager even did not want solve this issue, looked at what she said: "Why did you say bad to him? Because he did not say anything bad to you." What? I don't know what to say it.

It was really made me angry was for all of her comments/feedbacks, I did not know how to solve them. When I tried to analyze them and want to improve them, I found they were all no actionable, which drive me crazy. I know the solution was: follow her order, always say YES, you should not have your own ideas, just compliance, that is it!

It made me into deeper thinking: what is a good employee? Just always say YES, always nice to other people, not to stand out when finding a problem? Of course NOT.

This performance review totally lost its purpose: set goal, identify the issues and improve them; it becomes a means of manager to control her team members. It will look for compliance. It becomes a tool of governance, not for management.


I understand this would be the common issue of the command-and-control management style, the result will be always the same: mediocrity, compliance, lack of innovation.

Now I am happy in my current company, we do performance review, but quite different: we have 360 degree peer review, and quarterly review. Which are much better than before. I feel I was so lucky because I don't need to do that terrible review any more.

Wednesday, April 18, 2012

Review of my toastmaster CC#2 speech


Yesterday I finally finished my second speech, my topic is "Shu Ha Ri - The Japanese way of learning". After speech, I feel very exhausted. Because I am very nervous, and I practice it a lot. It might be easy for other people, but for me it is really difficult. Here I posted my personal review.

My Feedbacks
Positive
 - No notes
 - I looks very confident
 - The speech is clear, simple and easy to follow
 - transition is smoothly
 - The topic I choose is interesting

Constructive, I need to improve
 - Need more eye contact, I ignore the left side of the audience
 - My feet move back and forth, which is distracting, I understand it because I was nervous during the speech, and focus too much on recalling my script, so I can not cover other issues, this needs more practicing
 - more eye contact
 - need humorous
 - need quote for opening and ending.

How I choose the topic
 My criteria to choose a topic are:
  - 3-5 points
  - can be fit within 5 - 7 minutes
  - can bring value to audience

I chose Shu-Ha-Ri because it fits the above criteria: it has only 3 points, it will really new to the audience. Also it is my interest, I like to collect the learning model, Shu-Ha-Ri is the simplest one to fit the 5-7 minutes speech. And I feel it would be an interesting topic: the audience will learn some Chinese characters, and learn about martial art principles. And finally I will add examples to using this in the toastmaster learning, which will bring connection to the audience, and this topic will help them to apply it into their own learning.

Preparation
I will the hard part is preparation. It took me at least 2 weeks to prepare this speech. It is a long time, so I still don't know if it is worth doing like that. I got struggle to write the script, gradually I realize that spoken English is quite different with the written English, because when I write it down, I feel good, but when I read it, it just feel weird, so I modified a lot. Also I struggled to shrink the content to fit it into 5-7 minutes, I have to balance different situation, and cut my favourite part. Finally I realize that to fit within 7 minutes, my content has to be around 600 words. The whole process is very discomfort for me. But I will say I tried my best, because I want to bring the value to the audience.

Making the speech
Comparing to the preparation, doing speech seems lot easy. But I was still nervous before the meeting. I can feel I am still nervous during the speech, I was still not comfortable to speak in public. That was why people saw me move back and forth randomly, because I did that unconsciously. But in general they all said I looked very confident, that was because I did not use notes. Anyway this is a great experience, it seems this 7 minutes were worth all my hard works.

Summary
This speech is a great experience for me. I think I tried my best, and I delivered my message to the audience, and they like it. Also this speech exposed my ignorance for the public speech, all the issues were I never aware before. I also learned the difference between spoken English and written English. The biggest thing I want to improve next is how to shorten my preparation time, since it interrupted my so many other plans. And I really enjoy reading the evaluation from my club members. They are really helpful, I really appreciate that, I feel what I get is a lot more than I contributed. This will force me to bring excellent topic in future.

Update some more thoughts
My evaluator suggested me to use a quote to make the opening stronger, actually I thought about it, but I just could not find a good one, today I found a Chinese proverb:
Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime
So the opening like this:
A Chinese proverb says:"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime". Today I am going to show you a different way of learning, which will help you learn more effectively.

Is that sounds better?


P.S. my notes of the speech


Shu-Ha-Ri, the Japanese way of learning


Mr. Toastmaster, fellow toastmasters and welcome guests, my name is Steve.

Today my topic is about learning. Learning is very important for us, we need to keep learning, also we need to learn how to learn, to make our learning more efficient. Now I am going to introduce you a learning model, it is called Shu-Ha-Ri.

Shu-Ha-Ri is a concept coming from Japanese martial art. It describes the 3 stages from beginner to master.

These 3 Chinese characters are used in Japanese, and pronounced as "Shu Ha Ri" in Japanese.
This is Shu, it means “to follow”
This is Ha,  it means "to break",
This Ri, it means “to transcend”.

So roughly Shu-Ha-Ri means: First follow, second break, and finally transcend.

Next I will explain this model in details, and try to show you how to apply it in our toastmaster learning.

First in Shu stage, the martial art student is a beginner, he will copy his mentor's movement, he follows the rules precisely without modification. Shu implies loyalty, which means the student should follow one instructor, stick with one path, and focus on one technique. In this stage, the student only needs the clear and detailed instructions; he does not need to learn the theory.

In terms of toastmaster learning, if you are a beginner, you are in the shu stage, you have the manual, you got a mentor.  you need to follow the manual precisely, And you need to follow your mentor, and focus on one technique each time.  For my personal example, my mentor Robert gives me lots of help, especially this time he suggested me NOT to use slides right now, I should focus more on the speech only, this is great,  I really appreciate that , thank you Robert.

The goal in Shu stage is to let the student learn the fundamentals. If he achieves this goal, then he can go to next level, which is Ha stage.

In Ha stage, the student knows the fundamentals, but he needs to go deeper, he needs to understand the principles and theory behind the rules. he starts questioning the rules, reflects everything he learned. He applies the rules to different situations, he will modify them to make adaption. He also will explore different paths, and collect different techniques.

If you are ha level toastmaster, you will do the same thing: you need to go beyond the manual, you might follow different mentors, try different paths and learn different techniques.

During Ha stage, the student will gradually transform what he learned into his own experience.  And finally he will enter the Ri stage.

 In Ri stage, the student becomes a master. He totally abandons the rules, what he learned becomes his second nature. He will follow his own instinct, he moves naturally, spontaneously. He is very creative, and he has the freedom to do anything without limitation. The biggest difference between beginner and master is that the master follows his intuition, while the beginner follows the rigid rules.

The same thing is for toastmaster. If you are ri level toastmaster, you don't rely on the manual any more, you rely on your own instinct, you speak naturally and you are fully free to express yourself.  You are the real master.

Now I want to make a quick survey,  How many of you think you are a shu level toastmaster? Please raise your hands.
Are there any ha level toastmaster?
Are there any ri level toastmaster?

Now you know about what the Shu-Ha-Ri is. It is a learning process,  It is simple and powerful, please try to apply it in your own learning.

Mr. Toastmaster

Monday, April 9, 2012

Manage java property files using Apache Common Configuration API


Recently I did some research on how to manage the java property file in a better way. I found the Apache Common Configuration API  is actually really good.

I found the following 3 features are really powerful.

1. Variable interpolation
  Like using a variable in Ant, you can use variable in a property file, and Apache Common Configuration API proivide API to expand them on the fly.
code sample


2. Include other property files in a property file
   check this link for details.
property example

Code example:

3. combine multiple property file into one property object
   details are in here.
   Property example

   Code example:

I believe above the 3 features will greatly simply the java property file management.

Wednesday, April 4, 2012

Using JIRA REST API in Groovy

Recently, I want to update my company's site using program to automatic update the issue status, adding comments, etc.
I could use JIRA Web service SOAP/XML-RPC  to access, like Jenkins JIRA plugin, but according to the JIRA document about remote API reference,  the REST API is recommended and supported.
so I decide to use JIRA REST API. I did some research, there are some possible options:
- Use JIRA Java Client library;
- Use Groovy HttpBuilder

For JIRA java client library, I get stuck with the maven, it always gives me error, and I was scared by its depencency on so many libraries.And For Groovy HttpBuilder, I have the same feeling, it depends on many 3rd party libraries.
So I decide to choose the 3rd solution. Just use Java HttpConnection object inside the Groovy script, and finally I got it works, it didn't use too many lines of codes, and Groovy 1.8 built-in support JSON parser, which is very handy.

Here I posted two groovy samples, you can easily integrate them into your own JIRA site by adding the url and account information.

Request an JIRA issue
JIRA add comment 

Note:
Note:1. JIRA URL should be like this:
    http://hostname/rest/api/2/issue/MKY-1

2. According to JIRA reference: The prefered authentication methods are HTTP Basic (when using SSL) and OAuth, in Groovy code

     ...
     def authString = "user_id:password".getBytes().encodeBase64().toString()
     conn.setRequestProperty( "Authorization", "Basic ${authString}" )

Useful resource
 JIRA REST API reference
 JIRA REST API Version 2 Tutorial



Thursday, March 22, 2012

My ice breaker speech in Toastmaster club

This Tuesday, I finished my Ice-Breaker speech in the toastmaster club. I was inspired by Dr. Nick's blog post - "How to stop killing people with your public speeches".  The club I joined is club No. 4780, Markham Village club. In my first club, I talked about myself, and career and why I want to join the club.

Following is the text of my speech.

My Journey to Mastery

Mr. Chair, fellow toastmasters and welcome guests. 
My name is Steve. This is my first speech in the club. I feel so excited, since it means I will start a new journey, a journey of challenging myself and improving myself.
I would like to talk about myself, about my career, and why I am standing here.

I came from China. I was born in a province called Inner Mongolia. It is in the north part of China. I stayed there until I was 18 years old, then I went to Beijing for college, after graduation, I worked in Beijing until I moved to Canada later. My first job was working for China Aerospace Corporation as an engineer, now I am still really proud of having this experience in my life. And also I met my wife during that time.

Seven years ago my wife and I immigrated to Canada. Last year we got our first kid, my son Andy was born, now he is 14 months old, he give us so much fun, I love him so much.

About my career, I am a software developer; currently I develop applications for mobile phones. I’ve been a programmer for almost 20 years. When I look back, I will say for my first 10 years, I was an average developer; since my second 10 years, I started to know about the software craftsmanship movement. That really changed my self. It is about how to become a professional developer; it is about raising the bar of your job: not only write working code, but also write well-crafted code. It has principles, strategies and disciplines. Programming is like martial art, you need constantly to improve your skills; you need to keep practicing your skills. I really love this idea and I started to follow that philosophy, I learned a lot, gradually I can feel I get changed, change from an average developer to a professional developer, but I know there is a still a long way to go to become a master. I set my career goal to be a master; my career path will continue focus on technology.

But my mindset was changed due to my failure in my former company. About 3 years ago, I realized that the company has lots of issues: too many defects, projects always delayed, people always have to work over time. I got tired of working like that way, so I decided to stand out and push some changes: I talked to my manager, lobbied my colleagues, trying to bring the concept of craftsmanship and new methodology to the company. To my surprise, none of my suggestions was accepted; I did not get many positive feedbacks. I was frustrated because I thought those good ideas inspired me and should inspire others as well. But reality is totally different. I got stuck because I don't know what I need to do next. I realized that my vision was different with them, so I left the company 2 years ago.

Since then I tried to figure out why it is so hard to make people change. I started to understand that only have the good information is not enough; more important is delivering the message. You need to find a strategy, in some cases you need to be a good translator, transform the message to your audience in their languages. Based on my failure, I realize the importance of inspiring people, so I adjust my career goal: along my journey to become a master, I also want to be a coach, I want to tell other people their are better ways to develop software, I want to inspire more and more developers to follow the software craftsmanship. I believe this will be more valuable and more meaningful.

Based on the new goal, I realize I do have blind spots: my communication skill needs to be improved. I need to know how to inspire people, motivate people, and influence people. This is the reason why I am standing here.

Now I start my journey to become a toastmaster, I believe this journey is part of my long journey – the journey to become a master and a coach, I hope the toastmaster club will help me moving toward my final goal.



Saturday, March 10, 2012

Presentation note - Continuous Integration in the Mobile World

Yesterday I watched the presentation  Continuous Integration in the Mobile World by Godfrey Nolan in InfoQ. It is a very informative, the author covers the Jenkins CI server, Version Control and test tools for ios and Android mobile platform, and the author tells us how he integrates those tools in his company's mobile application development.  Most of those tools he mentioned are first time for me. We use Jenkins, but I haven't realize that there are so  many good tools available for you.

Here I just summarize the tools which are mentioned in the presentation.

Jenkins Plugins
- Android Emulator Plugin
- Xcode Plugin

Test tools
-  Perfecto mobile,  test real mobile device via the cloud,  I feel it is quite similar with DeviceAnyWhere.
- TestFligh App,  ios beta test on the fly.
- FoneMonkey,  Functional test tool for ios and Android
- Robotium,  like Selenium, it is for Android UI test framework
- OCUnit, Objective C unit test framework
- OCUnit2junit,  a ruby script to convert OCUnit to Junit, which allows Jenkins to run the OCUnit.

I need to do more research on those tools, I really appreciate Godfrey provide such a informative and inspiring presentation.

Wednesday, February 22, 2012

How to read a file in Xcode project

Recently I got stuck with an objective C problem, Given a text file in your Xcode project, how could I read this text file in my Xcode 4.2 project?
For example, you got a text file called test.txt, it has some contents. In your Xcode project, you need to read its file and print its content. It sounds easy at the beginning, but end up really tough, especially you are new with the latest version of Xcode.
The key problem is you need to make sure the file test.txt is put as the same folder as the build target file, which is the Products folder, otherwise you will always get the file not existed exception.

Through several times try out, finally I figure out how to do it.

1. Add your file into project
   Select File - Add File into xxx, chose the created file into project.
2. Add a "copy file" build phase
    View - Navigator - Show Project Navigator, chose Project, select targets, select Build phase,
    and click "Add Build Phase", add "Copy files";
    in the new Copy Files build phase, choose
      Destination - "Production Directory"
     and click "+" symbol, then choose the file test.txt in your project.

How to test if the file was added in the Product folder or not?
After press the "Run" button, you will see the executable target file under the "Product" folder of your Xcode project,select the target file, right click, select "Show in Finder", then the Product Folder will pop up in the Finder Application, then you should see the test.txt file in the same folder.

Monday, February 13, 2012

Jeremy Lin - an inspring story

Last week NBA belongs to Jeremy Lin!  he just exploded to a star from an unknown underdog, leaded his team 5 wins in a row in a week! What a amazing true cinderella story! I watched his game vs. Lakers last Friday. I was really enjoying the game: he demonstrated his basketball skills and talent: he is smart, he got a high IQ in the basketball. I like his personality: confident, calm and humble. I think these will attribute with his Christian religion, Harvard graduate background and his Chinese descendent. Jeremy's successful story made me realize that Basketball can be played like this: you don't need a very strong, very tall or very fast body, if you have a regular body but you are smart enough and hardworking, you can be a good player as well, like Jeremy Lin! The IQ and skills are more important than the body.

Now I becomes his fan, his story is really inspiring, I learned:
- Always have a big dream. Don't limit your self. You don't have to be genius, you need hard working.
- Craft your skills, practice hard. Jeremy's success is not by accident. I can feel behind scene he must be a hard worker. Since those skills can not be done in a short time.
- Be patient and prepared for the opportunity, you can only seize the chance when you are prepared.

I hope his lin-sanity keeps going!

PS:
 Jeremy Lin's blog
 His facebook page
 Youtube




Using Groovy to update/generate XML file


Recently when I refactored the Android framework in my work, I found I need to generate eclipse .classpath file based on the library file.
I found using Groovy XML library is a lot easier to do this job compare to Java.

1. Add a new library to the current .classpath file.
Problem:  You have a Eclipse .classpath file, which is XML, you need to add another jar file in the class path. for example, adding following into the .classpath:
Solution:
 If you want to write the output to file, use the following code snippet:

There is another method to print XML, using XmlNodePrinter, like:
But I found using XmlNodePrinter will not generate line break, and no xml header either.

2. Generate a new .classpath file
Problem:  iterate the libs folder, add all the jar file name into the .classpath file.
Solution: