Dealing with customers

Written Contract

Written Contract

Dealing with customers is always a hard topic. This blog post will not summarise some of my experience before working for my current company. Communication with customers require both art and discipline to make sure that nothing could possibly go wrong. Here is a quick list of errors I have been making throughout my working life. :

Not thinking through each of the small details the customers may want to add later.

For example, if the customers want his websites to work on mobile device, it would be wrong to assume that he meant iPhone. 

- Don’t have a specific, fixed requirement document.

It could go wrong if both sides did not agree on a specific set of requirement before the project starts. I think I may need to understand more about Agile development

- Agree on a verbal basic: this is one of the hard lesson that I learnt when working outsourcing. Everything needs to be at least written and agreed on the email and not just chat or voice call.

Not thinking through small details

This is what is hard with software estimation when all the devils are in the details. When customers say they want their app to work on iphone, they really think of all iphone versions, and they probably assume that it works on android as well unless you tell them. It is good to be clear upfront and think through all cases.

Another example is that customer do not understand how important security is, and they just want it to work. But while they are testing, they may find the security issue and blame us all for bad practice of coding and testing.

Don’t have a specific, fixed requirement document.

Customers may want us to change the graphics 2 to 3 times and that are lots of back and froth emails and demonstration with the client. It will also extend the deadline of the project as we may need to wait for them most of the time.

Agree on a verbal basic

Everything should be at least in a written form. This was the key lesson I learnt during the early days of doing business. Everything needs to be agreed again over email. Even if you trust someone, or have a good memory, it is important to remind both of us what we said. It could be as simple as the client wanted to change the graphics and then later on, they completely forgot. It would be troublesome if clients wanted to change the requirement, then to extend deadline and the budget but they regretted it later. A written document would be helpful, or at least an email. I am not a lawyer but I found this book (22 Legal Mistakes you don’t need to make) helpful for new people.

When you write something down and let the other side read through it once, you can confirm that both sides share the same idea and clear all the miscommunication. This proves to be effective when you work on project requirement.

What is your tip? Please share it in the comment.

 

Coursera Optimization

Discreet Optimization at Coursera

Discreet Optimization at Coursera

I just finished the Optimization course in Coursera.org and I felt excited about it. I learnt many new computer science concepts that I skipped during my undergraduate time. My postgraduate was more about management, business and finance than a technical one.

This is a quick review of the course to show what I learnt, what I wished to learn more and how I could apply it in my real world problem

What I learnt:
- NP-hard problems
- The basic knapsack problem
- Branch and bound
- Bottom Up Dynamic Programming
- Constraint Programming
- Local Search
- Integer Programming

It is one of the toughest course in coursera so I needed to watch one topic twice, one for the general understanding and the second is when I need to finish my programming assignment. I will summarise what I learnt in the next few posts, and upload my java code so people can learn from it. The code is not good, though.

The difficulty of the assignments increase significantly when you progress through the course. However, you can jump to any assignment and finish it if you feel comfortable. The lecturer has a hilarious style of teaching that I enjoyed. I personally got 256/320, about 80% of the score, enough to get a certificate

P/S: I recently had a discussion with my coworker about the role of the school and what students should expect to learn. Some of the key concepts offer short term benefits while others’ usefulness need years to recognize.I will write about that in another blog post.

Controls Android New Site

ControlsAndroid.com

ControlsAndroid.com

I am so excited to announce my new site: ControlsAndroid.com where I show my collection of all android controls that I find on the internet. We are still updating it everyday, so please spend time visiting the website, download and use the controls for your cool app. Leave my any comments or suggestions on how to improve the site much better for the community.

For a better Android Interface

General Purpose GPU Programming for Mobile

 

GPU_Computing

There are times that your app collects a whole lot of data (by capturing it live or by downloading from a third party, or import from email), and you want to do a whole ton of reports and visualisations inside your app. .

