This document describes a school management system project created with Python and MySQL. It includes tables for students, employees, fees, and exams. The Python code defines functions for various operations like inserting, displaying, updating, and deleting records for each table. The main function provides a menu to select the management system - student, employee, fee, or exam and then operations within each system like add, update, delete. Connections to the MySQL database are established and queries are executed to manipulate the data.
The document provides instructions and sample code for Python and MySQL practical programs. It includes:
1. Instructions for 8 Python programs covering topics like factorials, strings, lists, sets and classes.
2. Instructions for 2 MySQL programs to create tables, insert/update data, and perform queries on employee and student tables.
3. Sample code and outputs for each program are provided for reference in the practical exams.
The document provides instructions and sample code for Python and MySQL practical programs. It includes:
1. Instructions for 8 Python programs covering topics like factorials, strings, lists, sets and classes.
2. Instructions for 2 MySQL programs to create tables, insert/update data, and perform queries on employee and student tables.
3. Sample code and outputs for each program are provided for reference in the practical exams.
The document describes downloading and processing the Reuters news dataset to create training and test datasets for text classification. Key steps include:
1. Downloading the Reuters dataset and processing it to create feature vectors (x_train, x_test) and labels (y_train, y_test).
2. Creating a simple neural network model with an input, two hidden layers and an output layer.
3. Training the model on the training data for 20 epochs and evaluating performance on the validation set, showing decreasing loss and increasing accuracy over epochs.
This document summarizes machine learning frameworks and libraries, neural network structures, and the process of building and training a neural network model for image classification. It discusses TensorFlow and PyTorch frameworks, describes the structure of a convolutional neural network, and provides code to import datasets, define a model, train the model on GPUs, and test the model's accuracy.
This document contains code snippets and outputs from several programming assignments. The assignments involve tasks like displaying logged in users, listing connected devices, modifying process priorities, and measuring system memory. Code examples are provided in C, C++, Python, Java, Shell and Perl to demonstrate the various tasks. The outputs confirm that the programs are working as intended by displaying the expected results.
This document provides a cheat sheet on SQL basics in PySpark. It includes information on initializing SparkSession, creating DataFrames from different data sources, running SQL queries programmatically, transforming DataFrames through selections, filters, grouping and aggregation, handling missing data, and registering/querying views. Methods are demonstrated for inspecting, sorting, sampling, and writing DataFrames to files/storage.
This document contains a Java programming lab manual provided by Prof. K. Adisesha for a 5th semester BCA course. It includes 11 programs demonstrating Java concepts like classes, objects, inheritance, polymorphism, wrappers, strings, arrays, and more. For each program there is the Java code, sample output, and a brief description. Contact details for Prof. Adisesha are provided at the beginning for any feedback.
The Ring programming language version 1.5.3 book - Part 54 of 184Mahmoud Samir Fayed
The document discusses Ring code for database and web application classes and functions. It includes classes for Database, ModelBase, ControllerBase, and View classes. ModelBase handles database operations like insert, update, delete. ControllerBase handles routing and common functions. WebLib contains functions for loading variables, creating pages, encoding special characters, and templating.
The document provides instructions and sample code for Python and MySQL practical programs. It includes:
1. Instructions for 8 Python programs covering topics like factorials, strings, lists, sets and classes.
2. Instructions for 2 MySQL programs to create tables, insert/update data, and perform queries on employee and student tables.
3. Sample code and outputs for each program are provided for reference in the practical exams.
The document provides instructions and sample code for Python and MySQL practical programs. It includes:
1. Instructions for 8 Python programs covering topics like factorials, strings, lists, sets and classes.
2. Instructions for 2 MySQL programs to create tables, insert/update data, and perform queries on employee and student tables.
3. Sample code and outputs for each program are provided for reference in the practical exams.
The document describes downloading and processing the Reuters news dataset to create training and test datasets for text classification. Key steps include:
1. Downloading the Reuters dataset and processing it to create feature vectors (x_train, x_test) and labels (y_train, y_test).
2. Creating a simple neural network model with an input, two hidden layers and an output layer.
3. Training the model on the training data for 20 epochs and evaluating performance on the validation set, showing decreasing loss and increasing accuracy over epochs.
This document summarizes machine learning frameworks and libraries, neural network structures, and the process of building and training a neural network model for image classification. It discusses TensorFlow and PyTorch frameworks, describes the structure of a convolutional neural network, and provides code to import datasets, define a model, train the model on GPUs, and test the model's accuracy.
This document contains code snippets and outputs from several programming assignments. The assignments involve tasks like displaying logged in users, listing connected devices, modifying process priorities, and measuring system memory. Code examples are provided in C, C++, Python, Java, Shell and Perl to demonstrate the various tasks. The outputs confirm that the programs are working as intended by displaying the expected results.
This document provides a cheat sheet on SQL basics in PySpark. It includes information on initializing SparkSession, creating DataFrames from different data sources, running SQL queries programmatically, transforming DataFrames through selections, filters, grouping and aggregation, handling missing data, and registering/querying views. Methods are demonstrated for inspecting, sorting, sampling, and writing DataFrames to files/storage.
This document contains a Java programming lab manual provided by Prof. K. Adisesha for a 5th semester BCA course. It includes 11 programs demonstrating Java concepts like classes, objects, inheritance, polymorphism, wrappers, strings, arrays, and more. For each program there is the Java code, sample output, and a brief description. Contact details for Prof. Adisesha are provided at the beginning for any feedback.
The Ring programming language version 1.5.3 book - Part 54 of 184Mahmoud Samir Fayed
The document discusses Ring code for database and web application classes and functions. It includes classes for Database, ModelBase, ControllerBase, and View classes. ModelBase handles database operations like insert, update, delete. ControllerBase handles routing and common functions. WebLib contains functions for loading variables, creating pages, encoding special characters, and templating.
The Ring programming language version 1.5.3 book - Part 44 of 184Mahmoud Samir Fayed
This document provides code examples for classes used in a web application framework in Ring. It includes the Database, ModelBase, and ControllerBase classes which handle database connectivity and operations. It also includes an overview of the WebLib API which provides functions and classes for generating HTML pages and elements. Some key classes described are Page, Form, Table, and classes to generate specific HTML elements like Div, Link, Image etc.
The document describes the AlexNet neural network architecture and its application to classifying images from the Fashion-MNIST dataset. It constructs an AlexNet model, loads and preprocesses the Fashion-MNIST data, and trains the model on this dataset for 5 epochs. Key aspects covered include the convolutional and pooling layers in AlexNet, reading and transforming the Fashion-MNIST data, calculating training and test accuracy, and observing slower progress during training compared to LeNet due to the larger image size.
The document contains examples demonstrating various object-oriented programming concepts in C++ including constructors, destructors, inheritance, polymorphism, operator overloading, templates, and more. Each example includes the code for a concept, the output of running the code, and a brief description.
JavaScript Advanced - Useful methods to power up your codeLaurence Svekis ✔
Get this Course
https://www.udemy.com/javascript-course-plus/?couponCode=SLIDESHARE
Useful methods and JavaScript code snippets power up your code and make even more happen with it.
This course is perfect for anyone who has fundamental JavaScript experience and wants to move to the next level. Use and apply more advanced code, and do more with JavaScript.
Everything you need to learn more about JavaScript
Source code is included
60+ page Downloadable PDF guide with resources and code snippets
3 Challenges to get you coding try the code
demonstrating useful JavaScript methods that can power up your code and make even more happen with it.
Course lessons will cover
JavaScript Number Methods
JavaScript String Methods
JavaScript Math - including math random
DOMContentLoaded - DOM ready when the document has loaded.
JavaScript Date - Date methods and how to get set and use date.
JavaScript parse and stringify - strings to objects back to strings
JavaScript LocalStorage - store variables in the user browser
JavaScript getBoundingClientRect() - get the dimensions of an element
JavaScript Timers setTimeout() setInterval() requestAnimationFrame() - Run code when you want too
encodeURIComponent - encoding made easy
Regex - so powerful use it to get values from your string
prototype - extend JavaScript objects with customized powers
Try and catch - perfect for error and testing
Fetch xHR requests - bring content in from servers
and more
No libraries, no shortcuts just learning JavaScript making it DYNAMIC and INTERACTIVE web application.
Step by step learning with all steps included.
Write the code above and the ones below in netbeans IDE 8.13. (Eli.pdfarihantmum
Write the code above and the ones below in netbeans IDE 8.1
3. (Eliminate duplicates) Write a method that returns a new array by eliminating the duplicate
values in the array using the following method header: public static int[]
eliminateDuplicates(int[] list) Write a test program that reads in ten integers, invokes the method,
and displays the result. Here is the sample run of the program:
Enter ten numbers: 1 2 3 2 1 6 3 4 5 2 [Enter]
The distinct numbers are: 1 2 3 6 4 5
4. (Sort students) Write a program that prompts the user to enter the number of students, the
students’ names, and their scores, and prints student names in decreasing order of their scores.
Solution
Please follow the code and comments for description :
a)
CODE :
import java.util.Scanner;
public class MeanSD {
public static double deviation (double[] x) { // method to return the deviation
double sum = 0, mean = 0, deviation = 0; // required initialisations
double[] temp = new double[10]; // temporary array
for (int i = 0; i < 10; i++) //calculate the standard deviation
{
temp[i] = Math.pow((x[i] - mean), 2); // assigning the value to the array
sum += temp[i]; // adding up the values
}
mean = sum / 10; // getting the mean
deviation = Math.sqrt(mean); // calculating the deviation
return deviation; // returning the deviation
}
public static double mean (double[] x) { // method to return themean of the values entered
double sum = 0, mean; // required initialisations
for (int i = 0; i < 10; i++) //Take input in the array
{
sum += x[i]; //sum of all elements
}
mean = sum / 10; // calculating the mean
return mean; // returning the mean value
}
public static void main(String[] args) { // driver method
System.out.println(\"Enter the 10 numbers.\"); // prompt to enter the data
Scanner in = new Scanner(System.in); // scanner class to get the data from the user
double[] arr = new double[10]; // array that saves the data
double sum = 0, mean = 0, deviation = 0; // required initialisations
for (int i = 0; i < 10; i++) //Take input in the array
{
System.out.print(\"Enter a number : \"); // prompt to enter the number
arr[i] = in.nextDouble(); // getting the data from the console
}
mean = mean(arr); // calling the method to return the mean value
System.out.println(\"Mean : \" + mean); //Display mean of all elements
deviation = deviation(arr); // calling the method to return teh deviation value
System.out.println(\"Deviation : \" + deviation); // display the result
}
}
OUPTPUT :
Enter the 10 numbers.
Enter a number : 1
Enter a number : 2
Enter a number : 3
Enter a number : 4
Enter a number : 5
Enter a number : 6
Enter a number : 7
Enter a number : 8
Enter a number : 9
Enter a number : 10
Mean : 5.5
Deviation : 6.2048368229954285
b)
CODE :
import java.util.Scanner;
public class MyDuplicateElements {
public static int[] eliminateDuplicates(int[] input) { // method to remove the duplicates
int j = 0; // required initialisations
int i = 1;
//return if the array length is less than 2
if (input..
Map/reduce, geospatial indexing, and other cool features (Kristina Chodorow)MongoSF
The document appears to be notes from a MongoDB training session that discusses various MongoDB features like MapReduce, geospatial indexes, and GridFS. It also covers topics like database commands, indexing, and querying documents with embedded documents and arrays. Examples are provided for how to implement many of these MongoDB features and functions.
The Ring programming language version 1.10 book - Part 54 of 212Mahmoud Samir Fayed
This document describes code related to user registration and login functionality in Ring. It includes code for a registration form, login form, user registration logic, login validation, and checking if a user is logged in. Database and model classes are also shown that handle connecting to the database, querying for users, and managing user data.
Need an detailed analysis of what this code-model is doing- Thanks #St.pdfactexerode
Need an detailed analysis of what this code/model is doing. Thanks
#Step 1: Import the required Python libraries:
import numpy as np
import matplotlib.pyplot as plt
import keras
from keras.layers import Input, Dense, Reshape, Flatten, Dropout
from keras.layers import BatchNormalization, Activation, ZeroPadding2D
from keras.layers import LeakyReLU
from keras.layers.convolutional import UpSampling2D, Conv2D
from keras.models import Sequential, Model
from keras.optimizers import Adam,SGD
from keras.datasets import cifar10
#Step 2: Load the data.
#Loading the CIFAR10 data
(X, y), (_, _) = keras.datasets.cifar10.load_data()
#Selecting a single class of images
#The number was randomly chosen and any number
#between 1 and 10 can be chosen
X = X[y.flatten() == 8]
#Step 3: Define parameters to be used in later processes.
#Defining the Input shape
image_shape = (32, 32, 3)
latent_dimensions = 100
#Step 4: Define a utility function to build the generator.
def build_generator():
model = Sequential()
#Building the input layer
model.add(Dense(128 * 8 * 8, activation="relu",
input_dim=latent_dimensions))
model.add(Reshape((8, 8, 128)))
model.add(UpSampling2D())
model.add(Conv2D(128, kernel_size=3, padding="same"))
model.add(BatchNormalization(momentum=0.78))
model.add(Activation("relu"))
model.add(UpSampling2D())
model.add(Conv2D(64, kernel_size=3, padding="same"))
model.add(BatchNormalization(momentum=0.78))
model.add(Activation("relu"))
model.add(Conv2D(3, kernel_size=3, padding="same"))
model.add(Activation("tanh"))
#Generating the output image
noise = Input(shape=(latent_dimensions,))
image = model(noise)
return Model(noise, image)
#Step 5: Define a utility function to build the discriminator.
def build_discriminator():
#Building the convolutional layers
#to classify whether an image is real or fake
model = Sequential()
model.add(Conv2D(32, kernel_size=3, strides=2,
input_shape=image_shape, padding="same"))
model.add(LeakyReLU(alpha=0.2))
model.add(Dropout(0.25))
model.add(Conv2D(64, kernel_size=3, strides=2, padding="same"))
model.add(ZeroPadding2D(padding=((0,1),(0,1))))
model.add(BatchNormalization(momentum=0.82))
model.add(LeakyReLU(alpha=0.25))
model.add(Dropout(0.25))
model.add(Conv2D(128, kernel_size=3, strides=2, padding="same"))
model.add(BatchNormalization(momentum=0.82))
model.add(LeakyReLU(alpha=0.2))
model.add(Dropout(0.25))
model.add(Conv2D(256, kernel_size=3, strides=1, padding="same"))
model.add(BatchNormalization(momentum=0.8))
model.add(LeakyReLU(alpha=0.25))
model.add(Dropout(0.25))
#Building the output layer
model.add(Flatten())
model.add(Dense(1, activation='sigmoid'))
image = Input(shape=image_shape)
validity = model(image)
return Model(image, validity)
#Step 6: Define a utility function to display the generated images.
def display_images():
# Generate a batch of random noise
noise = np.random.normal(0, 1, (16, latent_dimensions))
# Generate images from the noise
generated_images = generator.predict(noise)
# Rescale the images to 0.
Detect Negative and Positive sentiment in user reviews using python word2vec ...Mamoon Ismail Khalid
detect Negative and Positive Sentiment in User Reviews_using Python word2vec model
libraries used:
Unsupervised training
from gensim.models.doc2vec import TaggedDocument
from gensim.models import Doc2Vec
from sklearn.neighbors import KNeighborsClassifier
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import cross_val_score
import numpy as np
This document describes ggTimeSeries, an R package that provides extensions to ggplot2 for creating time series plots. It includes examples of using functions from ggTimeSeries to create calendar heatmaps, horizon graphs, steam graphs, and marimekko plots from time series data. The examples demonstrate how to generate sample time series data, create basic plots, and add formatting customizations.
Rewrite the printInfo() functions of the Employee and Department cla.pdfalertshoeshingkimand
Rewrite the printInfo() functions of the Employee and Department classes by overloading the
put-to operator Operator<<.
C++
class Employee {
private:
string ID;
string name;
string jobTitle;
bool isManager;
string ID_of_Dept;
public:
void printInfo();
};
void Employee::printInfo() {
cout << "\t" << ID << "|" << name << " | " << jobTitle << " | " << isManager << " | " <<
ID_of_Dept << "\n";
}
class Department {
private:
string ID;
string name;
string loc;
string ID_of_manager;
vector listOfEmp_IDs;
public:
void printInfo();
};
void Department::printInfo() {
cout << ID << " | " << name << " | " << loc << " | Manager:" << ID_of_manager << endl;
cout << "List of emp IDs:\n";
}
void main()
{
vector emp_list;
vector dept_list;
readEmployeesFromFile(emp_list);
readDepartmentsFromFile(dept_list);
//print out department info
for (int d = 0; d < dept_list.size(); d++) {
dept_list[d].printInfo();
//1. for each depertment get me the list of emp_IDs.
vector _listOfEmp_IDs = dept_list[d].get_listOfEmp_IDs();
//2. for each emp ID, get its index in the emp_list
for (int e = 0; e < _listOfEmp_IDs.size(); e++) {
int idx = findEmpIdxByID(/*which list to search in?*/ emp_list,
_listOfEmp_IDs[e]);
//3. print out the emp info
emp_list[idx].printInfo();
}
cout << "\n-----------------------------------------------\n";
}
}.
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011Masahiro Nagano
The document describes using Log::Minimal to log messages with timestamps, severity levels, and stack traces. Log::Minimal provides functions like debugf(), infof(), warnf() that log messages, and configuration options like AUTODUMP and PRINT to customize the output format. It can be used to log messages from multi-threaded or distributed applications.
The document contains C code to perform matrix addition and multiplication using functions. It includes functions to read and write matrices, take user input for matrix dimensions and elements, perform the operations, and output the results. The code provides a menu for the user to select addition or multiplication and handles different cases for valid and invalid inputs.
This document introduces CouchDB, an open-source document-oriented NoSQL database that uses JSON documents with dynamic schemas instead of tables. It stores and retrieves these documents through a RESTful HTTP API. The document discusses CouchDB's key features like schema-less design, replication, views, and joins. It also provides examples of using CouchDB with different programming languages and libraries.
The document provides examples of basic C programs that demonstrate fundamental programming concepts like printing values, arithmetic operations, arrays, functions, conditionals, loops, and matrices. The programs cover topics such as printing and reading integers, adding/multiplying numbers, swapping values, checking vowels/consonants, Armstrong numbers, palindromes, summing matrices, and finding the transpose of a matrix.
The Ring programming language version 1.2 book - Part 32 of 84Mahmoud Samir Fayed
The document discusses user registration and login functionality in Ring. It describes classes for users (Model, View & Controller), form views for registration and login, and code to handle registration, login, and checking authentication. It also summarizes classes for database access (Database), model objects (ModelBase), and controllers (ControllerBase).
The code connects to a MySQL database, creates a user table and inserts sample data. It then allows a user to log in and perform CRUD operations on a students table, including inserting, updating, deleting, searching, and displaying records. The user can choose from menu options to perform the different operations and the code prints confirmation messages after each successful operation.
The document discusses the Sahana Eden emergency development environment. It provides an overview of key concepts like the model-view-controller architecture and describes how to build a new module for incident reporting with models, controllers and views. Instructions are given for setting up the development environment and performing common tasks like defining data models, creating forms and joining resources.
The Ring programming language version 1.5.3 book - Part 44 of 184Mahmoud Samir Fayed
This document provides code examples for classes used in a web application framework in Ring. It includes the Database, ModelBase, and ControllerBase classes which handle database connectivity and operations. It also includes an overview of the WebLib API which provides functions and classes for generating HTML pages and elements. Some key classes described are Page, Form, Table, and classes to generate specific HTML elements like Div, Link, Image etc.
The document describes the AlexNet neural network architecture and its application to classifying images from the Fashion-MNIST dataset. It constructs an AlexNet model, loads and preprocesses the Fashion-MNIST data, and trains the model on this dataset for 5 epochs. Key aspects covered include the convolutional and pooling layers in AlexNet, reading and transforming the Fashion-MNIST data, calculating training and test accuracy, and observing slower progress during training compared to LeNet due to the larger image size.
The document contains examples demonstrating various object-oriented programming concepts in C++ including constructors, destructors, inheritance, polymorphism, operator overloading, templates, and more. Each example includes the code for a concept, the output of running the code, and a brief description.
JavaScript Advanced - Useful methods to power up your codeLaurence Svekis ✔
Get this Course
https://www.udemy.com/javascript-course-plus/?couponCode=SLIDESHARE
Useful methods and JavaScript code snippets power up your code and make even more happen with it.
This course is perfect for anyone who has fundamental JavaScript experience and wants to move to the next level. Use and apply more advanced code, and do more with JavaScript.
Everything you need to learn more about JavaScript
Source code is included
60+ page Downloadable PDF guide with resources and code snippets
3 Challenges to get you coding try the code
demonstrating useful JavaScript methods that can power up your code and make even more happen with it.
Course lessons will cover
JavaScript Number Methods
JavaScript String Methods
JavaScript Math - including math random
DOMContentLoaded - DOM ready when the document has loaded.
JavaScript Date - Date methods and how to get set and use date.
JavaScript parse and stringify - strings to objects back to strings
JavaScript LocalStorage - store variables in the user browser
JavaScript getBoundingClientRect() - get the dimensions of an element
JavaScript Timers setTimeout() setInterval() requestAnimationFrame() - Run code when you want too
encodeURIComponent - encoding made easy
Regex - so powerful use it to get values from your string
prototype - extend JavaScript objects with customized powers
Try and catch - perfect for error and testing
Fetch xHR requests - bring content in from servers
and more
No libraries, no shortcuts just learning JavaScript making it DYNAMIC and INTERACTIVE web application.
Step by step learning with all steps included.
Write the code above and the ones below in netbeans IDE 8.13. (Eli.pdfarihantmum
Write the code above and the ones below in netbeans IDE 8.1
3. (Eliminate duplicates) Write a method that returns a new array by eliminating the duplicate
values in the array using the following method header: public static int[]
eliminateDuplicates(int[] list) Write a test program that reads in ten integers, invokes the method,
and displays the result. Here is the sample run of the program:
Enter ten numbers: 1 2 3 2 1 6 3 4 5 2 [Enter]
The distinct numbers are: 1 2 3 6 4 5
4. (Sort students) Write a program that prompts the user to enter the number of students, the
students’ names, and their scores, and prints student names in decreasing order of their scores.
Solution
Please follow the code and comments for description :
a)
CODE :
import java.util.Scanner;
public class MeanSD {
public static double deviation (double[] x) { // method to return the deviation
double sum = 0, mean = 0, deviation = 0; // required initialisations
double[] temp = new double[10]; // temporary array
for (int i = 0; i < 10; i++) //calculate the standard deviation
{
temp[i] = Math.pow((x[i] - mean), 2); // assigning the value to the array
sum += temp[i]; // adding up the values
}
mean = sum / 10; // getting the mean
deviation = Math.sqrt(mean); // calculating the deviation
return deviation; // returning the deviation
}
public static double mean (double[] x) { // method to return themean of the values entered
double sum = 0, mean; // required initialisations
for (int i = 0; i < 10; i++) //Take input in the array
{
sum += x[i]; //sum of all elements
}
mean = sum / 10; // calculating the mean
return mean; // returning the mean value
}
public static void main(String[] args) { // driver method
System.out.println(\"Enter the 10 numbers.\"); // prompt to enter the data
Scanner in = new Scanner(System.in); // scanner class to get the data from the user
double[] arr = new double[10]; // array that saves the data
double sum = 0, mean = 0, deviation = 0; // required initialisations
for (int i = 0; i < 10; i++) //Take input in the array
{
System.out.print(\"Enter a number : \"); // prompt to enter the number
arr[i] = in.nextDouble(); // getting the data from the console
}
mean = mean(arr); // calling the method to return the mean value
System.out.println(\"Mean : \" + mean); //Display mean of all elements
deviation = deviation(arr); // calling the method to return teh deviation value
System.out.println(\"Deviation : \" + deviation); // display the result
}
}
OUPTPUT :
Enter the 10 numbers.
Enter a number : 1
Enter a number : 2
Enter a number : 3
Enter a number : 4
Enter a number : 5
Enter a number : 6
Enter a number : 7
Enter a number : 8
Enter a number : 9
Enter a number : 10
Mean : 5.5
Deviation : 6.2048368229954285
b)
CODE :
import java.util.Scanner;
public class MyDuplicateElements {
public static int[] eliminateDuplicates(int[] input) { // method to remove the duplicates
int j = 0; // required initialisations
int i = 1;
//return if the array length is less than 2
if (input..
Map/reduce, geospatial indexing, and other cool features (Kristina Chodorow)MongoSF
The document appears to be notes from a MongoDB training session that discusses various MongoDB features like MapReduce, geospatial indexes, and GridFS. It also covers topics like database commands, indexing, and querying documents with embedded documents and arrays. Examples are provided for how to implement many of these MongoDB features and functions.
The Ring programming language version 1.10 book - Part 54 of 212Mahmoud Samir Fayed
This document describes code related to user registration and login functionality in Ring. It includes code for a registration form, login form, user registration logic, login validation, and checking if a user is logged in. Database and model classes are also shown that handle connecting to the database, querying for users, and managing user data.
Need an detailed analysis of what this code-model is doing- Thanks #St.pdfactexerode
Need an detailed analysis of what this code/model is doing. Thanks
#Step 1: Import the required Python libraries:
import numpy as np
import matplotlib.pyplot as plt
import keras
from keras.layers import Input, Dense, Reshape, Flatten, Dropout
from keras.layers import BatchNormalization, Activation, ZeroPadding2D
from keras.layers import LeakyReLU
from keras.layers.convolutional import UpSampling2D, Conv2D
from keras.models import Sequential, Model
from keras.optimizers import Adam,SGD
from keras.datasets import cifar10
#Step 2: Load the data.
#Loading the CIFAR10 data
(X, y), (_, _) = keras.datasets.cifar10.load_data()
#Selecting a single class of images
#The number was randomly chosen and any number
#between 1 and 10 can be chosen
X = X[y.flatten() == 8]
#Step 3: Define parameters to be used in later processes.
#Defining the Input shape
image_shape = (32, 32, 3)
latent_dimensions = 100
#Step 4: Define a utility function to build the generator.
def build_generator():
model = Sequential()
#Building the input layer
model.add(Dense(128 * 8 * 8, activation="relu",
input_dim=latent_dimensions))
model.add(Reshape((8, 8, 128)))
model.add(UpSampling2D())
model.add(Conv2D(128, kernel_size=3, padding="same"))
model.add(BatchNormalization(momentum=0.78))
model.add(Activation("relu"))
model.add(UpSampling2D())
model.add(Conv2D(64, kernel_size=3, padding="same"))
model.add(BatchNormalization(momentum=0.78))
model.add(Activation("relu"))
model.add(Conv2D(3, kernel_size=3, padding="same"))
model.add(Activation("tanh"))
#Generating the output image
noise = Input(shape=(latent_dimensions,))
image = model(noise)
return Model(noise, image)
#Step 5: Define a utility function to build the discriminator.
def build_discriminator():
#Building the convolutional layers
#to classify whether an image is real or fake
model = Sequential()
model.add(Conv2D(32, kernel_size=3, strides=2,
input_shape=image_shape, padding="same"))
model.add(LeakyReLU(alpha=0.2))
model.add(Dropout(0.25))
model.add(Conv2D(64, kernel_size=3, strides=2, padding="same"))
model.add(ZeroPadding2D(padding=((0,1),(0,1))))
model.add(BatchNormalization(momentum=0.82))
model.add(LeakyReLU(alpha=0.25))
model.add(Dropout(0.25))
model.add(Conv2D(128, kernel_size=3, strides=2, padding="same"))
model.add(BatchNormalization(momentum=0.82))
model.add(LeakyReLU(alpha=0.2))
model.add(Dropout(0.25))
model.add(Conv2D(256, kernel_size=3, strides=1, padding="same"))
model.add(BatchNormalization(momentum=0.8))
model.add(LeakyReLU(alpha=0.25))
model.add(Dropout(0.25))
#Building the output layer
model.add(Flatten())
model.add(Dense(1, activation='sigmoid'))
image = Input(shape=image_shape)
validity = model(image)
return Model(image, validity)
#Step 6: Define a utility function to display the generated images.
def display_images():
# Generate a batch of random noise
noise = np.random.normal(0, 1, (16, latent_dimensions))
# Generate images from the noise
generated_images = generator.predict(noise)
# Rescale the images to 0.
Detect Negative and Positive sentiment in user reviews using python word2vec ...Mamoon Ismail Khalid
detect Negative and Positive Sentiment in User Reviews_using Python word2vec model
libraries used:
Unsupervised training
from gensim.models.doc2vec import TaggedDocument
from gensim.models import Doc2Vec
from sklearn.neighbors import KNeighborsClassifier
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import cross_val_score
import numpy as np
This document describes ggTimeSeries, an R package that provides extensions to ggplot2 for creating time series plots. It includes examples of using functions from ggTimeSeries to create calendar heatmaps, horizon graphs, steam graphs, and marimekko plots from time series data. The examples demonstrate how to generate sample time series data, create basic plots, and add formatting customizations.
Rewrite the printInfo() functions of the Employee and Department cla.pdfalertshoeshingkimand
Rewrite the printInfo() functions of the Employee and Department classes by overloading the
put-to operator Operator<<.
C++
class Employee {
private:
string ID;
string name;
string jobTitle;
bool isManager;
string ID_of_Dept;
public:
void printInfo();
};
void Employee::printInfo() {
cout << "\t" << ID << "|" << name << " | " << jobTitle << " | " << isManager << " | " <<
ID_of_Dept << "\n";
}
class Department {
private:
string ID;
string name;
string loc;
string ID_of_manager;
vector listOfEmp_IDs;
public:
void printInfo();
};
void Department::printInfo() {
cout << ID << " | " << name << " | " << loc << " | Manager:" << ID_of_manager << endl;
cout << "List of emp IDs:\n";
}
void main()
{
vector emp_list;
vector dept_list;
readEmployeesFromFile(emp_list);
readDepartmentsFromFile(dept_list);
//print out department info
for (int d = 0; d < dept_list.size(); d++) {
dept_list[d].printInfo();
//1. for each depertment get me the list of emp_IDs.
vector _listOfEmp_IDs = dept_list[d].get_listOfEmp_IDs();
//2. for each emp ID, get its index in the emp_list
for (int e = 0; e < _listOfEmp_IDs.size(); e++) {
int idx = findEmpIdxByID(/*which list to search in?*/ emp_list,
_listOfEmp_IDs[e]);
//3. print out the emp info
emp_list[idx].printInfo();
}
cout << "\n-----------------------------------------------\n";
}
}.
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011Masahiro Nagano
The document describes using Log::Minimal to log messages with timestamps, severity levels, and stack traces. Log::Minimal provides functions like debugf(), infof(), warnf() that log messages, and configuration options like AUTODUMP and PRINT to customize the output format. It can be used to log messages from multi-threaded or distributed applications.
The document contains C code to perform matrix addition and multiplication using functions. It includes functions to read and write matrices, take user input for matrix dimensions and elements, perform the operations, and output the results. The code provides a menu for the user to select addition or multiplication and handles different cases for valid and invalid inputs.
This document introduces CouchDB, an open-source document-oriented NoSQL database that uses JSON documents with dynamic schemas instead of tables. It stores and retrieves these documents through a RESTful HTTP API. The document discusses CouchDB's key features like schema-less design, replication, views, and joins. It also provides examples of using CouchDB with different programming languages and libraries.
The document provides examples of basic C programs that demonstrate fundamental programming concepts like printing values, arithmetic operations, arrays, functions, conditionals, loops, and matrices. The programs cover topics such as printing and reading integers, adding/multiplying numbers, swapping values, checking vowels/consonants, Armstrong numbers, palindromes, summing matrices, and finding the transpose of a matrix.
The Ring programming language version 1.2 book - Part 32 of 84Mahmoud Samir Fayed
The document discusses user registration and login functionality in Ring. It describes classes for users (Model, View & Controller), form views for registration and login, and code to handle registration, login, and checking authentication. It also summarizes classes for database access (Database), model objects (ModelBase), and controllers (ControllerBase).
The code connects to a MySQL database, creates a user table and inserts sample data. It then allows a user to log in and perform CRUD operations on a students table, including inserting, updating, deleting, searching, and displaying records. The user can choose from menu options to perform the different operations and the code prints confirmation messages after each successful operation.
The document discusses the Sahana Eden emergency development environment. It provides an overview of key concepts like the model-view-controller architecture and describes how to build a new module for incident reporting with models, controllers and views. Instructions are given for setting up the development environment and performing common tasks like defining data models, creating forms and joining resources.
Similar to school-management-by-shivkamal-singh.pdf (20)
हिंदी वर्णमाला पीपीटी, hindi alphabet PPT presentation, hindi varnamala PPT, Hindi Varnamala pdf, हिंदी स्वर, हिंदी व्यंजन, sikhiye hindi varnmala, dr. mulla adam ali, hindi language and literature, hindi alphabet with drawing, hindi alphabet pdf, hindi varnamala for childrens, hindi language, hindi varnamala practice for kids, https://www.drmullaadamali.com
This presentation includes basic of PCOS their pathology and treatment and also Ayurveda correlation of PCOS and Ayurvedic line of treatment mentioned in classics.
A review of the growth of the Israel Genealogy Research Association Database Collection for the last 12 months. Our collection is now passed the 3 million mark and still growing. See which archives have contributed the most. See the different types of records we have, and which years have had records added. You can also see what we have for the future.
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...PECB
Denis is a dynamic and results-driven Chief Information Officer (CIO) with a distinguished career spanning information systems analysis and technical project management. With a proven track record of spearheading the design and delivery of cutting-edge Information Management solutions, he has consistently elevated business operations, streamlined reporting functions, and maximized process efficiency.
Certified as an ISO/IEC 27001: Information Security Management Systems (ISMS) Lead Implementer, Data Protection Officer, and Cyber Risks Analyst, Denis brings a heightened focus on data security, privacy, and cyber resilience to every endeavor.
His expertise extends across a diverse spectrum of reporting, database, and web development applications, underpinned by an exceptional grasp of data storage and virtualization technologies. His proficiency in application testing, database administration, and data cleansing ensures seamless execution of complex projects.
What sets Denis apart is his comprehensive understanding of Business and Systems Analysis technologies, honed through involvement in all phases of the Software Development Lifecycle (SDLC). From meticulous requirements gathering to precise analysis, innovative design, rigorous development, thorough testing, and successful implementation, he has consistently delivered exceptional results.
Throughout his career, he has taken on multifaceted roles, from leading technical project management teams to owning solutions that drive operational excellence. His conscientious and proactive approach is unwavering, whether he is working independently or collaboratively within a team. His ability to connect with colleagues on a personal level underscores his commitment to fostering a harmonious and productive workplace environment.
Date: May 29, 2024
Tags: Information Security, ISO/IEC 27001, ISO/IEC 42001, Artificial Intelligence, GDPR
-------------------------------------------------------------------------------
Find out more about ISO training and certification services
Training: ISO/IEC 27001 Information Security Management System - EN | PECB
ISO/IEC 42001 Artificial Intelligence Management System - EN | PECB
General Data Protection Regulation (GDPR) - Training Courses - EN | PECB
Webinars: https://pecb.com/webinars
Article: https://pecb.com/article
-------------------------------------------------------------------------------
For more information about PECB:
Website: https://pecb.com/
LinkedIn: https://www.linkedin.com/company/pecb/
Facebook: https://www.facebook.com/PECBInternational/
Slideshare: http://www.slideshare.net/PECBCERTIFICATION
How to Build a Module in Odoo 17 Using the Scaffold MethodCeline George
Odoo provides an option for creating a module by using a single line command. By using this command the user can make a whole structure of a module. It is very easy for a beginner to make a module. There is no need to make each file manually. This slide will show how to create a module using the scaffold method.
বাংলাদেশের অর্থনৈতিক সমীক্ষা ২০২৪ [Bangladesh Economic Review 2024 Bangla.pdf] কম্পিউটার , ট্যাব ও স্মার্ট ফোন ভার্সন সহ সম্পূর্ণ বাংলা ই-বুক বা pdf বই " সুচিপত্র ...বুকমার্ক মেনু 🔖 ও হাইপার লিংক মেনু 📝👆 যুক্ত ..
আমাদের সবার জন্য খুব খুব গুরুত্বপূর্ণ একটি বই ..বিসিএস, ব্যাংক, ইউনিভার্সিটি ভর্তি ও যে কোন প্রতিযোগিতা মূলক পরীক্ষার জন্য এর খুব ইম্পরট্যান্ট একটি বিষয় ...তাছাড়া বাংলাদেশের সাম্প্রতিক যে কোন ডাটা বা তথ্য এই বইতে পাবেন ...
তাই একজন নাগরিক হিসাবে এই তথ্য গুলো আপনার জানা প্রয়োজন ...।
বিসিএস ও ব্যাংক এর লিখিত পরীক্ষা ...+এছাড়া মাধ্যমিক ও উচ্চমাধ্যমিকের স্টুডেন্টদের জন্য অনেক কাজে আসবে ...
it describes the bony anatomy including the femoral head , acetabulum, labrum . also discusses the capsule , ligaments . muscle that act on the hip joint and the range of motion are outlined. factors affecting hip joint stability and weight transmission through the joint are summarized.
The simplified electron and muon model, Oscillating Spacetime: The Foundation...RitikBhardwaj56
Discover the Simplified Electron and Muon Model: A New Wave-Based Approach to Understanding Particles delves into a groundbreaking theory that presents electrons and muons as rotating soliton waves within oscillating spacetime. Geared towards students, researchers, and science buffs, this book breaks down complex ideas into simple explanations. It covers topics such as electron waves, temporal dynamics, and the implications of this model on particle physics. With clear illustrations and easy-to-follow explanations, readers will gain a new outlook on the universe's fundamental nature.
This presentation was provided by Steph Pollock of The American Psychological Association’s Journals Program, and Damita Snow, of The American Society of Civil Engineers (ASCE), for the initial session of NISO's 2024 Training Series "DEIA in the Scholarly Landscape." Session One: 'Setting Expectations: a DEIA Primer,' was held June 6, 2024.
1. PROJECT TITLE- “SCHOOL MANAGEMENT”
DBMS: MySQL
Host : localhost
User: root
Password: tiger
DataBase: mysql
Table Structure: As per the Screenshot given below:
Table:Student
Table: Emp
3. Python Code:
import os
import platform
import mysql.connector
#import pandas as pd
#from pandas import DataFrame
def selection():
db = mysql.connector.connect(user='root', password='tiger', host='localhost',database='mysql')
cursor = db.cursor()
print('-----------------------------------nWELCOME TO SCHOOL MANAGEMENT SYSTEMn-----------------------------------')
print("1.STUDENT MANAGEMENT")
print("2.EMPLOYEE MANAGEMENT")
print("3.FEE MANAGEMENT")
print("4.EXAM MANAGEMENT")
ch=int(input("nEnter ur choice (1-4) : "))
if ch==1:
print('nWELCOME TO STUDENT MANAGEMENT SYSTEMn')
print('a.NEW ADMISSION')
print('b.UPDATE STUDENT DETAILS')
print('c.ISSUE TC')
c=input("Enter ur choice (a-c) : ")
print('nInitially the details are..n')
display1()
if c=='a':
insert1()
print('nModified details are..n')
display1()
elif c=='b':
update1()
print('nModified details are..n')
display1()
elif c=='c':
delete1()
print('nModified details are..n')
display1()
else:
print('Enter correct choice...!!')
elif ch==2:
print('WELCOME TO EMPLOYEE MANAGEMENT SYSTEM')
print('a.NEW EMPLOYEE')
print('b.UPDATE STAFF DETAILS')
print('c.DELETE EMPLOYEE')
c=input("Enter ur choice : ")
if c=='a':
insert2()
4. print('nModified details are..n')
display2()
elif c=='b':
update2()
print('nModified details are..n')
display2()
elif c=='c':
delete2()
print('nModified details are..n')
display2()
else:
print('Enter correct choice...!!')
elif ch==3:
print('WELCOME TO FEE MANAGEMENT SYSTEM')
print('a.NEW FEE')
print('b.UPDATE FEE')
print('c.EXEMPT FEE')
c=input("Enter ur choice : ")
if c=='a':
insert3()
elif c=='b':
update3()
elif c=='c':
delete3()
else:
print('Enter correct choice...!!')
elif ch==4:
print('WELCOME TO EXAM MANAGEMENT SYSTEM')
print('a.EXAM DETAILS')
print('b.UPDATE DETAILS ')
print('c.DELETE DETAILS')
c=input("Enter ur choice : ")
if c=='a':
insert4()
elif c=='b':
update4()
elif c=='c':
delete4()
else:
print('Enter correct choice...!!')
else:
print('Enter correct choice..!!')
def insert1():
sname=input("Enter Student Name : ")
admno=int(input("Enter Admission No : "))
dob=input("Enter Date of Birth(yyyy-mm-dd): ")
cls=input("Enter class for admission: ")
cty=input("Enter City : ")
db = mysql.connector.connect(user='root', password='tiger', host='localhost',database='mysql')
cursor = db.cursor()
5. sql="INSERT INTO student(sname,admno,dob,cls,cty) VALUES ( '%s' ,'%d','%s','%s','%s')"%(sname,admno,dob,cls,cty)
try:
cursor.execute(sql)
db.commit()
except:
db.rollback()
db.close()
#insert()
def display1():
try:
db = mysql.connector.connect(user='root', password='tiger', host='localhost',database='mysql')
cursor = db.cursor()
sql = "SELECT * FROM student"
cursor.execute(sql)
results = cursor.fetchall()
for c in results:
sname = c[0]
admno= c[1]
dob=c[2]
cls=c[3]
cty=c[4]
print ("(sname=%s,admno=%d,dob=%s,cls=%s,cty=%s)" % (sname,admno,dob,cls,cty))
except:
print ("Error: unable to fetch data")
db.close()
def update1():
try:
db = mysql.connector.connect(user='root', password='tiger', host='localhost',database='mysql')
cursor = db.cursor()
sql = "SELECT * FROM student"
cursor.execute(sql)
results = cursor.fetchall()
for c in results:
sname = c[0]
admno= c[1]
dob=c[2]
cls=c[3]
cty=c[4]
except:
print ("Error: unable to fetch data")
print()
tempst=int(input("Enter Admission No : "))
temp=input("Enter new class : ")
try:
sql = "Update student set cls=%s where admno='%d'" % (temp,tempst)
cursor.execute(sql)
db.commit()
except Exception as e:
print (e)
6. db.close()
def delete1():
try:
db = mysql.connector.connect(user='root', password='tiger', host='localhost',database='mysql')
cursor = db.cursor()
sql = "SELECT * FROM student"
cursor.execute(sql)
results = cursor.fetchall()
for c in results:
sname = c[0]
admno= c[1]
dob=c[2]
cls=c[3]
cty=c[4]
except:
print ("Error: unable to fetch data")
temp=int(input("nEnter adm no to be deleted : "))
try:
sql = "delete from student where admno='%d'" % (temp)
ans=input("Are you sure you want to delete the record(y/n) : ")
if ans=='y' or ans=='Y':
cursor.execute(sql)
db.commit()
except Exception as e:
print (e)
db.close()
def insert2():
ename=input("Enter Employee Name : ")
empno=int(input("Enter Employee No : "))
job=input("Enter Designation: ")
hiredate=input("Enter date of joining: ")
db = mysql.connector.connect(user='root', password='tiger', host='localhost',database='mysql')
cursor = db.cursor()
sql="INSERT INTO emp(ename,empno,job,hiredate) VALUES ( '%s' ,'%d','%s','%s')"%(ename,empno,job,hiredate)
try:
cursor.execute(sql)
db.commit()
except:
db.rollback()
db.close()
def display2():
try:
db = mysql.connector.connect(user='root', password='tiger', host='localhost',database='mysql')
cursor = db.cursor()
sql = "SELECT * FROM emp"
cursor.execute(sql)
results = cursor.fetchall()
for c in results:
ename = c[0]
empno= c[1]
7. job=c[2]
hiredate=c[3]
print ("(empno=%d,ename=%s,job=%s,hiredate=%s)" % (empno,ename,job,hiredate))
except:
print ("Error: unable to fetch data")
db.close()
def update2():
try:
db = mysql.connector.connect(user='root', password='tiger', host='localhost',database='mysql')
cursor = db.cursor()
sql = "SELECT * FROM emp"
cursor.execute(sql)
results = cursor.fetchall()
for c in results:
ename = c[0]
empno= c[1]
job=c[2]
hiredate=c[3]
except:
print ("Error: unable to fetch data")
print()
tempst=int(input("Enter Employee No : "))
temp=input("Enter new designation : ")
try:
sql = "Update emp set job=%s where empno='%d'" % (temp,tempst)
cursor.execute(sql)
db.commit()
except Exception as e:
print (e)
db.close()
def delete2():
try:
db = mysql.connector.connect(user='root', password='tiger', host='localhost',database='mysql')
cursor = db.cursor()
sql = "SELECT * FROM emp"
cursor.execute(sql)
results = cursor.fetchall()
for c in results:
ename = c[0]
empno= c[1]
job=c[2]
hiredate=c[3]
except:
print ("Error: unable to fetch data")
temp=int(input("nEnter emp no to be deleted : "))
try:
sql = "delete from emp where empno='%d'" % (temp)
ans=input("Are you sure you want to delete the record(y/n) : ")
if ans=='y' or ans=='Y':
cursor.execute(sql)
8. db.commit()
except Exception as e:
print (e)
db.close()
def insert3():
admno=int(input("Enter adm no: "))
fee=float(input("Enter fee amount : "))
month=input("Enter Month: ")
db = mysql.connector.connect(user='root', password='tiger', host='localhost',database='mysql')
cursor = db.cursor()
sql="INSERT INTO fee(admno,fee,month) VALUES ( '%d','%d','%s')"%(admno,fee,month)
try:
cursor.execute(sql)
db.commit()
except:
db.rollback()
db.close()
def display3():
try:
db = mysql.connector.connect(user='root', password='tiger', host='localhost',database='mysql')
cursor = db.cursor()
sql = "SELECT * FROM fee"
cursor.execute(sql)
results = cursor.fetchall()
for c in results:
admno= c[0]
fee=c[1]
month=c[2]
print ("(admno=%d,fee=%s,month=%s)" % (admno,fee,month))
except:
print ("Error: unable to fetch data")
db.close()
def update3():
try:
db = mysql.connector.connect(user='root', password='tiger', host='localhost',database='mysql')
cursor = db.cursor()
sql = "SELECT * FROM fee"
cursor.execute(sql)
results = cursor.fetchall()
for c in results:
admno= c[0]
fee=c[1]
month=c[2]
except:
print ("Error: unable to fetch data")
print()
tempst=int(input("Enter Admission No : "))
temp=input("Enter new class : ")
try:
sql = "Update fee set month=%s where admno='%d'" % (temp,tempst)
cursor.execute(sql)
9. db.commit()
except Exception as e:
print (e)
db.close()
def delete3():
try:
db = mysql.connector.connect(user='root', password='tiger', host='localhost',database='mysql')
cursor = db.cursor()
sql = "SELECT * FROM fee"
cursor.execute(sql)
results = cursor.fetchall()
for c in results:
admno= c[0]
fee=c[1]
month=c[2]
except:
print ("Error: unable to fetch data")
temp=int(input("nEnter adm no to be deleted : "))
try:
sql = "delete from student where admno='%d'" % (temp)
ans=input("Are you sure you want to delete the record(y/n) : ")
if ans=='y' or ans=='Y':
cursor.execute(sql)
db.commit()
except Exception as e:
print (e)
db.close()
def insert4():
sname=input("Enter Student Name : ")
admno=int(input("Enter Admission No : "))
per=float(input("Enter percentage : "))
res=input("Enter result: ")
db = mysql.connector.connect(user='root', password='tiger', host='localhost',database='mysql')
cursor = db.cursor()
sql="INSERT INTO exam(sname,admno,per,res) VALUES ( '%s' ,'%d','%s','%s')"%(sname,admno,per,res)
try:
cursor.execute(sql)
db.commit()
except:
db.rollback()
db.close()
def display4():
try:
db = mysql.connector.connect(user='root', password='tiger', host='localhost',database='mysql')
cursor = db.cursor()
sql = "SELECT * FROM exam"
cursor.execute(sql)
results = cursor.fetchall()
for c in results:
sname = c[0]
10. admno= c[1]
dob=c[2]
cls=c[3]
cty=c[4]
print ("(sname,admno,per,res)"%(sname,admno,per,res) )
except:
print ("Error: unable to fetch data")
db.close()
def update4():
try:
db = mysql.connector.connect(user='root', password='tiger', host='localhost',database='mysql')
cursor = db.cursor()
sql = "SELECT * FROM exam"
cursor.execute(sql)
results = cursor.fetchall()
for c in results:
sname = c[0]
admno= c[1]
dob=c[2]
cls=c[3]
cty=c[4]
except:
print ("Error: unable to fetch data")
print()
tempst=int(input("Enter Admission No : "))
temp=input("Enter new result : ")
try:
sql = "Update student set res=%s where admno='%d'" % (temp,tempst)
cursor.execute(sql)
db.commit()
except Exception as e:
print (e)
db.close()
def delete4():
try:
db = mysql.connector.connect(user='root', password='tiger', host='localhost',database='mysql')
cursor = db.cursor()
sql = "SELECT * FROM exam"
cursor.execute(sql)
results = cursor.fetchall()
for c in results:
sname = c[0]
admno= c[1]
dob=c[2]
cls=c[3]
cty=c[4]
except:
print ("Error: unable to fetch data")
11. temp=int(input("nEnter adm no to be deleted : "))
try:
sql = "delete from exam where admno='%d'" % (temp)
ans=input("Are you sure you want to delete the record(y/n) : ")
if ans=='y' or ans=='Y':
cursor.execute(sql)
db.commit()
except Exception as e:
print (e)
db.close()
selection()