Category Theory : String diagrams

String diagrams (1 – 5)

2. Natural Transformation:

3. Adjunction

Advertisements

Old iMac “Life Saving” Procedures

Old Hardware

  • iMac 8,1 (2008), Intel Core 2 Duo, 2.4 GHz,
  • Memory (2GB DDR2 SDRM 800 MHZ), upgraded to 6 GB (2017)
  • OS with CD : Leopard (10.5.4), upgraded via purchased CD “Snow Leopard” (10.6.3), subsequent few more upgrades (via App Store) till (lastly) El Capitan 10.11.6 (last crashed here)

Useful Keyboard Commands (hold all keys together while start-up /powering on, then release after seeing Apple Logo)

  • <OPTION> (aka <Alt>) – “Start-Up Manager“: choose the selected Start-up drive to boot. (Macintosh HD is the default, if it is corrupted, then likely the Recovery HD too. )
  • <SHIFT>: Safe mode, do some simple repairs; if ok, exit manually by restart.
  • <COMMAND><R> /<COMMAND><R><OPTION>: Recovery Mode (<Option> is via Internet, screen right-hand-top corner “Wi-Fi” must set on). It will show Mac OS Installation Menu: (1…, 2.Reinstall OS…4. Disk Utility).

When Mac screen frozen in blank/grey / white / spinning rainbow Beachball / spinning wheel, the equivalent of “Control-C” in Microsoft windows is:

  • <COMMAND><Esc><OPTION>: This is Forced “Kill” the culprit app when screen hangs. The “Finder” will pop up, then “Force Quit” it. To kill the foremost culprit app, press additional <SHIFT> together with these 3 keys.

How do you know the Start Up HD fails:

Trying the above key commands in vain;

Try the various hardware Reset tricks in vain:

  • Reset SMC
  • Reset PRAM (after replace Hard disk)
  • Reset NVRM
  • etc

Watch this very well explained video series (Part 1 & 2) which cover ALL tricks to fix common problems : (If still fail, go to next section ” Life Saver Tools “)

Life Saver Tools :

1. Bootable Mac OS USB Drive (with Mac OS Installer = OS Recovery Utilities + Mac OS)

https://www.macworld.com/article/2981585/operating-systems/how-to-make-a-bootable-os-x-10-11-el-capitan-installer-drive.html

2. External Back Up Drive (Time Machine)

Notes:

1. Mac OS Generations:

Leopard [CD] (10.5.4 – 10.5.8)

Snow Leopard [CD] (10.6.3 – 10.6.8) : first time introduced “App Store”, built-in at Mac Apple menu (drop down).

Lion (10.7) – upgrade via App Store

Mountain Lion (10.8) – upgrade via App Store

Below free Mac OS since:

Maverick (10.9)

Yosemite (10.10)

El Capitan (10.11 – 10.11.6)

Sierra (10.12)

High Sierra (10.13)

Mojave (10.14)

Fields Medals 2018

Picture Order (From Left) :1. 2. 3. 4.

1. Caucher Birkar (UK / Kurdish – Iran, 40)

https://www.bbc.com/news/science-environment-45032422

2. Alessio Figalli (Italy, 34)
https://www.quantamagazine.org/alessio-figalli-a-mathematician-on-the-move-wins-fields-medal-20180801/

3. Akshay Venkatesh (Australia / India, 36)

Studies number theory and representation theory.

https://www.quantamagazine.org/fields-medalist-akshay-venkatesh-bridges-math-and-time-20180801/

4. Peter Scholze (Germany, 30)
Intersection between number theory and geometry

Programming is Math Proof: Structured Programming

Keywords:

  • Dijkstra, Edge Wyber (born 1930 Rotterdam)
  • Goto is harmful
  • Structures: sequence, selection, iteration

Three Programming Paradigms:

1. Structured Programming (1968 Dijkstra)

  • Impose discipline on direct transfer of control aka “Goto“.
  • “If/ then /else, do/while” control structures are structured.
  • Language: Pascal, etc

