Skip to content

Instantly share code, notes, and snippets.

View mdshopon's full-sized avatar

Md Shopon mdshopon

View GitHub Profile
@mdshopon
mdshopon / stl_vector.cpp
Last active September 24, 2020 07:54
C++ STL Vector Examples of Various Common Functions
#include<bits/stdc++.h>
using namespace std;
int main()
{
/* Basic Declaration */
// vector<int> vec_1(5);
// vector<int> vec_2(4,10);
// vector<int> vec_3{1,2,3,4,5};
# -*- coding: utf-8 -*-
import os
import itertools
import codecs
import re
import datetime
import cairocffi as cairo
import editdistance
import numpy as np
for i in range(50):
img=np.insert(img,0,255,axis=1)
for i in range(50):
img = np.insert(img, img.shape[1], 255, axis=1)
for i in range(25):
img = np.insert(img, 0, [255], axis=0)
for i in range(25):
img = np.insert(img, img.shape[0], 255, axis=0)
imgwide = 564
from PIL import Image
strn = "testpage/01000" + str(i) + ".bin.png"
# img = Image.open('test2.png')
# img = img.resize((imgwide, 64), Image.ANTIALIAS)
img = cv2.imread(strn)
img = cv2.resize(img, (imgwide, 64))
# #
#include<iostream>
#include<climits> /*Used for INT_MAX*/
using namespace std;
#define vertex 7 /*It is the total no of verteices in the graph*/
int minimumDist(int dist[], bool Dset[]) /*A method to find the vertex with minimum distance which is not yet included in Dset*/
{
int min=INT_MAX,index; /*initialize min with the maximum possible value as infinity does not exist */
for(int v=0;v<vertex;v++)
{
if(Dset[v]==false && dist[v]<=min)
#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef vector< pii > vii;
#define INF 0x3f3f3f3f
vii *G; // Graph