Thursday, May 28, 2020

A Good Phone

Our lives have been transformed by phones in the last decade. They have become an essential part of our lives. We cannot live without them. 

Thus choosing a phone is no trivial task. 

Before you spend, what normally is a substantial amount of money, you need to decide which phone you will buy. There is no dearth of options. There are too many choices. This makes it more difficult.

To start with you need to choose which mobile universe you will belong to. I remember, a decade ago, there were many universes. Android was just starting. Nokia had championed Symbian. Blackberry was the choice of professionals. IPhone was exploding. Microsoft was jumping into the fray with it's own Windows line up.

When the dust settled, there were just two standing, Android and iOS.

Android backed by Google and iOS backed by Apple. Both giants.

So, before you even start to looking up the phones, you need to decide which Universe you shall join, Android or iOS.

If you choose iOS, then there's just one company that manufactures those phones and that's Apple. And you have to shell out a decent amount of money. Because these phones are expensive. There isn't much choice, but you do get good quality, better security and some status ( at least in India ) to go with it.

If you go for Android, then there are many options. There are cheap phones that won't cost more than 5k-6k rupees. There are mid range phones that range from 10k rupees to 50k rupees. And, there are high end, flagship phones that will make you poorer by more than 100k rupees.

Let's talk about attributes of a decent phone.

There is the issue of RAM and Internal Memory. A phone that won't make you cry while you wait for your favorite app to launch should have at least 4 GB of RAM today. 

If you plan to document your life through photos and videos then you must go for nothing less than 128 GB of internal memory. The more the better in my opinion.

Talking of photos and videos, how can one forget the most essential part of any phone today. The Camera. Or should I say Cameras.

There are a whole of cameras in a single phone today. There is front camera. For when you want to take your own photo - popularly known as taking a selfie. Front camera should be good. The selfies should be great. 

There is back camera. And sometime there are more than one of them. To make your photo quality even better. 

Go for a phone that has at least 32 mega pixel camera. The photos and videos should be great, or else how would they trend on social media.

Wait, there's more. The battery. 

What use a phone is if it's battery dies every 5 hours. A phone worth its salt should be able to survive at least 24 hours on a full charge. A good battery with more than 4000 mAH capacity will do.

Display and CPU are two other things that you may want to worry about. But in my opinion, they are more or less the same on all medium to high end phones.

The size of the phone also does matter. If you have small hands, it does become cumbersome to hold the bigger phones for an extended period of time. 

Unfortunately, there are no phones with good specs and small screen size available in market right now. 

Also the weight of the phone. Do checkout the weight of the phone while selecting. A heavy phone becomes annoying if you use it for a long time. A lighter phone is easy on your wrists.

Happy phone search.

Monday, May 25, 2020

Lockdown and Working from home

Covid-19 has forced most of us to work remotely. This sudden drastic change in our work life has made some of us rethink about the viability of working remotely over an extended period of time.

After slogging in offices for more than ten years, I had started to think that working from home would be the change I want in my work life. It would make my life more relaxed. It would do away with the excruciating commute. The noise at office, the constant interruptions from others and loads of other factors that hinder your focus - all of them would go away. It was like a dream.

When Covid-19 started and lockdown happened, I realized that maybe the long standing dream is coming true. Since everyone was now forced to work from home, this practice would become more mainstream.

Traditionally working from home was not seen as a viable option for large ( or even small) teams for various reasons. Let's look at some of them.


  • If a few members of a team work remotely while rest are working from office, it was thought that the remote workers would miss out on essential communications that happen in office informally. There may be important decisions taken or complex issues discussed in impromptu face to face interactions that the remote workers will never be a part of. Even if a summary of such decisions or discussions is later shared in mail with them, they may not get the same feel for it had they been present themselves.
  • Lack  of socializing for the employees. Apart from the work that one accomplishes, a large part of the work life today is about meeting people at work place, developing friendships with like minded people and developing long term relationships with people you meet during the course of your work. But with remote work, the majority of time you would spend would be at you home office or a co-working space with you attached to your laptop for most part of it. This may lead to development of a certain kind of fatigue due to lack of enough real life social interactions on a day to day basis.
But there were some benefits as well. 
  • Ability to focus to hard problems without any interruptions.
  • Save time and money that was earlier wasted on commute. 
  • You can live anywhere as long as you have a good internet connection
  • Working hours and their time can be flexible

Most people wanted to find a middle path. They would go to office only when needed and work from home when the work could be any without anyone's intervention.

