Skip to main content

Posts

Top Python Interview Question(2022) || python interview question and answers || python interview questions and answers for freshers - Creation Code

  Top Python Interview Question You Must Know What are local variables and global variables in Python? Global Variables: Variables declared outside a function or in a global space are called global variables. These variables can be accessed by any function in the program. Local Variables: Any variable declared inside a function is known as a local variable. This variable is present in the local space and not in the global space. Example: 1 2 3 4 5 6 a=2 def add(): b=3 c=a+b print(c) add() What is PYTHONPATH? Ans: It is an environment variable that is used when a module is imported. Whenever a module is imported, PYTHONPATH is also looked up to check for the presence of the imported modules in various directories. The interpreter uses it to determine which module to load. What is _init_? Ans: _init_ is a method or constructor in Python. This method is automatically called to allocate memory when a new object/ instance of a class is created. All classes have the _init_ method. What are t

How to Make a Loader || loading animation css || css loading spinner - Creation Code

Loading animation with CSS When to use a loader? Immediate response time is less than 1 second. If they don't get any visual feedback after a second, they start to worry. If you have a process that takes longer than a second, you should display a spinner. It creates an excellent user experience on your website. HTML: <!DOCTYPE html> <html lang="en"> <head>     <meta charset="UTF-8">     <meta http-equiv="X-UA-Compatible" content="IE=edge">     <meta name="viewport" content="width=device-width, initial-scale=1.0">     <link rel="stylesheet" href="style.css">     <title>CREATION CODE</title> </head> <body>          <button class="btn">         <span class="loading">L<span class="loader"></span>ading</span>         <span class="dot dot1">.</span>         <sp

React Interview questions - Creation Code

 Top react interview question: 1. Differentiate between Real DOM and Virtual DOM?      Real DOM -    * it updates slow    * can directly update HTML   * create a new DOM if element updates   * DOM manipulation is very expensive   Virtual DOM -   * it updates faster   * can't update HTML directly   * updates the JSX if element updates   * DOM manipulation is very easy 2. What is JSX?        JSX is a shorthand for Javascript XML.this is a     type of file used by reacting which utilize the    the expressiveness of Javascript along with HTML     like template syntax. this makes the HTML file    really easy to understand. this file makes     application robust and boosts its performance.    Below is an example of JSX:                                  render(){                    return(                          <div>                          <h1>SUBSCRIBE TO CREATION CODE<h1/>                          <div/>);                         } 3. How can you embed two o

Create Login Page Like Twitter || Twitter login page clone || twitter clone html, css - Creation Code

Twitter: Twitter is an American microblogging and social networking service on which users post and interact with messages known as "tweets". Registered users can post, like, and retweet tweets, but unregistered users can only read those that are publicly available. Users interact with Twitter through browsers or mobile frontend software, or programmatically via its APIs. Prior to April 2020, services were accessible via SMS. The service is provided by Twitter, Inc., a corporation based in San Francisco, California, and has more than 25 offices around the world. Tweets were originally restricted to 140 characters, but the limit was doubled to 280 for non-CJK languages in November 2017. Audio and video tweets remain limited to 140 seconds for most accounts. We are going to build the login clone with HTML and CSS HTML: <!DOCTYPE html> <html lang="en"> <head>     <meta charset="UTF-8">     <meta http-equiv="X-UA-Compatible"

How to Detect Number Plate in Vehicle Using Python || How can I find out a number plate on a car || Number plate recognition using python - Creation Code

Number Plate Recognition: Automatic number-plate recognition is a technology that uses optical character recognition on images to read vehicle registration plates to create vehicle location data. It can use existing closed-circuit television, road-rule enforcement cameras, or cameras specifically designed for the task. It is used by police forces around the world for law enforcement purposes, including to check if a vehicle is registered or licensed. It is also used for electronic toll collection on pay-per-use roads and as a method of cataloging the movement of traffic, for example by highways agencies In this post, we will make a simple number plate recognition system with python and OpenCV Notes: In this project, we will use a dataset for recognizing the number plate you can find them from  here Code: import cv2 ############################################# frameWidth = 640 frameHeight = 480 nPlateCascade = cv2 . CascadeClassifier ( "haarcascade_russian_plate_number.xml&quo

Lane Detection Using Image Processing || Lane Detection with Python OpenCV - Creation Code

Introduction: Autonomous Driving Car is one of the most disruptive innovations in AI. Fuelled by Deep Learning algorithms, they are continuously driving our society forward and creating new opportunities in the mobility sector. An autonomous car can go anywhere a traditional car can go and does everything that an experienced human driver does. But it's very essential to train it properly. One of the many steps involved during the training of an autonomous driving car is lane detection, which is the preliminary step. Today, we are going to learn how to perform lane detection using videos. You can find the necessary files  here Code: import cv2 import numpy as np   # Canny edge detection # It's easier to find edges between pixels if # we're able to convert the entire image into gray. def canny ( img ):     # Turn the images Gray     # Processing a single channel instead of     # three (R/G/B) color image, is a lot more faster.     gray = cv2 . cvtColor ( img , cv2 . COL

OpenCV - Thug Life Filter - Creation Code

  Thug Life: We all know what is thug life filter and it is used in memes widely. As a tech geek, I was very curious to know how it works. After some research, I came to know that we can make it in python very easily  Necessary Files: Some important files we will use in this project to build this you can find from  here Code: import numpy as np import cv2 face_cascade = cv2 . CascadeClassifier ( 'haarcascade_frontalface_default.xml' ) specs_ori = cv2 . imread ( 'glass.png' , - 1 ) cigar_ori = cv2 . imread ( 'cigar.png' , - 1 ) mus_ori = cv2 . imread ( 'mustache.png' , - 1 ) # Camera Init cap = cv2 . VideoCapture ( 0 ) cap .set( cv2 . CAP_PROP_FPS , 30 ) def transparentOverlay ( src , overlay , pos =( 0 , 0 ), scale = 1 ):     overlay = cv2 . resize ( overlay , ( 0 , 0 ), fx = scale , fy = scale )     h , w , _ = overlay .shape   # Size of foreground     rows , cols , _ = src .shape   # Size of background Image     y , x = pos [ 0 ], pos [ 1