Skip to content

Instantly share code, notes, and snippets.

View awg01's full-sized avatar

Akash Gudadhe awg01

View GitHub Profile
@awg01
awg01 / django_form_render.md
Last active April 22, 2022 20:10
I want to render two forms on single html page

Objective

I want to render two forms on single html page.

Expectation

  1. form1 has two inputs(paragraph to summarize and length of summary) and after clicking on generate summary button from left side of page it will return summary for left side paragraph

  2. form2 has two inputs(paragraph to summarize and length of summary) and after clicking on generate summary button from right side of page it will return summary for right side paragraph

@awg01
awg01 / codes.md
Last active April 22, 2022 20:03
code for rendering two forms in one page

views.py logic

def paragraph(request):
    form1 = PSummaryForm1()
    form2 = PSummaryForm2()
    # return render(request, 'paragraph.html', {'form1': form1, 'form2': form2 })
    # if this is a POST request we need to process the form data
    if request.method == 'POST':
        form1 = PSummaryForm1(request.POST)
        if request.POST.get("form_type") == 'formOne':
@awg01
awg01 / lombok_import_steps.txt
Created March 26, 2022 05:35
Lombok dependency steps
- add lombok dependency inside pom.xml
- run lombook jar first using `java -jar lombok_jar`
- specify sts executable file name
- clean and build project
@awg01
awg01 / java_fresher.txt
Created July 11, 2021 09:22
Technical Interview Preparation resources for java developer fresher interview
Best SQL tutorial for begineers
https://www.sqltutorial.org/
https://www.sqltutorial.org/sql-cheat-sheet/
SQL Extra concepts
https://www.sqltutorial.org/sql-views/
https://www.sqltutorial.org/sql-functions/
https://www.sqltutorial.org/sql-triggers/
Interview Questions
@awg01
awg01 / fusejsdemo.html
Created June 13, 2021 17:04
Fuse Js :- Fuse.js is a powerful, lightweight fuzzy-search library, with zero dependencies. ( https://fusejs.io/ )
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap 4 Accordion with Plus Minus Icons</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/js/bootstrap.bundle.min.js"></script>
@awg01
awg01 / detail.html
Created June 27, 2020 13:03
"Update Albums Functionality" Code for Django Tutorial for Beginners - 32 - UpdateView and DeleteView
"Delete Albums Functionality" Code for Django Tutorial for Beginners - 32 - UpdateView and DeleteView
{% extends 'music/base.html' %}
{% block title %}Album Details{% endblock %}
{% block body %}
<img src="{{ album.album_logo }}" alt="">
<!-- Just add this code inside your detail.html for updating albums.Simple Code for demonstration of
functionality.If you understand this then you can design page according to your need.
Dont forget to write method name of form is POST.Add this code snippet in your detail.html -->
@awg01
awg01 / index.html
Last active November 3, 2020 08:36
"Delete Albums Functionality" Code for Django Tutorial for Beginners - 32 - UpdateView and DeleteView
{% extends 'music/base.html' %}
{% block body %}
{% if all_albums %}
<h3>All Albums : </h3>
<ul type='none'>
<!-- Just add this code inside your index.html for deleting albums.Simple Code for demonstration of
functionality.If you understand this then you can design page according to your need. -->
{% for album in all_albums %}
<li>
<div class="inline-form">
@awg01
awg01 / SILLYPRS.cpp
Created June 29, 2019 18:09
Code is giving correct answer after running on IDE.But doesn't get accepted by codechef.
/*
https://www.codechef.com/LTIME73B/problems/SILLYPRS
*/
#include <iostream>
using namespace std;
int main()
{
int t,n;
cin>>t;
@awg01
awg01 / city_name_matcher_from_CSV.py
Created June 26, 2019 10:20
I want to check whether city name from csv file is present in given sentence.
import csv
from re import search
#example_sent2 = "Sunset is the time of day when our sky meets the outer space solar winds. There are blue, pink, and purple swirls, spinning and twisting, like clouds of balloons caught in a whirlwind. The sun moves slowly to hide behind the line of horizon, while the moon races to take its place in prominence atop the night sky. People slow to a crawl, entranced, fully forgetting the deeds that must still be done. There is a coolness, a calmness, when the sun does set..XYZ, Example Exports as my Post Office Box 924 Yavatmal - 445001 INDIA.Ram is a very good student."
pin = []
ct = []
#for loading csv file into list
with open('pincode_final.csv',"r") as csvfile:
csv_f = csv.reader(csvfile)
@awg01
awg01 / cityNameFromCSV.py
Created June 26, 2019 09:35
I want to whether the cityname(from csv file) is present in given sentence.
import csv
from re import search
#example_sent2 = "Sunset is the time of day when our sky meets the outer space solar winds. There are blue, pink, and purple swirls, spinning and twisting, like clouds of balloons caught in a whirlwind. The sun moves slowly to hide behind the line of horizon, while the moon races to take its place in prominence atop the night sky. People slow to a crawl, entranced, fully forgetting the deeds that must still be done. There is a coolness, a calmness, when the sun does set..XYZ, Example Exports as my Post Office Box 924 Yavatmal - 445001 INDIA.Ram is a very good student."
pin = []
ct = []
#for loading csv file into list
with open('pincode_final.csv',"r") as csvfile:
csv_f = csv.reader(csvfile)