Dynamic Programming: Divide & Conquer


Diviser chacune des difficultés que j’examinerais, en autant de parcelles qu’il se pourrait et qu’il serait requis pour les mieux résoudre “. C’est la règle de la division du complexe en éléments simples (analyse). – – Descartes

…Divide the problem P into k small sub- problems (P1, P2,P3,…Pk), so that we can resolve with k solutions (S1, S2,S3,…Sk), then combine them into the final solution S.

Huawei Mobile Services (HMS)


The alternative of GMS on Huawei Mate 30/ -Pro.

For Singapore, without GMS Map, we can use “Waze” which has more local information.

YouTube can be accessed through Browser.

The rest of GMS (Appstore) is no big deal, easily downloadable from alternate Huawei AppGallery or other third party sites.

Huawei App Gallery $1 billion funding to HMS developers, also charge 15% commission on Apps sales (unlike Apple & Google charge 30%).


丘城桐:基础数学和AI, Big Data

AI and Big Data are Twins, their Mother is Math.

“AI 3.0“ today, although impressive in “DeepLearning“, is still using “primitive” high school Math, namely:

AI has not taken advantage of the power of post-Modern Math invented since WW II, esp. IT related, ie :

That is the argument of the Harvard Math Dean Prof ST Yau 丘城桐 (First Chinese Fields Medalist), who predicts the future “AI 4.0“ can be smarter and more powerful.


… Current AI deals with Big Data:

  1. Purely Statistical approach and experience-oriented, not from Big Data’s inherent Mathematical structures (eg. Homology or Homotopy).
  2. The Data analytical result is environment specific, lacks portability to other environments.

3. Lack effective Algorithms, esp. Algebraic Topology computes Homology or Co-homology using Linear Algebra (Matrices).

4. Limited by Hardware Speed (eg. GPU), reduced to layered-structure problem solving approach. It is a simple math analysis, not the REAL Boltzmann Machine which finds the most Optimum solution.


AI 1.0 : 1950s by Alan Turing, MIT John McCarthy (coined the term “AI”, Lisp Language inventor).

AI 2.0 : 1970s/80s. “Rule-Based Expert Systems” using Fuzzy Logic.

[AI Winter : 1990s / 2000s. Failed ambitious Japanese “5th Generation Computer” based on Prolog-based “Predicate” Logic]

AI 3.0 : 2010s – now. “DeepLearning” by Prof Geoffry Hinton using primitive Math (Statistics, Probability, Calculus Gradient Descent)

AI 4.0 : Future. Using “Propositional Type” Logic, Topology (Homology, Homotopy) , Linear Algebra, Category.

为什么 C/C++不会过时 (Outdated) ?


Biggest IT Lies:

  1. IBM Founder: The World only needs 5 Computers (implied IBM Mainframes)
  2. Microsoft Founder: 640 K Memory is big enough for all computers.
  3. DEC Founder (Ken Olsen) : No such thing as “Personal” Computer! Any computer is designed for sharing (Server).

Modern C++11 Course

C++ is divided into the Old C++ and the Modern C++ after version C++11, and currently C++ 17 (with STL complete Functional Programming features) .

The C++20 will be released in 2020.

Fortunately, C++ is backward compatible.

If you want to learn the Modern C++ which ovetcomes the weaknesses of the old C++, learn this Germany lecture (English complete series) is by far the latest C++11 free online :

Series: https://www.youtube.com/playlist?list=PLgnQpQtFTOGR50iIOtO36nK6aNPtVq98C


Modern C++ Course

C++17 Ideal for Mobile Cross-Platform Development

Mobile Cross-Platform :

  1. Android
  2. iOS
  3. Windows
  4. Linux
  5. Web
  6. HongMeng (aka Harmony) OS
  7. IoT

Cross-platform C++ in IDE :

  1. Mac : Xcode, Android Studio, Visual Studio on Mac (fee), Eclipse
  2. Windows : Visual Studio (full featured, pay fee), VS Code (limited feature, free), Eclipse
  3. Linux : many eg. Eclipse…

“So you want to write cross platform code, PAL? (Part I)” by Gal Shelef https://link.medium.com/ijqPGGDWd0

Apps Architecture:

The Salami Method

  • Cross-platform Language: C++ (preferred version 17 with STL for Functional Programming)
  • Apps divided into 2 parts:
    • UI logic: platform specific
      • Android : Java / Kotlin in Flutter framework
      • iOS: Swift / Objective-C
    • Core logic: C++17

Platform-specific Binding : PAL

What is Harmony OS? Huawei’s “Android rival” explained!


1. Harmony OS : Micro-Kernel for ‘1+8+N’ IoT devices

2. ARK Compiler for Android code compatibility (Java, C/C++, Kotlin, JS), yet 60% faster

3. AppGallery : confirmed ‘Yes’ for Facebook, WhatsApp, Insragram. Next ? will be Google Mobile Services (YouTube, Gmail, Google Map, Google Playstore )

4. HMS (Huawei Mobile Services) : $1 billion Apps development fund by Huawei

IT Math

There is a strange phenomenon in IT Profession : Computer Science / IT graduates usually become application / system programmers, while Math graduates are advanced software developers (Compiler, AI, Big Data…)



  • CS / IT grads study Applied Math eg. Linear Algebra, Polynomial, etc;
  • Math grads study Pure (Theoretical) Math eg. Abstract Algebra, Category Theory, Lambda Calculus, Algebraic Topology, Homological Algebra, etc. which are necessary for Compiler design, Functional Programming, etc.


Flutter vs React Native vs Xamarin or Native Codes: Which is the best choice for 2019?

