Posts
Idea of 'closure' in functional programming
Closure The inner function has access to variables which were in the enclosing scope even after that ’ennclosing scope’ execution is over. (Inner function gets a copy) This is my attempt to understand why is this such an important concept in functional programming, why is it named so and so on… Functions are first class citizens In functional paradigm of programming functions are considered as ‘first class citizens’. This means functions can be
read morePosts
Monoliths Vs Microservices
Microservice is not the silver bullet Software Industry is heavily trend-driven. People love going behind the trendy hypes
microservices are cool containers are cool noSQL is cool this new language/framework is cool what makes a good use case for microservice? functionality has very clear demarcation/boundary (the most important.. don’t try to force split an already domain complex module) functionality needs independent scaling functionality needs lot of re-use (many components need it) functionality demands language agnosticity (rapid iterations, deployment) what should you ensure?
read morePosts
Debugging Slow Queries In Backend
What are the things that should be on your checklist when you are facing a situation where your db queries are taking a lot of time?
Cross check simple things such as if you would require pagination. If your filters are none (or too broad) even with optimized query plan/indexing query can take some time.
Take the slow query, view the execution plan and cross check if you would require indexing, if your query is set to run with the indices (eg: is the query properly making use of functional indices?
read morePosts
Why Some ISPs block TCP 22?
Why Some ISPs block TCP 22?
Recently I got to know that some ISP indeed block any outbound traffic for port 22 (tcp) which is a standard port for ssh connections.
(I came to know about this as I was being unable to log into one of the compute instances from my terminal via gcloud in gcp. I prefer terminal logins instead of browser as it’s simply 100 times easier to work with.
read morePosts
Safely Indexing an Array (C to Java)
Arrays
Arrays are contiguous locations of memory set aside during compilation. (memory allocated is virtual address which is later mapped to actual memory address during run-time)
In the most simple form you need a base address and you can read starting from there. (there’s a limit how far you can go even with languages like C)
Simple Integer Array in C:
int arr[] = {1,2}; for (int i=0;i<10;i++){ printf("%d\n",arr[i]); } C doesn’t have a way to have a check on how far to go.
read morePosts
First PR (rather lame) that got merged
This was primarily for the inconvenience I had faced a few days prior java-storage API returns null for object with space in name
Fixing this issue required a bump in version
Upgraded version required an additional dependency which wasn’t documented. I added it.
(This is a rather lame contribution but I hope it gives me an impetus for trying and exploring more)
read morePosts
ENTRYPOINT Vs CMD in Docker
CMD Vs Entrypoint is a bit confusing at the beginning. When should you use CMD and when should you use ENTRYPOINT while building your docker images?
CMD
This is the command that runs when you start a container.
Eg:
cmd-docker
FROM ubuntu CMD [ "echo" , "this is running from CMD which runs when the container starts" ] Building an image:
docker build -t cmd-docker -f cmdvsentrypoint.yaml .
Default docker run:
read morePosts
(Book Review) Tuesdays with Morrie
Tuesdays with Morrie
I loved the narration.
I loved the content and the insights this book provides in addition to the beautifully crafted chapters. Almost every page gets you into a contemplative mode of introspection about life, love and the ‘culture’.
The biggest take away for me from this book is this:
Culture is a man-made thing and is presented in such a way that people tend to conform to it.
read morePosts
gcloud sdk
Accessing gcp compute instances via gcloud sdk
You have a bunch of options to ‘ssh’ into gcp VM instances:
open in browser window open in browser window on custom port open in browser window using provided ssh key another ssh client (putty, termius, etc) I personally find the ‘gcloud sdk’ way much more convenient to use since I can just launch it from my terminal without having to open the browser, log into cloud console, locate the vm instance and then ssh’ing into it.
read morePosts
What is good problem solving?
Problem Solving is the gold
We all focus on problem solving. We are in pursuits of so many activities which aim to identify the problems, propose a solution to them, build the solution and hopefully create some value out of it. But what is good problem solving? Especially in the realm of computer science.
The greatest part in ‘problem solving’ is not actually the solution. Its the break down of the problem.
read more