Skip to content

Instantly share code, notes, and snippets.

View prabhakaran9397's full-sized avatar

Prabhakaran Senthilnathan prabhakaran9397

View GitHub Profile
#!/bin/bash
baseurl=https://cdn-api.co-vin.in/api/v2/appointment/sessions/calendarByDistrict
did=571
rm -rf .response.ndjson report.html
for day in {0..30}; do
cdate=$(date -d "+$day day" +%d-%m-%Y)
url="$baseurl?district_id=$did&date=$cdate"
class Node:
def __init__(self, value=None, next=None):
self.value = value
self.next = next
#print override
def __repr__(self):
return str(self.value)
class LinkedList:
@prabhakaran9397
prabhakaran9397 / circuit_mpi.c
Created November 15, 2017 01:15
Circuit satisfiablity exhaustive search using MPI
# include <stdlib.h>
# include <stdio.h>
# include <mpi.h>
# include <time.h>
# define N 23
void to_bin(int val, int bvec[])
{
int i;
for (i=0; i<N; i++)
@prabhakaran9397
prabhakaran9397 / install
Created October 19, 2017 17:58
Plant CV Installation
# Update the system
apt-get update
# Install software dependencies
apt-get install build-essential unzip cmake libgtk2.0-dev python-dev python-numpy python-gtk2 python-matplotlib libavcodec-dev libavformat-dev libswscale-dev libdc1394-22 libjpeg-dev libpng-dev libjasper-dev libtiff-dev libtbb-dev sqlite3
# Install additional Perl packages
# Note: if this is your first time using CPAN on your system you may be asked some initial setup questions
perl -MCPAN -e 'install DBI'
#include <stdio.h>
#include <string.h>
#define SIZE 100001
void seive(int range[], int prime[], int *prime_size)
{
long long int i, j;
range[0] = range[1] = 1;
for(i=2; i<SIZE; ++i) {
if(range[i] == 0) {

>

Redirection: stdout to file

command > file.txt

2>

Redirection: stderr to file

command 2&gt; file.txt
@prabhakaran9397
prabhakaran9397 / Idea.md
Last active March 25, 2018 19:58
Egg Dropping Problem

K - Number of eggs - given N - Number of floors - given A - Minimum number of attempts - to find

Egg dropping puzzle follows binomial expansion.

1 egg - N floors - A attempts

N = A/1!

2 eggs - N floors - A attempts

@prabhakaran9397
prabhakaran9397 / combination.cpp
Last active June 20, 2017 17:14
All possible combinations
#include <iostream>
#include <vector>
using namespace std;
void go(int offset, int k, vector<int> number, vector<int> temp, vector< vector<int> > &all) {
if (k == 0) {
all.push_back(temp);
return;
}
@prabhakaran9397
prabhakaran9397 / ruby_1.md
Last active May 10, 2017 12:35
Beginning Ruby - 1

[10-05-2015] [Prabhakaran S]

Beginning Ruby - 1

Points to remember

puts to print, gets to scan

ARGV is the array that contains arguments passed.

@prabhakaran9397
prabhakaran9397 / credits.txt
Created November 17, 2016 16:57
CS, IT, EC 2012 regulation credits
BM8751 3
CH8202 3
CS8001 3
CS8002 3
CS8003 3
CS8004 3
CS8005 3
CS8006 3
CS8007 3
CS8008 3