Let’s build more robust concurrency systems

State diagram generated by the LTSA tool
State diagram generated by the LTSA tool
State diagram generated by the LTSA tool

Hello, I’m Asel. Today, I’m going to show you how to model a concurrent program using FSP by going through an example scenario.

First of All, Let's Look at Why We Need Concurrency

  • By using concurrency, we can gain performance from multiprocessing hardware, aka parallelism
  • Increased application throughput (the I/O call only needs to block one thread)
  • Increased application responsiveness due to executing the main tasks parallel to the background tasks (high-priority thread for user requests)
  • More appropriate structure (programs that interact with the environment, control multiple activities, and handle multiple events)

What’s FSP?

Finite state processes (FSP) is an abstract language that’s used to develop concurrent systems of processes.

We use modeling to gain confidence in the adequacy and validity of a proposed design. As with most complex design tasks, concurrency is best understood by employing multiple levels of abstraction. …


Deep learning pc build with all new Nvidia RTX 3080.

Image for post
Image for post
A personal Deep Learning Computer

Compared to the last year's RTX 20 series, this year RTX 30 GPU prices are cut down half. So now it's cheaper to build a pc than using a cloud service for your deep learning tasks in the long run. Amazon Web Services EC2 P3 instance with a one Tesla V100 GPU (Google Cloud or Microsoft Azure has the same prices also) will cost you $3 / hour or about $2100 / month. That's more than enough to build our own pc. Even when you shut your machine down, you still have to pay storage for the machine at $0.10 …


Writing a PID as a software engineering undergraduate.

Image for post
Image for post
project planning: image by William Iven

Why PID is IMPORTANT?

You may have been wondering why on earth we are wasting weeks doing documentation like this. You may think, why don’t we start doing prototyping so you can get ahead of schedule. Doing research is not that simple; It’s a well-planned task. Actually, documenting phases will help you in the rest of the project. It is the first basic step to ensure your project sets off on the right foot.

If you want to write a good PID, first, you have to understand its flow. All the topics are in PID are nicely connected. …


Get to know about one of the major scams in both crypto and stock trading before start trading.

Image for post
Image for post
crypto exchanges

Let's understand Pump and dump in a nutshell. A pump and dump scheme refers to a group of people artificially inflating the price of an asset through recommendations based on false, misleading, or greatly exaggerated statements. In essence, they will buy an asset for a low price all at once, prompting the price to rise. This sudden and rampant increase in nominal value will prompt unknowing traders to jump in and purchase the asset as they hope to ride a bull market. The original buyers then sell (dump) the assets to make a quick profit. …


Learn about coin freezing and Super Representative voting.

Image for post
Image for post
bitcoin, ethereum,litecoin

First I have to tell you this is not a super rewarding way to earn more Tron, but it is a risk-free method to use your available Tron to gain some more! This method is applicable to almost all of the cryptocurrencies, to demonstration purposes I’ll be using Tron and TronLink Wallet. It is a safe, professional, and comprehensive Tron wallet (TRX wallet), which is officially recommended by Tron.

This article is not sponsored or does not contain affiliate links. I’m writing this just to share my experience.

Let’s understand why they are offering this change to us and what is Staking.

Staking is the process of holding funds in a cryptocurrency wallet to support the operations of a blockchain network and, in return, holders are rewarded for their contribution.

Tron achieves a high rate of transactions per second (TPS) through a Delegated Proof of Stake mechanism. In the consensus, there are Super Representatives (SR) which are the block producers on the network. By making blocks those SR earn TRX rewards, that are redistributed to their voters. …


Get to know about the world's largest open-source contribution event.

Image for post
Image for post
Hacktoberfest 2020

Hacktoberfest is a monthlong celebration of open source software run by DigitalOcean. Hacktoberfest is open to everyone in our global community! Four quality pull requests must be submitted to public GitHub repositories. You can sign up anytime between October 1 and October 31.

How can a beginner participate?

It's simple. All you need is a Github account. GitHub is the center of the open-source universe. Register at hacktoberfest.digitalocean.com. Then you need to make 4 valid pull requests to a public repo. That's all!


This daemon can be used in the application server or in the database server to execute system commands using rest API calls.

Image for post
Image for post
actix.rs

Hello, I’m Asel. Today, I am going to show you how to create a rest API for executing system commands in your server. This method is used by well-known companies. Imagine you have moved your database to another server other than your backend server and you want to take control of your database server from your backend API. For that, we have to create a daemon in the database server.

*note — I’m writing this as a POC. If you are going production you should consider security issues seriously( using https etc).

Step 1 — Picking up dependencies

Let’s start by adding a couple of dependencies to our project. …


Build your API with the most-loved language of the past four years on Stack Overflow

Image for post
Image for post
Mozilla Rust

Hello, I’m Asel. Today, I am going to show you how to create a simple REST API in Rust.

For that, we are going to use the Rocket framework for the API and Diesel ORM framework for persisting features. This framework will cover all the things mentioned below. So, it will be much easier than implementing it from scratch.

  • Start a web server and open a PORT.
  • Listen to requests on this PORT.
  • If a request comes in, look at the Path in the HTTP header.
  • Route the request to the handler according to the Path.
  • Help you extract the information from the request. …


Verify that your app works and looks great in all supported languages

Image for post
Image for post
Photo from Travis CI.

In this article, I’m going to show you how to set up Travis CI to build multiple language applications in the same GitHub repo.

First, you have to make a repository on GitHub. I’m going to quickly skip through that step and assume that you have created the project in your local machine. Since I love Rust, I chose Rust and Angular to do this demo.


Image for post
Image for post

Angular 8 was released few months ago.I’m gonna mention the angular 8 new features before going to explain who to use web workers.

  • Preview of Ivy
  • Web Workers
  • Lazy Loading
  • Improvement of ngUpgrade

These are more like performance upgrades to compete with React. hahaha!

There are two popular ways to integrate Web Worker in your angular application:

  1. Run all the business logic of your application in a web worker thread.
  2. Run some of CPU intensive business logic in a web worker thread.
    (Like a password encryption processes in the login)

I’ll explain my experience with web workers and why I wanted it. In the project that I’m working on, there are some components that have more than 8 database requests and other computational tasks in the OnInt();.So …

About

Asel Siriwardena

University of Westminster • Former Software Engineering Intern — DirectFN | Mubasher • https://www.linkedin.com/in/aselsiriwardena/

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store