Category Archives: Learning

Office 365

I wouldn’t say I like Microsoft or most of its products much. But Office 365 is actually working well for me. It also receive lots of praise from the community and users.

I guess I miss something after few years working solely on Apple stuff :) )

Xamarin Migration Journey (Part 1 – Introduction)

We are trying Xamarin as our cross platform approach. And we have learnt many things along the way, some of them were the old approach of Static Library, the API definition and how the code structure and the API design of Xamarin and iOS are somehow different.

We have quite a big codebase (more than 100 thousand lines of code) in iOS and Android in native, mainly because we deal mostly with Video Processing and some native features. We use frameworks a lot to share code between different apps. I have been looking for ways to port the code from iOS to Android in a smooth and cost saving way.

There are multiple steps that I plan to go through when adapting Cross Platform:

- Same or similar architecture between iOS and Android codebase

- Prepare the library in correct format to be reused in the Cross Platform

- Prepare the Binding

- Prepare the team with C# knowledge to migrate the codebase

- Design the module and how best the app will be separated between Shared Module and iOS Module

Coursera Optimization

Discreet Optimization at Coursera

Discreet Optimization at Coursera

I just finished the Optimization course in 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.

5 things to know about cross-platform development for iOS/Android

Cross Platform App

Cross Platform App

People love the idea of cross-platform development for iOS/Android or try to use a familiar language to develop apps for either or both platforms. There are many solutions and platforms out there and each of them has pros and cons, here we will try to name a few and analyse them: MonoTouch, Appcelerator, RubyMotion, PhoneGap, HTML5, Java2ObjC…