Mobile Apps developed for cross-platform : iOS, Android, Web… (Huawei HongMengOS ? )

  1. Flutter (Google) — Dart
  2. Xamarin (Microsoft) — C#
  3. React Native (Facebook) —Javascript


The above analysis for the 3 tools is neutral – beauty is in the eye of the beholder – they are more or less the same family based on current Object-Oriented paradigm.

However, I would recommend a 4th option with additional future-promising Functional Pragramming (FP) paradigm for multi-platform mobile apps:

4. Native Codes in C++ (Version 17) with Standard Template Library.

  • C++ can be developed in Android Studio, called by Java / Kotlin / Flutter via JNI interface.
  • Or in React Native IDE.
  • IEEE 2019 Ranking : C++ / C is ranked 3rd popular language behind Python (1st) & Java (2nd), but it is unique in multi-paradigm & multi-platform, an advantage compared to the others.

“The dawn of a new era in app development”

[Source: please read the below link:]

“The dawn of a new era in app development” by gk_ https://link.medium.com/fDulXo3zWZ

The dilemma of maintaining 4 code bases for multi-platfofms:

  1. iOS,
  2. Android,
  3. Windows,
  4. Web.

Key Points:

  • Cross-platform tools for Web / Native codes.
  • Google’s future Android-replacement Fuchsia OS (OO&FP Logic : C++/C, Phone UI: Dart, Web: Rust, Server: Go) Flutter framework for iOS / Android / Windows / Web [Notice: the conspicuous absense of Java]

华为 鸿蒙 Huawei HongMeng‘s answer : “1+8+N” iOT multi-platforms (which will soon obsolete Apple iOS & Google Android)

  1. Smart HD TV (out in August 2019)
  2. Mobile Phones / Notepads (April 2020 Huawei P40)
  3. Driverless Car
  4. PC Desktop
  5. Earphones
  6. AI Sound boxes
  7. Virtual Reality (VR)
  8. Wearables
  9. (+ N) All iOT devices


C++ version 17 (Standard Template Library STL‘ for Functional Programming) is multi-paradigm : Imperative, OO & FP. It curently supports Android as Native codes (ie bypass JVM).

Data Science: 5 Statistics & Math tools






5. PCA = Pricinpal Component Analysis


1. Probability & Statistics

2. Linear Algebra (Matrix, Eigenvectors, Eigenvalues)

3. Optimisation : eg. Gradient Descent, etc.

4. Discrete Math in Computing

(想看更多合你口味的内容,马上下载 今日头条)

Functional Programming Python: Lambdas, Decorators, and Other Magic


Python is multi-paradigm: OO or FP.

Useful Functional Programming Techniques :

  • Closure: local variables
  • Resursion : stop unlimiting looping
  • Lambdas : anonymous function for 1-time throw-away functions
  • Nested Function: function returns a function as result.
  • Decorators : wrap an existing function with additional features without modifying it.

The Future of Programming is Dependent Types

Read the example in this excellent blog for explanation of Dependent Type (ie Type depends on its Value) :

Type ArrayOfOne with value ‘length’ of INT 1.

Type ArrayOfTwo with value ‘length’ of INT 2.

Type ArrayOfThree with value ‘length’ of INT 3.

Then compiler will know if correct (before run time error) :

ArrayOfThree = ArrayOfOne + ArrayOfTwo

or wrong if:

ArrayOfTwo = ArrayOfOne + ArrayOfThree


Math High-Pay Career in Data Science


Gone are the days where Math graduates were destined to low-pay teachers in the 1960s to 1990s.

Now Math career is the hottest high pay job in the 2 key engines of the “4th Industrial Revolution” , ie Mind Automation by Machine Learning (in Big Data) and its ‘Young Mother’ Artificial Intelligence.

The 3 top jobs (by order of pay) :

1. Data Scientist (US $120K) :

Skills : Math (Stats, Linear Algebra, Calculus, Probability, & potentially Algebraic Topology / Homological Algebra) + A. I.

Mathematician PhD preferred.

2. Data Architect / Engineer (US $100K)

Skill: Math + IT (especially in Big Data technologies).

3. Data Analyst / (US $65K)

Skills : IT + Business + some Math (Stats).

What Makes Functional and Object-oriented Programming Equal


Comparison of 4 Functional Programming (FP : F#, Lisp/Clojure Haskell, Scala,… ) concepts in Object-Oriented (OO: C#, C++, Java,… ) :

[Not covered here] : There are other FP techniques lacking in OO: Functor (FoldMap), Monad, etc.

1. Function:

2. Closure (variable binding)

3. Currying

4. Function Composition


A Programmer’s Regret: Neglecting Math at University – Adenoid Adventures

Advanced Programming needs Advanced Math: eg.

Video Game Animation: Verlet Integration

AI: Stats, Probability, Calculus, Linear Algebra

Search Engine : PageRank: Linear Algebra

Abstraction in Program “Polymorphism” : Monoid, Category, Functor, Monad

Program “Proof” : Propositions as Types, HoTT


Abstraction: Monoid, Category


信息熵 (Information Entropy) 是怎样炼成的

【信息熵是怎样炼成的 | 纪念信息论之父香农】
(想看更多合你口味的内容,马上下载 今日头条)

Huawei CEO Ren : P30 the Best ever phone camera is Math

Huawei P30 the Best ever phone camera is Math.

(想看更多合你口味的内容,马上下载 今日头条)

Programming with Math (Exploring Type Theory)

If you are inventing a new language, start to study Type Theory.

These 3 are the same thing:

Logic = Category = Type

Unfortunately Milewski’s presentation was cut short due to time constraint, he only presented the first few “Type” functions:

  • Unit,
  • Product,
  • Sum,
  • Exponential,…

(these are from Category Theory refound in Type Theory).