Search This Blog

Monday 26 February 2024

Installing CUDA 12.3 on Windows 11

 Go to

https://developer.nvidia.com/cuda-downloads

Pick your flavor until you find the button Download

Execute the .exe in your downloads and follow the wizard installation. 

Verify the installation by opening a command prompt

The paste

git clone https://github.com/NVIDIA/cuda-samples.git

in the command prompt and hit enter. 

Go to the folder where the samples were downloaded and double-click one the solutions to try one of the samples. 

For more info go to 

https://github.com/nvidia/cuda-samples

Happy Installation. 

AWS stuff

 Steps to deploy in AWS using windows:


Create an instance in EC2 with the Windows platform. 

Save your key pair with pem ending. 

Go to the instance and open Actions -> Security -> Get windows password and in upload private key file, upload the .pem file with the key pair you saved before. Click on Decrypt password and save all the information that appears. 


In your local computer go to remote desktop connection and use the information that you just saved. 

Install Maven in the remote windows. Download apache-maven. Go to environmental variables-> advance ->paste the path address of the bin folder in maven.


Follow this tutorial for that

https://www.youtube.com/watch?v=39NhCB5YFSY


For windows server and was deployment follow:

https://www.youtube.com/watch?v=x4KtSHyULVs&t=256s

and

https://www.youtube.com/watch?v=yO7Vh7N2me8&t=316s



Wednesday 14 February 2024

DataBases Stuff

 How to Connect a database in MySQL with a c++ application in Windows

Download Mysql from 

https://dev.mysql.com/downloads/installer/

And the connector library from 

https://dev.mysql.com/downloads/connector/cpp/

Unzip the file 

https://cdn.mysql.com//Downloads/Connector-C++/mysql-connector-c++-8.3.0-winx64.zip


Create a C++ empty project in Visual Studio.

Right-click over the name of the project, ->Add -> New Item -> C++ File. Rename the file as main.cpp

One important thing is to create a database. For that, you can open a command prompt, type the next command:

MySQL -u root -p 

Enter password: the one you used when install MySQL

Then use the command:

create database quickstartdb

Copy and paste the next code:

<stdlib.h> #include <iostream> #include "mysql_connection.h" #include <cppconn/driver.h> #include <cppconn/exception.h> #include <cppconn/prepared_statement.h> using namespace std; //for demonstration only. never save your password in the code! const string server = "localhost"; const string username = "root"; const string password = "yourownpassword"; int main() { sql::Driver *driver; sql::Connection *con; sql::Statement *stmt; sql::PreparedStatement *pstmt; try { driver = get_driver_instance(); con = driver->connect(server, username, password); } catch (sql::SQLException e) { cout << "Could not connect to server. Error message: " << e.what() << endl; system("pause"); exit(1); } //please create database "quickstartdb" ahead of time con->setSchema("quickstartdb"); stmt = con->createStatement(); stmt->execute("DROP TABLE IF EXISTS inventory"); cout << "Finished dropping table (if existed)" << endl; stmt->execute("CREATE TABLE inventory (id serial PRIMARY KEY, name VARCHAR(50), quantity INTEGER);"); cout << "Finished creating table" << endl; delete stmt; pstmt = con->prepareStatement("INSERT INTO inventory(name, quantity) VALUES(?,?)"); pstmt->setString(1, "banana"); pstmt->setInt(2, 150); pstmt->execute(); cout << "One row inserted." << endl; pstmt->setString(1, "orange"); pstmt->setInt(2, 154); pstmt->execute(); cout << "One row inserted." << endl; pstmt->setString(1, "apple"); pstmt->setInt(2, 100); pstmt->execute(); cout << "One row inserted." << endl; delete pstmt; delete con; system("pause"); return 0; }

I leave the video from where I took the code. 

Change debug to release in solution configuration. 

Go to Project-> NameofProject Properties. Change Configuration to Release. Follow the next configuration steps in:

https://www.youtube.com/watch?v=a_W4zt5sR1M&t=2s

And this link for the database creation, And another option for connection processes:

https://www.youtube.com/watch?v=B8fdzMTnOLc


MySQL - Java  Installation process 

I will share links that I used in the process:

This one is the forts one:

https://www.ionos.com/digitalguide/server/tools/xampp-tutorial-create-your-own-local-test-server/

Then the two for the antivirus and UAC disable:

https://www.process.st/how-to/disable-microsoft-defender-antivirus-service/

https://portal.microfocus.com/s/article/KM000020477?language=en_US

You will find some error, I encounter some and these videos helped me:

https://www.youtube.com/watch?v=faxAeJybrBw

https://www.youtube.com/watch?v=o56L2He3YbA

This video shows how to manage a MySQL database from intellij but does not show how to use java

This one gives the connection using Apache Net Beans, Java and MySQL

https://www.youtube.com/watch?v=zerYyyJ9CRs

These series of youtube videos teach JDBC concepts

https://www.youtube.com/playlist?list=PLhs1urmduZ2-yp3zID5rMEmXDETN8xvMo

Here is the code I generated following the last tutorial:

https://github.com/ivonneleonor/JavaSqlConnection