Simple Consumer Producer Parallelism using GoRoutines

Why?

One key advantage of the Go programming language is concurrency support out of the box through the use of GoRoutines. As you all know, GoRoutines can support parallelism support. However, parallelism is valuable in certain scenarios such as getting prediction from multiple machine learning models at the same time. Concurrency, in that case, would not be ideal.

Now the question is what does a simple parallelism pipeline look like? In this article, I will talk about an example on how we can achieve parallelism using GoRoutines.

How

Here are the components that form this example,

  • Worker 01
  • Worker 02
  • Producer/Sink


https://www.basf.com/sg/en/media/news-releases/asia-pacific/2021/01/basf_caregen_supply_agreement.html

Whether you are doing machine learning NLP engineering and/or research, you may come across Named Entity Recongition (NER) topics. Some of you may be working on proof of concepts (PoCs) that involves integrating one of those open source NLP frameworks into an actual model inference platform.

Some burning questions could be,

  • I don’t have the time to research on existing popular NLP frameworks, I want to know how they perform especially on NER topics.


You may be a follow engineer/developer scratching your head on how to scale your machine learning micro services pipeline. You may have read an article on using a streamer device for parallelized pipeline messaging[1] but do not know how to test the source code or extending to multiple services. This article extends on the knowledge and attempts to bridge the knowledge gaps.

Your intended machine learning micro services pipeline may involve multiple services that need to be scaled accordingly. This could consist of a service that produces data to multiple worker services in parallel. …


Photo by Domenico Loia on Unsplash

Backstory

Battleship is an exciting game where the player will attempt to select locations where the ship is placed. The ship location is obviously hidden from the player. In this simple implementation of the game, the player will input the X and Y coordinates of the playing grid. Each time the player does not hit the hidden ship, an “X” will be displayed on the playing grid. …


Photo by Wes Hicks on Unsplash

Backstory

I was first made aware of Coursera’s Guided Project when I received an email from them. Out of curiosity, I wanted to check them out, just to see if they can help with my learning. On their page, they cover projects on data science, business, and computer science in general. I was exploring through what they had to offer for data science and chanced upon “Named Entity Recognition using LSTMs in Keras” Guided Project. This will offer me two things, one is learn Named Entity Recognition and two is an experience in Guided Projects.

I’ll be going through the following…


Photo by Markus Winkler on Unsplash

Backstory

I took and passed my Certified Associate in Project Management (CAPM) exam in mid 2017. It was my first certification and I took it as I wasn’t eligible to take the Project Management Professional (PMP) certification. The CAPM provides an entry level exposure to project management if one didn’t not qualify for the PMP. I had to go through a 3 days course over 25 hours of course time as I have to finish the course before I am allowed to attempt the exam.

Today’ article is about sharing the resources that I have curated to allow me to pass…


Photo by Patrick Perkins on Unsplash

Backstory

Scrum has been a widely adopted process framework for developing products, especially in the software industry. It has been increasingly required for software engineers, designers and product managers to understand and support Scrum.

Today’s article is not explaining about Scrum, it is for people who wants to take on a certification as a Scrum Master, whether being pressured by HR or just a personal achievement. This article will walk you through the resources that enabled me to pass the Professional Scrum Master Level 1 certification by scrum.org. …


Photo by chuttersnap on Unsplash

Backstory

Ever wondered if the search algorithms that you have learnt in high school or college/university, would perform differently in different programming languages?

In this article, I will show you how linear and binary search algorithms can be implemented in two programming languages, namely Python and Rust language. Furthermore, the performance comparison between the two algorithms in those two languages.

Before we start on this article, I would like to give a quick shout out to my previous article, https://medium.com/@leonardyeo_xl/evaluating-performance-on-classic-sorting-algorithms-in-python-and-rust-76f981dfc0c, if you are into performance evaluation sort of thing.

Alright, let’s get started!

Prerequisites

Before continuing with this article, you should have,


Photo by chuttersnap on Unsplash

Backstory

Algorithm performance has always been one of the key factors in solving complex real world use cases. We need efficient algorithms especially in the case of sorting huge amounts of data. In this article, I will walk you through how Bubble, Insertion, Quick and Merge sort algorithms are implemented in Python and Rust programming languages to find out if the programming language does matter in getting the edge in performance.

Prerequisites

Before continuing with this article, you should have,

  • basic understanding of some classic sorting algorithms

Environment

  • Docker version 19.03.6
  • Python 3.7.3
  • Rust 1.43.1

Bubble Sort

Python


Expression tree illustration [1]

What is an Expression Tree?

In this article, I will show you how to create an expression tree that stores the tokens of a binary arithmetic expression.

An expression tree is a binary tree with the following properties:

  1. The root and internal nodes are operators.
  2. Subtrees are sub-expressions, with the root being an operator.

What is an Arithmetic Expression?

An arithmetic expression is a sequence of tokens that follows prescribed rules. A token may be either an operand or an operator.

A binary arithmetic operation using the standard arithmetic operators, additon(+), subtraction(-), multiplication(*), division(/), may be in the form of operand-operator-operand.

For example, 2 +…

Leonard Yeo

Generalist-Specialist juggling between learning and career development. Educator at https://www.eduelk.com, https://www.linkedin.com/in/leonardyeoxl

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