Skip to content

I request access to the files so I can contribute to the project! #181

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

Closed
wants to merge 338 commits into from
Closed
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
338 commits
Select commit Hold shift + click to select a range
f5fc930
Merge pull request #108 from frmatias/master
AnupKumarPanwar Sep 3, 2017
7e26755
Added front to indicate the starting of the Queue
GauthamramRavichandran Sep 3, 2017
616faac
Merge pull request #106 from frmatias/master
dynamitechetan Sep 4, 2017
e4ef5d4
Merge pull request #109 from RGauthamRam/patch-1
dynamitechetan Sep 5, 2017
7500733
Create singly_LinkedList.py (#110)
avkaran-singh Sep 9, 2017
fb1b87c
Merge pull request #107 from mk9440/master
dynamitechetan Sep 10, 2017
1bed547
Trie implementation (#111)
JavonDavis Sep 10, 2017
e1befed
add bp neural network with 3 layers
RiptideBo Sep 21, 2017
53b6fe1
improve
RiptideBo Sep 22, 2017
0e0e75d
improve
RiptideBo Sep 22, 2017
e1e897b
Merge pull request #114 from RiptideBo/master
AnupKumarPanwar Sep 22, 2017
a38e684
Merge pull request #115 from RiptideBo/stephen_branch
AnupKumarPanwar Sep 22, 2017
52ee9a1
commit convolution_neural_network.py
RiptideBo Sep 22, 2017
6e61ac1
commit convolution_neural_network.py
RiptideBo Sep 22, 2017
da449e0
Merge pull request #1 from RiptideBo/stephen_branch
RiptideBo Sep 22, 2017
e4d537a
Merge remote-tracking branch 'upstream/master'
RiptideBo Sep 22, 2017
42c5863
Merged Graphs
dhavdc Sep 28, 2017
d3f3a88
Merge pull request #120 from dhavdc/master
dynamitechetan Sep 28, 2017
1958cf2
added timsort.py
theycallmemac Sep 28, 2017
aad3fca
Update password_generator.py
d0io0 Sep 28, 2017
8bae14b
Update .travis.yml
AnupKumarPanwar Sep 29, 2017
aa8485b
Delete .travis.yml
AnupKumarPanwar Sep 29, 2017
1f0f4b2
Fixed heading's formatting errors
Ankit-Dhankhar Sep 29, 2017
edcf6d5
#130 fixed radix sort for python 3
KuLi Sep 29, 2017
4d4b0ff
Added Dijkstra Algorithm
malikshubham827 Sep 30, 2017
2480eac
Adding Euclidean GCD algorithm
JuantAldea Oct 1, 2017
a97ab2f
Update timsort.py
theycallmemac Oct 1, 2017
6903d95
AVL done
rafaelleru Oct 2, 2017
07fb7d6
added k means clustering algorithm, usage doc inside.
anuragkumarak95 Oct 2, 2017
9ba6426
Added A* Algorithm
Oct 3, 2017
271cc48
Update A*.py
rudrasohan Oct 3, 2017
46b82fa
Added Next Greater Element
rajnishyadav321 Oct 4, 2017
17e1a92
Refactor Stack
Oct 6, 2017
e8d0c7e
Added Code in Dynamic Programming section for Longest Strictly Increa…
aravindiiitb Oct 6, 2017
2a916b0
Delete P01_BreadthFirstSearch.py
b1o0d4x3 Oct 6, 2017
d33044e
Delete P02_DepthFirstSearch.py
b1o0d4x3 Oct 6, 2017
3ecb193
Merge pull request #148 from b1o0d4x3/master
AnupKumarPanwar Oct 7, 2017
014786e
Fix: typo in multiple files.
KyleScharnhorst Oct 7, 2017
b695175
binary exponentiation
chinmoy159 Oct 8, 2017
677dfe9
Delete binary_exponentiation.java
chinmoy159 Oct 8, 2017
a36ca7c
Create binary_exponentiation.py
chinmoy159 Oct 8, 2017
f4c6578
Binary Exponentiation for a^b
chinmoy159 Oct 8, 2017
f5917f5
Binary Exponentiation for Multiplication
chinmoy159 Oct 8, 2017
0393c5a
Update binary_exponentiation.py
chinmoy159 Oct 8, 2017
7447a9f
Added Ternary Search Algorithm
DTBUday Oct 9, 2017
8fb1eb7
Implementation of a regression tree in python
nbrgr Oct 9, 2017
37967bd
Fixed case where function didn't return where it should
nbrgr Oct 9, 2017
cb3ff4a
Create quick_select.py
fickleEfrit Oct 9, 2017
dc5e86b
Fixed compilation errors, fixes for readability/convention, changed d…
Oct 10, 2017
ab058ab
changed rigt->right, a typo fix.
Oct 10, 2017
14e6372
Added counting sort in python
shivams334 Oct 10, 2017
8f71b30
Fixed binary search to correctly recurse to left half and right half
TaylorL19 Oct 10, 2017
a3b72c5
Merge pull request #155 from TaylorL19/master
dynamitechetan Oct 10, 2017
48dc64f
Merge pull request #154 from alveeno/master
dynamitechetan Oct 10, 2017
59fc956
Merge pull request #153 from fickleEfrit/patch-1
dynamitechetan Oct 10, 2017
f9156cf
Merge pull request #152 from nbrgr/DecisionTree
dynamitechetan Oct 10, 2017
875c6cd
Add Linear Congruential Generator
TobCar Oct 11, 2017
7c9a07c
Merge remote-tracking branch 'upstream/master'
RiptideBo Oct 11, 2017
aac224d
Update radix_sort.py
satanb4 Oct 11, 2017
247089d
Update minimum_partition.py
satanb4 Oct 11, 2017
09131a7
implemented jump search
senapati-deepak Oct 12, 2017
a07baad
Added fastfibonacci.py
Oct 12, 2017
5d83eb7
Add Dijkstra's Algorithm
arpanjain97 Oct 13, 2017
176c330
Add Bellman-Ford Algorithm
arpanjain97 Oct 13, 2017
00575aa
Add Floyd-Warshall Algorithm
arpanjain97 Oct 13, 2017
86a5b03
Recursive solution to insert_tail in singly_LinkedList
coreyhu Oct 13, 2017
e021179
Changed the typographical error (#132)
nandujkishor Oct 13, 2017
81ab324
Revert "There were 2 codes for BFS and DFS in data-structure/Graph." …
sachinarora707 Oct 13, 2017
974acef
Deleting duplicate BFS and DFS files. (#164)
sachinarora707 Oct 13, 2017
85c1e03
Merge pull request #149 from KyleScharnhorst/master
sachinarora707 Oct 13, 2017
35d3873
Add counting sort
andrealmeid Oct 14, 2017
eb8375d
Commented travis tag
harshildarji Oct 14, 2017
ec9fdaa
Merge pull request #160 from kiandru/fastfibonacci
harshildarji Oct 14, 2017
db3b628
Merge pull request #165 from andrealmeid/master
harshildarji Oct 14, 2017
123b8a3
added simple chaos machine impl. to hashes/
Oct 14, 2017
d7fccf5
Updated README.md
yeggasd Oct 14, 2017
944c128
Merge pull request #168 from yeggasd/master
sachinarora707 Oct 14, 2017
2046a7b
Merge pull request #116 from RiptideBo/master
harshildarji Oct 15, 2017
4c9efea
Merge pull request #123 from theycallmemac/master
harshildarji Oct 15, 2017
d70b926
fixed spelling of coma to comma
sarbajitsaha Oct 15, 2017
6d19270
added interpolation search
sarbajitsaha Oct 15, 2017
464408e
Merge pull request #169 from sarbajitsaha/master
AnupKumarPanwar Oct 15, 2017
aab6d58
Merge pull request #134 from malikshubham827/master
harshildarji Oct 16, 2017
cf7d2cb
Fix typo in traversals
agdenadel Oct 17, 2017
12a5b3a
Merge pull request #170 from agdenadel/master
AnupKumarPanwar Oct 17, 2017
54eb79f
Merge pull request #135 from KuLi/radix_sort-fix
harshildarji Oct 17, 2017
6882321
Merge pull request #136 from JuantAldea/euclidean_gcd
harshildarji Oct 17, 2017
6bc30c7
Merge pull request #139 from anuragkumarak95/master
harshildarji Oct 17, 2017
438a9c6
Merge pull request #162 from coreywho/master
harshildarji Oct 17, 2017
bb76af3
Merge pull request #140 from rudrasohan/new
harshildarji Oct 17, 2017
1f8693d
Merge pull request #1 from TheAlgorithms/master
anuragkumarak95 Oct 18, 2017
2b8b65a
Merge pull request #143 from rajnishyadav321/patch-1
harshildarji Oct 18, 2017
7fe8fdc
Merge pull request #138 from rafaelleru/master
harshildarji Oct 19, 2017
8ae1f24
Merge pull request #151 from DTBUday/master
harshildarji Oct 19, 2017
971d53b
Merge pull request #150 from chinmoy159/master
harshildarji Oct 19, 2017
a093f55
Merge pull request #147 from aravindiiitb/master
harshildarji Oct 19, 2017
606e696
Merge pull request #146 from chrismclennon/stack
harshildarji Oct 19, 2017
85a599d
Add files via upload
d0io0 Oct 19, 2017
535cbb7
Merge pull request #156 from TobCar/master
harshildarji Oct 20, 2017
0dcf27f
Added basic-graphs.py with common graph algorithms
py-ranoid Oct 20, 2017
edaa2c1
Floyd Warshall Algorithm
Oct 20, 2017
d68d0ef
Add Fenwick Tree
Oct 20, 2017
29f8e5e
Create Arrays
Oct 20, 2017
e7e8558
Add Segment Tree
Oct 20, 2017
2617de8
Add Lazy Segment Tree
Oct 20, 2017
fe7b86c
Add files via upload
shivams334 Oct 20, 2017
b0d5301
fixed issue#171
itsdanni Oct 20, 2017
44ad272
Merge pull request #2 from TheAlgorithms/master
anuragkumarak95 Oct 20, 2017
226a0a4
Adding reverse() to singly-linked list
tonydelanuez Oct 22, 2017
850953c
Two-sum, common interview problem.
tonydelanuez Oct 22, 2017
0ad029c
Added getNode function and made changes to insert function
pablo9891 Oct 22, 2017
3786c0d
Deleted binary_seach_tree
pablo9891 Oct 22, 2017
da58cd9
added Sierpinski Triangle generation module(fractal structures).
anuragkumarak95 Oct 23, 2017
b96412c
Merge branch 'master' into patch-1
satanb4 Oct 23, 2017
8e6db7a
Merge pull request #173 from py-ranoid/patch-1
harshildarji Oct 23, 2017
7180f08
Created Union-Find algorithm
gilbertoalexsantos Oct 24, 2017
64610bc
Merge pull request #174 from SaBuZa/floyd_warshall
harshildarji Oct 24, 2017
fd4875a
Merge pull request #175 from SaBuZa/Fenwick-Tree
harshildarji Oct 24, 2017
3b69bfc
Merge pull request #176 from imcgeek/patch-1
harshildarji Oct 24, 2017
f6696d0
Merge pull request #177 from SaBuZa/Segment-Tree
harshildarji Oct 24, 2017
f07c8d5
Merge pull request #178 from SaBuZa/Lazy-Segment-Tree
harshildarji Oct 24, 2017
b2d165d
Merge pull request #1 from TheAlgorithms/master
rudrasohan Oct 24, 2017
88c881d
Changed Filename from A*.py to a_star.py
rudrasohan Oct 24, 2017
70c11da
Merge pull request #188 from rudrasohan/fix_name
sachinarora707 Oct 24, 2017
b039fcb
Merge pull request #180 from mathildapurr/fix_balanced_brackets
sachinarora707 Oct 24, 2017
46c0c66
deleted A*.py
sachinarora707 Oct 24, 2017
b50827f
Merge pull request #189 from TheAlgorithms/sachinarora707-patch-1
sachinarora707 Oct 24, 2017
848432c
Project Euler Problems Added.
sachinarora707 Oct 24, 2017
1aa3717
Merge pull request #191 from sachinarora707/master
dynamitechetan Oct 24, 2017
7284714
Project Euler Solutions Added.
sachinarora707 Oct 24, 2017
9bc80ea
Added Dequeue in Python
97arushisharma Oct 24, 2017
fb347ac
Merge branch 'master' of https://github.com/jyotsana19/Python
97arushisharma Oct 24, 2017
96536ad
add coin change problem
Oct 25, 2017
53ce9b8
fix typo
Oct 25, 2017
6bdf4fc
Merge pull request #182 from tonydelanuez/patch-1
harshildarji Oct 25, 2017
60a42cc
Merge pull request #183 from tonydelanuez/patch-2
harshildarji Oct 25, 2017
55ebf70
Merge pull request #184 from pablo9891/master
harshildarji Oct 26, 2017
a11d3b5
Merge pull request #185 from anuragkumarak95/master
harshildarji Oct 26, 2017
8f3abf5
Merge pull request #186 from gilbertoalexsantos/union-find
harshildarji Oct 26, 2017
07e8e25
Merge pull request #190 from jyotsana19/master
harshildarji Oct 26, 2017
dc5c576
Merge pull request #192 from sachinarora707/master
harshildarji Oct 26, 2017
f1621c4
[other] Added Conway's Game of Life Experiment.
anuragkumarak95 Oct 26, 2017
1e9d903
Merge pull request #3 from TheAlgorithms/master
anuragkumarak95 Oct 26, 2017
20a4577
Add a soution of ProjectEuler Problem 13
bT-53 Oct 27, 2017
3cae796
Create scc_kosaraju.py
bT-53 Oct 27, 2017
5c10a29
Merge pull request #196 from bT-53/patch-1
dynamitechetan Oct 27, 2017
ad935df
Merge pull request #179 from Shivams334/master
harshildarji Oct 27, 2017
8cd5157
Added Multi Heuristic Astar
yashasvi97 Oct 27, 2017
e07e0cb
add minimum spanning tree kruskal
First4196 Oct 27, 2017
6393251
add newline at the end
First4196 Oct 27, 2017
8c5fd4b
Create cyclesort.py
Oct 27, 2017
54700f2
Added delete function
pablo9891 Oct 28, 2017
f766bb4
Added delete function
pablo9891 Oct 28, 2017
9d88246
Finished delete function and added some prints functions too
pablo9891 Oct 28, 2017
75af340
ROT13
t0rr3sp3dr0 Oct 29, 2017
21e8724
Merge pull request #193 from erdenezul/coin_change_problem
harshildarji Oct 30, 2017
a5ccc42
Merge pull request #194 from anuragkumarak95/master
harshildarji Oct 30, 2017
4945623
Merge pull request #195 from bT-53/master
harshildarji Oct 30, 2017
aa15ab8
Merge pull request #197 from yashasvi97/yashasvi97-MHAstar
harshildarji Oct 31, 2017
92bf7a6
Merge pull request #198 from First4196/master
harshildarji Oct 31, 2017
ac33016
Merge pull request #199 from honeycoder96/patch-1
harshildarji Oct 31, 2017
9dfd0a6
Merge pull request #200 from pablo9891/master
harshildarji Oct 31, 2017
991d09a
Merge pull request #201 from t0rr3sp3dr0/master
harshildarji Oct 31, 2017
bb3287a
Merge pull request #157 from Sayan97/patch-1
harshildarji Nov 1, 2017
3c4c7eb
refactor longest common subsequence problem
Nov 1, 2017
823ce64
Merge pull request #1 from TheAlgorithms/master
satanb4 Nov 1, 2017
8e00180
Merge pull request #166 from maciejczyzewski/master
harshildarji Nov 2, 2017
3a63814
Merge pull request #203 from erdenezul/refactor_longest_common_subseq…
dynamitechetan Nov 2, 2017
e0733c2
add even tree problem
Nov 3, 2017
4306482
Merge pull request #161 from arpanjain97/master
harshildarji Nov 3, 2017
7f87515
Merge pull request #159 from Deepak345/master
harshildarji Nov 3, 2017
247f1b7
created sol1.py
Thejus-Paul Nov 8, 2017
3fae059
Added Question 9
Nov 9, 2017
495fdc1
Added a python implementation of knuth-morris-pratt string search algo
damelLP Nov 11, 2017
0f78cd6
Project Euler Solution Added
Nov 12, 2017
d97b34d
Send & receive files via ftp
nautiyaldeepak Nov 12, 2017
c522dda
Update ftp_send_receive.py
nautiyaldeepak Nov 12, 2017
b26998f
Merge pull request #208 from damelLP/add_string_algos
harshildarji Nov 15, 2017
b2beb8d
Merge pull request #209 from DeepakNautiyal987/master
harshildarji Nov 15, 2017
227e5a1
Merge pull request #206 from Thejus-Paul/master
harshildarji Nov 15, 2017
990b367
Merge pull request #205 from Thejus-Paul/patch-1
harshildarji Nov 15, 2017
a03b2ea
Merge pull request #204 from erdenezul/even_tree_problem
harshildarji Nov 15, 2017
80bdfbb
add mean bias deviation in scoring functions
himangSharatun Nov 18, 2017
50d3956
primelib
Nov 18, 2017
52d160e
Merge pull request #1 from christianbender/christianbender-primelib
Nov 18, 2017
567f2ad
Correction: Remove semicolons
Nov 19, 2017
a5c954f
Correction: File solv3.py
Nov 19, 2017
8d9da8f
Correction: File solv01.py
Nov 19, 2017
01f48e7
Correction: File solv01.py
Nov 19, 2017
c787a22
Problem 16 Added
Nov 19, 2017
abe0f29
Problem 29 -- Project Euler
Nov 19, 2017
01ae338
Delete main.py
Nov 19, 2017
31ebde6
Problem 29
Nov 19, 2017
69f009e
add abbrevation solution to dp
Nov 21, 2017
f920e2a
ftp client server connection
nautiyaldeepak Nov 21, 2017
bc53e2e
import numpy as np
Nov 24, 2017
ba759d9
Add automated flake8 testing of pull requests
Nov 24, 2017
4e06949
Modernize Python 2 code to get ready for Python 3
Nov 25, 2017
aed9cb1
chunk() --> chuncker() to resolve undefined name
Nov 25, 2017
c71471d
Typo: dfference --> difference (I added an i)
Nov 25, 2017
e31c780
Modernize Python 2 code to get ready for Python 3
Nov 25, 2017
ad6b0f1
Modernize Python 2 code to get ready for Python 3
Nov 25, 2017
0337441
Added Solution
Nov 27, 2017
d7a94a1
add a framework of bp neural network and delete the old one
RiptideBo Nov 28, 2017
491439a
Merge pull request #129 from Balance-Breaker/master
harshildarji Nov 28, 2017
f0addfb
Merge pull request #158 from Sayan97/patch-3
harshildarji Nov 28, 2017
7bb26e9
Merge pull request #211 from christianbender/master
harshildarji Nov 28, 2017
777d947
Merge pull request #210 from himangSharatun/master
harshildarji Nov 28, 2017
9714aa3
Merge pull request #213 from Thejus-Paul/master
harshildarji Nov 28, 2017
f069c20
Easier Solution To Problem 7
Richienb Nov 29, 2017
25104f3
Merge pull request #216 from nautiyaldeepak/master
harshildarji Nov 29, 2017
0330d88
Added Modular Exponential
piyush-pawar-17 Dec 1, 2017
a81084c
Refactoring solv1.py
Dec 3, 2017
9168237
Merge pull request #217 from cclauss/patch-2
harshildarji Dec 11, 2017
59d7da3
Merge pull request #224 from Sayan97/master
harshildarji Dec 11, 2017
a14ea99
Merge pull request #225 from Richienb/patch-1
harshildarji Dec 11, 2017
9e3562f
Merge pull request #223 from RiptideBo/master
harshildarji Dec 13, 2017
0524040
Merge pull request #226 from PiyushPawar17/Mod-Expo
harshildarji Dec 13, 2017
ac2b2d0
Merge pull request #227 from christianbender/master
harshildarji Dec 13, 2017
2dcbbd4
Merge pull request #215 from erdenezul/dp_abbreviation
harshildarji Dec 13, 2017
2ed1bad
Merge branch 'master' into modernize-python2-code
Dec 13, 2017
14d9e72
Merge pull request #222 from cclauss/patch-5
harshildarji Dec 14, 2017
a251e9f
Merge pull request #221 from cclauss/patch-4
harshildarji Dec 14, 2017
24bad2e
Add files via upload
mavroudo Dec 17, 2017
e0e7bc6
Merge pull request #1 from MindTraper/MindTraper-patch-1
mavroudo Dec 17, 2017
8bf6952
Merge pull request #228 from MindTraper/master
harshildarji Dec 18, 2017
ad265b9
XOR cipher algorithm
Dec 21, 2017
ecdfd99
Merge pull request #229 from christianbender/master
harshildarji Dec 22, 2017
b25bc2c
improvement
Dec 22, 2017
0e7d448
comment out
Dec 22, 2017
eb9fe88
Merge pull request #230 from christianbender/master
harshildarji Dec 23, 2017
59dab56
Merge pull request #172 from ghost/master
harshildarji Dec 28, 2017
09cc769
Merge pull request #220 from cclauss/modernize-python2-code
harshildarji Dec 29, 2017
1182377
Merge pull request #218 from cclauss/patch-3
harshildarji Dec 29, 2017
63189fa
typo fix
ashutoshcp Dec 30, 2017
a033150
Merge pull request #233 from ashu01/master
harshildarji Dec 30, 2017
4fb978c
1. typo fix {playfair_cipher.py, AVL.py}
ashutoshcp Dec 31, 2017
06c7827
1. typo fix {Arrays|
ashutoshcp Dec 31, 2017
c9debdb
1. Removed ;
ashutoshcp Dec 31, 2017
ee6e5a4
Merge pull request #234 from ashu01/develope-1
harshildarji Jan 1, 2018
4adf3b9
Pass flake8 tests
Jan 6, 2018
1f41a31
Merge pull request #235 from cclauss/patch-3
harshildarji Jan 7, 2018
5d4471d
Update cyclesort.py
satanb4 Jan 7, 2018
335bc2e
Merge pull request #236 from Sayan97/patch-4
harshildarji Jan 7, 2018
0d36dc6
fixed failure function and cleaned up code in kmp + added rabin-karp
damelLP Jan 7, 2018
122cf45
Update NeutonMethod.py
satanb4 Jan 7, 2018
a4c7e58
Merge pull request #237 from damelLP/add_string_algos
harshildarji Jan 8, 2018
4fedcb9
Merge pull request #238 from Sayan97/patch-5
harshildarji Jan 8, 2018
51492b7
Added Tarjan's algorithm for finding strongly connected components
damelLP Jan 14, 2018
3c61849
Merge pull request #239 from damelLP/graph_algos
harshildarji Jan 15, 2018
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,4 @@ ENV/
# Rope project settings
.ropeproject
.idea
.DS_Store
11 changes: 0 additions & 11 deletions .travis.yml

This file was deleted.

33 changes: 33 additions & 0 deletions Bisection.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import math


def bisection(function, a, b): # finds where the function becomes 0 in [a,b] using bolzano

start = a
end = b
if function(a) == 0: # one of the a or b is a root for the function
return a
elif function(b) == 0:
return b
elif function(a) * function(b) > 0: # if noone of these are root and they are both possitive or negative,
# then his algorith can't find the root
print("couldn't find root in [a,b]")
return
else:
mid = (start + end) / 2
while abs(start - mid) > 0.0000001: # untill we achive percise equals to 10^-7
if function(mid) == 0:
return mid
elif function(mid) * function(start) < 0:
end = mid
else:
start = mid
mid = (start + end) / 2
return mid


def f(x):
return math.pow(x, 3) - 2*x -5


print(bisection(f, 1, 1000))
58 changes: 58 additions & 0 deletions File_Transfer_Protocol/ftp_client_server.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# server

import socket # Import socket module

port = 60000 # Reserve a port for your service.
s = socket.socket() # Create a socket object
host = socket.gethostname() # Get local machine name
s.bind((host, port)) # Bind to the port
s.listen(5) # Now wait for client connection.

print 'Server listening....'

while True:
conn, addr = s.accept() # Establish connection with client.
print 'Got connection from', addr
data = conn.recv(1024)
print('Server received', repr(data))

filename='mytext.txt'
f = open(filename,'rb')
l = f.read(1024)
while (l):
conn.send(l)
print('Sent ',repr(l))
l = f.read(1024)
f.close()

print('Done sending')
conn.send('Thank you for connecting')
conn.close()


# client side server

import socket # Import socket module

s = socket.socket() # Create a socket object
host = socket.gethostname() # Get local machine name
port = 60000 # Reserve a port for your service.

s.connect((host, port))
s.send("Hello server!")

with open('received_file', 'wb') as f:
print 'file opened'
while True:
print('receiving data...')
data = s.recv(1024)
print('data=%s', (data))
if not data:
break
# write data to a file
f.write(data)

f.close()
print('Successfully get the file')
s.close()
print('connection closed')
36 changes: 36 additions & 0 deletions File_Transfer_Protocol/ftp_send_receive.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
"""
File transfer protocol used to send and receive files using FTP server.
Use credentials to provide access to the FTP client

Note: Do not use root username & password for security reasons
Create a seperate user and provide access to a home directory of the user
Use login id and password of the user created
cwd here stands for current working directory
"""

from ftplib import FTP
ftp = FTP('xxx.xxx.x.x') """ Enter the ip address or the ___domain name here """
ftp.login(user='username', passwd='password')
ftp.cwd('/Enter the directory here/')

"""
The file which will be received via the FTP server
Enter the ___location of the file where the file is received
"""

def ReceiveFile():
FileName = 'example.txt' """ Enter the ___location of the file """
LocalFile = open(FileName, 'wb')
ftp.retrbinary('RETR ' + filename, LocalFile.write, 1024)
ftp.quit()
LocalFile.close()

"""
The file which will be sent via the FTP server
The file send will be send to the current working directory
"""

def SendFile():
FileName = 'example.txt' """ Enter the name of the file """
ftp.storbinary('STOR ' + FileName, open(FileName, 'rb'))
ftp.quit()
101 changes: 101 additions & 0 deletions Graphs/a_star.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@

grid = [[0, 1, 0, 0, 0, 0],
[0, 1, 0, 0, 0, 0],#0 are free path whereas 1's are obstacles
[0, 1, 0, 0, 0, 0],
[0, 1, 0, 0, 1, 0],
[0, 0, 0, 0, 1, 0]]

'''
heuristic = [[9, 8, 7, 6, 5, 4],
[8, 7, 6, 5, 4, 3],
[7, 6, 5, 4, 3, 2],
[6, 5, 4, 3, 2, 1],
[5, 4, 3, 2, 1, 0]]'''

init = [0, 0]
goal = [len(grid)-1, len(grid[0])-1] #all coordinates are given in format [y,x]
cost = 1

#the cost map which pushes the path closer to the goal
heuristic = [[0 for row in range(len(grid[0]))] for col in range(len(grid))]
for i in range(len(grid)):
for j in range(len(grid[0])):
heuristic[i][j] = abs(i - goal[0]) + abs(j - goal[1])
if grid[i][j] == 1:
heuristic[i][j] = 99 #added extra penalty in the heuristic map


#the actions we can take
delta = [[-1, 0 ], # go up
[ 0, -1], # go left
[ 1, 0 ], # go down
[ 0, 1 ]] # go right


#function to search the path
def search(grid,init,goal,cost,heuristic):

closed = [[0 for col in range(len(grid[0]))] for row in range(len(grid))]# the referrence grid
closed[init[0]][init[1]] = 1
action = [[0 for col in range(len(grid[0]))] for row in range(len(grid))]#the action grid

x = init[0]
y = init[1]
g = 0
f = g + heuristic[init[0]][init[0]]
cell = [[f, g, x, y]]

found = False # flag that is set when search is complete
resign = False # flag set if we can't find expand

while not found and not resign:
if len(cell) == 0:
resign = True
return "FAIL"
else:
cell.sort()#to choose the least costliest action so as to move closer to the goal
cell.reverse()
next = cell.pop()
x = next[2]
y = next[3]
g = next[1]
f = next[0]


if x == goal[0] and y == goal[1]:
found = True
else:
for i in range(len(delta)):#to try out different valid actions
x2 = x + delta[i][0]
y2 = y + delta[i][1]
if x2 >= 0 and x2 < len(grid) and y2 >=0 and y2 < len(grid[0]):
if closed[x2][y2] == 0 and grid[x2][y2] == 0:
g2 = g + cost
f2 = g2 + heuristic[x2][y2]
cell.append([f2, g2, x2, y2])
closed[x2][y2] = 1
action[x2][y2] = i
invpath = []
x = goal[0]
y = goal[1]
invpath.append([x, y])#we get the reverse path from here
while x != init[0] or y != init[1]:
x2 = x - delta[action[x][y]][0]
y2 = y - delta[action[x][y]][1]
x = x2
y = y2
invpath.append([x, y])

path = []
for i in range(len(invpath)):
path.append(invpath[len(invpath) - 1 - i])
print "ACTION MAP"
for i in range(len(action)):
print action[i]

return path

a = search(grid,init,goal,cost,heuristic)
for i in range(len(a)):
print a[i]

Loading