Skip to main content

Posts

Showing posts from July, 2020

data visualize(bar chart)

from matplotlib import pyplot as plt movies = ["Annie Hall", "Ben-Hur", "Casablanca", "Gandhi", "West Side Story"] num_oscars = [5, 11, 3, 8, 10] #bar chart # bars are by default width 0.8, so we'll add 0.1 to the left coordinates # so that each bar is centered #xs = [i + 0.1 for i, _ in enumerate(movies)] # plot bars with left x-coordinates [xs], heights [num_oscars] plt.bar(movies,num_oscars,color='red') #label x-axis with movie names at bar centers #plt.xticks([i + 0.5 for i, _ in enumerate(movies)], movies) plt.show() fig:-

Data visualize with matplotlib(solid line)

Nominal GDP      from matplotlib import pyplot as plt      years = [1950, 1960, 1970, 1980, 1990, 2000, 2010]      gdp = [300.2, 543.3, 1075.9, 2862.5, 5979.6, 10289.7, 14958.3]      plt.title('GDP')      plt.ylabel('Billios of $')      plt.plot(years,gdp,color='red',marker='o',linestyle='solid')      plt.show() * plt.plot(x,y,color,marker per year,linestyle) there are several line style '-', '--', '-.', ':', 'None', ' ', '', 'solid', 'dashed', 'dashdot', 'dotted' fig-

Node js

Start -------------------------------- npm init Install dependency ---------------------------------- npm install uuid Install dev dependency ---------------------------------------- npm install -D nodemon

Form basic django

Model.py ----------------------------- from django.db import models # Create your models here. class Contact(models.Model):     name = models.CharField(max_length = 100)     email = models.CharField(max_length = 100)     phone = models.IntegerField()     message = models.CharField(max_length = 1000)     def __str__(self):         return self.name views.py ----------------------------------- from django.shortcuts import render,redirect from django.http import HttpResponse from . forms import ContactForm from . models import Contact # Create your views here. def index(request):     return render(request,'index.html') def contact(request):     if request.method == "POST":         form = ContactForm(request.POST or None)         if form.is_valid():       ...

Best Suspense Movie

Feeling Bored? Watch this best Suspense movie Wanna know where you can find all those?😁

Django Basic

Django startup all basic code personal using purpose number 1 --------------------------- create virtual env ~virtualenv v ~source bin/activate -------------------------------- django in-it pip install Django==3.0.8 ------------------------- start-project -------------- django-admin.py startproject {name} . ------------- create app ------------ python manage.py startapp {name} url -------------- include     path('db/',include('djangodb.urls')),      ------------------  save in settings  ------------------    views  ---------------------  from django.shortcuts import render from django.http import HttpResponse # Create your views here. def home(request):     return render(request,'home.html')   ------------------ creater superuser ------------- python manage.py createsuperuser MOdels --------------------------------- class Home(models.Model):     f_name = models.CharField(max_length = 80) ...

Linux best screen shoot app

Flameshot:Best screen shoot app. Feature official link Arch Snapshot also available via AUR: flameshot-git . Debian 10+ : apt install flameshot Ubuntu 18.04+ : apt install flameshot Fedora: dnf install flameshot openSUSE Void Linux : xbps-install flameshot Debian/Ubuntu Compilation Dependencies: apt install git g++ build-essential qt5-qmake qt5-default qttools5-dev-tools Compilation: run qmake && make in the main directory. Fedora Compilation Dependencies: dnf install qt5-devel gcc-c++ git qt5-qtbase-devel qt5-linguist Compilation: run qmake-qt5 && make in the main directory. Arch Compilation Dependencies: pacman - S git qt5-base base-devel qt5-t ools Compilation: run qmake && make in the main directory.

Django start_up - Ready To Go

Meet 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 Python is lovable by everyone.So django is the best choice for learning a new framework.And it is very easy to use. Ready To Go 😀 ------------------------------------------------------------------------------------------------------------------------------- 1) First have to create virtual environment ,By pip install virtualenv Here pip is a de facto standard package-management system used to install and manage software packages written in Python. https://pip.pypa.io/en/stable/installing/ In Bash terminal or cmd or powershell - $ virtualenv . $ source bin/activa...