Skip to content

Instantly share code, notes, and snippets.

View amoretspero's full-sized avatar
🏠
Working from home

Jiung amoretspero

🏠
Working from home
View GitHub Profile
@amoretspero
amoretspero / ACM_Code_of_Ethics_and_Professional_Conduct_ko_KR.md
Last active December 23, 2021 08:49
ACM code of ethics and professional translation in korean.

ACM Code of Ethics and Professional Conduct

윤리 및 전문성에 관한 행동 강령 - ACM

Adopted by ACM council 10/16/92.
1992년 10월 16일에 ACM 위원회에 의해 적용됨.

Preamble

@amoretspero
amoretspero / quicksort_comparison_count_random_pivot.js
Last active September 19, 2019 06:22
Quicksort comparison count for random pivot
#!/usr/bin/env node
//
// Count the number of comparisons required by quicksort using the following
// three pivot-selection strategies:
//
// 1. Always pick the first element.
// 2. Always pick the last element.
// 3. Pick the median of the first, last, and middle elements. If the list
// length is even, pick the element with the smaller index.
//
@amoretspero
amoretspero / heapsort_comparison_count.js
Last active September 19, 2019 06:22
Heapsort comparison count
let count = 0;
function shuffle(array) {
var currentIndex = array.length, temporaryValue, randomIndex;
// While there remain elements to shuffle...
while (0 !== currentIndex) {
// Pick a remaining element...
randomIndex = Math.floor(Math.random() * currentIndex);
@amoretspero
amoretspero / mergesort_comparison_count.js
Created September 19, 2019 06:22
Mergesort comparison count
let count = 0;
/**
* An implementation for Mergesort. Less efficient
* than Quicksort. Again, you'd just use Array.sort
* but if you found yourself unable to use that
* there's always this option.
*
* Tests with:
*
* var array = [];
@amoretspero
amoretspero / ubuntu_python_upgrade.sh
Created August 9, 2020 10:41
Upgrade python version on ubuntu (>= 18.04)
# 0. Get official distribution. Substitue 'x' with desired version.
sudo apt-get install python3.x
# 1. Get all installed python3 distributions
ls -alh /usr/bin | grep python3
# 2. Add installed python3 version to update-alternatives
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.x
# 3. Configure update-alternatives.