To do lots of computing inside your smartphone is a very challenging job, as I have experienced myself in processing video data. A small trick is to use your GPU, which could be 10-100 times faster than your CPU in calculating floating point.

Setting up a GPU shader and calculation could be a huge task for anybody who are not familiar with OpenGL. So, this excellent GPGPU library could help you a lot, all you need to do is to change the calculation inside the vsh file. I am planning to make it even easier for anybody to use in the near future.

Improve your Android emulator performance

Want to supercharge your Android emulator in Eclipse/IntelliJ, use the following, excellent tip from Stackoverflow

IMPORTANT NOTE : Please first refer to Intel list about VT to make sure your CPU support Intel VT.

HAXM Speeds Up the Slow Android Emulator

HAXM stands for - “Intel Hardware Accelerated Execution Manager”

Currently it supports only Intel® VT [Intel Virtualization Technology]

The Android emulator is based on QEMU; The interface between QEMU and the HAXM driver on the host system is designed to be vendor-agnostic.

HAXM

Steps for Configuring Your Android Development Environment for HAXM

  1. Update Eclipse: Make sure your Eclipse installation and the ADT plug-in are fully up to date.
  2. Update your Android Tools: After each Eclipse plug-in update, it is important to update your Android SDK Tools. To do this, launch the Android SDK Manager and update all the Android SDK components. To take advantage of HAXM, you must be on at least release version 17.

enter image description here

  • Download the x86 Atom System Images and the Intel Hardware Accelerated Execution Manager Driver: Follow the image below:

enter image description here

  • Install the HAXM Driver by running “IntelHaxm.exe”.
    It will be located in one of following locations:

    • C:\Program Files\Android\android-sdk\extras\intel\Hardware_Accelerated_Execution_Manager
    • C:\Users\<user>\adt-bundle-windows-x86_64\sdk\extras\intel\Hardware_Accelerated_Execution_Manager

    If the installer fails with message that Intel VT must be turned on, you need to enable this in BIOS. See description for how to do this here.

Install .exe or .dmg

  • Create a New x86 AVD: Follow the image below:

Create AVD

  • Or as for new SDK, enter image description here

Time Management for Software Project

Time, quality and cost

 The basic of project management is a balance between time, quality and cost. Pick 2 of them. And then we start discussing about how to estimate the time when we have fixed the quality and cost (just kidding, you can pick quality and time as well).

 

Time Cost Quality

Time Cost Quality – Pick 2

 In projects I have done over last 5 years, each always contains lots of unknown and challenges, as I have worked in most of the latest technology and sometimes I come to new project without any experience

 Main problems in estimating projects can be listed as below:

   - Miscommunication

   - Overestimate the team competency

   - Task breakdown not done carefully.

   - Underestimate integration between models

   - Technical unknown

   - Requirement changes

Miscommunication

This normally happens with outsourcing companies or when teams are spread between different locations. When I chat with clients or teammates, people are lazy to chat so they tend to chat short. It leads to lots of assumptions and miscommunications between people. Voice chat on skype suck energy really fast, and require both sides to communicate synchronously. It could be the miscommunication between clients and your teams or inside your team. You definitely don’t want after 3 months, you come back and the clients’ feeling is like the figure below….

Miscommunication

Well, a famous and familiar figure huh?

Overestimate team competency

I pick my team members really hard, and I also have strong belief in my people. That is why I overestimate my team member most of the time. Belief and overestimate should be separated from each other. “Keep a cold mind and a warm heart”. That means you should keep a strong feeling in your members and encourage them to do a good work, but when evaluate them for specific project, be careful to estimate.

Task breakdown & integration

These are the 2 most underestimated when managing any projects. It is easy to look at the whole and say that it would take 3 days to finish all of them. However, if you actually break it down, and allow time for writing the code, debugging, testing and fixing bugs again,the total time could be 10 days. Oh, I forgot to mention about integrating between tasks or modules. Sometimes, we assume that if task A is done, and task B is done, combining them would be easy. Poor us, it is not usually the case. The combination between module A and module B can generate a whole new level of bugs that need fixing. The bug may only happen due to specific conditions of module A and B. It is important to run lots of tests and allocate debugging time for this phase, as shown in the following figure.

