Skip to content

Instantly share code, notes, and snippets.

View ishank-dev's full-sized avatar

Ishank Sharma ishank-dev

  • CS Grad Student @CSULB
  • Long Beach, California
  • 03:08 (UTC -07:00)
View GitHub Profile
import io
import datetime
import statistics
from warcio.warcwriter import WARCWriter
from warcio.statusandheaders import StatusAndHeaders
from warcio.archiveiterator import ArchiveIterator
from bs4 import BeautifulSoup
from fastapi import FastAPI, Request
from fastapi.responses import JSONResponse
@ishank-dev
ishank-dev / connection_pool_fb.py
Created February 25, 2025 06:20
Connection Pool Simulation FB
"""
simulate_firebolt_pooling_varied.py
This script performs the following steps:
1. Runs a dummy query (SELECT 1) to warm up the Firebolt engine.
2. Runs two simulations (each for 10 seconds):
- WITHOUT connection pooling: A new connection is created for every query.
- WITH connection pooling: A pre-warmed pool of connections is used.
For each query, the script cycles through different severity filters (using numeric values)
@ishank-dev
ishank-dev / plot.py
Created October 31, 2024 00:36
Plot Gantt Chart Using JSON
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
from datetime import datetime
import pandas as pd
task_data = {
"Task Name": [
"Project Setup and Environment Configuration", "Design UI and Dashboard",
"Develop Home Screen and Dashboard", "Implement Navigation Logic",
"Develop Program Management Module", "Develop Area Management Module",
@ishank-dev
ishank-dev / monte.c
Last active February 16, 2021 14:47
/**
* MPI program to calculate the value of PI using the MONTO CARLO program.
*
* 1. Monto Carlo algorithm is very easy
* 2. Area of square = 4*R*R
* 3. Area of Circle = PI*R*R
* 4. Area of circle/area of square = Number of points lyting in circle by number in a square.
* 5. Calculate PI by multiplying this by 4.
* */
  1. Random forest - Golf
  2. Decision Tree - Sonar
  3. Clustering - Ripley Set
  4. Association - Market Data
'''
Logic is to find the end coordinates and start coordinates
start = [x1,y1] end = [x2,y2]
shortestDistance = abs(x2-x1) + abs(y2-y1)
Wrong moves = input_string_length - shortestDistance
'''
'''
How to run the code, run the python file and then give input_path as the string as shown below
python solve.py
class Node:
def __init__(self,data):
self.data = data
self.next = None
self.head = None
# class LinkedList:
# def __init__(self):
# self.next = None
# self.head = None
@ishank-dev
ishank-dev / reverseLinkedListAtMidPoint.py
Last active December 3, 2020 07:45
Coding Question asked in coding interview paytm
class Node:
# Constructor to initialize the node object
def __init__(self, data):
self.data = data
self.next = None
class LinkedList:
# Function to initialize head
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- CSS only -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
<title>Document</title>
</head>

Braille-Translator

API Endpoints

Request
GET  /languages

POST /translate
[
  {
 "text": "I love books",