When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:
main {
max-width: 38rem;
padding: 2rem;
margin: auto;
}
Whilst working through the many (Octave) coding assignment from Andrew Ng's Stanford Machine Learning course, a common problem that I have to solve revolves around this:
Given a Matrix A with m rows, and n columns find the mininum (or maximum) value and the associated row and column number
This article summarises my solution to this problem (which, hopefully this will also come in hadny to you!). Note that Octave index start from 1 (instead of 0).
Say we have a Matrix A that look like this:
try: | |
import numpypy as np # for compatibility with numpy in pypy | |
except: | |
import numpy as np # if using numpy in cpython | |
## Tri Diagonal Matrix Algorithm(a.k.a Thomas algorithm) solver | |
def TDMAsolver(a, b, c, d): | |
''' | |
TDMA solver, a b c d can be NumPy array type or Python list type. | |
refer to http://en.wikipedia.org/wiki/Tridiagonal_matrix_algorithm |