<?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>DEV Community: manulangat1</title>
    <description>The latest articles on DEV Community by manulangat1 (@manulangat1).</description>
    <link>https://dev.to/manulangat1</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%2F394039%2F13c1497e-9372-40e9-9173-bfa190fe43ee.jpeg</url>
      <title>DEV Community: manulangat1</title>
      <link>https://dev.to/manulangat1</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/manulangat1"/>
    <language>en</language>
    <item>
      <title>Manipulating arrays in javascript. </title>
      <dc:creator>manulangat1</dc:creator>
      <pubDate>Sun, 11 Apr 2021 10:03:05 +0000</pubDate>
      <link>https://dev.to/manulangat1/manipulating-arrays-in-javascript-2bk</link>
      <guid>https://dev.to/manulangat1/manipulating-arrays-in-javascript-2bk</guid>
      <description>&lt;p&gt;Hi guys, &lt;br&gt;
Today we are going to see ways in which arrays can be manipulated in javascript. We are going to focus on 4 main ways of doing that. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;PUSH . 
The push function appends data at the end of an array. Take an example.
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  var myArray = [] 
  myArray.push(1)
  console.log(myArray)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;We can also use the push() function to append more than one element into an array.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  var myArray = [] 
  myArray.push(1,2,3)
  console.log(myArray)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2 . Pop function. &lt;br&gt;
 The pop function is used to remove the last element of an array and return the removed element.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    var myArray = [1,2,3,4]
    var removedArray = myArray.pop()
    console.log(removedArray)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3 . Shift function. &lt;br&gt;
  The shift function is used to remove the first element of an array and returns the removed element.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    var myArray = [1,2,3,4]
    var removedArray = myArray.shift()
    console.log(removedArray)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;4 . Unshift function. &lt;br&gt;
The unshift function is used to add elements at the beginning of an array.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    var myArray = [1,2,3,4]
    myArray.unshift(0)
    console.log(myArray)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's all for today guys and I hope this short guide will help you understand the manipulation of arrays in javascript.&lt;/p&gt;

</description>
      <category>javascript</category>
    </item>
    <item>
      <title>Happy new year friends,</title>
      <dc:creator>manulangat1</dc:creator>
      <pubDate>Thu, 14 Jan 2021 18:41:52 +0000</pubDate>
      <link>https://dev.to/manulangat1/happy-new-year-friends-51k2</link>
      <guid>https://dev.to/manulangat1/happy-new-year-friends-51k2</guid>
      <description>&lt;p&gt;So, it has been a while since I last wrote something here and as we start the new year would like us to start by creating a fully functional microservice using Django, flask and react for the frontend.&lt;br&gt;
This will be a series that will begin today and we are going to cover all the nooks of the above tech.&lt;/p&gt;

&lt;p&gt;Happy hacking.&lt;/p&gt;

</description>
      <category>microservices</category>
      <category>python</category>
      <category>django</category>
      <category>flask</category>
    </item>
    <item>
      <title>Starting out  an async python  web scraping microservice,nodejs REST API microservice and react</title>
      <dc:creator>manulangat1</dc:creator>
      <pubDate>Mon, 02 Nov 2020 18:24:47 +0000</pubDate>
      <link>https://dev.to/manulangat1/starting-out-an-async-python-web-scraping-microservice-nodejs-rest-api-microservice-and-react-76c</link>
      <guid>https://dev.to/manulangat1/starting-out-an-async-python-web-scraping-microservice-nodejs-rest-api-microservice-and-react-76c</guid>
      <description>&lt;p&gt;Hi guys,&lt;br&gt;
It has been really long since i posted here, so, i am soon starting a series where we are going to build an job applications web scraping service using python flask, nodejs and react. We will start tomorrow with the project set up and the project will go on for a week.&lt;/p&gt;

&lt;p&gt;Happy hacking guys and follow me to get the whole series as soon as it is posted.&lt;/p&gt;

