import cv2
# Load the pre-trained face detection classifier
face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
# Load the image
img = cv2.imread('test.jpg')
# Convert the image to grayscale
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
# Detect faces in the grayscale image
faces = face_cascade.detectMultiScale(gray, scaleFactor=1.1, minNeighbors=5, minSize=(30, 30))
# Draw rectangles around the detected faces
for (x, y, w, h) in faces:
cv2.rectangle(img, (x, y), (x+w, y+h), (0, 255, 0), 2)
# Display the result
cv2.imshow('img', img)
cv2.waitKey(0)
cv2.destroyAllWindows()
Thursday, April 27, 2023
Object Detection with OpenCV-Python code
Wednesday, April 26, 2023
Get column count in MySQL
SELECT count(*) FROM information_schema.columns WHERE table_name = 'vmdata'
Get all column names in MySQL of a table comma separated
For that you can use the following MySQL:
select group_concat(column_name order by ordinal_position) from information_schema.columns where table_schema = 'vops' and table_name = 'vmdata'
Thursday, April 6, 2023
How to check the final SQL query generated by Entity Framework based on the LINQ expression for MySQL database
If you want to check the final SQL query generated by Entity Framework based on the LINQ expression for MySQL database . you can follow the following steps :
1. Connect to your MySQL command line
2. run the following command : SET GLOBAL general_log = 'ON';
Wednesday, March 29, 2023
Server sent charset unknown to the client.
After install mysql 8. I'm trying to connect to a MySQL database from php.
<?php
echo "Hello World!";
?>
</br>
<?php
$link = mysqli_connect('localhost', 'root', 'pass12#####');
if (!$link) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
die('Could not connect: ' . mysqli_error());
}
echo 'Connected successfully';
mysqli_close($link);
?>
</br>
<?php
phpinfo();
?>
</br>
But when I put in username and password I get the error message saying:
Server sent charset unknown to the client. Please, report to the developers
Solution
MySQL 8 changed the default charset to utf8mb4. But some clients don't know this charset. Hence when the server reports its default charset to the client, and the client doesn't know what the server means, it throws this error.
Edit my.cnf, specify the client code, and add the following content.
[client]
default-character-set=utf8
[mysql]
default-character-set=utf8
[mysqld]
collation-server = utf8_unicode_ci
character-set-server = utf8
Wednesday, January 18, 2023
MYSQL 5.6 data directory in windows
DB file location in mysql 5.6 in windows
The default data directory location is C:\Program Files\MySQL\MySQL Server 5.6\data , or C:\ProgramData\Mysql on Windows 7 and Windows Server 2008. The C:\ProgramData directory is hidden by default.
ASP.NET Core
Certainly! Here are 10 advanced .NET Core interview questions covering various topics: 1. **ASP.NET Core Middleware Pipeline**: Explain the...
-
The error message you encountered ("DeleteService FAILED 1072: The specified service has been marked for deletion") indicates tha...
-
replace html of a div using jquery this is simple . just use .html() method of jquery to set new html for a div . $ ( "#divID...
-
declare @ProductIds nvarchar(50)='18,19' SELECT * FROM products Where (',' + @ProductIds +',' LIKE '%,' ...