Skip to content

Instantly share code, notes, and snippets.

View saikatkumardey's full-sized avatar
🎯
Focusing

Saikat Kumar Dey saikatkumardey

🎯
Focusing
View GitHub Profile
@saikatkumardey
saikatkumardey / normcore-llm.md
Created August 27, 2023 15:14 — forked from veekaybee/normcore-llm.md
Normcore LLM Reads
@saikatkumardey
saikatkumardey / quicksort.py
Last active September 5, 2021 10:17
A simplified quicksort implementation
from typing import List, Tuple
import random
def quicksort(array: List[int]) -> List[int]:
"""Recursive implementation of quicksort.
Args:
array (List[int]): a list of integers
# delete all Evicted pods
kubectl get pods | grep Evicted | awk '{print $1}' | xargs kubectl delete pod
@saikatkumardey
saikatkumardey / CountOcc.java
Last active August 29, 2015 14:24
count_occurrences
public class CountOcc {
private static int search(int array[], int low, int high, int value) {
if (low <= high) {
int mid = low + (high - low) / 2;
if (array[mid] == value) {
return mid;
@saikatkumardey
saikatkumardey / double_cola
Created February 19, 2015 07:43
Double Cola
#!/usr/bin/env python
import math
n = input()
ans=["","Sheldon", "Leonard", "Penny", "Rajesh", "Howard"]
i= int(math.log(math.ceil(n*1.0/5),2))
@saikatkumardey
saikatkumardey / bit-masking.cpp
Last active August 29, 2015 14:12
Generate all possible sub-set sum
#include <iostream>
using namespace std;
//Given an array, generate all possible sum
int main(void)
{
int array[]= {1,2,3};
@saikatkumardey
saikatkumardey / kmp.cpp
Created December 27, 2014 13:32
KMP- String search
#include <iostream>
#include <vector>
#define print_vector(vec) for(int i=0;i<vec.size();i++) { cout<<vec[i]<<" ";} cout<<endl;
using namespace std;
/*
pattern = abacab
<!-- Respect Rollcall -->
<li><a href="http://www.alistapart.com/articles/">A List Apart &#8212; for website builders</a></li>
<li><a href="http://abstrusegoose.com/">Abstruse Goose &#8212; my favorite comic</a></li>
<li><a href="http://al3x.net/">Alex Payne &#8212; technology rambling</a></li>
<li><a href="http://dashes.com/anil/">Anil Dash &#8212; on culture, apple &amp; design</a></li>
<li><a href="http://weblogs.mozillazine.org/asa/">Asa Dotzler &#8212; on mozilla &amp; software</a></li>
<li><a href="http://www.azarask.in/blog/">Aza Raskin &#8211; on design &amp; firefox</a></li>
<li><a href="http://christophzillgens.com/en/">Christoph Zillgens &#8212; interface design</a></li>
<li><a href="http://cssremix.com/">CSS Remix &#8212; gorgeous designs</a></li>
<li><a href="http://css-tricks.com/">CSS Tricks</a></li>
@saikatkumardey
saikatkumardey / BITMAP.cpp
Created September 22, 2014 06:56
SPOJ: BITMAP
#include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <queue>
#include <vector>
#define INF 10000
using namespace std;
@saikatkumardey
saikatkumardey / pdf_spidey
Created September 18, 2014 12:03
PDF downloader
import urllib2
import sys
import os
from subprocess import call
try:
url = sys.argv[1]
k= urllib2.urlopen(url).readlines()
file_name= "random_file.txt"
op= open(file_name,'w')