Google officially supports Kotlin from May 2017

Kotlin is the “New Java” officially supported by Google from May 2017! It is less verbose (罗唆) than Java which is clumsy with boilerplates (样板),  interoperates with Java on JVM, with modern functional programming features, and most importantly, it is Multi-Platform : Java, Android, Javascript,  and future versions run as native codes on iOS, MacOS and Linux (Microsoft – work in progress). This eliminates the current headache of having to re-write the same applications for different platforms in different languages.

Google makes Kotlin a first-class language for writing Android apps

Kotlin Tutorials


Two ways to program in Kotlin:

1) Google way:  Download Android Studio 3.0 (with Kotlin and Java 8 Support):

2) (A better way): use Jetbrains “Intelli IDEA for kotlin” (bundled with Kotlin)


French youngest President Emmanuel Macron and his Education 

Emmanuel Macron is the youngest French President (39) since Napoleon Bonaparte (40).

A brilliant student since young, he impressed his secondary school Drama teacher 24 years older, finally married her.

Like any genius (Einstein, Galois, Edison, …) who doesn’t adapt well in the traditional education system, Macron entered the prestigious and highly competitive Classe Préparatoire (Art Stream) Lycée Henri IV in Paris to prepare for the “Concours” (法国抄袭自中国的)”科举” Entrance Exams in France’s top Ecole Normale Supérieure (ENS). Like the 19CE Math genius Evariste Galois who failed the Ecole Polytechnique Concours twice in 2 consecutive years, Macron also failed ENS “Concours” in 2 consecutive years. 

He revealed recently,  “The truth was I didn’t play the game. I was too much in love (with my former teacher) for seriously preparing the Concours …”

Note: French traditional  name for the elitist tertiary education (first 2 or 3 years if repeat last year):  “Khâgne” is the name of Classe Préparatoire for Art Stream. The Classe Préparatoire for Science Stream is called “Taupe” (Mole 鼹鼠 ). 

Also some cute  names for:

  • Art students:
  1. 1st year: hypo-khâgne
  2. 2nd year: khâgne / carré  (square)
  3. 3rd year (repeat): cube (cubic)
  • Science students:
  1. 1st year: “1/2” (Mathématiques Supérieures)
  2. 2nd year: “3/2” (Mathématiques Spéciales)
  3. 3rd year (repeat): “5/2”

    His party “En Marche” did a survey on French Education: “The elitist national education system for the elites & rich families. ”  

    Emmanuel <=> Contract with God 上帝与他同在

    — ” 谋事在人, 成事在天 “

    ( “Man proposes, God disposes”)


    BM Category Theory II 8: F-Algebra, Lambek’s Lemma , Catamorphism, Coalgebra, Anamorphism

    [Continued from previous BM Category Theory …]

    \boxed { \text {type Algebra f a = f a} \to \text {a} }

    Intuition: [Artificial Intelligence] You teach the computer like to a Primary 6 kid, that Algebra is a type of expression (f) which, after evaluation,  returns a value.

    If a = i (initial) [or u (terminal)],
    \boxed { \text {(f i} \to \text {i )} \implies \text {f = Fix-point} }

    Intuition: Fix-point because, the Initial “i”, after evaluating the expression f, returns itself “i”.

    Lambek’s Lemma 
    \boxed { \text {Initial Algebra is an Isomorphism} }

    Note: Endo-functor is a functor (equivalent to function in Set Theory) within the same Category (Endo = Self = 自)

    Video 8.1 F-Algebras & Lambek’s Lemma 

    Video 8.2 Catamorphism & Anamorphism 

    foldr ~ catamorphism (浅层变质) of a Fix-point endo-functor on a List.

    Examples: Fibonacci, Sum_List

    Remark: Cool Math! the more  advanced concept it is, the more closer to Nature (eg.Geology, Biology) : Catamorphism 浅层(风化)变质, or “thin-layer change in nature” (in Functional Programming languages: foldr or map) eg : add1 to a list (1 5 3 8…) 
    = (2 6 4 9 …)

    \boxed { \text {type Coalgebra f a = a} \to \text {f a} }

    Intuition: Reverse of Algebra, given a value, Coalgebra returns an expression (f).

    Anamorphism (合成变质) ~ unfoldr

    Example: Prime numbers

    Remark: Anamorphism (合成变质) or “synthesised change in nature“: eg. Start from a  “seed” prime number “2” generates  all other infinite prime numbers (3 5 7 9 11 13 17 …)

    Note: In Haskell, no difference between Initial and Terminal Fix-points. However, since Fix-point is not unique, in Category Theory there is the Least Fix-point (Initial) and Greatest Fix-point (Terminal).


    Reading “Understanding F-Algebra ” by BM:

    Catamorphism (下态) :

    Anamorphism :

    F-Algebra & F-coalgebra: