Posts

Showing posts with the label Cheatsheet

Django Cheatsheet

Image
What is Django? Django is a high-level Python web framework that encourages rapid development and clean, pragmatic design. Built by experienced developers, it takes care of much of the hassle of web development, so you can focus on writing your app without needing to reinvent the wheel. It’s free and open source. It is used for rapid development of web based application. Advantages : 1. Django was designed to help developers take applications from concept to completion as quickly as possible. 2. Django takes security seriously and helps developers avoid many common security mistakes. 3. Some of the busiest sites on the web leverage Django’s ability to quickly and flexibly scale. Installing Django + Setup pip install django Creating a project The below command creates a new project django-admin startproject projectName Starting a server The below command starts the development server. python manage.py runserver Django MVT Django follows MVT(Model, View, Template) architectur...

Flask Cheatsheet

Image
What is Flask Flask is a micro web framework written in Python. It is classified as a microframework because it does not require particular tools or libraries. It has no database abstraction layer, form validation, or any other components where pre-existing third-party libraries provide common functions. Importing Flask from flask import Flask Most used import functions These are some of the most used import functions from flask import Flask, render_template, redirect, url_for, request Boilerplate This is the basic template or barebone structure of Flask. from flask import Flask app = Flask(__name__) @app.route("/") def hello_world(): return "<p>Hello, World!</p>" app.run() route(endpoint) This is to make different endpoints in our flask app. @app.route("/") Route method Allowing get and post requests on an endpoint. methods = ['GET', 'POST'] Re-run while coding This is used to automatically rerun the pr...

PHP Cheatsheet

Image
What is php? PHP is a general-purpose scripting language geared towards web development. It was originally created by Danish-Canadian programmer Rasmus Lerdorf in 1994. The PHP reference implementation is now produced by The PHP Group. PHP originally stood for Personal Home Page, but it now stands for the recursive initialism PHP: Hypertext Preprocessor. PHP code is usually processed on a web server by a PHP interpreter implemented as a module, a daemon or as a Common Gateway Interface (CGI) executable. On a web server, the result of the interpreted and executed PHP code – which may be any type of data, such as generated HTML or binary image data – would form the whole or part of an HTTP response. Various web template systems, web content management systems, and web frameworks exist which can be employed to orchestrate or facilitate the generation of that response. Additionally, PHP can be used for many programming tasks outside the web context, such as standalone graphical applicati...

MySQL Cheatsheet

Image
Database It is defined as a collection of interrelated data stored together to serve multiple applications. What is MySQL? MySQL is an open-source relational database management system (RDBMS). Its name is a combination of "My", the name of co-founder Michael Widenius's daughter, and "SQL", the abbreviation for Structured Query Language. A relational database organizes data into one or more data tables in which data types may be related to each other; these relations help structure the data. SQL is a language programmers use to create, modify and extract data from the relational database, as well as control user access to the database. In addition to relational databases and SQL, an RDBMS like MySQL works with an operating system to implement a relational database in a computer's storage system, manages users, allows for network access and facilitates testing database integrity and creation of backups. MySQL is free and open-source software under the ter...

C++ Cheatsheet

Image
What is C++ Programming Language? C++ is a general-purpose programming language created by Bjarne Stroustrup as an extension of the C programming language , or "C with Classes". The language has expanded significantly over time, and modern C++ now has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation. It is almost always implemented as a compiled language, and many vendors provide C++ compilers, including the Free Software Foundation, LLVM, Microsoft, Intel, Oracle, and IBM, so it is available on many platforms. Basics Basic syntax and functions from the C++ programming language. Boilerplate #include <iostream> using namespace std; int main() { cout << "Welcome to C++"; return 0; } cout << It prints output on the screen cout << "This is C++ Programming"; cin >> It takes input from the user cin >> variable_name Data types Th...

Java Cheatsheet

Image
  What is JAVA? Java is a high-level, class-based, object-oriented programming language that is designed to have as few implementation dependencies as possible. It is a general-purpose programming language intended to let programmers write once, run anywhere (WORA), meaning that compiled Java code can run on all platforms that support Java without the need for recompilation. Java applications are typically compiled to bytecode that can run on any Java virtual machine (JVM) regardless of the underlying computer architecture. The syntax of Java is similar to C and C++, but has fewer low-level facilities than either of them. The Java runtime provides dynamic capabilities (such as reflection and runtime code modification) that are typically not available in traditional compiled languages. As of 2019, Java was one of the most popular programming languages in use according to GitHub, particularly for client–server web applications, with a reported 9 million developers. Basics Basic synt...

C Cheatsheet

Image
What is C Programming Language? C  is a general-purpose, procedural computer programming language supporting structured programming, lexical variable scope, and recursion, with a static type system. By design, C provides constructs that map efficiently to typical machine instructions. It has found lasting use in applications previously coded in assembly language. Such applications include operating systems and various application software for computer architectures that range from supercomputers to PLCs and embedded systems. Basics Basic syntax and functions from the C programming language. Boilerplate Code #include<stdio.h> int main() { return(0); } printf function It is used to show output on the screen printf("Hello World!") scanf function It is used to take input from the user scanf("placeholder", variables) Comments A comment is the code that is not executed by the compiler, and the programmer uses it to keep track of the code...