2. Object-Oriented ‘OO’ (1966 Ole Johan Dahl & Kristen Nygaard)

  • Impose discipline on Indirect transfer of control (Polymorphism, Inheritance, Encapsulation:constructor‘ function of class, it’s local variables = instance variables).
  • Language: C++/ C# / Objective-C, Java / JavaScript, Go, Python, etc.

OO = Data + Function
=>
Class = Object + Method

3. Functional Programming ‘FP’ (1958 John McCarthy’s LISP language, based on Math “Lambda Calculus” from Alonzo Church 1936).

In LISP: Data = Function

  • Impose discipline upon assignment (side effect, immutability of data, Referential Transparency *).
  • Category Theory = Program : Monad, etc
  • Language: Pure FP: {Lisp, Clojure, Haskell}, Hybrid OO+FP: {Scala, Kotlin}, etc.

4. Any more ?

All Programs can be constructed from just 3 structures (Böhm and Jacopini, 1966):

Sequence / Selection / Iteration.

Dijkstra’s Math Proofs for:

1. Sequence – by simple enumeration.

  • Math Technique: trace the inputs of the sequence to the outputs of the sequence.

2. Selection – by reapplication of enumeration.

  • Each path thru the selection was enumerated. If both paths eventually produced appropriate Math results, then the proof was solid.

3. Iteration – by induction.

  • Proved the case for 1 by enumeration.
  • Assume if N case was correct.
  • Proved N+1 case correct by enumeration.
  • Also proved the starting and ending criteria of the iteration by enumeration.

Note (*): Referential Transparency means – a function (f) with a given parameter always returns the same result.

Eg. Trigonometric function (f) = sin 30 = 0.5 (always! )

In FP, a program is many layers of composition of functions of function, with each function guaranteed (math proven) always returning the same result for given parameters (aka arguments). This is software safety with no surprising unexpected result due to side effects (like database search / Web search / IO output errors).

Reference:

Clean Architecture – A Craftsman’s Guide to Software Structure and Design (by Robert C. Martin)

[Singapore National Library NLB #004.22]

“Docker” – Solomon Hykes talks the future of Modern software

Docker” – the latest IT revolution of “Containers” in OS Virtualization was created by a young French IT graduate of the Parisian (private) Grande Ecole “Epitech” in 2010 – Solomon Hykes (born 1983).

https://youtu.be/JW8elKJbkAM

Why we built Docker?

https://youtu.be/3N3n9FzebAA

2014 Google “Kubernetes” embraces “Docker” in its Container Orchestration Automation tool:

https://www.sumologic.com/blog/devops/kubernetes-vs-docker/

Epitech Interview (in French):

https://youtu.be/VLiadroVNTM

Singapore PSLE Math baffled Anxious Parents

One afternoon 5 friends rented 3 bikes from 5 p.m. to 6:30 p.m. and took turns to ride on them. At any time, 3 of them cycled while the other 2 friends rested.

If each of them had the same amount of cycling time, how many minutes did each person ride on a bike?

Note: PSLE (Primary Schools Leaving Exams) is the Singapore National Exams for all 12 year-old pupils at Primary 6 year end. The result of which will determine which secondary school the pupil is qualified to enter the following year. Math subject, besides Science, English and mother tongue (Chinese or Malay or Tamil) are tested in PSLE.

[Answer] Try before you scroll down below ….

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

Answer = each student rides 18 mins per bike (= 90 mins /5 ).

The “3” bikes are tricky “smokes” not relevant, it could be any “n” (<6) bikes , as long as total 90 mins, and each student rides same duration.

IT Application’s 5 Evolution Stages

From Mainframe/Mini Server-based Monolithic Application since 80s, to
Browser-based thin-client-thick-Server Application from mid-90s, to
MicroServices-based Applications in 2018’s…

Small is beautiful !!

“Dinausaur” Monolithic Applications give way to Microservice-based Application.

Microservice is a realisation of “mini”-SAAS (Software As A Service).

Component-based Software a la hardware components VLSI is becoming a reality.

https://dzone.com/articles/convert-legacy-applications-into-future-proof-appl