# Author Archives: tomcircle

# A Fistful of Monads

__Kotlin Monad (and Functor, Applicative)__

1. Functor “**map” (Kotlin) **(fmap or <$> in Haskell)

https://hackernoon.com/kotlin-functors-applicatives-and-monads-in-pictures-part-3-3-832d58d92445

2. **Monads** “**flatmap**” (>>= in Haskell)

** Haskell Monad**:

http://learnyouahaskell.com/a-fistful-of-monads

Do not fear Monoid / Monoidal Category / Monad:

__Monad in Haskell__

**F# Monad:**

（分享自知乎网）

# The Ring Z/nZ, Fermat Little Theorem, Chinese Theorem (French)

Revision: Modular Arithmetics

(1/2) Fermat Little Theorem

(1/2) **Chinese Theorem**

** **(Note: This is the “RING” foundation of “The Chinese Remainder Theorem” which deals with remainders )

# Alternate Admission Route to NUS Computing

Source: http://www.straitstimes.com/singapore/education/nus-eyes-more-aptitude-based-admissions

Good news to students who are interested to study Computer Science. There is now an alternative route for students who are short of the cut-off point (currently at least two A’s).

To win a place on the increasingly popular computer science degree course at the National University of Singapore (NUS), students need at least two As for their A levels. Next year though, students eyeing a computing degree can be admitted through another route.

They can take up a five-month-long computer programming course at NUS and if they do well, gain fast-track admission into the degree course, even though they may fall short of the required grades.

# Topology application to Physics

Source: https://www.scientificamerican.com/article/the-strange-topology-that-is-reshaping-physics/?W

# The Strange Topology That Is Reshaping Physics

Topological effects might be hiding inside perfectly ordinary materials, waiting to reveal bizarre new particles or bolster quantum computing

Charles Kane never thought he would be cavorting with topologists. “I don’t think like a mathematician,” admits Kane, a theoretical physicist who has tended to focus on tangible problems about solid materials. He is not alone. Physicists have typically paid little attention to topology—the mathematical study of shapes and their arrangement in space. But now Kane and other physicists are flocking to the field.

In the past decade, they have found that topology provides unique insight into the physics of materials, such as how some insulators can sneakily conduct electricity along a single-atom layer on their surfaces.

Some of these topological effects were uncovered in the 1980s, but only in the past few years have researchers begun to realize that they could…

View original post 112 more words

# Parallel & Concurrent Haskell (2)

**Continued from : (**Part 1**)**

**2.2 Data Structure**

**Function (+) :: D -> D -> D**

**inc x = 1 + x ~ (+) :: 1 + x**

Section (Partial appl) :inc = (+ 1)

**Type** ~ Set {values} : Integer Set / Boolean Set {0,1} / Empty Set “Void” { } / …

Type of Singleton (1 element) : **Unit** ( )

Declare a new Type :

data

data () = ()

1st () = Type of Unit

2nd () = constructor of Unit

Haskell convention : Type name = constructor name

(To avoid having too many nsmes)

Define cares Ian product of Types (Sets):

data Product a b = **P** a b

**Product** : **Type constructor**

**P** : **Data constructor** (function with 2 args of types a, b)

**P :: a -> b -> Product a b**

Data

Immutable: remember how it was constructed.

(+) :: Num a => a -> a -> a

sqDist ‘ ‘ (P x y ) = x^2 + y^2

sqDist ‘ ‘ :: Num a =-> Product a a -> a

Built-in for “pair”:

data ( , ) a b =( , ) a b

eg.

( , ) 1 2 gives (1, 2)

All **data** (Types) are formed by only 2 methods : Product or Sum.

Parallel and Concurrent Haskell: http://www.youtube.com/playlist?list=PLbgaMIhjbmEm_51-HWv9BQUXcmHYtl4sw

<b>Read Free Online Book:</b>

http://chimera.labs.oreilly.com/books/1230000000929/index.html

<a href=”https://tomcircle.files.wordpress.com/2017/07/20170712_200456.png”><img src=”https://tomcircle.files.wordpress.com/2017/07/20170712_200456.png” alt=”” class=”wp-image-13955 alignnone size-full” width=”1064″ height=”1262″></a>

# Guide to Starting Javaplex (With Matlab)

Persistent Homology Tool

## Guide to Starting Javaplex (With Matlab)

Step 1)

Visit https://appliedtopology.github.io/javaplex/ and download the Persistent Homology and Topological Data Analysis Library

2)

Download the tutorial at http://www.math.colostate.edu/~adams/research/javaplex_tutorial.pdf and jump to section 1.3. Installation for Matlab.

3)

In Matlab, change Matlab’s “Current Folder” to the directory matlab examples that you just extracted from the zip file.

(See https://www.mathworks.com/help/matlab/ref/cd.html to change current folder)

Type this in Matlab: cd /…/matlab_examples

Where … depends on where you put the folder

4) In the tutorial (from the link given in step 2), proceed to follow the instructions starting from “In Matlab, change Matlab’s “Current Folder” to the directory matlab examples that you just extracted from the zip file. In the Matlab command window, run the load javaplex.m file.”.

5) Test: Run example 3.2 (House example) by typing in the code (following the tutorial)