<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Vishal Dhapola</title>
    <description>The latest articles on Forem by Vishal Dhapola (@vd300).</description>
    <link>https://forem.com/vd300</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F759644%2Fb81bf9e9-498a-4f1b-b04f-fe1507a6bf0d.png</url>
      <title>Forem: Vishal Dhapola</title>
      <link>https://forem.com/vd300</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/vd300"/>
    <language>en</language>
    <item>
      <title>simple restapi in go with post request</title>
      <dc:creator>Vishal Dhapola</dc:creator>
      <pubDate>Sun, 09 Jan 2022 09:56:26 +0000</pubDate>
      <link>https://forem.com/vd300/simple-restapi-in-go-with-post-request-58jo</link>
      <guid>https://forem.com/vd300/simple-restapi-in-go-with-post-request-58jo</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package main

import (
    "net/http"

    "github.com/gin-gonic/gin"
)

type album struct {
    ID     string  `json:"id"`
    Title  string  `json:"title"`
    Artist string  `json:"artist"`
    Price  float64 `json:"price"`
}

func postAlbums(c *gin.Context) { // postAlbums adds an album from JSON received in the request body.
    var newAlbum album

    // Call BindJSON to bind the received JSON to
    // newAlbum.
    if err := c.BindJSON(&amp;amp;newAlbum); err != nil {
        return
    }

    // Add the new album to the slice.
    albums = append(albums, newAlbum)
    c.IndentedJSON(http.StatusCreated, newAlbum)
}

func main() {
    // new_list := []string{}
    // fmt.Printf("%T\n", albums)
    // fmt.Printf("%T\n", new_list)
    router := gin.Default() //Default returns an Engine instance with the Logger and Recovery middleware already attached.
    router.GET("/albums", getAlbums)
    router.POST("/albums", postAlbums)
    router.Run("localhost:8000")
}

var albums = []album{
    {ID: "1", Title: "Blue Train", Artist: "John Coltrane", Price: 56.99},
    {ID: "2", Title: "Jeru", Artist: "Gerry Mulligan", Price: 17.99},
    {ID: "3", Title: "Sarah Vaughan and Clifford Brown", Artist: "Sarah Vaughan", Price: 39.99},
}

