I hereby claim:
- I am specbug on github.
- I am specbug (https://keybase.io/specbug) on keybase.
- I have a public key ASDStgoHWKiP216MqojMY0BmVc9Ybb1q2-PoQ--w5FYOXwo
To claim this, I am signing this object:
| # Place all repos, and the script, in a folder. | |
| COUNTER=0 | |
| for d in */ | |
| do | |
| cd "./$d" | |
| GIT_C=$(git rev-list --all --count) | |
| echo "Commits in $d: $GIT_C" | |
| COUNTER=$((COUNTER + GIT_C)) |
| def curry(func): | |
| total_args = func.__code__.co_argcount | |
| def curried_wrapper(*args): | |
| l_args = list(args) | |
| def recurry(*args): | |
| l_args.extend(args) | |
| if len(l_args) == total_args: | |
| return func(*l_args) | |
| return recurry |
| #1 | |
| for i in range(n): # executes n times - {1} | |
| for j in range(m): # executes m times - {2} | |
| t += i * j # executes in constant time - {3} |
| # Analyze the clusters and connections in the graph | |
| for node, cluster in partition.items(): | |
| if cluster == 1: | |
| # Calculate the percentage of nodes that represent Tweets and the percentage of nodes that represent people you follow | |
| num_tweets = len([n for n in cluster1 if n['type'] == 'tweet']) | |
| num_following = len([n for n in cluster1 if n['type'] == 'person']) | |
| tweet_percentage = num_tweets / len(cluster1) | |
| following_percentage = num_following / len(cluster1) | |
| print(f'Cluster 1: {tweet_percentage}% Tweets, {following_percentage}% people you follow') |
I hereby claim:
To claim this, I am signing this object:
| #!/bin/zsh | |
| if [[ "$1" == "work" ]]; then | |
| git config --global user.email <work email> | |
| git config --global user.name <work username> | |
| echo "Switched to work profile" | |
| elif [[ "$1" == "personal" ]]; then | |
| git config --global user.email <personal email> | |
| git config --global user.name <personal username> | |
| echo "Switched to personal profile" |
| """ | |
| Run: `python ia_assignment.py 5` | |
| (1) Generate all combinations & prune branches with four consecutive misses. | |
| (2) Track cases where the student is absent on the Nth day. | |
| I use backtracking to generate all combinations with early pruning to optimize runtime. | |
| For each valid attendance branch, we increment the count of ways by one. | |
| If a branch concludes with an absence, the count of misses increases by one. |
| import hashlib | |
| import binascii | |
| import random | |
| def derive_key(password, salt, iterations, dklen): | |
| password = password.encode('utf-8') | |
| salt = salt.encode('utf-8') | |
| dk = hashlib.pbkdf2_hmac('sha256', password, salt, iterations, dklen) | |
| return binascii.hexlify(dk).decode('utf-8') |