Skip to content

directory_writer (#1) #1549

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/directory_writer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# The objective of this GitHub Action is to add a new DIRECTORY.md file to a pull request if needed.
name: directory_writer
on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 1
matrix:
python-version: [3.7]
steps:

- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Update DIRECTORY.md
run: |
scripts/build_directory_md.py 2>&1 | tee DIRECTORY.md
git config --global user.name 'directory_writer'
git config --global user.email '[email protected]'
git remote set-url origin https://x-access-token:${{ secrets.gh_token }}@github.com/$GITHUB_REPOSITORY
git checkout $GITHUB_HEAD_REF
if git diff-files --quiet; then echo 0; else git commit -am "fixup: DIRECTORY.md" && git push; fi
25 changes: 25 additions & 0 deletions DIRECTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* [Newton Forward Interpolation](https://github.com/TheAlgorithms/Python/blob/master/arithmetic_analysis/newton_forward_interpolation.py)
* [Newton Method](https://github.com/TheAlgorithms/Python/blob/master/arithmetic_analysis/newton_method.py)
* [Newton Raphson Method](https://github.com/TheAlgorithms/Python/blob/master/arithmetic_analysis/newton_raphson_method.py)
* [Secant Method](https://github.com/TheAlgorithms/Python/blob/master/arithmetic_analysis/secant_method.py)

## Backtracking
* [All Combinations](https://github.com/TheAlgorithms/Python/blob/master/backtracking/all_combinations.py)
Expand Down Expand Up @@ -36,8 +37,11 @@
* [Brute Force Caesar Cipher](https://github.com/TheAlgorithms/Python/blob/master/ciphers/brute_force_caesar_cipher.py)
* [Caesar Cipher](https://github.com/TheAlgorithms/Python/blob/master/ciphers/caesar_cipher.py)
* [Cryptomath Module](https://github.com/TheAlgorithms/Python/blob/master/ciphers/cryptomath_module.py)
* [Deterministic Miller Rabin](https://github.com/TheAlgorithms/Python/blob/master/ciphers/deterministic_miller_rabin.py)
* [Diffie](https://github.com/TheAlgorithms/Python/blob/master/ciphers/diffie.py)
* [Elgamal Key Generator](https://github.com/TheAlgorithms/Python/blob/master/ciphers/elgamal_key_generator.py)
* [Hill Cipher](https://github.com/TheAlgorithms/Python/blob/master/ciphers/hill_cipher.py)
* [Mixed Keyword Cypher](https://github.com/TheAlgorithms/Python/blob/master/ciphers/mixed_keyword_cypher.py)
* [Morse Code Implementation](https://github.com/TheAlgorithms/Python/blob/master/ciphers/morse_code_implementation.py)
* [Onepad Cipher](https://github.com/TheAlgorithms/Python/blob/master/ciphers/onepad_cipher.py)
* [Playfair Cipher](https://github.com/TheAlgorithms/Python/blob/master/ciphers/playfair_cipher.py)
Expand Down Expand Up @@ -71,6 +75,7 @@
* [Fenwick Tree](https://github.com/TheAlgorithms/Python/blob/master/data_structures/binary_tree/fenwick_tree.py)
* [Lazy Segment Tree](https://github.com/TheAlgorithms/Python/blob/master/data_structures/binary_tree/lazy_segment_tree.py)
* [Lca](https://github.com/TheAlgorithms/Python/blob/master/data_structures/binary_tree/lca.py)
* [Non Recursive Segment Tree](https://github.com/TheAlgorithms/Python/blob/master/data_structures/binary_tree/non_recursive_segment_tree.py)
* [Red Black Tree](https://github.com/TheAlgorithms/Python/blob/master/data_structures/binary_tree/red_black_tree.py)
* [Segment Tree](https://github.com/TheAlgorithms/Python/blob/master/data_structures/binary_tree/segment_tree.py)
* [Treap](https://github.com/TheAlgorithms/Python/blob/master/data_structures/binary_tree/treap.py)
Expand Down Expand Up @@ -149,6 +154,7 @@
* [Longest Sub Array](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/longest_sub_array.py)
* [Matrix Chain Order](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/matrix_chain_order.py)
* [Max Sub Array](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/max_sub_array.py)
* [Max Sum Contigous Subsequence](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/max_sum_contigous_subsequence.py)
* [Minimum Partition](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/minimum_partition.py)
* [Rod Cutting](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/rod_cutting.py)
* [Subset Generation](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/subset_generation.py)
Expand Down Expand Up @@ -228,13 +234,16 @@
* [Abs Min](https://github.com/TheAlgorithms/Python/blob/master/maths/abs_min.py)
* [Average Mean](https://github.com/TheAlgorithms/Python/blob/master/maths/average_mean.py)
* [Average Median](https://github.com/TheAlgorithms/Python/blob/master/maths/average_median.py)
* [Average Mode](https://github.com/TheAlgorithms/Python/blob/master/maths/average_mode.py)
* [Basic Maths](https://github.com/TheAlgorithms/Python/blob/master/maths/basic_maths.py)
* [Binary Exponentiation](https://github.com/TheAlgorithms/Python/blob/master/maths/binary_exponentiation.py)
* [Binomial Coefficient](https://github.com/TheAlgorithms/Python/blob/master/maths/binomial_coefficient.py)
* [Collatz Sequence](https://github.com/TheAlgorithms/Python/blob/master/maths/collatz_sequence.py)
* [Explicit Euler](https://github.com/TheAlgorithms/Python/blob/master/maths/explicit_euler.py)
* [Extended Euclidean Algorithm](https://github.com/TheAlgorithms/Python/blob/master/maths/extended_euclidean_algorithm.py)
* [Factorial Python](https://github.com/TheAlgorithms/Python/blob/master/maths/factorial_python.py)
* [Factorial Recursive](https://github.com/TheAlgorithms/Python/blob/master/maths/factorial_recursive.py)
* [Factors](https://github.com/TheAlgorithms/Python/blob/master/maths/factors.py)
* [Fermat Little Theorem](https://github.com/TheAlgorithms/Python/blob/master/maths/fermat_little_theorem.py)
* [Fibonacci](https://github.com/TheAlgorithms/Python/blob/master/maths/fibonacci.py)
* [Fibonacci Sequence Recursion](https://github.com/TheAlgorithms/Python/blob/master/maths/fibonacci_sequence_recursion.py)
Expand All @@ -257,9 +266,11 @@
* [Mobius Function](https://github.com/TheAlgorithms/Python/blob/master/maths/mobius_function.py)
* [Modular Exponential](https://github.com/TheAlgorithms/Python/blob/master/maths/modular_exponential.py)
* [Newton Raphson](https://github.com/TheAlgorithms/Python/blob/master/maths/newton_raphson.py)
* [Perfect Square](https://github.com/TheAlgorithms/Python/blob/master/maths/perfect_square.py)
* [Polynomial Evaluation](https://github.com/TheAlgorithms/Python/blob/master/maths/polynomial_evaluation.py)
* [Prime Check](https://github.com/TheAlgorithms/Python/blob/master/maths/prime_check.py)
* [Prime Factors](https://github.com/TheAlgorithms/Python/blob/master/maths/prime_factors.py)
* [Prime Numbers](https://github.com/TheAlgorithms/Python/blob/master/maths/prime_numbers.py)
* [Prime Sieve Eratosthenes](https://github.com/TheAlgorithms/Python/blob/master/maths/prime_sieve_eratosthenes.py)
* [Qr Decomposition](https://github.com/TheAlgorithms/Python/blob/master/maths/qr_decomposition.py)
* [Quadratic Equations Complex Numbers](https://github.com/TheAlgorithms/Python/blob/master/maths/quadratic_equations_complex_numbers.py)
Expand Down Expand Up @@ -293,6 +304,8 @@
## Neural Network
* [Back Propagation Neural Network](https://github.com/TheAlgorithms/Python/blob/master/neural_network/back_propagation_neural_network.py)
* [Convolution Neural Network](https://github.com/TheAlgorithms/Python/blob/master/neural_network/convolution_neural_network.py)
* [Gan](https://github.com/TheAlgorithms/Python/blob/master/neural_network/gan.py)
* [Input Data](https://github.com/TheAlgorithms/Python/blob/master/neural_network/input_data.py)
* [Perceptron](https://github.com/TheAlgorithms/Python/blob/master/neural_network/perceptron.py)

## Other
Expand All @@ -309,12 +322,14 @@
* [Game Of Life](https://github.com/TheAlgorithms/Python/blob/master/other/game_of_life.py)
* [Greedy](https://github.com/TheAlgorithms/Python/blob/master/other/greedy.py)
* [Largest Subarray Sum](https://github.com/TheAlgorithms/Python/blob/master/other/largest_subarray_sum.py)
* [Least Recently Used](https://github.com/TheAlgorithms/Python/blob/master/other/least_recently_used.py)
* [Linear Congruential Generator](https://github.com/TheAlgorithms/Python/blob/master/other/linear_congruential_generator.py)
* [Magicdiamondpattern](https://github.com/TheAlgorithms/Python/blob/master/other/magicdiamondpattern.py)
* [Nested Brackets](https://github.com/TheAlgorithms/Python/blob/master/other/nested_brackets.py)
* [Palindrome](https://github.com/TheAlgorithms/Python/blob/master/other/palindrome.py)
* [Password Generator](https://github.com/TheAlgorithms/Python/blob/master/other/password_generator.py)
* [Primelib](https://github.com/TheAlgorithms/Python/blob/master/other/primelib.py)
* [Sdes](https://github.com/TheAlgorithms/Python/blob/master/other/sdes.py)
* [Sierpinski Triangle](https://github.com/TheAlgorithms/Python/blob/master/other/sierpinski_triangle.py)
* [Tower Of Hanoi](https://github.com/TheAlgorithms/Python/blob/master/other/tower_of_hanoi.py)
* [Two Sum](https://github.com/TheAlgorithms/Python/blob/master/other/two_sum.py)
Expand Down Expand Up @@ -390,6 +405,7 @@
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_20/sol1.py)
* [Sol2](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_20/sol2.py)
* [Sol3](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_20/sol3.py)
* [Sol4](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_20/sol4.py)
* Problem 21
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_21/sol1.py)
* Problem 22
Expand All @@ -404,6 +420,9 @@
* Problem 25
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_25/sol1.py)
* [Sol2](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_25/sol2.py)
* [Sol3](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_25/sol3.py)
* Problem 27
* [Problem 27 Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_27/problem_27_sol1.py)
* Problem 28
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_28/sol1.py)
* Problem 29
Expand All @@ -412,6 +431,8 @@
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_31/sol1.py)
* Problem 32
* [Sol32](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_32/sol32.py)
* Problem 33
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_33/sol1.py)
* Problem 36
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_36/sol1.py)
* Problem 40
Expand All @@ -432,6 +453,8 @@
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_67/sol1.py)
* Problem 76
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_76/sol1.py)
* Problem 99
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_99/sol1.py)

## Searches
* [Binary Search](https://github.com/TheAlgorithms/Python/blob/master/searches/binary_search.py)
Expand Down Expand Up @@ -471,6 +494,7 @@
* [Radix Sort](https://github.com/TheAlgorithms/Python/blob/master/sorts/radix_sort.py)
* [Random Normal Distribution Quicksort](https://github.com/TheAlgorithms/Python/blob/master/sorts/random_normal_distribution_quicksort.py)
* [Random Pivot Quick Sort](https://github.com/TheAlgorithms/Python/blob/master/sorts/random_pivot_quick_sort.py)
* [Recursive-Quick-Sort](https://github.com/TheAlgorithms/Python/blob/master/sorts/recursive-quick-sort.py)
* [Selection Sort](https://github.com/TheAlgorithms/Python/blob/master/sorts/selection_sort.py)
* [Shell Sort](https://github.com/TheAlgorithms/Python/blob/master/sorts/shell_sort.py)
* [Stooge Sort](https://github.com/TheAlgorithms/Python/blob/master/sorts/stooge_sort.py)
Expand All @@ -494,3 +518,4 @@

## Web Programming
* [Crawl Google Results](https://github.com/TheAlgorithms/Python/blob/master/web_programming/crawl_google_results.py)
* [Get Imdbtop](https://github.com/TheAlgorithms/Python/blob/master/web_programming/get_imdbtop.py)
30 changes: 16 additions & 14 deletions ciphers/deterministic_miller_rabin.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,21 @@ def miller_rabin(n, allow_probable=False):
"A return value of True indicates a probable prime."
)
# array bounds provided by analysis
bounds = [2_047,
1_373_653,
25_326_001,
3_215_031_751,
2_152_302_898_747,
3_474_749_660_383,
341_550_071_728_321,
1,
3_825_123_056_546_413_051,
1,
1,
318_665_857_834_031_151_167_461,
3_317_044_064_679_887_385_961_981]
bounds = [
2_047,
1_373_653,
25_326_001,
3_215_031_751,
2_152_302_898_747,
3_474_749_660_383,
341_550_071_728_321,
1,
3_825_123_056_546_413_051,
1,
1,
318_665_857_834_031_151_167_461,
3_317_044_064_679_887_385_961_981,
]

primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41]
for idx, _p in enumerate(bounds, 1):
Expand Down Expand Up @@ -131,5 +133,5 @@ def test_miller_rabin():
# upper limit for probabilistic test


if __name__ == '__main__':
if __name__ == "__main__":
test_miller_rabin()
15 changes: 7 additions & 8 deletions ciphers/diffie.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
def find_primitive(n):
for r in range(1, n):
li = []
for x in range(n-1):
val = pow(r,x,n)
for x in range(n - 1):
val = pow(r, x, n)
if val in li:
break
li.append(val)
Expand All @@ -11,16 +11,15 @@ def find_primitive(n):


if __name__ == "__main__":
q = int(input('Enter a prime number q: '))
q = int(input("Enter a prime number q: "))
a = find_primitive(q)
a_private = int(input('Enter private key of A: '))
a_private = int(input("Enter private key of A: "))
a_public = pow(a, a_private, q)
b_private = int(input('Enter private key of B: '))
b_private = int(input("Enter private key of B: "))
b_public = pow(a, b_private, q)

a_secret = pow(b_public, a_private, q)
b_secret = pow(a_public, b_private, q)

print('The key value generated by A is: ', a_secret)
print('The key value generated by B is: ', b_secret)

print("The key value generated by A is: ", a_secret)
print("The key value generated by B is: ", b_secret)
4 changes: 2 additions & 2 deletions data_structures/binary_tree/basic_binary_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def display(tree): # In Order traversal of the tree


def depth_of_tree(
tree
tree,
): # This is the recursive function to find the depth of binary tree.
if tree is None:
return 0
Expand All @@ -36,7 +36,7 @@ def depth_of_tree(


def is_full_binary_tree(
tree
tree,
): # This functions returns that is it full binary tree or not?
if tree is None:
return True
Expand Down
1 change: 0 additions & 1 deletion data_structures/binary_tree/treap.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ def main():
args = input()

print("good by!")



if __name__ == "__main__":
Expand Down
7 changes: 4 additions & 3 deletions data_structures/heap/min_heap.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,10 @@ def sift_down(self, idx, array):

if smallest != idx:
array[idx], array[smallest] = array[smallest], array[idx]
self.idx_of_element[array[idx]], self.idx_of_element[
array[smallest]
] = (
(
self.idx_of_element[array[idx]],
self.idx_of_element[array[smallest]],
) = (
self.idx_of_element[array[smallest]],
self.idx_of_element[array[idx]],
)
Expand Down
4 changes: 1 addition & 3 deletions data_structures/linked_list/doubly_linked_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ def insertHead(self, x):
def deleteHead(self):
temp = self.head
self.head = self.head.next # oldHead <--> 2ndElement(head)
self.head.previous = (
None
) # oldHead --> 2ndElement(head) nothing pointing at it so the old head will be removed
self.head.previous = None # oldHead --> 2ndElement(head) nothing pointing at it so the old head will be removed
if self.head is None:
self.tail = None # if empty linked list
return temp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#############################
from typing import List


def CeilIndex(v, l, r, key):
while r - l > 1:
m = (l + r) // 2
Expand Down Expand Up @@ -49,4 +50,5 @@ def LongestIncreasingSubsequenceLength(v: List[int]) -> int:

if __name__ == "__main__":
import doctest

doctest.testmod()
1 change: 1 addition & 0 deletions dynamic_programming/max_sub_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def max_sub_array(nums: List[int]) -> int:
import time
import matplotlib.pyplot as plt
from random import randint

inputs = [10, 100, 1000, 10000, 50000, 100000, 200000, 300000, 400000, 500000]
tim = []
for i in inputs:
Expand Down
4 changes: 2 additions & 2 deletions file_transfer/send_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import socket # Import socket module

ONE_CONNECTION_ONLY = (
True
) # Set this to False if you wish to continuously accept connections
True # Set this to False if you wish to continuously accept connections
)

filename = "mytext.txt"
port = 12312 # Reserve a port for your service.
Expand Down
2 changes: 1 addition & 1 deletion maths/factorial_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def factorial(input_number: int) -> int:
return result


if __name__ == '__main__':
if __name__ == "__main__":
import doctest

doctest.testmod()
2 changes: 1 addition & 1 deletion maths/factorial_recursive.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def factorial(n: int) -> int:
return 1 if n == 0 or n == 1 else n * factorial(n - 1)


if __name__ == '__main__':
if __name__ == "__main__":
import doctest

doctest.testmod()
2 changes: 1 addition & 1 deletion maths/gaussian.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def gaussian(x, mu: float = 0.0, sigma: float = 1.0) -> int:
>>> gaussian(2523, mu=234234, sigma=3425)
0.0
"""
return 1 / sqrt(2 * pi * sigma ** 2) * exp(-(x - mu) ** 2 / 2 * sigma ** 2)
return 1 / sqrt(2 * pi * sigma ** 2) * exp(-((x - mu) ** 2) / 2 * sigma ** 2)


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion maths/perfect_square.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def perfect_square(num: int) -> bool:
return math.sqrt(num) * math.sqrt(num) == num


if __name__ == '__main__':
if __name__ == "__main__":
import doctest

doctest.testmod()
Loading