Skip to content

Instantly share code, notes, and snippets.

View rajan9519's full-sized avatar
🎯
Focusing

Rajan Kumar Singh rajan9519

🎯
Focusing
View GitHub Profile
void visual(int* arr){
glClear(GL_COLOR_BUFFER_BIT); // sets the previous background with the current background
drawBitmapString(400,570,sortName);
drawBitmapString(400,550,"Number of Compares:"+std::to_string(compares));
drawBitmapString(400,530,"Number of Exchanges:"+std::to_string(exchanges));
glColor3f(1.0f,0.0f,0.0f); //red
// drawing bars on the screen by diagonal coordinates
for(int i=0;i<N;i++){
glRecti(4*i,0,4*i+3,arr[i]);
}
void drawBitmapString(int x,int y,std::string s)
{
glColor3f(1.0f,1.0f,1.0f); // sets color of the text
glRasterPos2f(x, y);// screen coordinate at which text will appear
int length = s.size();
// writing charater by charater on the screen
for(int i=0;i<length;i++)
{
glutBitmapCharacter( GLUT_BITMAP_HELVETICA_18, s[i]);
}
# opencv(cv2) for image processing
# numpy for efficient and easy matrix manipulations
import cv2
import numpy as np
from matplotlib import pyplot as plt
# reading video from camera
cap = cv2.VideoCapture(0)
_, frame = cap.read()
import cv2
import numpy as np
cap = cv2.VideoCapture(0)
ret,frame = cap.read()
# HSV color space
frame = cv2.cvtColor(frame,cv2.COLOR_BGR2HSV)
cv2.imshow('image',frame)
cv2.waitKey(0)
#include<bits/stdc++.h>
using namespace std;
class student
{
private:
string name;
int rollNumeber;
public:
#include<bits/stdc++.h>
using namespace std;
class student
{
private:
string name;
int rollNumeber;
public:
#include<bits/stdc++.h>
using namespace std;
class student
{
private:
string name;
int rollNumeber;
public:
#include<bits/stdc++.h>
using namespace std;
class student
{
private:
string name;
int rollNumeber;
public:
class student
{
private:
string name;
int rollNumeber;
public:
student(string sName,int roll); // Constructorn with two arguments
};
student::student(string sName,int roll)
{
class student
{
private:
string name;
int rollNumeber;
public:
student(); // Constructor
};
student::student()
{