<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Piyumika Sewwandi on Medium]]></title>
        <description><![CDATA[Stories by Piyumika Sewwandi on Medium]]></description>
        <link>https://medium.com/@piyumika546?source=rss-36c5179dcf53------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*IUh0YP3E3D7mA9NSRKLc5w.jpeg</url>
            <title>Stories by Piyumika Sewwandi on Medium</title>
            <link>https://medium.com/@piyumika546?source=rss-36c5179dcf53------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 16:05:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@piyumika546/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to connect MySQL databases in Weka using MySQL jdbc connector?]]></title>
            <link>https://piyumika546.medium.com/how-to-connect-mysql-databases-in-weka-using-mysql-jdbc-connector-4dbb60149577?source=rss-36c5179dcf53------2</link>
            <guid isPermaLink="false">https://medium.com/p/4dbb60149577</guid>
            <category><![CDATA[mysql]]></category>
            <category><![CDATA[database-connection]]></category>
            <category><![CDATA[mysql-jdbc-connector]]></category>
            <category><![CDATA[weka]]></category>
            <category><![CDATA[phpmyadmin]]></category>
            <dc:creator><![CDATA[Piyumika Sewwandi]]></dc:creator>
            <pubDate>Fri, 22 May 2020 20:21:14 GMT</pubDate>
            <atom:updated>2020-05-22T20:21:14.285Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*hvmhzqwZFN_jtUi3tbUtdg.jpeg" /></figure><p>In this tutorial I’m going to explain how to connect MySql databases to Weka application. As pre-requisites</p><ul><li>you need to have installed MySQL on windows or you may use PHPMyAdmin.</li><li>Download and install weka machine learning tool version 3.6 or higher using <a href="https://waikato.github.io/weka-wiki/downloading_weka/">https://waikato.github.io/weka-wiki/downloading_weka/</a></li><li>Download MySQL-connector-java-5.1.49 or higher version according to your weka tool’s version using <a href="https://dev.mysql.com/downloads/connector/j/5.1.html">https://dev.mysql.com/downloads/connector/j/5.1.html</a></li></ul><p>Follow the below steps to set the connection string to the MySQL database in weka on Windows OS.</p><blockquote><strong>Step 1</strong></blockquote><p>Find and copy mysql-connector-java-5.1.49-bin jar file from where you have downloaded mysql-connector-java-5.1.49 file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*2erdPpxu2w54MZNNEqdnsw.png" /><figcaption>mysql-connector-java-5.1.49-bin jar file</figcaption></figure><p>Then paste it inside the folder where you have installed weka. In my case it is in <strong><em>C:\Program Files\Weka-3–9–4.</em></strong></p><blockquote><strong>Step 2</strong></blockquote><p>Locate your RunWeka.init file inside the weka installed folder and open it from a notepad++/any editor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/659/1*7rTmjdxHIfz3BLwFYnIu0A.jpeg" /><figcaption>RunWeka.init file</figcaption></figure><p>Then add “<strong>cp=%CLASSPATH%;C:\Program Files\Weka-3–9–4\mysql-connector-java-5.1.49-bin”</strong> at the end of the RunWeka.init file and save it. This path can be varied according to the locations of your weka folder. You should enter your path to mysql-conectivity jar file which you pasted in step1.</p><blockquote><strong>Step 3</strong></blockquote><p>Then go to This PC → Properties → Advanced System settings → Environment variables → System variables</p><p>Then click on New button under system variables as in the below image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RGHwF4_y3WR2LURw9m1d9A.jpeg" /><figcaption>System variables</figcaption></figure><p>Then give “CLASSPATH” as the variable name and browse the mysql-connector-java-5.1.49-bin .jar<strong> </strong>file inside Weka installed folder and give that path as the variable value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/1*ItfJ7dlrvurHMXUBKtYdzw.jpeg" /></figure><blockquote><strong>Step 4</strong></blockquote><p>4th step is editing the props.mysql file. Again locate to the folder where Weka installed and you will find weka.jar file inside it. Extract weka.jar file into the same folder by giving extract here option. Now you can see a new weka folder inside Weka.3.9.4 folder. Then go inside the weka → experiment.</p><p>Now you will see a file called “<strong><em>DatabaseUtils.props.mysql</em></strong>”.Copy this file and paste it in C:\Users\UsersName\wekafiles\props folder. This is the Weka current working folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*_N8eNNU-DLz3izPp4WsVYw.jpeg" /></figure><p>Then open <em>DatabaseUtils.props.mysql</em> using a notepad editor and change the jdbc URL like below</p><p><strong><em># database URL<br>jdbcURL=jdbc:mysql://localhost:3306/DatabaseName</em></strong></p><p>You should give your database name in your MySql server and save the edited file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*pVsFG9G6ZuseORz_FUsAFQ.jpeg" /></figure><blockquote><strong>Step 5</strong></blockquote><p>Now open up the weka application and go to Explorer → OpenDB(under preprocess). Then you will get the SQL Viewer window and set the URL as <strong><em>jdbcURL=jdbc:mysql://localhost:3306/DatabaseName </em></strong>as you are given in the above step. Then click the man icon and give the URL to the database as previously and give username and password accordingly. In my case I only have the username (root). Next click OK.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/1*BxeYJbKm2x-BB_s9bqunOw.jpeg" /></figure><p>Then click the plug 🔌 icon and set the connection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*sgJYN6DA4V5RkgPWx6P-ag.jpeg" /></figure><p>In the above picture you can see the connection has successfully set. Now you can write queries as in the below picture and using the execute button you can view the result in the result pane.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/765/1*bOm0YE82l4rheKwwXSaiHg.jpeg" /><figcaption>Resulted query data</figcaption></figure><p>If you are using phpMyAdmin don’t forget to start the server using XAMPP. That&#39;s how we connect the Weka application to our MySql databases. Feel free to ask questions on this. Thank you for reading. Put clap if you feel this is worthy.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4dbb60149577" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting started with Image Processing]]></title>
            <link>https://piyumika546.medium.com/getting-started-with-image-processing-98cda49149db?source=rss-36c5179dcf53------2</link>
            <guid isPermaLink="false">https://medium.com/p/98cda49149db</guid>
            <category><![CDATA[image-recognition]]></category>
            <category><![CDATA[opencv]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[digital-image-processing]]></category>
            <category><![CDATA[image-processing]]></category>
            <dc:creator><![CDATA[Piyumika Sewwandi]]></dc:creator>
            <pubDate>Mon, 20 Apr 2020 08:59:27 GMT</pubDate>
            <atom:updated>2020-04-20T08:59:27.942Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/849/1*J1Rw3cercQfx6VenK3Nsfw.jpeg" /></figure><blockquote><strong>Image</strong></blockquote><p>In the context of signal processing, an image is a distributed amplitude of color(s). Images are a two-dimensional representation of the visible light spectrum. And the visible light spectrum is just a part of the electromagnetic spectrum lying there between the infrared and ultraviolet spectrum.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PNHsEK18OblJTKwFt8QfFw.jpeg" /><figcaption>Electro Magnetic Spectrum</figcaption></figure><blockquote><strong>How are images formed?</strong></blockquote><p>An image is formed on the retina with light rays converging most at the cornea and upon entering and exiting the lens. Rays from the top and bottom of the object are traced and produce an inverted real image on the retina. The distance to the object is drawn smaller than the scale.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/1*SaVj_xRk79MJWyfN41Uz2g.jpeg" /></figure><p>This is how our eyes work, using a barrier to block the most point of lights leaving a small opening through which light can pass it is called as <strong>aperture</strong>, and it forms a much-focused image and is a working model for a pinhole camera, but there is a problem in a pinhole camera, that same amount of light will be entering the aperture, which could not be suitable for the film or image formed also we can’t get a focused image, so as to focus the image we need to move the film back and forth, but this is problematic in many situations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/296/1*9Dkoz-BptXa-SegnqV5cIQ.png" /><figcaption>Image formation with the help of lenses</figcaption></figure><blockquote><strong>Digital Image</strong></blockquote><p>Image composed of picture elements, also known as <em>pixels</em>, each with <em>finite</em>, <em>discrete quantities</em> of numeric representation for its intensity or gray level that is an output from its two-dimensional functions fed as input by its spatial coordinates denoted with <em>x</em>, <em>y</em> on the x-axis and y-axis, respectively. Depending on whether the image resolution is fixed, it may be of vector or raster type. By itself, the term “digital image” usually refers to raster images or bitmapped images (as opposed to vector images)</p><blockquote><strong>Machine vision</strong> (MV)</blockquote><p>It’s the technology and methods used to provide imaging-based automatic inspection and analysis for such applications as automatic inspection, process control, and robot guidance, usually in industry. Machine vision refers to many technologies, software and hardware products, integrated systems, actions, methods, and expertise. Machine vision as a systems engineering discipline can be considered distinct from computer vision, a form of computer science. It attempts to integrate existing technologies in new ways and apply them to solve real-world problems. The term is the prevalent one for these functions in industrial automation environments but is also used for these functions in other environments such as security and vehicle guidance.</p><p>The Primary Objective of Image Processing is to enhance the appearance of pictures/photographs (images) using digital computers. After an image is acquired, it is processed. Multiple stages of processing are generally used in a sequence that ends up as the desired result. Machine vision image processing methods include;</p><ul><li>Stitching/Registration: Combining of adjacent 2D or 3D images.</li><li>Filtering (e.g. morphological filtering)</li><li>Thresholding: Thresholding starts with setting or determining a gray value that will be useful for the following steps. The value is then used to separate portions of the image, and sometimes to transform each portion of the image to simply black and white based on whether it is below or above that grayscale value.</li><li>Pixel counting: counts the number of light or dark pixels</li><li>Segmentation: Partitioning a digital image into multiple segments to simplify and/or change the representation of an image into something that is more meaningful and easier to analyze.</li><li>Edge detection: finding object edges</li><li>Color Analysis: Identify parts, products, and items using color, assess quality from color, and isolate features using color.[6]</li><li>Blob detection and extraction: inspecting an image for discrete blobs of connected pixels (e.g. a black hole in a grey object) as image landmarks.</li><li>Neural net / deep learning/machine learning processing: weighted and self-training multi-variable decision making Circa 2019 there is a large expansion of this, using deep learning and machine learning to significantly expand machine vision capabilities.</li><li>Pattern recognition including template matching. Finding, matching, and/or counting specific patterns. This may include the location of an object that may be rotated, partially hidden by another object, or varying in size.</li><li>Barcode, Data Matrix and “2D barcode” reading.</li><li>Optical character recognition: automated reading of text such as serial numbers.</li><li>Gauging/Metrology: measurement of object dimensions (e.g. in pixels, inches or millimeters)</li></ul><blockquote><strong>Sampling and Quantization</strong></blockquote><p>To be suitable for computer processing, an image function f(x,y) must be digitized both spatially and in amplitude. Digitization of the spatial coordinates (x,y) is called image sampling, and the amplitude digitization is called grey-level quantization. Image sampling creates a grid of squares which are called pixels (picture element). Each pixel will be assigned an integer value (grey-level) depending on its brightness. Hence, a digital image is represented by a two-dimensional array of grey-levels.</p><blockquote><strong>How your computer stores images</strong></blockquote><p>You may have heard of various image formats like.PNG, .JPEG and etc. all of these are a digital representation of our analog world, computers do it by translating the image into digital code for storage and then interpret the file back into an image for display. But at the basics, they use a common platform for storing the images, and same is true for the OpenCV.</p><blockquote><strong>RGB Model</strong></blockquote><p>A color perceived by the human eye can be defined by a linear combination of three primary colors red, green and blue. It is possible to construct ( almost) all visible colors by combining these three primary colors because the human eye has only three different color receptors, each of them sensible to one of the three colors. Different combinations in the simulation of the receptors enable the human eye to distinguish approximately 350,000 colors. An RGB color image is a multi-spectral image with one band for each color red, green and blue, thus producing a weighted combination of the three primary colors for each pixel.</p><p>OpenCV uses RGB (red, green and blue) color space by default for its images, where each pixel coordinate (x, y) contains 3 values ranging for intensities in an 8-bit form i.e. (0–255). Mixing different intensities of each color gives us the full spectrum, that’s why in painting or art these three colors are regarded as primary colors and all others as secondary because most of the secondary colors can be formed by primary colors. Like for yellow, we have the following values: Red — 255; Green — 255; Blue — 0. Now the images are stored in multi-dimensional arrays. In programming, an array is a series of collections of objects. And here we deal with three types of arrays 1D, 2D, and 3D where ‘D’ stands for dimensions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/1*DfJQBBfMUDKhmIR7rNvrvQ.jpeg" /><figcaption>1,2, and 3-dimensional array</figcaption></figure><p><strong>Colored images are stored in three-dimensional arrays</strong>, where the third dimensions represent the RGB colors (which we will see later), and in together they form different intensities of pixels for an image, while the <strong>black &amp; white images are stored in two-dimensional arrays </strong>and also there are two types of black &amp; white images Greyscale and binary images.</p><p><strong>Greyscale images</strong> are formed from the shades of grey of a two-dimensional array [(0,255), (0,255)], while the <strong>binary images</strong> are of pixels either of black or white.</p><blockquote><strong>Why it is difficult for a machine to identify images</strong></blockquote><p>Computer vision is a challenging task in itself, you can yourself imagine how hard it is to give a machine a sense of vision, recognition, and identification. The following factors are there that make computer vision so hard.</p><ul><li>Camera sensor and lens limitations</li><li>Viewpoint variations</li><li>Changing lighting</li><li>Scaling</li><li>Occlusions</li><li>Object class variations</li><li>Ambiguous Images/Optical Illusions</li><li>Swathes of data</li><li>Inherent loss of information</li><li>Dealing with noise</li><li>Requirements for interpretation</li></ul><p>Hope this is useful 😃!! Put me a clap if this is interesting 👏.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=98cda49149db" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to send emails from Laravel? ]]></title>
            <link>https://piyumika546.medium.com/how-to-send-emails-from-laravel-d0d7364df4fb?source=rss-36c5179dcf53------2</link>
            <guid isPermaLink="false">https://medium.com/p/d0d7364df4fb</guid>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[laravelemail]]></category>
            <category><![CDATA[email]]></category>
            <category><![CDATA[mailtrap]]></category>
            <category><![CDATA[implementation]]></category>
            <dc:creator><![CDATA[Piyumika Sewwandi]]></dc:creator>
            <pubDate>Thu, 12 Mar 2020 09:58:16 GMT</pubDate>
            <atom:updated>2020-03-16T06:10:32.509Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MQ_-zHLdS8j8F6DT.jpg" /></figure><p>This post is about how to send emails from Laravel in an easy way.</p><h3>step 1</h3><p>First, you have to create a view in your laravel project for the email message. I will create a view file in <strong>resources/views/mail.blade.php</strong> in my project and paste the following piece of line or put what you want to send as the mail.</p><p>This is a test mail</p><h3>step 2</h3><p>Then create the controller class and method for your emailing function. You can customize this as you wish. Run the following command on your project terminal.</p><p><strong>php artisan make:controller mailController</strong></p><p>Then add a mail provider in your controller as follows.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1ab663ed26548acfb402e7b85e1b2a5d/href">https://medium.com/media/1ab663ed26548acfb402e7b85e1b2a5d/href</a></iframe><h3>step 3</h3><p>Replace the sender and user emails as you want. It’s better to try this using <a href="https://mailtrap.io/">https://mailtrap.io</a> .</p><p>Now you have to configure <strong>.env</strong> file as below.</p><p>MAIL_DRIVER=smtp<br>MAIL_HOST=smtp.mailtrap.io<br>MAIL_PORT=465<br>MAIL_USERNAME=mailtrap username<br>MAIL_PASSWORD=mailtrap password<br>MAIL_ENCRYPTION=null</p><p>for the demonstration, I have used mailtrap.io credentials. Using mailtrap you can view, test and share emails within your application. It gives you the configuration details. copy paste those details as in your mailtrap to your .env file as above. If you are using your current email then configure .env file as below</p><p>MAIL_DRIVER=smtp<br>MAIL_HOST=smtp.gmail.com<br>MAIL_PORT=587<br><a href="/service/mailto:MAIL_USERNAME=username@gmail.com">MAIL_USERNAME=username@gmail.com</a><br>MAIL_PASSWORD=yourpassword<br>MAIL_ENCRYPTION=tls</p><h3>step 4</h3><p>Then you have to create the route for the email.blade.php. Go to <strong>routes/web.php</strong> and add the below part of the code.</p><p>Route::get(‘send’,’mailController@send’);</p><h3>step 5</h3><p>Now you can run the command in your terminal</p><p>php artisan serve</p><h3>step 6</h3><p>If you have used your real email account details for the .env configuration and if it gives you an error in email’s security then go to your email and click the button to allow for less secure apps. Then stop the terminal(ctrl+c) and again run the project(php artisan serve). Then probably you will solve the problems.</p><p>When you want to send an email to custom email according to the database or user inputs simply use the following structure of code.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f9fcc2575084335a22fdf8c115fa6315/href">https://medium.com/media/f9fcc2575084335a22fdf8c115fa6315/href</a></iframe><p>Since we are passing as an array containing the user key in the example code, we could display the user’s name within our e-mail view using the following PHP code.</p><p>(in mail.blade.php file)</p><pre>&lt;?php echo $user-&gt;name; ?&gt;</pre><p>When you want to display the message in Html format replace ‘text’ with ‘Html’</p><pre><strong>..</strong></pre><pre><strong>public function send(){</strong></pre><pre><strong>Mail:: send([&#39;html&#39;=&gt;&#39;mail&#39;],[&#39;name&#39;=&gt;&#39;piyumikablog&#39;],function($message)..<br>..</strong></pre><p>Now all the things are done. After doing all the above, you can see the email preview below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*kOUxTGdb3YH8mOjaLmRDkg.png" /><figcaption>preview of the mail in mailtrap</figcaption></figure><p>clap 👏 this story if you feel worthy and feel free to add your comments. 💻 💭 ⭐️</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d0d7364df4fb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to implement a Laravel 5.5 Rating System?]]></title>
            <link>https://piyumika546.medium.com/how-to-implement-a-laravel-5-5-rating-system-30c401c90a73?source=rss-36c5179dcf53------2</link>
            <guid isPermaLink="false">https://medium.com/p/30c401c90a73</guid>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[implementation]]></category>
            <category><![CDATA[star-rating]]></category>
            <category><![CDATA[rating-system]]></category>
            <category><![CDATA[composer]]></category>
            <dc:creator><![CDATA[Piyumika Sewwandi]]></dc:creator>
            <pubDate>Thu, 27 Feb 2020 08:42:08 GMT</pubDate>
            <atom:updated>2020-02-27T08:46:54.779Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/542/1*DL5oHZ4fwu9KmxdM5yz22Q.jpeg" /><figcaption>Laravel 5</figcaption></figure><p>Here I will show you how to build a star-rating system in your laravel 5.5 web application. In this example, I have installed a laravel ratable composer package and created posts table in PHP, my admin. So you have to follow the below simple steps and you will get a preview as the screenshots at the end of this page.</p><h3>step 1 (install laravel 5.+ application)</h3><p>first, you have to install the laravel 5.5 application. You can install laravel via laravel installer or via laravel create- project.</p><ul><li><strong>via laravel installer</strong></li></ul><p>first, download the laravel installer using the composer. Using</p><p>composer global require laravel/installer</p><p>Now you can create the project using the below command</p><pre>laravel new blog</pre><ul><li><strong>via Composer create-project</strong></li></ul><p>Open your terminal and run below command. It will create a new project called a blog</p><pre>composer create-project --prefer-dist laravel/laravel blog</pre><p>now run the below command on your terminal to start a development server at <a href="http://localhost:8000/">http://localhost:8000</a></p><pre>php artisan serve</pre><h3>step 2 (install composer rateable package)</h3><p>Now install composer rateable package to your project using bellow command.</p><pre>composer require  willvincent/laravel-rateable</pre><p>After that, you have to add the following provider into providers&#39; array of the configuration file in <strong>config/app.php</strong>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c18eeb6b5d6957c5a439df360aca7d55/href">https://medium.com/media/c18eeb6b5d6957c5a439df360aca7d55/href</a></iframe><p>After the rateable package correctly installed we need to generate the migration by running the following command on the terminal.</p><pre>PHP artisan rateable: migration</pre><p>Next, require to run the newly generated migration by using the following command.</p><pre>PHP artisan migrate</pre><h3>step 3 (Generate default auth)</h3><p>Next, create the default auth using the below command.</p><pre>PHP artisan make: auth</pre><h3>step 4 (Create posts table and model)</h3><p>For the next step, we should create a posts table using laravel 5.+ PHP artisan command.</p><pre>php artisan make:migration create_posts_table</pre><p>After the above command ran, we will find one file in the following path <strong>database/migrations</strong> and you have to put bellow code in your migration file to create posts table.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9c79f2af737364fdcf60e3addfcfa093/href">https://medium.com/media/9c79f2af737364fdcf60e3addfcfa093/href</a></iframe><p>important:- Do not keep any space at the top. The first line must be &lt;? PHP. Next, you need to create a model for the ‘posts’ table. Just run the below command</p><pre>php artisan make:model Post</pre><p>After running the above command you will see <strong>app/Post.php</strong> and put below code in Post.php file.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b17f2f32dc14fbaa74c6d8673b5f1ad0/href">https://medium.com/media/b17f2f32dc14fbaa74c6d8673b5f1ad0/href</a></iframe><h3>step 5(Create a controller method)</h3><p>In this step we will create three methods called rate(),ratings(),show() in-home controller. But you can add these methods anywhere according to your requirements.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a35133b2f31f0d44d30b1872423d890e/href">https://medium.com/media/a35133b2f31f0d44d30b1872423d890e/href</a></iframe><h3>step 6(Create blade files)</h3><p>Let’s create two blade files, one to make view page for rating and another one for listing average rating for all posts.</p><ul><li>create a blade file in <strong>resources/views/posts.blade.php</strong></li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d7057e98b260c88247f0f569b3157229/href">https://medium.com/media/d7057e98b260c88247f0f569b3157229/href</a></iframe><ul><li>Next, create a blade file in <strong>resources/views/postsShow.blade.php</strong></li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/05771b81abbfa54b0685a84fbc132b77/href">https://medium.com/media/05771b81abbfa54b0685a84fbc132b77/href</a></iframe><h3>step 7(Create new routes)</h3><p>The next step is adding routes to<strong> routes/web.php</strong> file. Add the following routes to that file.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7851c8461ab3d4737a31ac02d4e0743a/href">https://medium.com/media/7851c8461ab3d4737a31ac02d4e0743a/href</a></iframe><h3>step 8(Create CSS file)</h3><p>The next step is adding CSS files. Add the following CSS file links to the <strong>resources/views/layouts/app.blade.php</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d0c459390adb4c9dc24e4b124e265f90/href">https://medium.com/media/d0c459390adb4c9dc24e4b124e265f90/href</a></iframe><p>Use <a href="http://127.0.0.1:8000/posts/1"><strong>http://127.0.0.1:8000/posts/1</strong></a><strong> </strong>to view the <strong>postsShow.blade.php</strong> after login to the application. Then you can view the<strong> postsShow.blade.php</strong> as below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*in_4e3kuBLsCzXwt.png" /></figure><p>Now we have done all the things…After doing all these you can see the post table as below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/0*zrB2VskmwgEr679H.png" /></figure><p>When you submit a rate it will automatically render to the posts.blade.php view file. It will looks like below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vige_la0ql8QvZsS.png" /></figure><p>Put a clap 👏 if you feel this worth and comment 📝below your suggestions and your questions. Thank you.!!!! 😃 ❤️</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=30c401c90a73" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HTML 5 Interview Questions and Answers ]]></title>
            <link>https://piyumika546.medium.com/html-5-interview-questions-and-answers-79f4674e0eaa?source=rss-36c5179dcf53------2</link>
            <guid isPermaLink="false">https://medium.com/p/79f4674e0eaa</guid>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[answers]]></category>
            <category><![CDATA[html5-development]]></category>
            <category><![CDATA[html]]></category>
            <category><![CDATA[questions]]></category>
            <dc:creator><![CDATA[Piyumika Sewwandi]]></dc:creator>
            <pubDate>Mon, 17 Feb 2020 07:31:37 GMT</pubDate>
            <atom:updated>2020-02-17T07:31:37.516Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*CeBT7xdl7gKz4hO96JMNvg.png" /></figure><p>In this story, I have included 30 questions and their answers on HTML 5.</p><ol><li>What is HTML5? Define its purpose as well?</li></ol><ul><li><em>HTML is the short form for HyperText Markup Language and with the release of its’ latest version HTML5 is used diversely in crafting animated and beautiful websites by creating a web layout of amazing user experience(UX).</em></li></ul><p>2. What is the correct syntax for Doctype in HTML 5?</p><ul><li><em>The latest syntax is &lt;!DOCTYPE&gt;.its, not an HTML tag it instructs the browser about the version of the HTML being used.</em></li></ul><p>3. Explain the meaning of the term ‘HTML attributes’?</p><ul><li><em>These are the parts of the tags that give them context and purpose of their meaning like align attribute for &lt;p&gt; tag in HTML. Similarly, there are some global attributes such as class, style, id which can be used on all tags directly.</em></li></ul><p>4. What are semantic elements?</p><ul><li><em>Semantic elements are those which clearly defines their own meaning with only like &lt;form&gt;, &lt;table&gt;, &lt;p&gt;, &lt;ul&gt; , &lt;address&gt;, &lt;code&gt;. While nearly every HTML4 and HTML5 tags have a semantic meaning, some tags are primarily semantic. Examples of non-semantic elements are &lt;</em><em>div&gt; and &lt;</em><em>span&gt;. These tags don&#39;t tell the computer anything about the meaning of the contents of the element.</em></li></ul><p>5. Is HTML5 case — sensitive?</p><ul><li><em>No. HTML tags are not case sensitive but the recommended standard is lowercase.</em></li></ul><p>6. Name a few new HTML 5 tags that will form the core for present and future modern layouts?</p><ul><li><em>Few new elements and tags that will be found in all modern layouts are &lt;header&gt; , &lt;footer&gt; , &lt;section&gt; , &lt;nav&gt; , &lt;article&gt; . these are some tags found in almost all the never version of themes , templates and web layouts.</em></li></ul><p>7. Explain the benefits of using HTML5 as opposed to an earlier version of HTML.</p><p><em>HTML5 has made direct functionalities and provides access for a lot of things that were before could only be used with 3rd party plugins or separate programs.</em></p><ul><li><em>New semantic elements that are purposefully made for their name use like &lt;header&gt; for header section, &lt;footer&gt; for footer section and other &lt;nav&gt;, &lt;article&gt;, &lt;section&gt; and so on.</em></li><li><em>Improved javascript API for geolocation, drag and drop and media APIs.</em></li><li><em>Support for audio with &lt;audio&gt; tag, video with &lt;video&gt; tag and &lt;canvas&gt; tag for embedding graphics directly into HTML5.</em></li><li><em>Enhanced support for multi-platform accessibility.</em></li><li><em>New form elements (&lt;time&gt;, &lt;url&gt; etc) and smooth validation process.</em></li></ul><p>8. What are the differences between inline and block elements?</p><ul><li><em>Inline elements take only the space in their line with no margine-padding like &lt;a&gt;, &lt;hr&gt;,&lt;span&gt; etc. whereas block elements block the whole area once placed in the html layout like &lt;div&gt;, &lt;h1&gt; ,&lt;p&gt; etc.</em></li></ul><p>9. Define the data — attribute in the current form of HTML5?</p><ul><li><em>Data attributes in HTML5 are used to embed custom data to an element that is quite helpful in developing Single Page Web Applications in modern web development.</em></li></ul><p>10. How you will explain the datalist element in HTML5?</p><ul><li><em>The &lt;datalist&gt; tag is used to provide an “autocomplete” feature on &lt;input&gt; elements. Users will see a drop-down list of pre-defined options as they input data</em>.</li></ul><p>11. Can you link an image with a webpage? Is it possible? If possible please explain in detail.</p><ul><li><em>Linking image with a webpage is done by placing the &lt;img&gt; tag inside &lt;a&gt; and closing the tags accordingly within. The source of the image is defined with the src attribute. we can use the &lt;alt&gt; attribute to display something whenever the source cannot found by the browser.</em></li></ul><p>12. How can differentiate between &lt;article&gt; and &lt;section&gt; tags?</p><ul><li><em>&lt;article&gt; defines a document whereas &lt;section&gt; is part of the page. Both can be used inside each other as the conditions ask for it with the purposely defined structure in the web layout.</em></li></ul><p>13. What are web workers?</p><ul><li><em>These are just Javascript files that run in the background.</em></li></ul><p>14. Explain the media tags associated with HTML5?</p><ul><li><em>&lt;audio&gt; and &lt;video&gt; tags are the new addition in the HTML5 that requires specific JS library if additional required.</em></li></ul><p>15. Are we allowed to multiple uses of tags like &lt;header&gt;, &lt;footer&gt; in the information of the web layouts of the designing?</p><ul><li><em>Yes, these two tags &lt;header&gt;, &lt;footer&gt; have been created to use them multiple times for every part of the body(section). Every section can have their own &lt;header&gt; tag and &lt;footer&gt; tag marking their own identity in the HTML.</em></li></ul><p>16. Which tag has replaced most of the properties of flash in HTML5?</p><ul><li><em>&lt;canvas&gt; is the tag that has a lot of properties similar to flash directly integrated into HTML5 with access for drawing boxes, paths, circles, text and graphic images.</em></li></ul><p>17. Can we create new elements in HTML5? Are there any criteria for it?</p><ul><li><em>Yes, you can create new elements but using JavaScript with purposeful meaning.</em></li></ul><p>18. List a few tags that are now not supported with HTML 5?</p><ul><li><em>Some tags are either replaced with new tags or merged with some old ones and some replaced with CSS properties entirely. These are</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/893/1*eXopAKVYMXXk7Lo9ySYHOg.png" /></figure><p>19. Can you store data locally in HTML5?is there a possibility? Explain!</p><ul><li><em>Yes, HTML5 offers local storage within the user’s browser. Earlier this functionality was handled by cookies. Local storage through HTML5 is permanent until the user deletes it himself whereas Session storage is over as soon as you close the browser of your system.</em></li></ul><p>20. With the advent of HTML5, are there any changes in API use for HTML5 with web development?</p><ul><li><em>Yes, there are quite a few changes with API integration with HTML5 that are new and will make development easy like High-Resolution Time API, Media API, Text Track API, User Timing API, Data Transfer API, Command API, History API creating web environment for future.</em></li></ul><p>21. What is the default Browser font size of HTML5?</p><ul><li><em>16px is the browser default in case there is no specified font-size value being assigned in CSS. Otherwise, the given value will take effect respectively.</em></li></ul><p>22. Is it necessary to close HTML tags while making layouts?</p><ul><li><em>Yes. One must close all the tags as they might have individual properties concerning inline or block elements.But there are single elements can survive without closing like &lt;hr&gt;, &lt;br&gt;,&lt;img&gt;,&lt;input&gt;,&lt;meta&gt;.</em></li></ul><p>23. Can we use a percentage in font sizes?</p><ul><li><em>Only if we use them with a specific set e.g. if the website is set with default size 16px than we can use values like em to scale them with our choice i.e 1.25%em. font measuring units like px are absolute while em, pt are scalable.</em></li></ul><p>24. What is HTML Shiv?</p><ul><li><em>HTML Shiv is a javascript fix made by Individual brilliance of Sjoerd Visscher for enabling styling of HTML5 in Internet Explorer that is before version 9.</em></li></ul><p>25. What is HTML5 boilerplate?</p><ul><li><em>HTML5 Boilerplate is a professional front end template that is used to create fast, robust and adaptable HTML5 sites that are Cross-Browser compatible features.</em></li></ul><p>26. Which is the most correct as per HTML5 Standards..&lt;br&gt;,&lt;br/&gt;, or &lt;br/&gt;?</p><ul><li><em>As per HTML5 Standards &lt;br&gt; is enough to get the desired results but these values most often will give you the same results. Until HTML4 &lt;br/&gt; was allowed and if you are using XHTML it is still preferred.</em></li></ul><p>27. What is HTML5 ARIA?</p><ul><li><em>HTML5 ARIA stands for HTML5 Accessible Rich Internet Application i.e. standard semantic markup that web developers can add to HTML tags that allow better reading standards for the screen reader. the role, attribute &lt;button&gt; tag for the button, &lt;lat&gt; attribute that provides user information, informative links building with titles, language declaration, and more semantic HTML standards. These ARIA standards allow disabling friendly HTML5 behavior to the web pages.</em></li></ul><p>28. What are meta charsets? Why are they written?</p><ul><li><em>Along with Doctype, these meta charsets define the type of HTML document is written in. Below is the standard meta charset notation defined in HTML5. They are written to define the browser support for the HTML respectively.</em></li></ul><p><em>&lt;meta charset = “utf-8” /&gt;</em></p><p>29. Which type of video formats are accepted with HTML5 video tags?</p><ul><li><em>MPE4, WEBM, OGG are the three standards video format supported by HTML5 tags while you can run others using right codecs, plugins, and libraries.</em></li></ul><p>30. Do all browsers support HTML5?</p><ul><li><em>Yes all latest versions of browsers support HTML5 although there are specific elements which have some issues which can be fixed by writing browser-specific CSS</em></li></ul><p>Hope this will be useful. Request to read this if you have any questions regarding my post leave a comment below.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=79f4674e0eaa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fundamentals in Networking]]></title>
            <link>https://medium.com/minitechi/fundamentals-in-networking-1628a50672ea?source=rss-36c5179dcf53------2</link>
            <guid isPermaLink="false">https://medium.com/p/1628a50672ea</guid>
            <category><![CDATA[network-topology]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[types-of-network]]></category>
            <category><![CDATA[computer-networking]]></category>
            <dc:creator><![CDATA[Piyumika Sewwandi]]></dc:creator>
            <pubDate>Sun, 16 Feb 2020 10:30:49 GMT</pubDate>
            <atom:updated>2020-02-16T11:01:53.660Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Network Topologies" src="https://cdn-images-1.medium.com/max/583/1*SW6oche7tew8OmZU4FgO5Q.gif" /></figure><p>In this post, I’m going to give you a brief introduction to Computer Networking. After you read this you will get a rough knowledge about computer networks, types of networks, network topologies and their pros and cons as well.</p><blockquote><strong>What is a computer network?</strong></blockquote><p>Computer Network is a network consists of two or more computers that are linked to share resources (such as printers and CD-ROMS), exchange files, or allow electronic communication. The computer on a network may be linked through cables, telephone lines, radio waves, satellites, or infrared light beams.</p><blockquote><strong>Types of Networks</strong></blockquote><p>The three basic types of networks include:</p><ol><li><em>Local Area Network (LAN)</em></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/349/1*-OWqf992w5GCeEz4kruLDQ.png" /><figcaption>Local Area Network(LAN)</figcaption></figure><p>A local Area Network(LAN) is a network that is confined to a relatively small area, generally limited to a geographic area such as writing lab, school, or building. Rarely are LAN computers more than a mile apart in a typical LAN configuration, one computer is designated as the file server and stores all of the software that controls the network. Computers connected to the file server are called <strong><em>workstations</em></strong>. The workstations can be less powerful than the file server and they may have additional software on their hard drives.</p><p><em>2. Metropolitan Area Network(MAN)</em></p><p>This network covers larger geographic areas, such as cities or school districts. By interconnecting smaller networks within a large geographic area, information is easily disseminated throughout the network. Local libraries and government agencies often use a MAN to connect to citizens and private industries. One example of a MAN is the MIND Network located in Pasco country, Florida. It connects all of Pasco’s media centers to a centralized mainframe at the district office by using dedicated phone lines, coaxial cabling, and wireless compunctions providers.</p><p><em>3. Wide Area Network(WAN)</em></p><p>This network connects larger geographical areas, such as Florida, the United States, or the world. Satellite uplinks may be used to connect this type of network. Using a WAN, schools in Florida can communicate with places like Tokyo in a matter of minutes, without paying enormous phone bills. It uses multiplexers to connect local and metropolitan networks to global communications networks like the internet.</p><blockquote><strong>Network Topologies</strong></blockquote><p>There are two main types of topologies:</p><ol><li><strong><em>Physical topology</em></strong>: the physical topology of a network refers to the configuration of cables, computers, and other applications.</li><li><strong><em>Logical topology</em></strong>: physical topology should not be confused with the logical topology which is the method used to pass information between workstations.</li></ol><blockquote><strong>The physical topology</strong></blockquote><p>Some examples of physical topologies are,</p><ol><li><strong>Linear bus</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/546/1*27G57OuLGn3ygTBnfvAA6A.gif" /><figcaption>Linear bus topology</figcaption></figure><ul><li>A linear bus topology consists of a main run of cable with a terminator at each end.</li><li>All nodes(file server, workstation, and peripherals) are connected to the linear cable.</li><li>Ethernet and LocalTalk networks use a linear bus topology.</li></ul><p>— Advantages of linear bus topology —</p><ul><li>Easy to connect a computer or peripheral to a linear bus</li><li>It requires less cable length than a star topology.</li></ul><p>— Disadvantages of linear bus topology —</p><ul><li>The entire network shuts down if there is a break down in the main cable.</li><li>Terminators are required at both ends of the backbone cable.</li><li>Difficult to identify the problem if the entire network shuts down.</li><li>Not mean to be used as a stand-alone solution in a large building.</li></ul><p><strong>2. Star</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/549/1*zqJB003TnC-FCQen44MAHw.jpeg" /><figcaption>Star topology</figcaption></figure><ul><li>A star topology is designed with each node(file server, workstations, and peripherals) connected directly to a central network hub or concentrator.</li><li>Data on a star network passes through the hub or concentrator before continuing to its destinations. The hub or concentrator manages and controls all the functions of the network.</li><li>It also acts as a repeater for the data flow. This configuration is common with twisted pair cable; however, it can be used with coaxial cable or fiber optic cable.</li></ul><p>— Advantages of star topology —</p><ul><li>easy to install and wire</li><li>No disruptions to the network when connecting or removing devices.</li><li>Easy to detect faults and to remove parts.</li></ul><p>— Disadvantages of star topology —</p><ul><li>Requires more cable length than a linear topology.</li><li>If the hub or concentrator fails, nodes attached are disabled.</li><li>More expensive than linear bus topologies because of the cost of the concentrator.</li></ul><p><strong>3. Star -wired ring</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/402/1*gqEACsqQVSgCScfe6KgjHw.jpeg" /><figcaption>star-wired ring topology</figcaption></figure><ul><li>A star wired ring topology appears (externally) to be the same as a star topology, internally, the MAU(multi-station access unit) of a star-wired ring contains wiring that allows information to pass from one device to another in a circle or ring.</li><li>The token ring protocol uses a star-wired ring topology.</li></ul><p><strong>4. Tree</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/350/1*FyWT_AcfMdlbuv3a4CQyJA.png" /><figcaption>Tree topology</figcaption></figure><ul><li>A tree topology combines characteristics of linear bus and star topologies. It consists of a group of star-configured workstations connected to a linear bus backbone cable. Tree topology allows for the expansion of an existing network, and enable schools to configure a network to meet their needs.</li></ul><p>— Advantages of Tree topology —</p><ul><li>Point to point wiring for individual segments</li><li>Supported by several hardware and software vendors.</li></ul><p>— Disadvantages of tree topology —</p><ul><li>The overall length of each segment is limited by the type of cabling used.</li><li>If the backbone line breaks, the entire segment goes down. But better than the linear bus.</li><li>More difficult to configure and wire than other topologies.</li></ul><blockquote><strong>Logical topologies</strong></blockquote><p>There are some examples of logical topologies.</p><ul><li>Ethernet</li><li>LocalTalk</li><li>Token Ring</li><li>FDDI</li><li>ATM</li></ul><p>— Ethernet —</p><p>The ethernet protocol is by far the most widely used. Ethernet uses an access method called CSMA/CD(Carrier Sense Multiple Access/Collision Detection).</p><p>This is a system where each computer listens to the cable before sending anything through the network. If the network is clear, the computer will transmit. If some other node is already transmitting on the cable, the computer will wait and try again when the line is clear.</p><p>The ethernet protocol allows for linear bus, star or tree topologies. Data can be transmitted over twisted pair, coaxial, or fiber optic cable at a speed of 10mbps up to 100mbps.</p><p>— LocalTalk —</p><p>It was a network protocol that was developed by Apple Computer Inc, for Macintosh computers. The method uses by LocalTalk is called CSMA/CA(Carrier Sense Multiple Access/Collision Avoidance). It is similar to CSMA/CD except that a computer signals its intent to transmit before it actually does so.</p><p>The LocalTalk protocol allows for linear bus, star, or tree topologies using twisted pair cable. A primary disadvantage of LocalTalk is speed. Its speed of transmission in only 230Kbps.</p><p>— Token Ring —</p><p>The access method used involves token passing. In the token ring, the computers are connected so that the signal travels around the network from one computer to another in a logical ring. A single electronic token moves around the ring from one computer to the next. If a computer doesn’t have information to transmit, it simply passes the token on to the next workstation. If a computer wishes to transmit and receives an empty token, it attaches the message to the token and sends it to the destination workstation.</p><p>— FDDI —</p><p>Fiber Distributed Data Interface(FDDI) is a network protocol that is used primarily to interconnect two or more local area networks, often over large distances. The access method used by FDDI involves token passing.</p><p>FDDI uses a dual-ring physical topology. Transmission normally occurs on one of the rings; however, if a break occurs, the system keeps information moving by automatically using portions of the second ring to create a new complete ring. A major advantage of FDDI is speed. It operates over fiber optic cable at 100mbps.</p><p>— ATM —</p><p>Asynchronous transfer mode(ATM) is a network protocol that transmits data at the speed of 155mbps and higher. ATM works by transmitting all data in small packets of fixed size; whereas, other protocols transfer variable-length packets.</p><p>ATM supports a variety of media such as video, CD-Quality audio, and imaging. ATM employs a star topology, which can work with fiber optics as well as twisted pair cable.ATM is frequently used by Internet Service Providers to utilize high-speed access to the internet for their clients.</p><p>Hope this will be useful. Request to read this and leave a comment for any detail. Good Times!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1628a50672ea" width="1" height="1" alt=""><hr><p><a href="https://medium.com/minitechi/fundamentals-in-networking-1628a50672ea">Fundamentals in Networking</a> was originally published in <a href="https://medium.com/minitechi">MiniTechi</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>