Skip to content

Instantly share code, notes, and snippets.

View LeparaLaMapara's full-sized avatar
🌴
On vacation

Tha-bang! LeparaLaMapara

🌴
On vacation
View GitHub Profile
#!/usr/bin/env python
"""
An iterative implementation of depth-first search from:
"Python Algorithms: Mastering Basic Algorithms in the Python Language"
by Magnus Lie Hetland
ISBN: 9781484200551
@LeparaLaMapara
LeparaLaMapara / search.py
Created October 12, 2022 07:52 — forked from professormahi/search.py
UCS, BFS, and DFS Search in python
from queue import Queue, PriorityQueue
def bfs(graph, start, end):
"""
Compute DFS(Depth First Search) for a graph
:param graph: The given graph
:param start: Node to start BFS
:param end: Goal-node
"""
@LeparaLaMapara
LeparaLaMapara / Depth First Search (DFS).ipynb
Created October 12, 2022 07:51 — forked from Kautenja/Depth First Search (DFS).ipynb
Depth First Search (DFS) in Python with path backtrace. Iterative and recursive solutions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@LeparaLaMapara
LeparaLaMapara / nearest_neighbors.py
Created July 20, 2022 13:37 — forked from ZaxR/nearest_neighbors.py
Find nearest neighbors by lat/long using Haversine distance with a BallTree
"""
Example:
# All locations; also locations FROM which we want to find nearest neighbors
locations = pd.DataFrame({"LOCATION_NAME": ["Chicago, IL", "New York, NY", "San Fransisco, CA"],
"LATITUDE": [1, 2, 3],
"LONGITUDE": [1, 2, 3],
"ID": [1, 2, 3]})
locations = locations.apply(lambda x: Location(location_name=x['LOCATION_NAME'],
latitude=x['LATITUDE'],
longitude=x['LONGITUDE'],
Step1: Download MySQL Community Server x.x.x TAR Archive and untar it in user home folder
Step2: Create a my.cnf file in user home directroy
[server]
user=username
basedir=/home/username/mysql
datadir=/home/username/sql_data
socket=/home/username/socket
port=3666
@LeparaLaMapara
LeparaLaMapara / README.md
Created March 2, 2021 08:06 — forked from taylorpaul/README.md
Tensorboard on SLURM

Environment:

Tensorflow: v0.11.0rc2 OS: CENTOS 6.8 (No root access)

Description:

  1. The tensorboardSLURM.sh can be run with the following command to start a tensorboard server on a SLURM cluster:
sbatch --array=0-0 tensorboardSLURM.sh