</description>
      <category>react</category>
      <category>node</category>
      <category>express</category>
    </item>
    <item>
      <title>Has the graphql bug caught up with you yet?</title>
      <dc:creator>manulangat1</dc:creator>
      <pubDate>Sat, 25 Jul 2020 19:15:34 +0000</pubDate>
      <link>https://dev.to/manulangat1/has-the-graphql-bug-caught-up-with-you-yet-4hei</link>
      <guid>https://dev.to/manulangat1/has-the-graphql-bug-caught-up-with-you-yet-4hei</guid>
      <description>&lt;p&gt;Hello noobs, Lets start the graphql vs REST debate... Looking to hear from you...&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Visualizing insertion Sort in python using pygame</title>
      <dc:creator>manulangat1</dc:creator>
      <pubDate>Sat, 25 Jul 2020 17:22:36 +0000</pubDate>
      <link>https://dev.to/manulangat1/visualizing-insertion-sort-in-python-using-pygame-2d4h</link>
      <guid>https://dev.to/manulangat1/visualizing-insertion-sort-in-python-using-pygame-2d4h</guid>
      <description>&lt;p&gt;This is the second part of my series... Visualizing Sorting algorithms in python.&lt;br&gt;
In this second part, we are going to talk about insertion sort. This is a simple sorting algorithm that works like a deck of cards.&lt;/p&gt;

&lt;p&gt;Now to the juicy part. Head per to your terminal and navigate to your desired directory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd Desktop &amp;amp;&amp;amp; mkdir visuals &amp;amp;&amp;amp; cd visuals
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Once in the visuals directory, open vs code&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;code . 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Create and activate the virtual environment by&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python3 -m virtualenv venv &amp;amp;&amp;amp; source venv/bin/activate
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Install pygame using pip&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install pygame
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Create a file named insertion.py&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;touch insertion.py&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Now to the juicer part... Implementing the fleshy part&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import pygame
import random
pygame.init()
import numpy as np
win = pygame.display.set_mode((800,800))
pygame.display.set_caption("Bubble sort")
x,y = 40,40
width = 20 

height = [ np.unique(random.randint(0,600)) for i in range(30)]

run = True 

def show(height):
    for i in range(len(height)):
        pygame.draw.rect(win,(74,192,200),(x + 30 * i,y,width,height[i]))

while run:
    execute = False
    pygame.time.delay(10)
    keys = pygame.key.get_pressed()

    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            run = False
    if keys[pygame.K_SPACE]:
        execute = True 
    if execute == False:
        win.fill((0,0,0))
        show(height)
        pygame.display.update()
    else:
        for i in range(0,len(height)-1):
            while height[i] &amp;gt; height[i+1] and i &amp;gt;= 0:
                height[i],height[i+1] = height[i+1],height[i]
                i -= 1
                show(height)
                pygame.time.delay(50)
                pygame.display.update()
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;I do hope that you have learnt a thing or two today. Will truly appreciate if you, yes you follow me on Github &lt;a href="https://github.com/manulangat1"&gt;link&lt;/a&gt;&lt;br&gt;
I will honestly appreciate code reviews and constructive criticism, Till next time...&lt;/p&gt;

</description>
      <category>python</category>
      <category>pygame</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Visualizing Bubble sort algorithm in python using pygame.</title>
      <dc:creator>manulangat1</dc:creator>
      <pubDate>Sat, 25 Jul 2020 16:58:56 +0000</pubDate>
      <link>https://dev.to/manulangat1/visualizing-bubble-sort-algorithm-in-python-using-pygame-ich</link>
      <guid>https://dev.to/manulangat1/visualizing-bubble-sort-algorithm-in-python-using-pygame-ich</guid>
      <description>&lt;p&gt;Hello geeks, &lt;br&gt;
I presume that this is my second or third post on this forum, so I do apologize for any errors. &lt;/p&gt;

&lt;p&gt;Today we are going to visualize &lt;strong&gt;bubble sort algorithm&lt;/strong&gt; in Python. Bubble sort is the simplest sorting algorithm that works by swapping adjacent elements in a list if they are not in the correct order. The time complexity of the bubble sort algorithm is &lt;strong&gt;O(n2)&lt;/strong&gt; and the space complexity for Bubble sort is &lt;strong&gt;O(1)&lt;/strong&gt; because only a single additional memory space is required.&lt;/p&gt;

