Open in app

Sign In

Write

Sign In

Ankit Wadhwana
Ankit Wadhwana

17 Followers

Home

About

Dec 22, 2022

Recursion in Golang

In computer science, recursion is a method of solving a computational problem where the solution depends on solutions to smaller instances of the same problem. Recursion solves such recursive problems by using functions that call themselves from within their own code Source: Wikipedia To understand Recursion in a visual format…

Golang

4 min read

Recursion in Golang
Recursion in Golang
Golang

4 min read


Apr 29, 2022

Renaming git branch Local and Remote

How often it has been that you created a new branch and accidentally spelled it wrong or you started working with a branch and later down the timeline there was a need to change the branch name? I’m sure we all have run into such kinds of scenarios. Modern code…

Git

2 min read

Renaming git branch Local and Remote
Renaming git branch Local and Remote
Git

2 min read


Sep 26, 2021

Managing Docker containers. 🐳

Today we’ll be looking into two things. First is how we can persist the data with docker-compose. The second is using a script to manage your docker composes. Persisting data with docker-compose: Use volumes: Volumes are the preferred mechanism for persisting data generated by and used by Docker containers. While bind mounts are dependent…

Docker

2 min read

Managing Docker containers. 🐳
Managing Docker containers. 🐳
Docker

2 min read


Jan 15, 2021

Golang struct size and memory optimisation.

As I came across this example by my colleague, I was pleasantly surprised as I didn’t know how the memory allocation works internally, when you instantiate a struct. But not anymore 😎 Before trying to understand how and why the size of the struct varies , let’s review some fundamentals: …

Go

3 min read

Golang struct size and memory optimisation.
Golang struct size and memory optimisation.
Go

3 min read


Jul 21, 2020

My solution for the slice exercise on A Tour of Go.

Exercise: Slices Implement Pic. It should return a slice of length dy, each element of which is a slice of dx 8-bit unsigned integers. When you run the program, it will display your picture, interpreting the integers as grayscale (well, bluescale) values. The choice of image is up to you. Interesting functions…

Go

1 min read

My solution for the slice exercise on A Tour of Go.
My solution for the slice exercise on A Tour of Go.
Go

1 min read


Jul 21, 2020

My solution for the map exercise on A Tour of Go.

Exercise: Maps Implement WordCount. It should return a map of the counts of each “word” in the string s. The wc.Test function runs a test suite against the provided function and prints success or failure. package main package main import ( "strings" "golang.org/x/tour/wc" ) func WordCount(s string) map[string]int { //using make to initialise an empty map stringSlice := make(map[string]int) //words is a slice of substrings of s words := strings.Fields(s) for _, v := range words { //If key is not in the map, //then elem is the zero value for the map's element type. //zero value of int is 0 //incrementing it by 1 for the number of times the key is found stringSlice[v]++ } return stringSlice }

Go

1 min read

My solution for the map exercise on A Tour of Go.
My solution for the map exercise on A Tour of Go.
Go

1 min read


Jun 16, 2020

Installing Go Lang on Mac (Homebrew)

I’m starting to learn GoLang today and they’ve a coding playground on the homepage which is really cool and easy to get started but I’d still like to install it on my machine for developing complex apps and I think you too are looking for the same :P I’m on…

Go

2 min read

Installing Go Lang on Mac (Homebrew)
Installing Go Lang on Mac (Homebrew)
Go

2 min read


Oct 18, 2019

Effective ways to remain motivated.

Lately I was finding it very difficult to remain motivated which was affecting me in a bad way. It was taking me longer to finish a project and even the daily tasks. …

Productivity

3 min read

Productivity

3 min read


Aug 21, 2019

Creating a new rails 6 app

Who will benefit from this post: people who have rails 5.2 or lower installed and looking to create a new rails 6 app from scratch. Make sure your Ruby version is compatible The first change that comes with Rails 6 is the minimum Ruby version it requires. While Rails 5 required at least Ruby 2.2.2, Rails 6…

Ruby

2 min read

Creating a new rails 6 app
Creating a new rails 6 app
Ruby

2 min read

Ankit Wadhwana

Ankit Wadhwana

17 Followers

Live in the moment, be happy (:

Following
  • Shinichi Okada

    Shinichi Okada

  • Judy@webdecoded

    Judy@webdecoded

  • Arun Malik

    Arun Malik

  • TK

    TK

  • Uday Hiwarale

    Uday Hiwarale

Help

Status

Writers

Blog

Careers

Privacy

Terms

About

Text to speech