Kiran Kumar Panigrahi has Published 61 Answers

What is Accrual Principle in Accounting?

Kiran Kumar Panigrahi

Kiran Kumar Panigrahi

Updated on 17-Nov-2021 05:10:34

The Accrual Principle is a concept in Accounting where the financial transactions are recorded during the same time period in which they occur. Note that the actual cash flow may occur at a later stage. For example, suppose a company supplies goods worth $50, 000 in the first quarter of ... Read More

What is Value-Based Pricing?

Kiran Kumar Panigrahi

Kiran Kumar Panigrahi

Updated on 17-Nov-2021 05:09:20

Cost-Plus Pricing Vs Value-Based PricingIn general, companies calculate the selling price of a product or service based on the costs incurred in manufacturing that product or delivering that service. This is what we call Cost-Plus Pricing strategy where the price of a product is proportional to the manufacturing cost.We very ... Read More

What is Marginal Benefit?

Kiran Kumar Panigrahi

Kiran Kumar Panigrahi

Updated on 17-Nov-2021 05:00:32

We can define Marginal Benefit as the maximum amount a buyer can pay for an extra unit of product purchased after the first unit. Consumers normally tend to compare the marginal cost of purchasing an extra unit with the marginal benefit derived from purchasing it. In other words, we can ... Read More

Decorator function pattern in Golang

Kiran Kumar Panigrahi

Kiran Kumar Panigrahi

Updated on 01-Nov-2021 08:00:50

Decorator function pattern is a pattern that is mainly found in Python and JavaScript, but we can also use it in Golang.It is a pattern in which we can add our own functionality over a current function by wrapping it. Since functions in Golang are considered firstclass objects, which in ... Read More

How to get the current username and directory in Golang?

Kiran Kumar Panigrahi

Kiran Kumar Panigrahi

Updated on 01-Nov-2021 07:58:39

Sometimes there are cases where we want to know which user is executing the current program and in which directory and we can get all these details with the help of the user package that is present inside the os package of Go's standard library.In this article, we will explore ... Read More

How to get the size of an array or a slice in Golang?

Kiran Kumar Panigrahi

Kiran Kumar Panigrahi

Updated on 01-Nov-2021 07:47:24

In case we want to get the size of an array or a slice, we can make use of the built-in len() function that Go provides us with.Example 1Let's first explore how to use the len function with an array. Consider the code shown below.package main import (   ... Read More

How to close a channel in Golang?

Kiran Kumar Panigrahi

Kiran Kumar Panigrahi

Updated on 01-Nov-2021 07:45:20

We can close a channel in Golang with the help of the close() function. Once a channel is closed, we can't send data to it, though we can still read data from it. A closed channel denotes a case where we want to show that the work has been done ... Read More

How to check if a string is a valid URL in Golang?

Kiran Kumar Panigrahi

Kiran Kumar Panigrahi

Updated on 01-Nov-2021 07:41:23

There are cases where we would want to know if the URL that we got from an http request in the form of a string is even valid or not. In such cases, one can use two functions that the net/url package of Go's standard library provides.Example 1The first basic ... Read More

What are WaitGroups in Golang?

Kiran Kumar Panigrahi

Kiran Kumar Panigrahi

Updated on 01-Nov-2021 07:36:26

There may be instances in Golang where the execution of different goroutines may cause unexpected behaviour. In such cases, we want to make sure that certain goroutines work in a predefined manner and the program waits for all goroutines that are launched from the main function to wait. To do ... Read More

How to use Mutex in Golang?

Kiran Kumar Panigrahi

Kiran Kumar Panigrahi

Updated on 01-Nov-2021 07:33:12

In order to understand why mutex in Go play a significant role to write better and accurate concurrent programs, we must first be aware of the concept called Race Conditions. Let's first understand what Race conditions are and how we can write a concurrent program that features a race condition ... Read More

Advertisements