This is the kind of flexibility most of us were looking for. I didn't anticipate what it would be like to be forced to work from home over an extended period of time.

That is what happened with the arrival of covid-19 and subsequent lockdown.  

Working from home doesn't seem that attractive anymore. 

This change of heart could be due to a few reasons. Let's look at them.


  • The need to socialize for us to have a stable work life may be more important than we initially thought.
  • Going to office and working there, makes it easy to leave the work related stress behind when you get back to home. The commute works as some kind of insulation layer between the two environments. 
  • Lack of experience with respect to setting up a home office. Getting the right kind of lighting, the right furniture etc. 
  • Maybe due to lockdown, most people have their families at home now. So the distractions haven't gone away. They have just changed their form. Now you could have to Kids/Spouse/Parents, who could be the one disturbing you.

This has been my experience along with that of some people that I have spoken to.

With Major companies like Google and Twitter now allowing their employees to work from home for the foreseeable future, other companies are likely to follow suit.

How will this change our work culture? The situation is still evolving and we are living in interesting times. 

Let's wait and watch how it turns out.

Friday, May 22, 2020

Dunning–Kruger effect in real world - Of Uber drivers, Torture Movies etc.

I recently came upon the study done by David Dunning and Justin Kruger in 1999, which describes a bias that people may have, that makes them overestimate or underestimate their competence at a certain task.

A person who has little knowledge in a particular field may tend to overestimate their competence or skill level in that field.

While on the opposite side, a person who has a fair amount of knowledge in a particular field may tend to underestimate their competence in that field.

Now, I am sure I have seen multiple examples in my life where this study seems to hold true. So must have you. 

Sometime back I took an Uber. The driver was a middle aged fellow, who looked like he had a lot of experience in cab business. But this guy drove rashly. I literally held on to the roof handle in the back seat the whole ride, fearing for my life, dreading that this guy would crash the car as soon as his luck runs out. I did try to persuade him to drive sanely, but to no avail. He mentioned something about him being the best driver in his driver friends group. When I heard his claim, the first thing that came to mind was that he must be delusional. At least his Uber rating did not seem to concur with his view of himself. I guess, that was Dunning-Kruger effect at play.

So this study seems to be intuitive and does seem to stand with some events I have experienced  or some people I have met. And to take it further, we may say that someone suffering from such a cognitive bias, will tend to screw up the task at hand most of the times.

Take the example of Indian Movies. There are some masterpieces made in Indian film industry that have gained the cult status of being called torture movies. 

A Torture movie is a movie that you would show a suspect to make him confess to his crime. In Indian Jokelore, a torture movie is employed by the police when even the third degree torture fails to get any information or confession from the suspect.

When you think of Torture movies, the first guy that comes to mind is Sajid Khan. This guy has such gems as Humshakals and Himmatwala to boast of. The situation here surely reeks of Dunning-Kruger effect.

Dunning-Kruger effect is evident in workplaces too. Especially in software industry here in India. I have seen plenty of technical leaders get into project management. There is some sort of unspoken code here in Indian SW Industry that to be successful, this is the path one must take. 

And given the herd mentality that most Indians live by, it's not surprising that most of the technical guys do take the next logical step and become project managers. 

Now some of these guys have no clue. They come into project management with confidence gained by working on the technical stuff for more than 8 to 10 years. But being good at technical stuff, doesn't naturally translate into being good at managing a team of humans and getting the best out of them, while still keeping them happy and productive over the long run.

Hence they end up making life miserable for their team. This is certainly not true for everyone out there, but its applicable on a large enough percentage that it deserves a mention here.

Well there must be more examples out there. Will write about them when they come to my mind. 

What other examples of Dunning-Kruger effect do you see in real life? Do share in the comments. Thanks. 

Thursday, May 21, 2020

Thoughts on Korean Series Signal



I recently finished watching the Korean series Signal on Netflix. It has sixteen episodes and each episode is around an hour long. It took me around 2 weeks to finish it.

The series is very good. Though I have had my fair share of Korean cinema, this was the first Korean series that I watched. I stumbled upon the series when I read this article on BBC website.

The show was engaging from the very beginning. There are enough twists and turns throughout the season that will keep you watching the series till the very end. The acting from everyone in the cast is top notch, especially from the three lead characters.

I would refrain from revealing the plot details or any spoilers in this blog post. The show must be watched without reading anything about it's story. That would make it more enjoyable.

This blog post is about the various things that I noticed about the Korean culture and way of life while watching this series.


Korean Names

