Skip to content

Instantly share code, notes, and snippets.

View abishakex's full-sized avatar

Abishek Saravanakumar abishakex

View GitHub Profile
import numpy as np
import pandas as pd
from xgboost import XGBRegressor
print("Loading cached data...")
X_train = np.load('X_train_cache.npy')
X_unlabeled = np.load('X_unlabeled_cache.npy')
train_df = pd.read_csv('Hackathon_data/train.csv')
test_df = pd.read_csv('Hackathon_data/test.csv')
import requests
import json
import time
import sys
def get_mbid_from_api(artist, song_title, app_name="MyApp", app_version="1.0", contact="your-email@example.com"):
api_url = "https://musicbrainz.org/ws/2/recording"
query = f'artist:"{artist}" AND recording:"{song_title}"'
import requests
def get_specific_highlevel_features(mbid):
url = f"https://acousticbrainz.org/api/v1/{mbid}/high-level"
try:
response = requests.get(url)
response.raise_for_status()
data = response.json()
@abishakex
abishakex / local-poller-server.cjs
Created April 21, 2025 21:44
Poller that refreshes every 5 seconds when the dynamoDB table gets updated
// File: local-poller-server.cjs
// MODIFIED to add detailed logging
const AWS = require('aws-sdk'); // Using AWS SDK v2
const WebSocketServer = require('ws').WebSocketServer;
// --- Configuration ---
const REGION = "us-east-2"; // Your DynamoDB table region
const TABLE_NAME = "stride-gps"; // Your DynamoDB table name
const POLLING_INTERVAL_MS = 5000; // Poll DynamoDB every 5 seconds
@abishakex
abishakex / BusMap_2.tsx
Created April 21, 2025 21:34
Different UI for the Live Bus Map such that you track a Bus only by its bus id
// File: src/components/BusMap_2.tsx
import React, { useState, useEffect, useRef, useCallback } from 'react';
import { GoogleMap, useJsApiLoader, Marker } from '@react-google-maps/api';
import {
mapContainerStyle,
mapOptions as defaultMapOptions, // Rename to avoid conflict with dynamic options
libraries,
GOOGLE_MAPS_API_KEY
} from './map/constants'; // Assuming constants are defined here