func getAlbums(c *gin.Context) { //gin.Context is the most important part of Gin.
    //It carries request details, validates and serializes JSON, and more.
    //(Despite the similar name, this is different from Go’s built-in context package.)
    c.IndentedJSON(http.StatusOK, albums) //Call Context.IndentedJSON to serialize the struct into JSON and add it to the response.
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>My first simple rest api using golang</title>
      <dc:creator>Vishal Dhapola</dc:creator>
      <pubDate>Sun, 09 Jan 2022 05:49:59 +0000</pubDate>
      <link>https://forem.com/vd300/my-first-simple-rest-api-using-golang-5d6c</link>
      <guid>https://forem.com/vd300/my-first-simple-rest-api-using-golang-5d6c</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package main

import (
    "net/http"

    "github.com/gin-gonic/gin"
)

type album struct {
    ID     string  `json:"id"`
    Title  string  `json:"title"`
    Artist string  `json:"artist"`
    Price  float64 `json:"price"`
}

func main() {
    // new_list := []string{}
    // fmt.Printf("%T\n", albums)
    // fmt.Printf("%T\n", new_list)
    router := gin.Default() //Default returns an Engine instance with the Logger and Recovery middleware already attached.
    router.GET("/albums", getAlbums)
    router.Run("localhost:8000")
}

var albums = []album{
    {ID: "1", Title: "Blue Train", Artist: "John Coltrane", Price: 56.99},
    {ID: "2", Title: "Jeru", Artist: "Gerry Mulligan", Price: 17.99},
    {ID: "3", Title: "Sarah Vaughan and Clifford Brown", Artist: "Sarah Vaughan", Price: 39.99},
}

func getAlbums(c *gin.Context) { //gin.Context is the most important part of Gin.
    //It carries request details, validates and serializes JSON, and more.
    //(Despite the similar name, this is different from Go’s built-in context package.)
    c.IndentedJSON(http.StatusOK, albums) //Call Context.IndentedJSON to serialize the struct into JSON and add it to the response.
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>go</category>
      <category>beginners</category>
      <category>restapi</category>
      <category>simplerestapi</category>
    </item>
    <item>
      <title>Python vs GO</title>
      <dc:creator>Vishal Dhapola</dc:creator>
      <pubDate>Sun, 19 Dec 2021 06:33:36 +0000</pubDate>
      <link>https://forem.com/vd300/python-vs-go-1e2m</link>
      <guid>https://forem.com/vd300/python-vs-go-1e2m</guid>
      <description>&lt;p&gt;&lt;a href="https://dev.to_url_"&gt;Go cheatsheet- https://devhints.io/go&lt;/a&gt;&lt;br&gt;
1.&lt;br&gt;
&lt;strong&gt;For loop in Go&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package main
import "fmt"
func main() {
   even_numbers := []int{}
   for i := 1; i &amp;lt;= 10; i++ {
      if i%2 == 0 {
         even_numbers = append(even_numbers, i)
      }
    }
   fmt.Println(even_numbers)
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;For loop in Python&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;even_numbers = []
for number in range(10):
   if number % 2 == 0:
      even_numbers.append(number)
print(even_numbers)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






</description>
    </item>
    <item>
      <title>My Interview Questions</title>
      <dc:creator>Vishal Dhapola</dc:creator>
      <pubDate>Mon, 22 Nov 2021 12:46:21 +0000</pubDate>
      <link>https://forem.com/vd300/my-interview-question-2oia</link>
      <guid>https://forem.com/vd300/my-interview-question-2oia</guid>
      <description>&lt;p&gt;1.What is session?&lt;br&gt;
2.What is list and list comprehension?&lt;br&gt;
3.What is global variables.Differnce between global and local variable.&lt;br&gt;
4.What is the difference between xrange and range?&lt;br&gt;
5.What python version has xrange?&lt;br&gt;
6.What is dataframe?&lt;br&gt;
7.In python, how to connect to mysql database?&lt;br&gt;
8.If a column value is greater than the column size, what type of &lt;br&gt;
  error do you get in python and how do you identify/resolve it? &lt;/p&gt;

&lt;p&gt;9.Explain Django Architecture?Features of Django?Why Use Django?Disadvantage of Django?&lt;br&gt;
10.Explain the Django project directory structure?&lt;br&gt;
11.What are models in Django?&lt;br&gt;
12.What is admin in Django?&lt;br&gt;
13.What are views in Django?What is signals?Describe two important signals modules?&lt;br&gt;
14.What is Django ORM?&lt;br&gt;
15.Difference between Django and Flask?&lt;br&gt;
16.How to run a django project?&lt;br&gt;
17.What will be the ouput--&amp;gt;&lt;br&gt;
    def fast(a=[]):&lt;br&gt;
        a.append(1)&lt;br&gt;
        return a&lt;br&gt;
    print(fast)&lt;br&gt;
    print(fast)&lt;/p&gt;

&lt;p&gt;18.Write a code to display the sum of all integer from 1 to 10.&lt;br&gt;
19.What is &lt;strong&gt;init&lt;/strong&gt;?&lt;br&gt;
20.What is pickeling and pep8?&lt;br&gt;
21.How do you convert a string to Hex,Int,String?&lt;br&gt;
22.How to change the attribute of a class at runtime?&lt;br&gt;
23.What is slicing?&lt;br&gt;
24.Differnce between list and tuples?&lt;br&gt;
25.Mutable and Immutable datatypes in python?&lt;br&gt;
26.What are packages and modules?&lt;br&gt;
27.Can a package contains modules?&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Data Analytics Question&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DnKU0efz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gf32x2q7v8jbov8p3jfb.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DnKU0efz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gf32x2q7v8jbov8p3jfb.jpg" alt="Input.csv" width="508" height="714"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;1.Add new column 'Flag_A_B'. Values in the new column:&lt;br&gt;
    if A is greater than B ,then 1&lt;br&gt;
    otherwise 0&lt;br&gt;
*Add new column 'AVG_C'. Values in the new column:&lt;br&gt;
    Average of previous 5 seconds values of C. &lt;br&gt;
    for example, if the previous 5 seconds values of C is 10,20,30,40,50, then the current value in AVG_C is (10+20+30+40+50)/5=30&lt;/p&gt;

&lt;p&gt;*Add new column 'FLAG_C'. Values in the new column:&lt;br&gt;
    if current value in C is within +-10% of current value in 'AVG_C', 1&lt;br&gt;
    if current value in C is below -10% of current value in 'AVG_C', 0&lt;br&gt;
    if current value in C is above +10% of current value in 'AVG_C',2&lt;/p&gt;

&lt;p&gt;2.There are quick ways to show the basic statistics of each column, like mean, max, min, median. Please show us one.&lt;/p&gt;

&lt;p&gt;==========================Part2 =============================&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What is constrains in sql?&lt;/li&gt;
&lt;li&gt;Difference between primary key, unique key ,foreign key.&lt;/li&gt;
&lt;li&gt;Name and explain different types of join?&lt;/li&gt;
&lt;li&gt;Explain views and procedure.&lt;/li&gt;
&lt;li&gt;What is polymorphism,inheritance and abstract method?&lt;/li&gt;
&lt;li&gt;What are magic methods?&lt;/li&gt;
&lt;li&gt;What are generators in python?Explain Memory management in python.&lt;/li&gt;
&lt;li&gt;How to merge two dictionaries with the same key.&lt;/li&gt;
&lt;li&gt;What is scope in python?&lt;/li&gt;
&lt;li&gt;What is pass and continue?Difference between the same.&lt;/li&gt;
&lt;li&gt;What is access modifiers in python?&lt;/li&gt;
&lt;li&gt;What is constructor?&lt;/li&gt;
&lt;li&gt;What is self in python?&lt;/li&gt;
&lt;li&gt;What is decorators?Give an example.&lt;/li&gt;
&lt;li&gt;What is lamda?&lt;/li&gt;
&lt;li&gt;Different types of copies?Difference between shallow copy and deep copy
17.Difference Between xrange and range?&lt;/li&gt;
&lt;li&gt;Difference between count and len.&lt;/li&gt;
&lt;li&gt;What are .pyc files?&lt;/li&gt;
&lt;li&gt;What is GIL?
21.Find the median by merging two list.
22.Explain splitwise?Create an app similar to splitwise.&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>python</category>
      <category>beginners</category>
      <category>django</category>
      <category>career</category>
    </item>
  </channel>
</rss>
