Skip to content

Instantly share code, notes, and snippets.

View rjrajivjha's full-sized avatar
💭
Beginning of a new journey

Rajiv Jha rjrajivjha

💭
Beginning of a new journey
View GitHub Profile
"""
Given a list of existing meetings (each containing a meeting a set of participants, a room, start and end times) and an input (containing a room and a set of users) find out the possible times at which a meeting can be held with that room and users.
Meeting = start time and end time, room, set of participants (including owner) ,
Room = 1 , users_set = (1, 2, 3)
Step 1 :
filter meeting for target room : O(n), : considering n meeting
@rjrajivjha
rjrajivjha / MBTA API
Last active May 18, 2021 20:09
Predict Next 10 Trains Departing from Park Street Station of MBTA , Using MBTA API
import pytz
import requests
import unittest
from collections import defaultdict
from datetime import datetime
from typing import Optional, Union
# from unittest.mock import patch # Mock current time function and API result to test complete functionality
@rjrajivjha
rjrajivjha / geoencoding.py
Last active August 30, 2018 12:01
Convert Address to Geo Encoding - Latitude Longitude and other params.
"""
Python script for batch geocoding of addresses using the Google Geocoding API.
This script allows for massive lists of addresses to be geocoded for free by pausing when the
geocoder hits the free rate limit set by Google (2500 per day). If you have an API key for paid
geocoding from Google, set it in the API key section.
Addresses for geocoding can be specified in a list of strings "addresses". In this script, addresses
come from a csv file with a column "Address". Adjust the code to your own requirements as needed.
After every 500 successul geocode operations, a temporary file with results is recorded in case of
script failure / loss of connection later.
@rjrajivjha
rjrajivjha / Freenode IRC.md
Created September 22, 2016 10:34
Freenode Nickserv Commands

Connect

/server chat.freenode.net

Nick