DP = “Reversed” Recursion

DP is Bottom-Up

Recusion is Top-Down

DP is faster, unlike Recusion repeats many unnecessary similar steps.

https://blog.scottlogic.com/2018/01/30/exploring-dynamic-programming.html

DP = “Reversed” Recursion

DP is Bottom-Up

Recusion is Top-Down

DP is faster, unlike Recusion repeats many unnecessary similar steps.

https://blog.scottlogic.com/2018/01/30/exploring-dynamic-programming.html

https://dev.to/dm8typrogrammer/inheritance-vs-composition-51eg

There are situations OO is too cumbersome (multi-inheritance) with too many variances, then use **Composition**.

Example: Pizza with many variant Toppings.

https://dzone.com/articles/dynamic-programming

“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.

https://www.huaweicentral.com/huawei-mobile-services-hms-everything-you-need-to-know/

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%).

**Algebraic Data Type**:

- Product Type
- Sum Type: Either

Functor (map) :

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:

- Statistics,
- Probability (Bayesian) ,
- Calculus (Gradient Descent)

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

- Category Theory (Functional Programming),
- Algebraic Topology : Homology (Big Data Analytics)
- Homotopy Type Theory ‘HoTT’ (Machine Proof Math Theorems) .

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:

- Purely Statistical approach and experience-oriented, not from Big Data’s inherent Mathematical structures (eg. Homology or Homotopy).
- 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.

**Notes**:

**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++11 and the subsequent major releases every 3 years, namely C++14 (2014) , C++17 (2017) and C++20 (in 2020)… are different products from the old C++ before, below are the major changes :

Native vs Cross-Playform Framework Approaches:

- Naive : Java / Kotlin (Android) or Objective-C / Swift (iOS)
- Cross-platform Framework: Flutter / Dart (Google), React Native

Biggest IT Lies:

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

**Learning & Teaching:**

**New C++20 in 2020:**

**STL Algorithms in 1 hour:**

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

**Slides**:

Writing browser-based applications used to require many tools:

- Browser-side: Javascript, HTML, CSS, or PhP…
- Server-side: Go, or node.js, or C++, or Java…

A **Full-Stack** development tool like “**React.js**” is a single language which does both.

https://codeburst.io/why-should-i-even-bother-with-full-stack-development-142b9c4c7c3f

Microsoft 40+ series of FREE Python Tutorials on Youtube : AI / Machine Learning, Data Analytics, Automation Scripting.

Github:

** Mobile Cross-Platform** :

- Android
- iOS
- Windows
- Linux
- Web
- HongMeng (aka Harmony) OS
- IoT

__ Cross-platform C++ in IDE__ :

- Mac :
**Xcode**,**Android Studio**, Visual Studio on Mac (fee), Eclipse - Windows : Visual Studio (full featured, pay fee), VS Code (limited feature, free), Eclipse
- 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__:

- 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

- UI logic: platform specific

**Platform-specific Binding : PAL**

https://www.androidauthority.com/huawei-harmony-os-1030848/

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

“Lambdas: The Functional Programming Companion of Modern C++” by Deepak K [Daksh] Gupta https://link.medium.com/yHpn3xmx9Z

https://www.codeproject.com/Articles/1267996/Functional-Programming-in-Cplusplus

Very good presentation of Functional C++ by the guru Kevlin Henney.

Piping (Functional Composition) in Channels Asynchronously Concurrency:

h

…

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…)

Why?

**Answer**:

- 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.

https://android.jlelse.eu/5-must-have-android-libraries-for-smooth-app-development-a85ecbdd8a54

Five Android Libraries :

Example: Glide

…

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

- Flutter (Google) — Dart
- Xamarin (Microsoft) — C#
- React Native (Facebook) —Javascript

The above analysis for the 3 tools is neutral – *beauty is in the eye of the beholde*r – 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.

[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:

- iOS,
- Android,
- Windows,
- 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*of*absense***Java**]

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

- Smart HD TV (out in August 2019)
- Mobile Phones / Notepads (April 2020 Huawei P40)
- Driverless Car
- PC Desktop
- Earphones
- AI Sound boxes
- Virtual Reality (VR)
- Wearables
- (+ N) All iOT devices

**Remark**:

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).

“Much Needed Mathematics for Machine Learning Algorithms” by Kolla Leela Kishan https://link.medium.com/SWIrEa5FLZ

1. MEAN / MEDIUM

2. PERCENTILE

3. SKEWNESS

4. STANDARD DEVIATION

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

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

http://app.toutiao.com/news_article/?utm_source=link

Harmony OS = HongMeng OS 鸿蒙

Its Ark Compiler (方舟) supports Java, Javascript, Google’s Kotlin, C/C++, runs 60% faster than in Android JVM.

Huawei announces HarmonyOS, an open-source platform for every device

https://dev.to/codemouse92/dead-simple-python-lambdas-decorators-and-other-magic-5gbf

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.

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

eg.

Type ArrayOf**One **with value ‘length’ of INT 1.

Type ArrayOf**Two **with value ‘length’ of INT 2.

Type ArrayOf**Three** with value ‘length’ of INT 3.

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

ArrayOf**Three = **ArrayOf**One + **ArrayOf**Two**

or wrong if:

ArrayOf**Two **= ArrayOf**One + **ArrayOf**Three**

https://towardsdatascience.com/data-science-jobs-with-their-salaries-171acd3bf9be

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).

http://codinghelmet.com/articles/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 techniquesin OO:lackingFunctor(FoldMap),Monad, etc.

1. **Function:**

2. **Closure**** (variable binding) **

3. **Currying**

4. **Function** **Composition**

…

…**Conclusion**:

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

https://awalterschulze.github.io/blog/post/neglecting-math-at-university/

Abstraction: Monoid, Category

Category

关系学 Study of Relationship between Structures:

Mathematician Solves Computer Science “Sensitivity Conjecture” in Two Pages.

https://amp.livescience.com/66065-sensitivity-conjecture-mysterious-math-proof.html

Unicode UTF-8:

- 7-bit ASCII (127 characters) was invented on the back of a napkin by computer scientist in 1960s
- Unicode (UTF-8) was invented for WWW Web in 1990s, backward compatible with ASCII
- 100,000 characters of all human’s languages (Chinese, Japanese, Arabic, Korean,…)

https://dev.to/renegadecoder94/understanding-the-number-theory-behind-rsa-encryption-1pdo

Background knowledge:

1. **Group**

2. **Cardinality** : **Euler Totient Function**

**Note**:

A linguistic remark: The Latin word “totiens” (or “toties”) means “that/so many times”.

【信息熵是怎样炼成的 | 纪念信息论之父香农】

https://m.toutiaocdn.com/group/6685498360318657036/?app=news_article_lite×tamp=1561737552&req_id=201906282359120101520481610092161&group_id=6685498360318657036&tt_from=android_share&utm_medium=toutiao_android&utm_campaign=client_share

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

http://app.toutiao.com/news_article/?utm_source=link

【任正非真正的忧虑是什么？】

Huawei P30 the Best ever phone camera is Math.

https://m.toutiaocdn.com/group/6706661065654010372/?app=news_article_lite×tamp=1561530044&req_id=20190626142044010152040076039145F&group_id=6706661065654010372&tt_from=android_share&utm_medium=toutiao_android&utm_campaign=client_share

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

http://app.toutiao.com/news_article/?utm_source=link

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).

…