Skip to content

Instantly share code, notes, and snippets.

Avatar

Saikat Kumar Dey saikatkumardey

View GitHub Profile
View kubectl-commands.sh
# delete all Evicted pods
kubectl get pods | grep Evicted | awk '{print $1}' | xargs kubectl delete pod
@saikatkumardey
saikatkumardey / CountOcc.java
Last active Aug 29, 2015
count_occurrences
View CountOcc.java
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;
View 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 Aug 29, 2015
Generate all possible sub-set sum
View bit-masking.cpp
#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 Dec 27, 2014
KMP- String search
View kmp.cpp
#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
View Respect Rollcall.html
<!-- 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>
View BITMAP.cpp
#include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <queue>
#include <vector>
#define INF 10000
using namespace std;
View pdf_spidey
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')
@saikatkumardey
saikatkumardey / numdigit
Created Sep 9, 2014
Find number of digits of 100!
View numdigit
import math
print len(str(math.factorial(100)))
You can’t perform that action at this time.