Python Notes
import sqlite3
from sqlite3 import Error
# after importing
conn = sqlite3.connect(db_name)
# db_name is the name of database
# after connecting
c = conn.cursor() # this is essential before executing any statement
c.execute(stmt)
# stmt is a full SQLite statement
# after connecting
c.execute(pstmt, values)
# pstmt is a SQLite prepared statement
# value is a tupple
When to commit: edit, delete, alter table
When not needed: query, creating table
# after executing
conn.commit()
Always close connection after using. Do not try to use after colsing.
# use database here
# after using
conn.close()
# do not use database here
try:
# connetion, cursor, execution
except Error as e:
print(e)
finally:
#close connection
Made with :hearts: by Kavyas |
---|
Learn SQLite on https://www.sqlitetutorial.net/ |
In programming languages and type theory, polymorphism is the provision of a single interface to entities of different types or the use of a single symbol to represent multiple different types. Most common way of achieving polymorphism is through inheritence/Subtyping. Besides for this there are other ways to achieve polymorphism. The most commonly recognized of which is parametric polymorphism. Using parametric polymorphism, a function or a data type can be written generically so that it can handle values identically without depending on their type. Such functions and data types are called generic functions and generic datatypes respectively and form the basis of generic programming. For example, in java, this feature is supported by the name of 'generics'. It is used in the standard Java library collections. For example, Collections.sort is declared as:
Jan 3, 2021which document is used as a contact document among stack holders involve in software engineering process, by taking example explain it? The software requirements document (also called software requirements specification or SRS) is an official document of what should be implemented. It's also used as a contract between the stakeholders and the software developers. It should include both; user and system requirements. For an example we can take a hypothetical software project we need to undertake for the database management for an airline company. Before staring the project we need to establish the basis for an agreement between the engineers and the airline company on how the software product should function. The role can be played by the marketing and development divisions. For this a standard documentation can be implemented which makes rigorous assessment of requirements before more specific system design on later stages. Its goal is to reduce later redesign. wikipedia Software requirements specification establishes the basis for an agreement between customers and contractors or suppliers on how the software product should function (in a market-driven project, these roles may be played by the marketing and development divisions). Software requirements specification is a rigorous assessment of requirements before the more specific system design stages, and its goal is to reduce later redesign. It should also provide a realistic basis for estimating product costs, risks, and schedules.[1] Used appropriately, software requirements specifications can help prevent software project failure.[2] The software requirements specification document lists sufficient and necessary requirements for the project development.[3] To derive the requirements, the developer needs to have clear and thorough understanding of the products under development. This is achieved through detailed and continuous communications with the project team and customer throughout the software development process.
Sep 23, 2020or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up