Work Breadown Structure

Work Breadown Structure

Technical Unknown

The risk level of the project depends on how many unknown stuff in your project. Some of them is that the requirement is unclear, or the technical solution is not yet known or implemented by any people in the team. It requires an expert with sharp eye to know which areas are unknown and needs to allocate time for it. The problem is people don’t know what is unknown…

One cool example that strikes me a lot is how Video Player is implemented in iOS and Android. In iOS, seeking to any arbitrary frame is a piece of cake, and I assume a well-designed framework like Android would be the same. I was totally wrong. It took me 2 months to search through many different solutions and approaches to figure how to do it in the correct way.

Only when you really get into coding, you can really know which part is challenging.

How to deal with changes

Another problem is customer change their requirement based on what you demonstrate them. An Agile approach normally helps by clearing any customers’ assumptions as soon as possible and not let them wait until the finished product. By receiving early feedback, we can constantly change the products.
HOWEVER…

1 problem of the Agile approach is that customers keep changing their minds way too often. There is 1 point that we really need to lock the requirement no matter what the customers want. Striking a balance between these issues may keep customers happy and our project budget and timeline in a good shape.

Linkedin Network Analysis with ggplot2

In this part, we will demonstrate how to create a network graph like the one you see in the Linkedin InMap http://community.tradeking.com/upload/0002/3315/linkedin-inmap-jude.jpg

You may achieve the same result using igraph but in this post, we will focus on how to do it in ggplot2. We will not focus on how to download the linkedin data and format it into an appropriate data structure. We assume that you can get your data in the appropriate format like the LinkedinData (download for example), an adjacent matrix like the following:


Jeff Grif Cody Bolh Curtis Blag Eric Wood
Jeff Grif 0 0 0 0
Cody Bolh 1 0 0 0
Curtis Blag 1 0 0 0
Eric Wood 1 0 0 0

Our output will be as beautiful as below image:

Linkedin InMap with R

Linkedin InMap with R

 

We will use the following code to draw based on that data:

LinkedinData<-read.table("LinkedinData",header=TRUE)
names<-as.character(LinkedinData[,1])
LinkedinData<-LinkedinData[,-1]
rownames(LinkedinData)=names
colnames(LinkedinData)=names

LinkedinData<-data.matrix(LinkedinData)
layoutCoordinates

LinkedinList LinkedinList 0, ]

##community dectection
g ###cluster
lead<-leading.eigenvector.community(g)
temp<-layoutCoordinates
temp<-data.frame(temp,lead$names,lead$membership,colSums(LinkedinData)+rowSums(LinkedinData))
colnames(temp)<-c("x","y","name","group","size")

# Function to generate paths between each connected node
edgeMaker index.temp1<-which(LinkedinList[whichRow,1]==temp[,3], arr.ind = TRUE)
index.temp2<-which(LinkedinList[whichRow,2]==temp[,3], arr.ind = TRUE) if(temp[index.temp1,5]>=temp[index.temp2,5]){
index<-c(index.temp1,index.temp2)
}else{
index<-c(index.temp2,index.temp1)
}

fromC toC

# Add curve:
graphCenter bezierMid bezierMid<-as.matrix(bezierMid)
distance1 if(distance1 < sum((graphCenter - c(toC[1], fromC[2]))^2)){
bezierMid } # To select the best Bezier midpoint
bezierMid if(curved == FALSE){bezierMid

edge c(fromC[2], bezierMid[2], toC[2]) # X & y
,evaluation = len)) # Bezier path coordinates
edge$Sequence edge$Group ")
edge$index<-rep(temp[index[2],4],len)
return(edge)
}

# Generate a (curved) edge path for each pair of connected nodes
allEdges allEdges

