We don’t like to talk but we like to perform

Photo by Womanizer WOW Tech on Unsplash

Only moment we forget the world, just thinking of it.
Only moment we close eyes, to see better heart;

Only moment we enjoy pain, pleasing the mind.
Only moment we like to wait, finishing up not;

Only moment we are cruel, showering of love.
Only moment we feel hard, eventually softer;

Only moment we ensured, sign of success.
Only moment we fall, symbol of triumph;

Only moment we die, rebirth of soul.
Only moment we live, wishing to die;

Only moment we dissatisfied, early victory.
Only moment we satisfied, thirst of heart;

Only moment we stop, for better start. …


New improvements in Kernel module Elixir 1.12

This article is all about knowing the two newly added macros then/2 and tap/2 from Kernel module. Here, we cover some real world situations with simple examples where these functions would be useful.

Actually these are macros, point to be noted.

Let’s check when and where to use these functions.


Check out the

Don’t fear to reply anymore.

BG Photo by Nicolas Jehly on Unsplash

In this article, we are talking about two scenarios on how to use reply function in GenServer module explaining with live examples.

The following are the two use cases we are going to cover in this article.

  1. Multi Node Communication via server messages using multi_call
  2. Converting Asynchronous request to Synchronous

What this article isn’t about ?

It don’t talk about GenServers and its usage. I hope you already know about the GenServer and its functions. If not check the following articles to master GenServer.

Article References for better understanding GenServer


Let’s unveil

IO Lists and Phoenix rendering Templates

Photo by Ben White on Unsplash

In this article we are going to see the optimal way to develop a big string from the pieces of strings. We also look into why IO Lists are used for rendering templates in Phoenix and why this is the best approach.

We start with a simple concatenation operation that we use in every day by either string interpolation or binary concatenation operator <> and also we look into iolist style.

Let’s Code it.

For example developing the full_name from the first, middle and last name.

Consider the following function

1) String Interpolation

def gen_full_name(first_name, middle_name, last_name)
"#{first_name} #{middle_name} #{last_name}"
end

Of course…


Give a try on

Better try and fail than being idle.

Photo by Viktor Talashuk on Unsplash

While learning to program in Elixir, I discovered some strange things. In this post, I dive into the 5 strange approaches that you may or may not know to expose its underlying mechanisms.

Talk is cheap, here is the code.

1. Compile Time Vs Run Time Struct Pattern Matching — In Different way

We all know that structs can be pattern matched with %StructName{}

Consider the following struct Student

defmodule Student do
defstruct name: "john"
end

We generally use the following approach to pattern match the above struct. But, it expects the struct to be available at the compile time itself.

%Student{} = student

The struct can also be pattern matched as

%{__struct__…


Put the brain on

Change is inevitable but not for Elixir

Photo by Aleks Dorohovich on Unsplash

This article comprises a simple example with an anonymous function that explains the data immutability in Elixir Programming.

The concept of data immutability is that the data once it is created in a memory location cannot be altered. Immutability must be preserved.

Before going to actual coding, we need to know fewer things.

The Match Operator =

In Elixir, the = is not an assignment operator and if you see any instructions or statements similar to a=7 is not an assignment. Here, a=7 means a match or binding. So, = in Elixir is a matching operator.

Most of the programmers and myself are fond…


Win over the

It’s all about the space

Photo by jean wimmerlin on Unsplash

I have been traveling with Elixir for 5 years where I saw many curved roads in my journey to be a slower learner. Then after I started drifting the curves and of course I met with many accidents. I’m still alive.

About the Article it isn’t:-

It is not about the coding and I’m not going to teach you anything here. I’m telling you the stories. If you are a good listener or a reader, then it is for you.

It is for fellow programmers who care about speed & memory :-)

One must remember that coding is not about how fast you type, it’s…


Find out

Puzzle solving using elixir.

breakthecode.tech

Elixir is fun when you find time to play with it.

I have broken into the first three room levels at breakthecode.tech challenges. So, With 6 distinct game rooms, Break The Code will put your logic, knowledge and creativity to the test. It is a set of challenging games with prizes galore, for you! [From Website]

In one of the rooms, I encountered a problem and took the elixir help to solve it. It is completely math. You can do with any programming language, but Elixir made it simple for me.

Let’s go…

Problem

A = 1 , B = 2


Learn about

Charts are the good-looking way of data

Logos are the properties of respective company

In this article, we are going to use Chart.JS, a Node Library in a Phoenix application. I hope you already know how to work with Phoenix.

Here, we try to replicate a company’s progress yearly. We also provide UI for adding year based progress to our database.

The whole process involves 5 steps.

Let’s dive in.

At the moment of writing this article , I am using the following configuration.

Hex:    0.20.5
Elixir: 1.10.4
OTP: 23.0.3
Built with: Elixir 1.10.0 and OTP 21.3

Step1 — Creating A New Phoenix Project

mix phx.new hello

Create a new Phoenix project using the above command and run the necessary commands…

Blackode

coding, thoughts & ideas

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