<?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 Rasara Thrilanka on Medium]]></title>
        <description><![CDATA[Stories by Rasara Thrilanka on Medium]]></description>
        <link>https://medium.com/@rasarathrilanka?source=rss-887dbf6dac51------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*X9egRS_9tFndCxTg.jpg</url>
            <title>Stories by Rasara Thrilanka on Medium</title>
            <link>https://medium.com/@rasarathrilanka?source=rss-887dbf6dac51------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 02:46:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rasarathrilanka/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[Internship in Software Engineering Field]]></title>
            <link>https://levelup.gitconnected.com/internship-in-software-engineering-field-62fcdd2f0e55?source=rss-887dbf6dac51------2</link>
            <guid isPermaLink="false">https://medium.com/p/62fcdd2f0e55</guid>
            <category><![CDATA[swot-analysis]]></category>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[internships]]></category>
            <category><![CDATA[swot]]></category>
            <dc:creator><![CDATA[Rasara Thrilanka]]></dc:creator>
            <pubDate>Sat, 10 Jul 2021 22:11:57 GMT</pubDate>
            <atom:updated>2021-07-10T22:11:57.442Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*sNJJQeYmUCaLBMVD.jpeg" /></figure><p>If you are already a student developer or a student who is looking to be a software engineer one day, this article is for you guys!</p><p><strong><em>“The expert in anything was once a beginner”</em></strong></p><p>If you want to be an expert in the software engineering industry, you have to make a strong solid foundation that will remain forever. The best time to build the base is your internship period. I’ll share some secret tips on how are we getting maximum value from the internship.</p><p>Internship defines who you are and gain the experience to identify your career path in the future after graduation.</p><h4><strong>Preparation</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*JZkdcrg1LXfXZ0NB.jpeg" /></figure><p>First off, you should prepare to face interviews and get selected to be a part of the organization as an intern.</p><p>Before everything just go and google your own name — what do you see there? Your facebook, instagram pages and many more… What is in there apart from your selfies or external stuff. There’s nothing that can add value to yourself. So you have to go beyond until someone can identify you from your work, your attitude and your contribution, then you must be a value to others.</p><p><strong>Adding value to your profile</strong></p><ol><li>Engage with official social platforms like LinkedIn, Twitter and make your model there.</li><li>Follow online courses from recommended universities and websites like Coursera, edx, udacity, LinkedIn learning, nano degrees etc.</li><li>Start to write blog posts, articles about any simple thing that you’ve learned.</li><li>Be a member of communities like HackerRank, GSoC, StackOverflow.</li><li>Be a competitor of online hackathons like Hashcode, Kickstart etc.</li></ol><p>This will change the search results on you by your own.</p><p><strong>Background of preparation for an interview</strong></p><ol><li>Start early. Doesn’t matter when the interview is, you have to work from now onwards.</li><li>Prepare for technical interviews.</li><li>Do side projects.</li><li>Utilize your network or try to grow it.</li><li>Compete for hackathons and ideathons.</li></ol><p>After you get selected for a company, there’s one more thing you should do before starting. You should analyze yourself with SWOT concept.</p><p><strong>SWOT Analysis</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/0*6d9zZRvmo27R1OZp.jpeg" /></figure><p>SWOT Analysis is a useful technique for us to understand <strong>Strengths</strong> and <strong>Weaknesses</strong>, and to identify both the <strong>Opportunities</strong> open to us and the <strong>Threats</strong> we have to face.</p><p><strong>Smart goals</strong></p><p>Simply the smart goals you should reach out during the internship are related to what you find from SWOT analysis.</p><p>• Getting the knowledge from the newest technologies and getting hands-on experience with them. (Adaption to new technology)<br>• Spent your first 2 months to get to know how the project should be carried out by the team.<br>• Getting to know about the company functions and culture during the first month.<br>• Learning project management tools and designing skills.<br>• Improve your presentation skills and communication skills during the time.<br>• Learn how the managing process of a project could be done in a professional manner in the company.<br>• Improve your critical thinking skills and solve real-world problems in the projects during the internship.<br>• Improve your competency skills and become a competent undergraduate.<br>• Learn to be a team player and contribute to the projects you’ve assigned and give your fullest to that.<br>• Meet experts from different backgrounds and expand your network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*oR8unJqd3Ic3hLXd.jpeg" /></figure><p>Internship is a crucial factor to decide your career path. The concepts and techniques play a major role when it comes to Internship since the technology we use, is updating day by day. Internship is a good opportunity to learn from mistakes and become a good role player in the industry.</p><p><strong><em>“Success seems to be connected with action. Successful people keep moving. They make mistakes, but they don’t quit.”</em></strong></p><p><em>Note: This post is simply meant to share the advice I wish I’d gotten.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=62fcdd2f0e55" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/internship-in-software-engineering-field-62fcdd2f0e55">Internship in Software Engineering Field</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Simple Augmented Reality(AR) Integration with A-FRAME]]></title>
            <link>https://levelup.gitconnected.com/simple-augmented-reality-ar-integration-with-a-frame-f625e9dc66b8?source=rss-887dbf6dac51------2</link>
            <guid isPermaLink="false">https://medium.com/p/f625e9dc66b8</guid>
            <category><![CDATA[ar]]></category>
            <category><![CDATA[a-frame]]></category>
            <category><![CDATA[aframe-io]]></category>
            <category><![CDATA[arjs]]></category>
            <category><![CDATA[augmented-reality]]></category>
            <dc:creator><![CDATA[Rasara Thrilanka]]></dc:creator>
            <pubDate>Tue, 09 Feb 2021 04:08:23 GMT</pubDate>
            <atom:updated>2021-02-09T04:08:23.376Z</atom:updated>
            <content:encoded><![CDATA[<h4>Tutorial: Example codes to develop simple AR functions using AR.js</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*XzAreZzHw3fNyFbR.jpeg" /><figcaption>Photo by aframe.io</figcaption></figure><p>Hey, guys 👋 This time I want you to experience an AR integration for a web application which is something a bit attractive to you all. Before everything, you need to know a basic idea of A-Frame.</p><h3>What is A-Frame?</h3><p><a href="https://aframe.io/">A-Frame</a> is a web framework for building virtual reality (VR) experiences. This is based on top of HTML, making it simple to get started. And A-Frame is not just a 3D scene graph or a markup language but also is a powerful entity-component framework that provides a declarative, extensible, and composable structure.</p><p>Through this article, let me give you an insight into how we are going to develop an AR integration using a-frame. Let’s do it step by step.</p><h3>Include the Libraries</h3><p>The first thing you need to do is include the libraries in your HTML script. Basically, you have to add two libraries as follows.</p><p>Initially, you must include an a-frame library and it calls a-frame.</p><pre>&lt;script src=&quot;<a href="https://aframe.io/releases/0.8.0/aframe.min.js">https://aframe.io/releases/0.8.0/aframe.min.js</a>&quot;&gt;&lt;/script&gt;</pre><p>Then you need to include AR.js for a-frame. The following line calls the AR.js component to be used for a-frame and finds the source of different assets like the description of 3D objects, the camera calibration.</p><pre>&lt;script src=&quot;<a href="https://cdn.rawgit.com/jeromeetienne/AR.js/1.6.0/aframe/build/aframe-ar.js">https://cdn.rawgit.com/jeromeetienne/AR.js/1.6.0/aframe/build/aframe-ar.js</a>&quot;&gt;&lt;/script&gt;</pre><h3>Define the body</h3><p>This is simply a normal HTML page and it needs to be defined the body of that.</p><pre>&lt;body style=&#39;margin : 0px; overflow: hidden;&#39;&gt;<br>    &lt;!-- include the body content here --&gt;<br>&lt;/body&gt;</pre><p>The next step is how to write the body of the page. So, now I will show you <strong>3 examples</strong> of AR integration that is mostly used. Let’s try them one by one.</p><p>The all following examples will use &lt;a-marker-camera&gt; with &#39;hiro’ preset. You will understand the way it should include and how it going to work at the end of the article.</p><h4>1. Display a text in AR</h4><p>If you want to display any text with your AR feature, the following is a sample code for it. Also, you can change several attributes; the font color, font size, position and rotation of the text, etc.</p><pre>&lt;body style=&#39;margin : 0px; overflow: hidden;&#39;&gt;<br>   &lt;a-scene embedded arjs=&#39;sourceType: webcam;&#39;&gt;<br>      &lt;a-text text=&quot;value: Whatever \n you want !&quot; color=&quot;blue&quot;    rotation=&quot;-90 0 0&quot;&gt;&lt;/a-text&gt;<br>      &lt;a-marker-camera preset=&#39;hiro&#39;&gt;&lt;/a-marker-camera&gt;<br>   &lt;/a-scene&gt;<br>&lt;/body&gt;</pre><p>The output will look like,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0iEy5DRo6xFEshfA.png" /><figcaption>Output of displaying a text</figcaption></figure><h4>2. Display an AR box</h4><p>This example is about displaying a box with customized size, color, and appearance.</p><pre>&lt;body style=&#39;margin : 0px; overflow: hidden;&#39;&gt;<br> &lt;a-scene embedded arjs=&#39;sourceType: webcam;&#39;&gt;<br>  &lt;a-box position=&#39;0 0.5 0&#39; material=&#39;opacity: .7;&#39; color=&quot;red&quot;&gt;&lt;/a-box&gt;<br>  &lt;a-marker-camera preset=&#39;hiro&#39;&gt;&lt;/a-marker-camera&gt;<br> &lt;/a-scene&gt;<br>&lt;/body&gt;</pre><p>The output for this is,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gqd1Xt-0J88VK3To.png" /><figcaption>Output of displaying a box</figcaption></figure><h4>3. Display an AR plane with text and image</h4><pre>&lt;body style=&#39;margin : 0px; overflow: hidden;&#39;&gt;<br>&lt;a-scene embedded arjs=&#39;sourceType: webcam;&#39;&gt;<br>    &lt;a-entity<br>            rotation=&quot;-90 0 0&quot;<br>            geometry=&quot;primitive: plane; width: 4; height: auto&quot;<br>            material=&quot;color: blue&quot;<br>            text=&quot;value: Alexender Statue\n Alexandria&quot;&gt;&lt;/a-entity&gt;&lt;a-image src=&quot;images/ar.png&quot; rotation=&quot;-90 0 0&quot;&gt;&lt;/a-image&gt;<br>    &lt;a-marker-camera preset=&#39;hiro&#39;&gt;&lt;/a-marker-camera&gt;<br>&lt;/a-scene&gt;<br>&lt;/body&gt;</pre><p>If you want to display a plane with a text and image you can go with the above code,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PhhcjKGjnSw7OOZP.png" /><figcaption>Output of displaying an AR plane with text and image</figcaption></figure><p>These are some of the basic tutorials that I choose just to make you feel on this amazing experience. You will find many more shapes and ways of integrating AR using a-frame according to your requirements, through the <a href="https://aframe.io/docs/1.1.0/introduction/">A-Frame official website documentation</a>.</p><h3>How you can experience this?</h3><p>You can allow opening your webcam and capture the<strong> ‘hiro’ </strong>marker you have. This should be a clear image in hard copy or you can capture this through your mobile phone easily with a clear photo of this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jnrfGsbVSbrbOC2m.png" /><figcaption>Hiro marker</figcaption></figure><p>In the mobile or web application after capturing this marker, you will see the image or the text according to your body content as mentioned above.</p><p>Let’s did it, guys… Hope this helps you.</p><p>This covered a simple guide to AR integration using a-frame. we will meet again with another tutorial of AR which little bit advanced.</p><p>Cheers…!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f625e9dc66b8" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/simple-augmented-reality-ar-integration-with-a-frame-f625e9dc66b8">Simple Augmented Reality(AR) Integration with A-FRAME</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Simple Augmented Reality(AR) Integration with A-FRAME]]></title>
            <link>https://levelup.gitconnected.com/simple-augmented-reality-ar-integration-with-a-frame-30bb315fed47?source=rss-887dbf6dac51------2</link>
            <guid isPermaLink="false">https://medium.com/p/30bb315fed47</guid>
            <category><![CDATA[a-frame]]></category>
            <category><![CDATA[glitch]]></category>
            <category><![CDATA[gltf]]></category>
            <category><![CDATA[aframe-io]]></category>
            <category><![CDATA[ar]]></category>
            <dc:creator><![CDATA[Rasara Thrilanka]]></dc:creator>
            <pubDate>Tue, 09 Feb 2021 04:08:20 GMT</pubDate>
            <atom:updated>2021-02-09T04:08:20.743Z</atom:updated>
            <content:encoded><![CDATA[<h4>Tutorial: A Step-by-Step Guide to view a glTF model using AR.js</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YPEbioKj7TnOlEGs.png" /><figcaption>Figure 1: Expected output</figcaption></figure><p>Hey guys, it’s me, Rasara again 👋 This tutorial will help you to develop a simple Augmented Reality integration to your mobile or web app using a-frame.</p><blockquote>You can find a comprehensive guide in the <a href="https://aframe.io/docs/1.1.0/introduction/">A-Frame official documentation</a> to use A-Frame, BUT I thought to share my experience and some tips which I’ve followed to do this in minimal steps. So let me walkthrough the process that let to the completion of the above expected output(Figure 1).</blockquote><h3>Find a glTF model</h3><p>The first thing you need to do is find a glTF model that suits your requirement. There are several websites in which you can freely download glTF models but the challenging part is to find a better model that is working. Because in my case, I have to put a lot of effort to find such a working 3D model with .gltf extension.</p><p>The following are some websites which I can recommend you to find 3D models.</p><ol><li><a href="https://www.cgtrader.com/">CGTrader</a></li><li><a href="https://sketchfab.com/feed">Sketchfab</a></li></ol><p>You can click one of the 3D models which can freely download and you must download the file with .gltf extension as follows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ipLhi6_Dzniv0PmI.png" /><figcaption>Figure 2: Download a gltf model</figcaption></figure><h3>Apply the 3D model to your project</h3><p>Here I’m trying to explain the code which we need to do this with a-frame. As the basic steps, first you need to include the relevant libraries and define the body of the page.</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>&lt;head&gt;<br>    &lt;!-- this line calls aframe --&gt;<br>    &lt;script src=&quot;https://aframe.io/releases/0.8.0/aframe.min.js&quot;&gt;&lt;/script&gt;</pre><pre>    &lt;!-- this line calls the AR.js component to be used for aframe and finds the source of different assets like the description of 3D objects, the camera calibration--&gt;<br>    &lt;script src=&quot;https://cdn.rawgit.com/jeromeetienne/AR.js/1.6.0/aframe/build/aframe-ar.js&quot;&gt;&lt;/script&gt;<br>&lt;/head&gt;</pre><pre>&lt;body style=&#39;margin : 0px; overflow: hidden;&#39;&gt;<br>    &lt;!-- include the body content here --&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p>If you are not familiar with the above, you can refer the previous article written by me (<em>Tutorial: Example codes to develop simple AR functions using AR.js</em>) to get a basic idea of this.</p><p>Now, you need to include the body content of the page to apply this 3D model. This can be breakdown into two different ways.</p><h4>1. Add the model to your project path locally</h4><p>First one is you can simply add the model to your project path and set the path of your model to the code as follows.</p><pre>&lt;body style=&#39;margin : 0px; overflow: hidden;&#39;&gt;<br>    &lt;a-scene embedded arjs=&#39;sourceType: webcam;&#39;&gt;<br>        &lt;a-marker-camera preset=&#39;hiro&#39;&gt;<br>            &lt;a-entity gltf-model=<strong>&quot;assets/images/Mosque.gltf</strong>&quot; scale=&quot;0.2 0.2 0.2&quot;&gt;&lt;/a-entity&gt;<br>        &lt;/a-marker-camera&gt;<br>    &lt;/a-scene&gt;<br>&lt;/body&gt;</pre><p>But this will make some issues of loading the model <strong>sometimes</strong> because of some local changes.</p><p>In my case, I tried out this but it doesn’t work for me. So, I went for the second option.</p><h4>2. Upload the model to your Glitch Account</h4><p>In my understanding, the best and the easiest way to apply a gltf model to your application is this.</p><p>Here you need to follow some steps. I will go through them one by one.</p><p><strong>01. Create your Glitch Account and create a New Project.</strong></p><p>Go to <a href="https://glitch.com/">glitch.com</a> official website and create an account there. Then create a New Glitch Project (Figure 3).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Zwrx1A7Izhrr8NhS.png" /><figcaption>Figure 3: Create a New Glitch Project</figcaption></figure><p><strong>02. Upload the glTF model to your Glitch Project</strong></p><p>When you have created a new project, you will see it includes a folder named “<strong>assets” </strong>under the project structure (Figure 4 -(1)). Select it and upload your glTF model there. Then it will look like this (Figure 4 -(2)).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WESVtDPPAhsevyaA.png" /><figcaption>Figure 4: Upload the model to the Glitch Project</figcaption></figure><p><strong>3. Get the cdn url of the model</strong></p><p>Click the gltf model that you uploaded and then you can see the following popup there (Figure 5). Now you can copy the cdn url of your glTF model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Jwsm1dwhKjMZaFG_.png" /><figcaption>Figure 5: Get the cdn url</figcaption></figure><p><strong>4. Add the URL to your code</strong></p><p>Now you can simply include the cdn url of the glTF model instead of adding it to your project path locally. This displays you a quick loading glTF model.</p><p>So, the final code will look like this,</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>&lt;head&gt;<br>    &lt;!-- this line calls aframe --&gt;<br>    &lt;script src=&quot;https://aframe.io/releases/0.8.0/aframe.min.js&quot;&gt;&lt;/script&gt;<br>    &lt;!-- this line calls the AR.js component to be used for aframe and finds the source of different assets like the description of 3D objects, the camera calibration--&gt;<br>    &lt;script src=&quot;https://cdn.rawgit.com/jeromeetienne/AR.js/1.6.0/aframe/build/aframe-ar.js&quot;&gt;&lt;/script&gt;<br>&lt;/head&gt;</pre><pre>&lt;body style=&#39;margin : 0px; overflow: hidden;&#39;&gt;<br>&lt;a-scene embedded arjs=&#39;sourceType: webcam;&#39;&gt;<br>    &lt;a-marker-camera preset=&#39;hiro&#39;&gt;<br>        &lt;a-entity position=&quot;0 0 0&quot; scale=&quot;0.2 0.2 0.2&quot; <strong>gltf-model=&quot;https://cdn.glitch.com/0f662680-b46a-4a86-bc3e-660c29752c5a%2FMosque.gltf?v=1611234341037&quot;</strong>&gt;&lt;/a-entity&gt;<br>    &lt;/a-marker-camera&gt;<br>&lt;/a-scene&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p>Now you are done with the expected output as in the very first image (figure 1)….😉!</p><p>Try out this interesting tutorial and don’t forget to give your feedback.</p><p>Cheers guys…!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=30bb315fed47" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/simple-augmented-reality-ar-integration-with-a-frame-30bb315fed47">Simple Augmented Reality(AR) Integration with A-FRAME</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Concurrent Program Modelling-FSP]]></title>
            <link>https://medium.com/geekculture/concurrent-program-modelling-fsp-7a530d3dcbb?source=rss-887dbf6dac51------2</link>
            <guid isPermaLink="false">https://medium.com/p/7a530d3dcbb</guid>
            <category><![CDATA[concurrent-programming]]></category>
            <category><![CDATA[vending-machine-water]]></category>
            <category><![CDATA[fsp]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[modelling]]></category>
            <dc:creator><![CDATA[Rasara Thrilanka]]></dc:creator>
            <pubDate>Tue, 19 Jan 2021 02:02:29 GMT</pubDate>
            <atom:updated>2021-01-19T02:02:29.100Z</atom:updated>
            <content:encoded><![CDATA[<h4>Initial steps to model a Simple Concurrent Program Using <em>Finite State Processes (FSP) - </em>A Vending Machine example</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xZcjTKwZmJgturFkKANpJg.jpeg" /></figure><p>Hi, I’m Rasara. This article is all about the basic concepts behind Concurrent Programming Modelling and what should we know as the initial steps to begin.</p><h3>It’s almost a Concurrent World…</h3><p>A Concurrent Program consists of a collection of sub-programs. When the concurrent program executes, each of the individual subprograms is executed by a separate process. These processes generally execute at the same time. Therefore, the execution of a concurrent program thus consists of multiple processes executing at the same time.</p><p>If we take any real-world example, all of them have a set of simple activities or tasks. For an instance, the execution of house building includes a lot of sub-tasks like wiring, roofing, carpentry, bricklaying, plumbing, and also, make 5 teacups each with two sugar spoons as well. Some processes are strictly occurring sequentially, BUT most can overlap and take place concurrently. So, this is the reason why we are saying <em>It’s almost a concurrent world we are in.</em></p><h3>Why we need a modeling approach to develop a concurrent program?</h3><p>Developing a concurrent program that satisfies the specified requirements &amp; behaves in a safe manner is such a complex process in terms of the following points.</p><ul><li>Testing such software is difficult, with far too many scenarios.</li><li>Don’t know when we have done a sufficient number of tests.</li><li>Testing is very difficult as it relies on executing the particular sequence of events &amp; actions that cause a problem.</li><li>Since concurrent events may occur in any order, or may not always occur, the problem sequences may never be tested.</li></ul><p>So, the <strong>Solution </strong>is in need of a better way to design, check &amp; construct concurrent programs. This is where the <strong>Modelling Approach</strong> comes into play.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oHB5fJHQvFe1bbSPfAH-aw.png" /><figcaption>Figure 1: Test pass rate probability of Concurrent programs with &amp; without Modelling</figcaption></figure><h3>Modelling Concurrent Systems</h3><p>As we have seen a <em>model </em>is meant to be a simplified representation of <em>“</em>something<em>”</em>. But in our case, the “something” we want to model is a <em>Concurrent System</em>.</p><p>So, our Model must include simplified representations of the following;</p><ul><li>an individual Process,</li><li>a Concurrent Program, (collection of processes executing concurrently),</li><li>the interactions<em> </em>between a collection of processes,</li><li>the dynamic behavior &amp; properties<em> </em>of a process &amp; concurrent system.</li></ul><p>If our model does <strong>not </strong>have these features then it is not <strong>“fit-for-purpose”</strong>!</p><h3>What is FSP?</h3><p>Finite-state processes (FSP) is an abstract language that’s used to develop concurrent systems of processes with the modeling approach. The following aspects are achieving the above-mentioned need for concurrent programming.</p><p>1. <strong>Design</strong> a concurrent system</p><p>2. <strong>Model</strong> designed system</p><p>3. <strong>Analyze</strong> the modeled system</p><p>Let’s have a look into this one by one later with related to a simple scenario.</p><h3>FSP, FSM, LTS, and LTSA in a nutshell</h3><ul><li>A concurrent system is a collection of abstract processes.</li><li>These Abstract processes can be defined using <strong>FSP</strong> language.</li><li>FSP process represented or modeled by a <strong>Finite State Machine(FSM).</strong></li><li>FSM model abstracts away the details of a real program. FSM is implemented by a <strong>Labelled Transition System(LTS).</strong></li><li>Every FSP process has a corresponding FMS/LTS description.</li><li><strong>LTS Analyzer (LTSA)</strong> is the FSP’s modeling tool that used to animate and analyze.</li></ul><p>Now, let’s try to understand these concepts using a simple example, a Vender Machine. Before that, You need to set up an LTSA tool to animate and analyze the scenario.</p><h4>Use of LTSA Tool</h4><p>The following are the basic components of ltsa tool.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-F9-mXCuPN0w-64XUh79TQ.png" /><figcaption>Figure 2: Basic components of ltsa tool</figcaption></figure><p>But, If you didn’t see Alphabet, Transition, and Draw windows in your ltsa, step up to the window tab as the following and add them one by one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*otJ6mV-DRjuB1kBXpUjG2w.png" /><figcaption>Figure 3: Windows tab in ltsa tool</figcaption></figure><p>Now all are set to be tried out a simple concurrent system.🙃</p><h3>A DRINKS Vender Machine</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/317/1*NRx1Yp66tgChaU3nfbjwIw.jpeg" /><figcaption>Figure 4: Vender machine</figcaption></figure><p>Using an example will make it easier to explain the concepts and models. Let’s analyze and model an FSP process that describes drinks dispensing machine that can dispense,</p><ul><li>hot <strong>coffee</strong> if the <strong>red</strong> button is pressed &amp;</li><li>iced <strong>tea</strong> if the <strong>blue</strong> button is pressed.</li></ul><h4>First, let’s design the system...</h4><p>As the initial step, we need to understand the required requirements and design the system. Under this, processes and their actions, their synchronization requirements, and interactions between the processes are considered.</p><p>According to the given scenario,</p><ul><li>We should design the genric process od DRINKS which has two options either tea or coffee. And the actions of them should be <strong>red</strong> for tea and <strong>blue</strong> for coffee respectively.</li><li>Then we need to design the two separate customer processes of COFFEE_CUSTOMER and TEA_CUSTOMER who is going to use this machine.</li><li>And later, the composite execution which is VendingSystem, should be defined, with the synchronization requirements.</li></ul><h4>Next is to <strong>Model</strong> designed system…</h4><p>Following is the designed model of the given scenario and this should be modeled using FSM with FSP language. This should add to the Edit window of LTSA.</p><pre>set VMOptions = { red, coffee, blue, tea }<br><br>set Customers = { cc, tc }<br><br>DRINKS = (   red -&gt;  coffee -&gt; DRINKS<br>           | blue -&gt; tea -&gt;    DRINKS ) .<br><br><br>COFFEE_CUSTOMER = ( choose_coffee -&gt; red -&gt; coffee <br>                 -&gt; pickup_coffee -&gt; drink_coffee -&gt; COFFEE_CUSTOMER <br>		   ) +VMOptions.<br><br>TEA_CUSTOMER = ( choose_tea -&gt; blue -&gt; tea <br>                 -&gt; pickup_tea -&gt; drink_tea -&gt; TEA_CUSTOMER <br>		   ) +VMOptions.<br><br><br>|| VendingSystem = (    Customers :: DRINKS || cc: COFFEE_CUSTOMER || tc: TEA_CUSTOMER ) .</pre><p>This will allow one user to acquire the resource and the other to release it. Hence, when the DRINKS is composed with the USER processes, this composition ensures that only the same user that acquired the resource can release it. Now will test the system to check whether the requirements are compatible with the designed model.</p><h4>Finally, the time to analyze the modeled system…</h4><p>Before animation, you must have to compile and compose the code you have written and then you have to navigate to the <strong>draw</strong> tab. It shows you a graphical representation of all individual and composite processes.</p><p><strong>Graphical Representation</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QjG_wnjBIow-D0y-lwwRUA.png" /><figcaption>Figure 5: graphical representation of processes</figcaption></figure><p>Then you have to animate and can analyze the code by checking,</p><ul><li>the system’s <strong>alphabet</strong><em> </em>is correct,</li><li>the system performs the correct, it’s <strong>actions </strong>and<strong> transitions.</strong></li><li>whether it avoids <strong>deadlock</strong><em> </em>&amp; maintains <strong>mutual exclusion</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/330/1*OnGYuW4DFyW4-KAlVPa5WQ.png" /><figcaption>Figure 6: Animator of ltsa tool</figcaption></figure><p>Through all this, you can have a proper idea of the system you are going to be developed and you also know the ability to have deadlocks and other concurrent issues prior to the development.</p><p>So, this Modeling concept is really an essential need for Concurrent Programming.</p><p>I hope this helps with your concurrent programming studies. Cheers.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a530d3dcbb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/geekculture/concurrent-program-modelling-fsp-7a530d3dcbb">Concurrent Program Modelling-FSP</a> was originally published in <a href="https://medium.com/geekculture">Geek Culture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Java Concurrency : Thread Creation -Understand Why & How?]]></title>
            <link>https://rasarathrilanka.medium.com/java-concurrency-thread-creation-understand-why-how-8d61169cea91?source=rss-887dbf6dac51------2</link>
            <guid isPermaLink="false">https://medium.com/p/8d61169cea91</guid>
            <category><![CDATA[extend]]></category>
            <category><![CDATA[threads]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[concurrency]]></category>
            <category><![CDATA[runnable]]></category>
            <dc:creator><![CDATA[Rasara Thrilanka]]></dc:creator>
            <pubDate>Thu, 14 Jan 2021 23:56:13 GMT</pubDate>
            <atom:updated>2021-01-14T23:56:13.358Z</atom:updated>
            <content:encoded><![CDATA[<h3>Java Concurrency: Thread Creation -Understand Why &amp; How?</h3><h4>Two ways of creating Thread in Java</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rJBini9prTI-zVqlxDlERA.png" /></figure><p>This article is all about a nutshell guide to understand the reason why we want to create a Java Thread and how to do it in two different ways.</p><h3>Why do we need to create a Java Thread?</h3><p>First, we need to know that, by default, every standard Java application has a main thread which is represented as the main method. Normally, whenever we run the Java application, we write the code inside the main method which we wanted to happen sequentially. So,main method will have the instructions returned within it and all those instructions are being executed as a part of the main thread in a sequence, one after the other.</p><p>So, what will happen if we have to do a long-running operation within the main method. Most probably the operations or the instructions that are written below the long-running operation will be blocked and the operating system will start giving messages to the user that <em>This application is not responding. Would you like to wait or kill this application? </em>To avoid this behavior, we can create a separate thread for the long-running job and make the application works fine.</p><p>On the other way, we can create our own threads to change the sequential behavior of the main method and make them run concurrently.</p><h3>How to create a Java Thread?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lytW6wbhtzkiOVZK73rypw.png" /></figure><p>There are two different ways to create a thread &amp; define its associated run() method.</p><ul><li>Extending Thread Class</li><li>Implementing Runnable Interface</li></ul><p>Let’s see how both ways help in implementing the Java thread.</p><h4>Extend the Thread Class</h4><p>The first way of creating a Java thread is to create a new class that extends the Thread class, override the run() method with the code that the thread must run and then create an instance of that class.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/737b76911b19a60d408b25eb82d191dd/href">https://medium.com/media/737b76911b19a60d408b25eb82d191dd/href</a></iframe><p>1. Create a Thread Class</p><p>2. Override run() method</p><p>3. Create an object of the class</p><p>4. Invoke start() method to execute the custom Threads run()</p><p>When the thread is started it will call and execute the run() method of the MyThread instance instead of executing its own run() method.</p><h4>Implement the Runnable Interface</h4><p>This is the easiest way of creating a Java Thread. Here we need to create a class that implements the Runnable interface. To execute the run() method by a thread, pass an instance of MyThread to a Thread in its constructor. Here is the way that is done.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/66ed799653ed974fb377e4bbfa55f8fc/href">https://medium.com/media/66ed799653ed974fb377e4bbfa55f8fc/href</a></iframe><p>1. Create a Thread Class implementing Runnable interface</p><p>2. Override run() method</p><p>3. Create an object of the class</p><p>4. Invoke start() method to execute the custom Threads run()</p><h3>Which method should we choose?</h3><p>Which method is chosen will depend on the context but the following guideline provides assistance.</p><p><strong>Guideline: </strong>If your class <strong><em>must</em></strong><em> </em>subclass some other class, you should use Runnable as described in part 2.</p><p><strong>Explanation: </strong>If your class is inheriting some other class, then it cannot inherit the thread at the same time, because multiple inheritance is not supported in Java. Then, we need to go for Runnable interface.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/deed4fc7c76ec201ae3ee9692f97acb6/href">https://medium.com/media/deed4fc7c76ec201ae3ee9692f97acb6/href</a></iframe><p>So far, we have been creating threads using only two threads; the main thread and one child thread. However, our application can affect by many threads as it needs. Let’s see how we can create multiple threads.</p><h3>Create Multiple Threads</h3><p>Creating multiple threads is simply called multithreading. If we want to create multiple threads, we can go for both above two ways of Thread creation. For an instance, let’s take a look at extending Thread class to multithreading here.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b7ea5b961b2cf91d76f44eccbb26a726/href">https://medium.com/media/b7ea5b961b2cf91d76f44eccbb26a726/href</a></iframe><p>Output :</p><pre>Thread 8 is running<br>Thread 9 is running<br>Thread 10 is running<br>Thread 11 is running<br>Thread 12 is running<br>Thread 13 is running<br>Thread 14 is running<br>Thread 15 is running</pre><p>This is the entire concept behind Thread Creation in Java. I hope this helps you.</p><p>Cheers guys!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8d61169cea91" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to do a Simple Animation with ProB | A Step-by-Step Guide]]></title>
            <link>https://rasarathrilanka.medium.com/how-to-do-a-simple-animation-with-prob-a-step-by-step-guide-8e9e6b437aa?source=rss-887dbf6dac51------2</link>
            <guid isPermaLink="false">https://medium.com/p/8e9e6b437aa</guid>
            <category><![CDATA[animation-function]]></category>
            <category><![CDATA[probs]]></category>
            <category><![CDATA[animation]]></category>
            <category><![CDATA[b-specification]]></category>
            <category><![CDATA[robot-maze]]></category>
            <dc:creator><![CDATA[Rasara Thrilanka]]></dc:creator>
            <pubDate>Mon, 28 Dec 2020 10:37:30 GMT</pubDate>
            <atom:updated>2020-12-28T10:37:30.572Z</atom:updated>
            <content:encoded><![CDATA[<h4>A simple Robot-Maze animation in ProB</h4><blockquote><em>You can find a comprehensive guide in the </em><a href="https://www3.hhu.de/stups/prob/index.php/Main_Page"><em>ProB official website</em></a><em> to use ProB Animator, BUT I thought to share my experience and some tips which I’ve followed to do a simple animation in minimal steps. So let me walkthrough the process that let to the completion of the Robot-Maze Animation.</em></blockquote><h4>The Robot-Maze Puzzel</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/1*Yr87bzDNKhAKbIyo_v4y3A.png" /><figcaption>Figure 1 : The Maze &amp; Robot</figcaption></figure><p>We are required to develop and animate a B specification of a Robot moving from entrance to exit around a simple Maze using B tools<em>.</em></p><p>By this article, I’m gonna cover up only the animation part of the B Specification with ProB. Here we go…</p><h4>Prerequisites</h4><p>Prior to the animation, make sure that the following steps are completed.</p><p><strong>01.</strong> First, you need to <a href="https://www3.hhu.de/stups/prob/index.php/Download">download</a> and <a href="https://www3.hhu.de/stups/prob/index.php/Tutorial_First_Step">install</a> ProB successfully to your PC. (Still you are stuck in here, make sure to work with correct version compatible to your machine.)</p><p><strong>02.</strong> When you are animating in Prob B, you may need some additional tools to configure. Then only you can generate process diagrams as graphs. Graphviz is the tool we are using, That can be downloaded at <a href="https://graphviz.gitlab.io/download/">here</a>.</p><p><strong>03. </strong>Write the B Machine specification to implement the robot navigation logic. The specification must be syntactically &amp; type correct. (You can easily do this using <a href="https://www.atelierb.eu/en/download/">AtelierB</a>)</p><p><strong>Note</strong> : Under B Machine specification, the following constants and variables need to be defined and declared with related to the animation. (You don’t need to do this, if you’re already defined this in your B machine)</p><ul><li>maze_x_range : x-axis range of the Maze</li><li>maze_y_range : y-axis range of the Maze</li><li>internal_wall : a set including the internal walls of the Maze which are prohibited to visit.</li><li>robot_x_position : x-axis value of the current position of Robot</li><li>robot_y_position : y-axis value of the current position of Robot</li></ul><p>Here I attached the B Machine specification only for the robot navigation with related to the animation part.</p><pre>CONSTANTS<br>    width, <br>    height,<br>    maze_x_range, <br>    maze_y_range,<br>    internal_wall<br>    <br>PROPERTIES<br>    width = 7 &amp; <br>    height = 5 &amp;<br>    maze_x_range &lt;: NATURAL1 &amp; maze_x_range = 1..width &amp; <br>    maze_y_range &lt;: NATURAL1 &amp; maze_y_range = 1..height &amp;<br>    internal_wall = {(1 |-&gt; 3), (2 |-&gt; 1), (2 |-&gt; 3), (2 |-&gt; 5), (3 |-&gt; 3), (4 |-&gt; 2), (4 |-&gt; 3), (4 |-&gt; 4), (6 |-&gt; 1), (6 |-&gt; 2), (6 |-&gt; 4), (7 |-&gt; 4)}</pre><pre>VARIABLES<br>    robot_x_position,<br>    robot_y_position</pre><pre>INVARIANT<br>    robot_x_position : NATURAL1 &amp; robot_x_position : maze_x_range &amp;<br>    robot_y_position : NATURAL1 &amp; robot_y_position : maze_y_range </pre><pre>INITIALISATION<br>    robot_x_position := 1 ||<br>    robot_y_position := 1 <br></pre><p><strong>Note</strong> : You can either use the corresponding names and values which you have used for your own implementation instead of just copying and pasting which is a bad habit 😉.</p><p>Once you are done with this, you can head on to the animation part.</p><h4>Animation</h4><p>I attached the graph (<em>Figure 1</em>) which need to be created<em>.</em></p><p>The only thing you need to do is just add the following block to your B Machine specification under DEFINITIONS and run ProB. Then you can get the animated graph as it is in <em>Figure 1</em>.</p><pre>DEFINITIONS</pre><pre>// These functions will be used to create the graph<br>    ANIMATION_FUNCTION == ({ row, col, img | col:maze_x_range &amp; <br>row: maze_y_range &amp; img=0 &amp; (col, 6-row) /: internal_wall });<br>    ANIMATION_FUNCTION1 == ({ row, col, img | col: maze_x_range &amp; <br>row: maze_y_range  &amp; img=1 &amp; (col, 6-row) : internal_wall });<br>    ANIMATION_FUNCTION2 == ({ row, col, img | col: maze_x_range &amp; <br>row: maze_y_range &amp; img=2 &amp; col=robot_x_position &amp; row=(6-robot_y_position) });</pre><pre>// Images for animations<br>    ANIMATION_IMG0 == &quot;images/empty_cell.gif&quot;;<br>    ANIMATION_IMG1 == &quot;images/internal_wall.gif&quot;;<br>    ANIMATION_IMG2 == &quot;images/robot.gif&quot;;</pre><p>The created graph (<em>Figure 2</em>) for the above DEFINITIONS is,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*BnJ404bOi2TxGANARuwUYw.png" /><figcaption>Figure 2 : The animated graph</figcaption></figure><p>This is all that was required to handle the entire animation!😋</p><p>As there’s always BUT…</p><p>You MUST know how the animation takes place here to apply this to another different scenario. So, Let’s try to understand this logic.</p><h4>Explanation of the Animation logic</h4><p>As interpreted above there are three functions,</p><ul><li>ANIMATION_FUNCTION represents the empty squares/cells which Robot can be moved.</li><li>ANIMATION_FUNCTION1 represents the internal wall squares/cells which Robot has prohibited to visit.</li><li>ANIMATION_FUNCTION2<strong> </strong>governs the logic to navigate the Robot as the program flowed.</li></ul><p>All these 3 functions contain <strong>3</strong> variables, which are row<strong>, </strong>col &amp; img.</p><ul><li>row : the number of horizontal cell required for the maze</li><li>col : the number of vertical cell required for the maze</li><li>img : the image to be placed on each of the cells</li></ul><p>To place the relevant image to the each cells, here I included some specific conditions to the each definitions.</p><ul><li>(col, 6-row) /: internal_wall means that the corresponding cell is not an internal wall; so it should be an empty cell.</li><li>(col, 6-row) : internal_wall means that the corresponding cell is an internal wall.</li><li>col=robot_x_position &amp; row=(6-robot_y_position) means that the corresponding cell is equal to the current position of robot need to be placed.</li></ul><p>According to the definitions, the above three functions are assigned 3 different values to img which are 0,1 and 2.</p><p>When img=0, img=1 and img=2 the image that will be displayed areANIMATION_IMG0 , ANIMATION_IMG1 and ANIMATION_IMG2 respectively.</p><p>I think, now you guys have a clear idea on this. Isn’t it?</p><p>But WAIT… We missed something.</p><p>Go and check again those 3 animation functions. What is the 6 inside them? Is it a mistake? <strong>Shouldn’t it be without “6 -” ?</strong></p><p><strong>What is the 6 inside the Animation functions ?</strong></p><p>Before bogging into the explanation, I will show you, what will create <strong>without “6 -”</strong>. Then you will get to know by your own, why I am using that.</p><p>The DEFINITIONS which I’ve used (without “6 -”) is,</p><pre>ANIMATION_FUNCTION == ({ row, col, img | col:maze_x_range &amp; <br>row: maze_y_range &amp; img=0 &amp; (col, row) /: internal_wall});<br>ANIMATION_FUNCTION1 == ({ row, col, img | col: maze_x_range &amp; <br>row: maze_y_range  &amp; img=1 &amp; (col, row) : internal_wall });<br>ANIMATION_FUNCTION2 == ({ row, col, img | col: maze_x_range &amp; <br>row: maze_y_range &amp; img=2 &amp; col=robot_x_position &amp; row=robot_y_position });</pre><p>The created graph (<em>Figure 3</em>) for the above DEFINITIONS is,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/696/1*_2ek6Ob66FLWUMrw-pV7UA.png" /><figcaption>Figure 3</figcaption></figure><p>ooh ! Now the graph is vertically flipped. What happened here? I will clarify this in a short &amp; sweet manner.</p><p>If we compare the two created graphs in <em>Figure 2</em> and <em>Figure 3</em>,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PilXHdURraQ7I44hKj6CSw.png" /><figcaption>Figure 4 : Comparison of two different outputs</figcaption></figure><p>Here, you can see in <em>Figure 3</em>, the row<strong> </strong>and<strong> </strong>col positions that are defined in the ANIMATION_FUNCTIONS , count from top left corner to bottom. Now look at the very first image (<em>Figure 1</em>) which is required us to do. There, the x and y positions count from bottom left corner. Because of this change, only the row numbers are mismatched each other. So to compatible with the required process, we need to use 6-row instead of just using row as it is for the row numbers. Then you can realised (in Figure 4) how the Figure 3 converts to Figure 2 and it’s matched with final required output.</p><p>Now you are completely getting touched with entire idea.</p><h4>Demonstration</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FEOuJPbRjfy8%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DEOuJPbRjfy8&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FEOuJPbRjfy8%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/599afa235f791e7c842d520a12e0d3e4/href">https://medium.com/media/599afa235f791e7c842d520a12e0d3e4/href</a></iframe><p>Yes, it is simple as that… 😋 We did it guys !</p><p><strong>How should I apply this to another scenario?</strong></p><p>As an instance, think about a Queen movement in a chess board.</p><p>What you have to do is, replace row &amp; col with the number of horizontal and vertical images/grid cells respectively and img with corresponding definitions to the position of the Queen.</p><p>Likewise, First you point up the concept to your mind carefully and then you can try this out to any scenario.</p><p>I hope this helps. Cheers!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e9e6b437aa" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>