This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # switch.sh is used to avoid downloading a new | |
| # version of Golang everytime I want a new version. | |
| # | |
| # Versions are stored in a repo keyed by "go{version}", | |
| # for example "go17" and "go18". | |
| # | |
| # First check that the requested version exists, | |
| # and then delete the old and link the new binary |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo apt update | |
| sudo apt install software-properties-common | |
| sudo add-apt-repository ppa:deadsnakes/ppa | |
| sudo apt update | |
| sudo apt install python3.7 | |
| sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 1 | |
| sudo apt-get install python3.7-dev libkrb5-dev gcc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Hello, and welcome to makefile basics. | |
| # | |
| # You will learn why `make` is so great, and why, despite its "weird" syntax, | |
| # it is actually a highly expressive, efficient, and powerful way to build | |
| # programs. | |
| # | |
| # Once you're done here, go to | |
| # http://www.gnu.org/software/make/manual/make.html | |
| # to learn SOOOO much more. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| import networkx as nx | |
| from functools import wraps | |
| # decorator normalize a selector return array | |
| def normalized(selector): | |
| @wraps(selector) | |
| def normalized_selector(*args, **kwargs): | |
| weights = selector(*args, **kwargs) | |
| return weights / np.sum(weights) |