Skip to content

Instantly share code, notes, and snippets.

View iamaziz's full-sized avatar
🎲

Aziz Alto iamaziz

🎲
View GitHub Profile
@iamaziz
iamaziz / comparison-sort_algorithms_compared.ipynb
Created March 21, 2019 22:10
comparison-sort algorithms compared and visualized
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@iamaziz
iamaziz / k_means.py
Last active June 15, 2019 04:23
Vanilla k_means algorithm with zero import (for any number of dimensions)
def distance(u, v):
"""
Calculates Euclidean distance between two point
distance = square_root( sum(u_i - v_i)^2 )
u: [float, float], point1
v: [float, float], point2
"""
sum_ = sum((u[i] - v[i]) ** 2 for i in range(len(u)))
return sum_ ** (1 / 2)
@iamaziz
iamaziz / k_means.ipynb
Last active June 15, 2019 06:28
k_means.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@iamaziz
iamaziz / code_book_python_algorithms.py
Created September 21, 2019 01:57
Code Book: read source code just like reading a book.
# --- Code Book: Python Algorithms
# --- Source : github.com/keon/algorithms.git
#========================================================================================================================
# :: tree/path_sum.py ::
#========================================================================================================================
| 1| """
| 2| Given a binary tree and a sum, determine if the tree has a root-to-leaf
| 3| path such that adding up all the values along the path equals the given sum.
| 4|
@iamaziz
iamaziz / git-file-size-growth
Last active February 15, 2020 01:46
See the total size growth between a number of consecutive commits in your git project. Based on http://stackoverflow.com/questions/10845051/git-show-total-file-size-difference-between-two-commits/10847242#10847242
#!/usr/bin/env python
"""
Usage:
$ git-file-size-growth <NUM_COMMIT>
note:
- Put `git-file-size-growth` somewhere in your PATH along with `git-file-size-diff`
# see `git-file-size-diff` at: http://stackoverflow.com/questions/10845051/git-show-total-file-size-difference-between-two-commits/10847242#10847242
"""
@iamaziz
iamaziz / metaprogramming.md
Last active May 6, 2020 05:07
Note on metaprogramming and metacalss in Python
Date: 4/27/2020

Why need metaprogramming? (maybe metaclass?)

Scenario:

  • I want to have a single Interface Class that has a Base Implementation Class with multiple instance implementations for other Inheriting Classes
@iamaziz
iamaziz / copy-of-imagecolorizercolab.ipynb
Last active May 12, 2020 21:56
ImageColorizerColab.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Classical Programming vs. Machine Learning Programming:

image

e.g.

image

source:

@iamaziz
iamaziz / nyc_to_sharqiyahdata_with_love.ipynb
Last active May 15, 2020 05:35
nyc_to_sharqiyahdata_with_love.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@iamaziz
iamaziz / count-qura-an-words-v1.ipynb
Last active May 20, 2020 00:58
Count Qura'an Words - v1
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.