I am also active at:
Saturday, March 28, 2020
How to include graphics.h in Code::Blocks IDE https://www.geeksforgeeks.org/include-graphics-h-codeblocks/
How to include graphics.h in DevC++ IDE https://www.geeksforgeeks.org/basic-graphic-programming-in-c/
How to include graphics.h in DevC++ IDE https://www.geeksforgeeks.org/basic-graphic-programming-in-c/
Friday, March 27, 2020
OpenGL color code table
Here is a table for various colors and their corresponding data for OpenGL
https://community.khronos.org/t/color-tables/22518/6
https://community.khronos.org/t/color-tables/22518/6
Aman's career blog
This is a great blog by Aman Goel for all computer science students https://www.amangoel.in/?m=1
Thursday, March 26, 2020
OpenGL: Drawing a Circle in C
C program to draw a circle using OpenGL on Windows in Code::Blocks
// C program to demonstrate
// drawing a circle using
// OpenGL
#include<stdio.h>
#include<GL/glut.h>
#include<math.h>
#define pi 3.142857
// function to initialize
void myInit (void)
{
// making background color black as first
// 3 arguments all are 0.0
glClearColor(0.0, 0.0, 0.0, 1.0);
// making picture color green (in RGB mode), as middle argument is 1.0
glColor3f(0.0, 1.0, 0.0);
// breadth of picture boundary is 1 pixel
glPointSize(1.0);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
// setting window dimension in X- and Y- direction
gluOrtho2D(-780, 780, -420, 420);
}
void display (void)
{
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_POINTS);
float x, y, i;
// iterate y up to 2*pi, i.e., 360 degree
// with small increment in angle as
// glVertex2i just draws a point on specified co-ordinate
for ( i = 0; i < (2 * pi); i += 0.001)
{
// let 200 is radius of circle and as,
// circle is defined as x=r*cos(i) and y=r*sin(i)
x = 200 * cos(i);
y = 200 * sin(i);
glVertex2i(x, y);
}
glEnd();
glFlush();
}
int main (int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
// giving window size in X- and Y- direction
glutInitWindowSize(640, 480);
glutInitWindowPosition(0, 0);
// Giving name to window
glutCreateWindow("Circle Drawing");
myInit();
glutDisplayFunc(display);
glutMainLoop();
}
output:
source : Detail on how to install OpenGL in codeblocks for windows
source : https://www.geeksforgeeks.org/getting-started-with-opengl/
// C program to demonstrate
// drawing a circle using
// OpenGL
#include<stdio.h>
#include<GL/glut.h>
#include<math.h>
#define pi 3.142857
// function to initialize
void myInit (void)
{
// making background color black as first
// 3 arguments all are 0.0
glClearColor(0.0, 0.0, 0.0, 1.0);
// making picture color green (in RGB mode), as middle argument is 1.0
glColor3f(0.0, 1.0, 0.0);
// breadth of picture boundary is 1 pixel
glPointSize(1.0);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
// setting window dimension in X- and Y- direction
gluOrtho2D(-780, 780, -420, 420);
}
void display (void)
{
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_POINTS);
float x, y, i;
// iterate y up to 2*pi, i.e., 360 degree
// with small increment in angle as
// glVertex2i just draws a point on specified co-ordinate
for ( i = 0; i < (2 * pi); i += 0.001)
{
// let 200 is radius of circle and as,
// circle is defined as x=r*cos(i) and y=r*sin(i)
x = 200 * cos(i);
y = 200 * sin(i);
glVertex2i(x, y);
}
glEnd();
glFlush();
}
int main (int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
// giving window size in X- and Y- direction
glutInitWindowSize(640, 480);
glutInitWindowPosition(0, 0);
// Giving name to window
glutCreateWindow("Circle Drawing");
myInit();
glutDisplayFunc(display);
glutMainLoop();
}
output:
source : Detail on how to install OpenGL in codeblocks for windows
Install OpenGL on windows in Code::Blocks
- Download code block and install it
- Go to the link and download zip file from the download link that appears after freeglut MinGW package with having link name as Download freeglut 3.0.0 for MinGW and extract it.
- Open notepad with run as administrator and open file from
- This PC > C:(C-drive) > Program Files(x86) > CodeBlocks > share > CodeBlocks > templates, (then click to show All Files)
- Next, open glut.cbp and and search all glut32 and replace with freeglut.
- Then, open from This PC > C:(C-drive) > Program Files(x86) > CodeBlocks > share > CodeBlocks > templates > wizard > glut (then click to show All Files)
- Open wizard.script and here, also replace all glut32 with freeglut
- Then go to freeglut folder (where it was downloaded) and
- Include > GL and copy all four file from there
- Go to This PC > C:(C-drive) > Program Files(x86) > CodeBlocks > MinGW > include > GL and paste it.
- Then, from download folder freeglut > lib, copy two files and go to This PC > C:(C-drive) > Program Files(x86) > CodeBlocks > MinGW > lib and paste it.
- Again go to downloaded folder freeglut > bin and copy one file (freeglut.dll) from here and go to This PC > C:(C-drive) > Windows > SysWOW64 and paste this file.
- Now open Code::Blocks.
- Select File > New > Project > GLUT project > Next.
- Give project title anything and then choose Next.
- For selecting GLUT’s location : This PC > C:(C-drive) > Program Files(x86) > CodeBlocks > MinGW.
- Press OK > Next > Finish.
Now, Code::Blocks is ready to test for OpenGL File
NOTE: Once you save your file in the GLUT project in codeblocks, comment the main() method of the 'main.cpp' file, because there can be only one main() method i.e. the one in your C file.source : https://www.geeksforgeeks.org/getting-started-with-opengl/
Wednesday, March 25, 2020
Python 'Statistics' module and 'Numpy' statistical functions
Python statistics module https://www.tutorialsteacher.com/python/statistics-module
Python NumPy statistical functions https://www.tutorialspoint.com/numpy/numpy_statistical_functions.htm
Python NumPy statistical functions https://www.tutorialspoint.com/numpy/numpy_statistical_functions.htm
Tuesday, March 24, 2020
Saturday, March 21, 2020
Friday, March 20, 2020
How to remove the 'Unable to load authentication plugin 'caching_sha2_password' issue in Netbeans while connecting to MySQL 8.0.19
The newer versions of MySQL default to caching_sha2_password. If you want to disable it then follow below steps
- Login into your MYSQL console as root user like below.
eg mysql -uYOUR_ROOT_USER_NAME -pYOUR_ROOT_USER_PASSWORD
- Then execute the command by replacing YOUR_ROOT_USER_NAME and YOUR_ROOT_USER_PASSWORD
ALTER USER 'YOUR_ROOT_USER_NAME'@'localhost' IDENTIFIED WITH mysql_native_password BY 'YOUR_ROOT_USER_PASSWORD';
You will no longer get any 'caching_sha2_password' exception while connecting for any client after this.
Source:
https://stackoverflow.com/questions/50193771/unable-to-load-authentication-plugin-caching-sha2-password
Downloading and adding the latest JDBCDriver in your Netbeans project
See my stackoverflow answer https://stackoverflow.com/questions/46131295/classcastexception-java-math-biginteger-cannot-be-cast-to-java-lang-long-on-con/60780362#60780362
You can get the latest mysqljdbcdriver by downloading this MySQL-connector-java-5.1.48.zip file from here https://dev.mysql.com/downloads/connector/j/5.1.html
You can get the latest mysqljdbcdriver by downloading this MySQL-connector-java-5.1.48.zip file from here https://dev.mysql.com/downloads/connector/j/5.1.html
Saturday, March 14, 2020
LISP programs
https://rahulkumarsaurabh.blogspot.com/search/label/LISP%20Program has a few good LISP programs.
Online LISP compiler https://rextester.com/l/common_lisp_online_compiler
Online LISP compiler https://rextester.com/l/common_lisp_online_compiler
Thursday, March 12, 2020
Wednesday, March 11, 2020
Resolution method in FOL
Explanation of the resolution method of FOL and example.
https://www.youtube.com/watch?v=C_iqWGOhvak&list=PLrjkTql3jnm_yol-ZK1QqPSn5YSg0NF9r&index=36&app=desktop
https://www.youtube.com/watch?v=C_iqWGOhvak&list=PLrjkTql3jnm_yol-ZK1QqPSn5YSg0NF9r&index=36&app=desktop
Friday, March 6, 2020
Using Simulated Annealing to solve TSM
YouTube lecture Simulated Annealing and Genetic algorithms to TSM
https://www.youtube.com/watch?time_continue=42&v=0rPZSyTgo-w&feature=emb_logo
Python code for simulated annealing solution to TSM
https://raw.githubusercontent.com/goossaert/algorithms/master/simulated_annealing/annealing.py
Heuristic search methods
https://www.youtube.com/watch?v=dtGRmhZ6Cuo&list=PLbMVogVj5nJQu5qwm-HmJgjmeGhsErvXD&index=9
What is Simulated Annealing? what's the pseudocode?
https://en.wikipedia.org/wiki/Simulated_annealing
Simulated Annealing lecture IIT Kh
https://www.youtube.com/watch?v=TC9WNwM2noM
https://www.youtube.com/watch?time_continue=42&v=0rPZSyTgo-w&feature=emb_logo
Python code for simulated annealing solution to TSM
https://raw.githubusercontent.com/goossaert/algorithms/master/simulated_annealing/annealing.py
Heuristic search methods
https://www.youtube.com/watch?v=dtGRmhZ6Cuo&list=PLbMVogVj5nJQu5qwm-HmJgjmeGhsErvXD&index=9
What is Simulated Annealing? what's the pseudocode?
https://en.wikipedia.org/wiki/Simulated_annealing
Simulated Annealing lecture IIT Kh
https://www.youtube.com/watch?v=TC9WNwM2noM
Parallel programs in C/C++
OpenMP(Open Multiprocessing) parallel programs in C
https://people.sc.fsu.edu/~jburkardt/c_src/openmp/openmp.html
Matrix-Matrix multiplication
Ex 1. https://www.appentra.com/parallel-matrix-matrix-multiplication/
Ex 2. https://computing.llnl.gov/tutorials/openMP/samples/C/omp_mm.c
OpenMP parallel programs in C++
https://people.sc.fsu.edu/~jburkardt/cpp_src/openmp/openmp.html
Parallel Computing in C++
https://www.cs.cmu.edu/~15210/pasl.html
MPI programs in C
Estimating Pi using MPI programming in C
https://gribblelab.org/CBootCamp/A2_Parallel_Programming_in_C.html#orgad28152
MPI tutorial https://computing.llnl.gov/tutorials/mpi/
https://people.sc.fsu.edu/~jburkardt/c_src/openmp/openmp.html
Matrix-Matrix multiplication
Ex 1. https://www.appentra.com/parallel-matrix-matrix-multiplication/
Ex 2. https://computing.llnl.gov/tutorials/openMP/samples/C/omp_mm.c
OpenMP parallel programs in C++
https://people.sc.fsu.edu/~jburkardt/cpp_src/openmp/openmp.html
Parallel Computing in C++
https://www.cs.cmu.edu/~15210/pasl.html
MPI programs in C
Estimating Pi using MPI programming in C
https://gribblelab.org/CBootCamp/A2_Parallel_Programming_in_C.html#orgad28152
MPI tutorial https://computing.llnl.gov/tutorials/mpi/
Wednesday, March 4, 2020
Monday, March 2, 2020
OpenMP program for Matrix multiplication
Matrix multiplication with openMp shared memory parallel programming https://www.youtube.com/watch?v=K84-zInk_ec&app=desktop
NPTEL's Introduction to parallel programming in OpenMP https://www.youtube.com/watch?v=a8R784VtXBg&list=PLJ5C_6qdAvBFMAko9JTyDJDIt1W48Sxmg&app=desktop
NPTEL's Introduction to parallel programming in OpenMP https://www.youtube.com/watch?v=a8R784VtXBg&list=PLJ5C_6qdAvBFMAko9JTyDJDIt1W48Sxmg&app=desktop
Subscribe to:
Posts (Atom)
इश्क में ग़ैरत-ए-जज़्बात ने रोने ना दिया - सुदर्शन फ़ाकिर
इश्क में ग़ैरत-ए-जज़्बात ने रोने ना दिया वरना क्या बात थी किस बात ने रोने ना दिया आप कहते थे कि रोने से ना बदलेंगे नसीब उमर भर आप की इस बात...
-
Acronym Full Form AJAX Asynchronous JavaScript and XML API Application Programming Interface APK Android Application Package ASP Activ...
-
#include<stdio.h> int main() { int M,N,q; scanf("%i %i",&M, &N); if((M%N)!=0) {printf("0...
-
"A good company understands that problem solving ability and the ability to learn new things are far more important than knowledge o...