&lt;p&gt;Enough about the wordy part of it. Let us get into the tasty stuff...&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ETjyH6YT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/0cna4udrtynhqcnibs4a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ETjyH6YT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/0cna4udrtynhqcnibs4a.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And more...&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--AGT6EF8X--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/eyrdzbinz6xg4ljb0rhk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--AGT6EF8X--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/eyrdzbinz6xg4ljb0rhk.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I am sorry I didn't add comments to my code. Also, code reviews are welcome and constructive criticism.&lt;br&gt;
You can follow me in Github through this link &lt;a href="https://github.com/manulangat1"&gt;link&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>pygame</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Web scraping using Python, requests and beautiful soup.</title>
      <dc:creator>manulangat1</dc:creator>
      <pubDate>Fri, 26 Jun 2020 17:29:41 +0000</pubDate>
      <link>https://dev.to/manulangat1/web-scraping-using-python-requests-and-beautiful-soup-2a44</link>
      <guid>https://dev.to/manulangat1/web-scraping-using-python-requests-and-beautiful-soup-2a44</guid>
      <description>&lt;p&gt;Hello, noobs, &lt;br&gt;
So this is my second post in this forum and we are going to learn how to scrape data from a website using &lt;strong&gt;Python,beautifulsoup4 and requests&lt;/strong&gt; in this series.&lt;/p&gt;

&lt;p&gt;I will presume that you are using a Unix based os for the purposes of this tutorial.&lt;br&gt;
Now heading onto the yummy part of it. We will start by creating a new directory,.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   cd Desktop &amp;amp;&amp;amp; mkdir webscraping &amp;amp;&amp;amp; cd webscraping
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;While still on your terminal, create a virtual environment, activate it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   python3 -m virtualenv venv &amp;amp;&amp;amp; source venv/bin/activate
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Now we install the libraries we need.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  pip install requests  beautifulsoup4 pandas
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Now we are all set up to go. In the webscraping folder that we had  created earlier create a file named &lt;strong&gt;app.py&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   touch app.py
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;In the file, import the modules that we need.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt; from bs4 import BeautifulSoup
 import requests
 import pandas as pd
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;We will use century21 as our data source for the purpose of this tutorial. we will now call the URL&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;url = "https://www.century21.com/real-estate/rock-springs-wy/LCWYROCKSPRINGS/?ty=0"

response = requests.get(url)
c = response.content
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;We can now start our webscraping part.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;soup = BeautifulSoup(c,'html.parser')
all = (I for I in soup.find_all('div',{'class':'infinite-item'} )

d = {}
l = []
for i in all:
    price = i.find('a',{'class':'listing-price'},text=True)
    if price:
        d['price'] = price.get_text().strip()
    beds= i.find('div',{'class':'property-beds'})
    if beds:
        d['beds'] = beds.get_text().strip()
    bath = i.find('div',{'class':'property-baths'})
    if bath:
        d['bath'] = bath.get_text().strip()

    address = i.find('div',{'class':'property-address'})
    if address:
        d['address'] = address.get_text().strip()

    address_city = i.find('div',{'class':'property-address-city'})
    if address_city:
        d['address_city'] = address_city.get_text().strip()
    l.append(d)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;we can now save the data in a pandas data frame and a csv file&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;df = pd.DataFrame(l)
df.to_csv('Output.csv',mode='a',header='False'
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Hooray... You now have a working webscraping script that is functional.&lt;br&gt;
You can follow me on GitHub &lt;a href="https://github.com/manulangat1"&gt;https://github.com/manulangat1&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Corrections and criticism are highly welcomed and appreciated.&lt;br&gt;
See you next time...&lt;/p&gt;

</description>
      <category>python</category>
    </item>
    <item>
      <title>Ecommerce website using Django for backend and React for frontend</title>
      <dc:creator>manulangat1</dc:creator>
      <pubDate>Fri, 26 Jun 2020 16:47:08 +0000</pubDate>
      <link>https://dev.to/manulangat1/ecommerce-website-using-django-for-backend-and-react-for-frontend-3iif</link>
      <guid>https://dev.to/manulangat1/ecommerce-website-using-django-for-backend-and-react-for-frontend-3iif</guid>
      <description>&lt;p&gt;Hello noobs, &lt;br&gt;
This is my first time posting to the forum, so pardon any mistakes in the post.&lt;br&gt;
As from tomorrow, I would start an eight-part series on building an e-commerce application using Django for the backend (and also Django rest framework) and React for the frontend.&lt;br&gt;
See you then.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  print("Happy hacking!!!!")
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Am sorry guys I could start the series due to personal reasons. But now we are good to go.&lt;/p&gt;

</description>
      <category>react</category>
      <category>python</category>
      <category>django</category>
      <category>redux</category>
    </item>
  </channel>
</rss>