The pro is quite clear, it supports both platforms at the same time, you only need 1 guy with 1 skill (either it is C#/Javascript/HTML5 or Ruby) to learn and quickly produce apps for both platforms at the same time.

The cons are quite depending on which you choose to go with, but we will analyse them in some aspects: easy for maintenance, native performance, delay for update, community support, pricing/bankrupt, talent hiring

1. Easy for Maintenance

I found some of the platforms are challenging to maintain, just to name a few: appcelerator and phone gap… With javascript and not available debugger, when it comes to debugging, you will spend as twice/three times as much to debug. Other platforms do support debugging well like MonoTouch or RubyMotion…

One thing that most cross-platform framework has problem is that it adds another layer of complexity into your system. If some bug happens or something does not run as intended, you have three times of works. You have to check if the bug is your bug, is your framework’s bug, the interaction between the framework and the iOS/Android platform, and finally, if that is a bug of iOS/Android. Let’s take a simple example:
iOS had an old bug with rotation and I encountered that bug when I tried to use Appcelerator to build my simple project. It took me the whole day to find that bug was an Apple bug, there is a work around in Apple way but that is not well supported by Appcelerator….

2. Native Performance
When it comes to native performance, I can say that most of the third-party frameworks do well in this area. However, HTML5 is not an excel when it comes to this, or at least, not yet. Facebook has shown us an important lesson with its decision to be back to native to improve its performance. I think that in the future, when the WebKit, the hardware and the requirement for a good app has matched each other, more and more apps will be developed using HTML5 and other open web technologies. Simply, because it is open.

So, if you are building something simple and may grow well over a long time, you may consider the hybrid approach to combine HTML5 and native code. This could work well with if you can integrate it with the web service at your backend.

3. Delay for update/community support/pricing
All of them come to the same problem of third-party frameworks, that middle complexity layer that you add into your project. Most of the frameworks will update quite fast when Apple release a new version, except many minor bugs. I used to have code that is working well with Apple in the iOS4 release and stop working when iOS5 is released. The problem gets worse when most iOS5 beta still works well with my apps. So, when I try to run our app on iOS5 final release, I get panic. I don’t know what is wrong with my code, is it the middle framework, is it just Apple’s release has changed something. I finally figure out that Apple has changed some rules in their API and that affects the old way the middle framework is working. I need to wait for their update to get it work.

Most of the middle framework has their premium supports but you either have to pay more or you have to wait a hell long of time. And most of the communities are a fraction of either the iOS/Objc communities or Android communities. At there, at least somebody has worked with your problem, somebody tested and figured a work around.

4. Bankrupt?
There are quite a lot of third-party frameworks around, and I am quite sure many of them will go bankrupt or stop working after a while. Or the price can go up, or the support rate gets slow down. You don’t know what the hell is waiting for you there. If your product is very important, be careful, you don’t want to throw tens of thousands of lines of code away and start all over again. These middle frameworks code, unfortunately, are not much reusable. You can generate Objective-C/Java code from them and then continue working from that. But, believe me, reading, understanding and maintaining those generated code are as twice as hard as you write it from the beginning. I don’t say all of them may have problems, but be careful which framework you pick, how long your project will last, and make sure there is a good match. If your project is pretty longer than 3-5 years, maybe thinking deep about it…

5. Talent Hiring
This is a people management, a project management issue. I remember 3 years ago, finding a good iOS developer is as hard as hell. Although it is easier now, it may not make sense to have a whole team of engineers in Ruby/C# and 1 guy in iOS and 1 guy in Android (or 1 guy for both iOS/Android). That means you have to feed 2 more guys, training them with company’s culture, to understand the domain knowledge that you have. And when things grow, each of these 3 teams grows. Another solution is that 1 of the web guy need to learn both iOS and Android development. That’s why it may make sense for you to reuse your team’s talent. It is also a good thing to consider to have a guy with HTML5 to approach the app in hybrid (HTML5+native code) model.

Netflix’s bet on House of Cards

netflxiIt is always an interesting time to see a good company to make a bold move into a new market. I was looking at the Apple while they released the first iPhone and keep improving it until today. It was nice to see Netflix to make a bet into original content, as HBO or other channels are doing. This article is quite good and explains most things, in terms of possitive look at the Netflix’s move:

Economics of Netflix 100 million new show


It is never too late for you


Just read this fantastic post on Quora feeling that I might have some further thoughts about it. I have seen many people obsessing about getting things right at the first time, and if they cannot, they think things are too late. However, what I see is that chances and opportunities are almost everywhere and after every couple of years, those chances and opportunities will come back.

Should I switch what I am doing?

I was once asked by my friend, a developer, if he should switch to Business Analysis or not. He feels like it more than programming but if he tries it and he does not fit it, he would waste 2 years of his career. And this kind of switching is raised a lot by my friends and other people. “Should I switch from a big company to work for startup/startup by myself?”, “Should I switch and try doing this/that?”, “My first job/internship was terrible, it would affect my career…”. The answer is you should not worry.

Any Experience Counts

Any experience that you learn, either from a big company, from a small company, from another job or career would bring you a unique point of view into the new career. If you work as sale and now want to move to programming, your sale knowledge is unique, 90% of programmers I know have no knowledge in sales. Understanding sales and customer would bring you a competitive advantage that most don’t have. And vice versa, if you work as programmer before and switch to be business analysis, you really understand the programming work, you understand the technical difficulties and you can help the customers and programmers to talk better. Any experience counts, any unique experience counts twice.

Why knowledge/skill costs a lot?

Yesterday, I have just done a very good job. It is very good because I spent almost a year keep thinking and trying to solve the problem but I couldn’t really solve much. However, the solution yesterday was so easy and short that I was shocked. It reminds me of the following story:

1 guy with a car broken going into a gargage. The repairer asks him for 100$ and it took him the whole day to fix the car. However, the car gets broken again after just a few days. The owner was so disappointed and tried with a new repairer. This new repairer, an elder, just took a quick look at the car and blow the hammer 3 times into some specific place. He then charged the owner 500$. This time, the owner was shocked, “How can I pay you 500$ for just 3 hammer blows?”. “1$ for 1 hammer blow and 497$ for me to know where to do so”.

It just shows me how much matter the knowledge, the thinking through the problem matters, not how much the efforts. Of course, experience and knowledge comes after efforts, but always think before doing

Why not join with a startup idea?

Idea vs Execution

Idea vs Execution

Just found a brillian post, says all I need to say for most of my friends or people. And a good advice to people, please think through and not so disappointed if some developer does not want to go with your idea. The #1 item is the most important thing, imo:

  • Ideas are easy, execution is hard.
  • People approaching developers often dramatically underestimate the amount of development work, or the complexity of it.
  • Proposing a revenue share means the developer has to take as much risk as the idea guy (for very low pay, given the point above), and trust that the business will receive the right amount of marketing/sales follow-through.
  • There’s an opportunity cost to working on someone else’s idea instead of for paying clients.
  • The idea being proposed is often very unrealistic (and the developer, having worked on a number of such ideas, can tell).
  • Developers have their own ideas to work in anyway.

Competitive Advantage – how to make it last

In the last 2-3 years, iPhone development has been my advantage when I stepped into the area early. It brings me many good results. But, that’s over. You hear it correctly. I don’t mean iPhone development will decline, but the growth of the market is significantly slowed down. And the number of good developers in this area will significantly grow when more resources are available.

Long-Lasting Success Requires Non-Ending Efforts

Competitive Advantage

Competitive Advantage

To be successful, a company or a person has to get some competitive advantage. The problem is sooner or later, every other companies/people will improve themselves to gain your competitive advantage. It may take them 3-5 years, but in this technical world, it would be even less. This advantage can never generate a long term plan. No matter how you protect it, no matter what cost you pay to protect it, people will soon be leveling your advantage. Don’t dream and don’t sleep on the victory. Long term and scalable model requires lots of building efforts to generate more competitive advantages.

I have never tried to protect my knowledge about iPhone development because I know the market controls itself. I see enough of stupid people trying to protect their knowledge to gain advantage in company promotion.

To be successful in long term, the same for personal or company, you need to build a culture that motivates new innovation, i.e creating new values. These new values, new knowledge or new understanding will bring you more competitive advantages or guarantee with you a long term success

Online Education and Interaction

Education Video

Education Video

Coursera is cool. Online Education is cool. Content is cool. But do you know what is not? The interaction. It is damn boring to stay focused in 3 hours for a video lecture. Recently, my wife and I tried our best to study Introduction to Finance and Financial Computation Econometric. The interaction environment in the normal classroom is not always interesting, it is even worse in an online course. Maybe we haven’t used all the resources we have or we haven’t tried hard enough. But to make the model more successful, interactions would be the key.

Offline watching has its benefits: people can watch anytime, anywhere and any videos you like. It sounds good until it comes to practice. People get lazy, some of them are watching half the video and have to stop to do something else. When they come back, they lose time to get into focus again. It takes more time and efforts to really focus and learn quickly with offline video.

Obviously, they are still free, I have no complaint about a specific site. What I mean is “Hey, this is my problem and may be others’ problems, hope you guys can fix it”. I think we need to give more benefits for people, as gamification and gaming theory often do, to let them spend a specific of time in their schedule to finish the video, to really focus. Maybe these sites offer some chance to chat with the professor, some small quiz that can be both challenging and rewarding.

In the long term, I really think that solving this problem is the business key and competitive advantage for any company.