In India and the I assume most of the western world, a person's name comprises of a first name, a middle name and a surname. When you call out someone's name in full, you would generally start with their first name and then call out their last name. Middle name is normally left out.

While watching this series, I noticed that in Korea the last name is called our first followed by the first name. For example, one of the lead characters has the name Park Hae-young. Where Park is the Surname and Hae-young the first/given name.

Other names in the series follow the same pattern.

Cha Soo-hyun where Cha is the surname and Soo-hyun is the first/given name.
Lee Jae-han where Lee is the surname and Jae-han is the first/given name.

Middle names are missing.

Reading up on wikipedia, I found that korean surnames ( or family name as it says in the wiki article ), are based on clans, which normally trace their origin to the place or region where it started. A single surname is associated with multiple clans. So, a two person with surname 'Lee' could belong to different clans, but I don't know how that is deciphered based just on the given name and the family name.

Another interesting thing that the article mentions is that as per census conducted in the year 2000, there were just 286 surnames being used at that time. The most common surnames are Kim, Lee and Park, which account for nearly half of the population. This frankly blows my mind since I am an Indian.

Considering the number of names we have here in India, which are based on a variety of things like religion, caste, sub-caste, place of origin, history, occupation etc, I wonder how the naming conventions reflect on the complexities and nature of the societies that use them.

Does a lot of variety in names indicates the extent of stratification in the society? It seems so.   


Grey Characters

All characters in this series, barring one, were either good people/heroes or bad/villains. There were no grey characters. A character whom you are not able to figure out. Lack of such characters does make it easy for you while watching a drama series as this. You are easily able to identify and love some characters, while hate those that you know are up to no good.

But is real life so simple. Is everyone as bad to the bone or as good at heart as shown in this series?

Crying

There is a lot of emotional moments in this series. And there is a fair share of crying, not excessive though and well placed. What's interesting is that most of crying is done by men.

Having watched a lot of stuff from Hollywood and Indian film industry, we are used to men being shown as tough macho characters who wouldn't give a damn about crying.

I won't pass any kind of judgement until I have watched some more Korean series, but I would definitely like to see a trend related to this and how it dictates the kind of stories that Korean storytellers like to tell. How does it shape their culture, their identity and does the same feeling exists across the northern border.   


Well there are a lot of other things that I would like to discuss. Maybe I will write a follow up post.

Monday, June 10, 2019

Removing boilerplate from webpages using python

I am an avid Firefox web browser user and more often that not, when I am visiting a webpage containing an article, I end up clicking on the "Reader Mode" button in the address bar so that I can remove all the useless noise and just focus on the main content that the page has to offer.

A news article, like this one shown below

becomes like this after entering the reader mode.
As you can see, all the ads, boilerplate etc is gone and now I can focus on the actual content without straining my eyes to find the stuff that I visited the webpage for.


It turns out that one could easily write a python program ( python being my language of choice for such quick experiments ) to do the same thing.

We will use the python readability library to achieve this thing in our python program.

 Here is the program. Seems to work for me.



Friday, March 29, 2019

Using Regular Expressions in Go

Go language provides package regexp for making use of regular expressions in Go programming. The syntax of the regular expressions is almost identical to that supported by other languages like Perl, Python etc.

Let's start with the basics. We will try to use regexp package to find out if a given text contains any alphanumeric words. By alphanumeric words, we mean any word that is comprised of letters or numerals.

To do this, we will compile a regexp object out of a regular expression. Then we use this regexp object on input strings to check if they contain any alphanumeric words or not, and if they do, we print each one of them.

Here is a program for doing this.




Tuesday, March 5, 2019

Writing the simplest HTTP server in Go

To write a very simple, HTTP server in Go, that serves just a single static page, you just need to do the following.

  • Import the net/http package
  • start listening on a port of your choice using http's ListenAndServe
  • server requests using a HTTP ResponseWriter.

Here is the code for this:-
package main
import (
"net/http"
"log"
)

func viewHandler(w http.ResponseWriter, r *http.Request) {
    w.Write([]byte("Hello there..."))
}

func main() {
    http.HandleFunc("/", viewHandler)
    log.Fatal(http.ListenAndServe(":8087",nil))
}
Using http.HandleFunc we choose to handle incoming requests on '/' path using the viewHandler function. After this, we start a ListenAndServe() function to start handling incoming HTTP requests on 8087.

Go ahead and build this and then run the exe. Your server has started. Now, open the browser and goto http://localhost:8087/

You should see a 'hello there...'.

Go has a pretty powerful HTTP library that allows you to do a lot of things. We shall explore more in the future.