Skip to content

Instantly share code, notes, and snippets.

View Aniruddha-Deb's full-sized avatar

Aniruddha Deb Aniruddha-Deb

View GitHub Profile
@Aniruddha-Deb
Aniruddha-Deb / luck.ipynb
Created September 1, 2023 11:51
Small CGPA density simulation
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Aniruddha-Deb
Aniruddha-Deb / nbserver.sh
Created December 29, 2022 17:44
Runs a PBS job to launch a jupyter lab server
#!/bin/sh
### Set the job name (for your reference)
#PBS -N nbserver
### Set the project name, your department code by default
#PBS -P <project_name>
### Request email when job begins and ends
#PBS -m bea
### Specify email address to use for notification.
#PBS -M $USER@iitd.ac.in
####
@Aniruddha-Deb
Aniruddha-Deb / sudoku.cpp
Created September 4, 2022 12:02
sudoku solver
// CP hath spoiled me, I'm too lazy to write headers out.
// atleast not lazy enough to use namespace std :P
#include <bits/stdc++.h>
// Sudoku bitboard:
struct board_t {
uint8_t data[324];
uint8_t gs[90];
uint8_t rs[90];
uint8_t cs[90];
@Aniruddha-Deb
Aniruddha-Deb / queue_logger.py
Created June 30, 2022 08:23
Logger for queue (entry/exit time)
# Person, queue_in_time, queue_out_time, timedelta
# <int>, <time> , <time> , <timedelta>
import datetime
import curses
import pandas as pd
import os
def main(win):
win.nodelay(False)
@Aniruddha-Deb
Aniruddha-Deb / gentest.c
Last active March 5, 2022 14:12
generate VHDL test benches from an assembly file
#include <stdio.h>
#include <stdlib.h>
typedef char byte;
typedef unsigned int word;
char* header =
"-- TESTCASE AUTOGENERATED by gentest\n"
"library ieee;\n"
"use ieee.std_logic_1164.all;\n"
@Aniruddha-Deb
Aniruddha-Deb / rand_gen.c
Last active May 9, 2021 06:58
Generate random numbers following a given discrete distribution
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
double rand_gen(double *classes, double *probabilities, int n) {
double class = ((double)rand())/RAND_MAX;
double prob_sum = 0;
int class_index = 0;
for (; class_index<n; class_index++) {
if (prob_sum < class && prob_sum+probabilities[class_index] > class) {
@Aniruddha-Deb
Aniruddha-Deb / tut_scrape.sh
Created March 19, 2021 15:19
Scrape Math Tutorial Solutions using Screenshots
#!/bin/zsh
set -e
cp $HOME/Desktop/*.png .
# delete all screen 1 screenshots
find . -name '*PM.png' -delete
# convert images one by one
@Aniruddha-Deb
Aniruddha-Deb / OpSolverGreedy.java
Created November 6, 2020 09:58
Greedy algorithm to solve operations required for answer
package com.sensei.algorithms.numeric;
import java.util.Scanner;
public class OpSolverGreedy {
public static final double EPSILON = 0.005;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
@Aniruddha-Deb
Aniruddha-Deb / libsdltest.c
Last active August 24, 2020 14:50
Testing some SDL Graphics by making a bouncing ball
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <stdbool.h>
#include <SDL2/SDL.h>
typedef struct {
int x;
int y;
int r;
import java.io.*;
import java.util.*;
import java.math.*;
import static java.lang.Math.*;
/**
This is my custom comeptitive programming setup.
@author Aniruddha Deb
*/