#cleaning plot
new_theme_empty new_theme_empty$line new_theme_empty$rect new_theme_empty$strip.text new_theme_empty$axis.text new_theme_empty$plot.title new_theme_empty$axis.title new_theme_empty$plot.margin valid.unit = 3L, class = "unit")

zp1 zp1 zp1 size=factor(size)),pch = 21)
zp1<-zp1+geom_text(data=temp,aes(x=x,y=y,label=name,hjust = 0, vjust = 0))
zp1 zp1<-zp1+theme(legend.position="none")

#print(zp1)
zp1

What surprises me about sport business

Sport Business

Sport Business

I has long been a fan of Manchester United and it is fascinating for me to learn about their business and in general, sport business. So, I followed a course in Coursera, https://www.coursera.org/course/globalsportsbusiness to find out more about this industry.

I always have these big questions:

  • How much do these sport companies earn?

  • How do they justify their big spending on player transfer?

  • What are different source of revenues, like advertising, media streaming, player transfer, youth training and transferring, gate tickets?

  • How can the weak team survive, comparing to big teams like Manchester or Real Madrid?

  • How people make sure that these teams don’t cheat on their games?

  • How about drug testing? (this question is already answered on this blog post)

Their Revenue and Income

Big Sport Teams like Manchester United only earns very little comparing with some giant Internet companies like Facebook or Microsoft. Their players can earn a lot comparing to other companies’ employees, though.

Manchester United market capitalisation is: 3.10 Billion $. Well, that is relatively low, comparing to 1B$ of Instagram or 47$B of Facebook. We will investigate each of their sources of revenues to understand where is the big budget and what the league does to make sure it stays competitive and interesting.

Gate Income
is sometimes shared between home and away team, normally ranging from 0%-33% to the away team. Here is the following list of 10 top gate receipts. This gate income contributes a significant part of the income for the clubs:

1 Real Madrid – 438.6m

2 Barcelona – 398.1m

3 Man Utd – 349.8m

4 Bayern Munich – 323.0m

5 Arsenal – 274.1m

6 Chelsea – 255.9m

7 AC Milan – 235.8m

8 Liverpool – 225.3m

9 Inter – 224.8m

10 Juventus 205.0m

Media Income:

The Media is working really well with sport business as the percentage of audience watching a delayed sport is very low, only 4.4%. The following table shows the proportion of audience that watches a delayed show.

Category

% of audience watching delayed

Sport Events

4.4%

Award Ceremonies

14.7%

Comedies

39.5%

There are different business models in this area: TV Networks, Cable TV Model, Regional Sport Network. They can benefit from both the Subscriber Fee and the Advertising Revenue.

The Media Income of some big sporting event:

- Superbowl: 106 million audience (at year 2010)

- UEFA Champions League: 109 million audience (at year 2010)

Other income:

There are other incomes from training the young players and selling them to other teams. The naming fee for the stadiums and the team. There is also salary cap for the players inside the league as well.

 

Drug Testing and Statistics

Doping

I feel very surprised that people like Lance Amstrong or any other atheletes could by pass the drug test so easily for many years until they got caught. Until recently, I read a blog post about the statistics that reveal the truth about this:

Anti-doping tests have a huge false-negative problem. I have been talking about this for years

As it is a huge false-negative problem, most of the time, the dopers will escape it. But if a player tested positive, it is very high likely that they use doping. It is only somebody suspects and request an official legal and expensive process.

And even if you pass 500 doping test is not an impressive as you thought, more here

The anti-doping agencies are so concerned about not falsely accusing anyone that they leave a gigantic hole for dopers to walk through. . . . While we think about Armstrong’s plight, let’s not forget about this fact: every one of those who now confessed passed hundreds of tests in their careers, just like Armstrong did. In fact, fallen stars like Tyler Hamilton and Floyd Landis also passed lots of tests before they got caught. In effect, dopers face a lottery with high odds of winning and low odds of losing. .