17 July 2018

Learning R through tutorials

R can be daunting initially, but you'll become comfortable with it in a month, compared to something like Matlab which takes longer to master. A good tutorial can speed up your comfort-level even more.

One good tutorial I found was this.

08 July 2018

Take a screenshot of a rectangular area of the screen in Ubuntu or Mac without any extra software

This was a niggling problem for so many years, and I didn't know the solution was right under my nose.

In Ubuntu, if you want to take a screenshot of the entire screen, use the PrtScn key on the keyboard. Everyone knows that.

To take a screenshot of the current active window, press Alt key and the PrtScn key together. Most people know that too.

What most people don't know is that you can take a screenshot of a rectangular selection of an area on your screen by pressing Shift and PrtScn together, and then using the mouse pointer to select an area on the screen.

Oh...how much time it'd have saved me if I knew this earlier!!!

On a Mac you can do the same using pressing the keys Command Shift 4 together.

17 June 2018

Privacy in the age of Augmented Reality

It is said that the stone age lasted 2.5 million years.
The agricultural age lasted a few millenia.
The industrial age lasted a few centuries.
The digital age lasted a few decades.

Now we are said to be at the brink of a new age: "The age of Augmented Reality".

We are already there. We have virtual reality headsets. We pick up our phone to internet-search for answers when we have questions.
More importantly, we are at the doorstep of mind-controlled devices. Microsoft has already applied for a patent. You could eventually even communicate with people or animals without having to speak a word.

While it's fascinating to see what technology has to offer, there's also the element of loss of privacy. Governments and corporations got access to our homes via the internet. Now they have even more intimate information of us via our smartphones. With brain controlled devices, they are posed to have access to the very depths of our thoughts.

I had an SMS conversation with a friend about a cab service and in a couple of hours and on the next day I received SMS advertisements about that cab service. I have never received ads about that service before in my life. So now the harsh reality is that even if you avoid messaging apps, your mobile phone service providers are monitoring and monetizing on your SMS'es and perhaps your conversations too.

There's plenty more.

In-spite of knowing this, most people happily allow companies and governments to have access to their personal data. Because the services are free!
Given the way my data was used without my consent for sending me an SMS ad, I wonder if we would have privacy even if we paid for using GMail, Facebook, WhatsApp etc.

Are our thoughts going to remain private?
I'm very sure that companies designing mind control apps and devices will also be devising an elaborate strategy to convince people to happily give them access to their minds and thoughts. In the same care-free way we do with free email and messaging services.

People born before the 1950's used to envy us when they saw how fascinating the digital age was. They weren't able to adapt quickly enough to use it, but they wished they could. They told us how lucky we were to be born into the "jackpot generation" which is witnessing a phenomenal change in technology.
Some people don't envy us though. They envy our grandparents, saying that maybe they lived in a world with lesser access to medical facilities, information, travel and a lot of other things we enjoy. Even then, they lived happier lives where life moved at a more comfortable pace. Food, air and water were purer. Privacy was something they had a lot more control over.

There will come a time though, when people will ask if privacy is really so necessary? A time when information and thought will be so pervasive that it'll become a lot easier to trust someone because you already know everything about them. This would remove barriers of communication and basically the entire world, not just humans, but even animals and perhaps trees and plants would be able to function as a single cooperative entity, sharing knowledge and purpose. Perhaps leading to a time when we finally answer the ultimate question of why we exist in this universe!

22 May 2018

Sick or sleepy? You ruin it for everyone by forcing these kids/employees to push themselves.


Put simply, would you prefer that one sick employee or student remains away from everyone else for the duration of their contagious illness or would you prefer that more people to get infected and productivity plummets?

In a competitive world, it's sad how people push themselves (or are pushed) to show up for work even when sick. You don't have to. Even with a chronic illness or a family member's illness, there are ways to manage it. Businesses always have a contingency plan for employee absence. It's their job to arrange for that, and not something that you have to worry about when sick.

What you should do:
Even if your illness is not contagious, stay at home and get rest. A company will never sacrifice their profitability for you, so you have no obligation to sacrifice your health for them either. I've seen this happen with multiple people. Sacrificing health for work or schooling is never worth it.


Again, put simply: Would you prefer that people remain productive throughout the day by taking naps in-between or that they remain productive for half a day, making mistakes (which will cost you a lot in re-work) and struggling to remain awake and focus?

When you feel sleepy, you aren't supposed drink tea/coffee to shake off the feeling. You are supposed to sleep.
There's some kind of a 'laziness-related' social stigma attached to sleeping in class or in office. It's high-time we got rid of this sleep depriving culture.
Human beings are not meant to sleep only at night. We naturally have either Biphasic sleep or Polyphasic sleep. This means that when you feel like sleeping, it's perfectly ok to sleep or take a nap. You don't have to apologize to anybody. If you want to be super-human and avoid sleep, you need to take a serious look at how sleep deprivation can wreck havoc on your body.
I had a teacher who scolded students for yawning in her class. I have another teacher who feels insecure when students feel sleepy in his class. Both of them didn't seem to observe that it wasn't the fault of their teaching. All they had to do was allow the students to take a 10 minute nap.

What you should do:
If you are at a school or college, the authorities should either specifically allow for a nap break during afternoon classes, where students can rest their head on the table and take a short nap, or arrange for monitored sleep boxes.
If you work at a company, convince your bosses on how a short nap can help boost productivity without negatively affecting morale. Don't worry. There's plenty of evidence about this already. Companies can definitely introduce sleep boxes.

Sleep deprivation begins early in life and continues unless you stop it:

  • Waking through the night when the kid is born.
  • Kids sleep cycles and duration being ruined when woken up for school.
  • The horrible sleep-depriving culture of "burning the midnight oil" or waking up early during exams.
  • Eating improperly cooked or burnt food, leading to sleep loss
  • Having to wake up early to go to office.
  • Staying up to complete a project (which never gets complete).

In an ideal world, one should be allowed to sleep and wake up as per their natural sleep cycle rather than society's insensitive work cycle. When one is sick, one should be able to take rest instead of worrying about losing out in the rat race. Advice like this can only show you the way. You are the one who decides to walk the path.

You won't believe it until you measure it

If you feel you are getting enough sleep, write down how many hours of sleep you think you are getting. Then, keep a piece of paper and a pen by your bedside. Every night and morning, note down the approximate time you woke and slept.
Have two columns.
  • Column 1: Number of hours of un-interrupted sleep. 
  • Column 2: Total sleep = un-interrupted sleep + remaining sleep duration in hours.
Interrupted sleep happens when you are woken by noise at night, need to go to the toilet at midnight, are woken by discomfort in your stomach after having eaten bad food etc.

Do this experiment at least for a week or two.
I assure you; you'll be startled at how less sleep you are getting. Do let me know what your results were and I'll tell you how to improve.

19 May 2018

How to install R and R Studio on Ubuntu 16.04

The desktop installation of R is very simple if you are ok with Ubuntu's apt version.

You will need to have libcurl, libxml2, gtk2 and openssl installed on Ubuntu if you want to install certain packages, so also run these commands:
sudo apt-get update
sudo apt-get install libcurl4-openssl-dev
sudo apt-get install libssl-dev
sudo apt-get install libxml2-dev
sudo apt-get install libgtk2.0-dev
Method 1 (recommended):
Another way that worked for me is to add the repository:
sudo add-apt-repository 'deb https://ftp.ussg.iu.edu/CRAN/bin/linux/ubuntu xenial/'
sudo apt-get update

Now you might get an error like this:
W: GPG error: https://ftp.ussg.iu.edu/CRAN/bin/linux/ubuntu xenial/ InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 51716619E084DAB9
W: The repository 'https://ftp.ussg.iu.edu/CRAN/bin/linux/ubuntu xenial/ InRelease' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: There is no public key available for the following key IDs:

The solution is to add the key:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys KEYID
where you have to replace KEYID with the key ID shown in the error. Marked in bold three lines above this line.
Now update and install.
sudo apt-get update
sudo apt-get install r-base 
sudo apt-get install r-base-dev

Method 2: 
sudo apt-get update
sudo apt-get install r-base

Download the jpeg62 dependency from here and run dpkg to install it.
sudo dpkg -i libjpeg62_6b2-2_amd64.deb

Download R Studio from here and run dpkg to install it.
sudo dpkg -i rstudio-xenial-1.1.453-amd64.deb

Method 3:
However, if you want the latest version (advisable if you plan to install packages like arules) or you want to upgrade the version installed above, follow this:
sudo gedit /etc/apt/sources.list
Enter this line in the sources.list file (substitute the right Ubuntu version. Xenial is for Ubuntu 16.04): deb http://cran.rstudio.com/bin/linux/ubuntu xenial/
sudo apt-get update
sudo apt-get install r-base

16 May 2018

Using email like chat

Many people prefer using a messaging app for chats and email for a formal, letter-like communication. Certain people insist on always starting an email with a greeting like "Dear x", "Hi" or "Hello". It doesn't necessarily have to be that way.

If we rigorously stuck to tradition, we would be writing on cave walls and living in the jungle. There's nothing wrong with introducing change. There's nothing wrong in reducing the degree of formality to make someone feel comfortable or to make technology more cordial and usable.

If you are someone who does not like using invasive smartphone apps and are in a bit of a hurry to start/continue a conversation in a chat messenger, feel free to use email. Many modern email clients support the "email conversation" format, so it's easy to follow the conversation even if multiple people are in the conversation. It's easy to add attachments, include/exclude people, use highlighting and make use of all the other functionalities that an email offers.
Given that there are smartphone apps for email, you can even get your updates in the same way you'd get it from a messaging app.

When you are having a conversation with someone in the same way that you'd want to converse on a messaging app, go ahead and skip the formalities of email. Use email like a messaging app.
When using email for formal communication, use the standard letter-writing style and use all necessary formalities.

Let's keep technology flexible and make it comfortable for everyone. It's like how the heads of Google spoke about their choice to wear t-shirts instead of suits; they said "You don't have to wear a suit to be serious".

13 May 2018

Bitplane slicing

I was quite impressed with the person who thought of this technique. Slicing bits into planes to be able to use them to compress an image. The concept is so simple that not much explanation is needed. You'll see how it works directly from the code. Two techniques are presented here. One from Rashi Agarwal's use of mod and Angel Johnsy's use of bitget and bitset.

Once the image is sliced into bit planes, this is what you'll get:

MSB is the Most Significant Bit. LSB is the Least Significant Bit. You can choose to reconstruct the image with any of the planes which have sufficient information to represent the image. In this case I'm taking planes 7 and 6, although you could even take plane 6 and 8 or even 5 and 7.

Method 1: Using mod

clear all; close all; clc;
I = imread('moon.tif'); figure,imshow(I); title('original'); impixelinfo;
II = double(I);

%---Slice into bit planes
c0 = mod(II, 2);
c1 = mod(floor(II/2), 2);
c2 = mod(floor(II/4), 2);
c3 = mod(floor(II/8), 2);
c4 = mod(floor(II/16), 2);
c5 = mod(floor(II/32), 2);
c6 = mod(floor(II/64), 2);
c7 = mod(floor(II/128), 2);

%---display planes
sr = 2; sc = 4; si = 1;
subplot(sr, sc, si);si=si+1; imshow(c0); title('plane1. LSB');
subplot(sr, sc, si);si=si+1; imshow(c1); title('plane2');
subplot(sr, sc, si);si=si+1; imshow(c2); title('plane3');
subplot(sr, sc, si);si=si+1; imshow(c3); title('plane4');
subplot(sr, sc, si);si=si+1; imshow(c4); title('plane5');
subplot(sr, sc, si);si=si+1; imshow(c5); title('plane6');
subplot(sr, sc, si);si=si+1; imshow(c6); title('plane7');
subplot(sr, sc, si);si=si+1; imshow(c7); title('plane8. MSB');

%---restore from bit planes
figure,imshow(uint8(c7*128 + c6*64));title('restored with plane 7 and 6');
figure,imshow(uint8(c7*128 + c6*64 + c5*32 + c4*16 + c3*8 + c2*4 + c1*2 + c0));title('Fully restored');
% ri=2*(2*(2*(2*(2*(2*(2*c7+c6)+c5)+c4)+c3)+c2)+c1)+c0;%shortcut technique
% figure,imshow(uint8(ri)); title('Restored image');

Method 2: Using bitget and bitset

clear all; close all; clc;

I = imread('moon.tif'); figure, imshow(I); title('Original');
sr = 2; sc = 4; si = 1;

%---slice into planes
b1 = bitget(I,1);
b2 = bitget(I,2);
b3 = bitget(I,3);
b4 = bitget(I,4);
b5 = bitget(I,5);
b6 = bitget(I,6);
b7 = bitget(I,7);
b8 = bitget(I,8);

%---display planes
subplot(sr,sc,si);imshow(logical(b1));title('Plane1 LSB');si=si+1;
subplot(sr,sc,si);imshow(logical(b8));title('Plane8 MSB');si=si+1;

%---reconstruct using plane 7 and 8
IR = zeros(size(I));
IR = bitset(IR,7, b7);
IR = bitset(IR,8, b8);
figure, imshow(uint8(IR)); title('reconstructed with plane 7+8');

Once the planes are sliced, you can choose to take just plane 7 + plane 8 and rearrange the bits of each plane in bunches of 8 bits. Then you can convert each bunch of 8 bits to a decimal number. This is called bit plane compression

12 May 2018

Getting LaTeX working on Ubuntu 16.04

As of today, if you download the LaTeX template for IEEE conferences, you'll have to place any image named "fig1.png" in the same folder as your tex file, to be able to build the template.
You'll also have to ensure you have a few necessary packages installed on your Ubuntu OS before you can start working with the template.

To install, use the following commands:

sudo updatedb
sudo apt-get install texmaker
sudo apt-get install texlive-publishers
sudo apt-get install texlive-science

Of course, instead of installing the texlive packages separately you could've also installed it all in one shot with the command sudo apt-get install texlive-full, but it installs a whole lot of packages, some of which you wouldn't even dream of using.

That's it. With TexMaker installed, just double click the tex file template you got, and click the "quick build" option on the TexMaker toolbar. You'll be shown a preview of the PDF.

It's not necessary to save or export the PDF, because the PDF is already created and available on the same folder that you have your TexMaker template on.

For all of you pronouncing it as Lay-Tex, the right pronunciation is shown here: https://en.wikipedia.org/wiki/LaTeX#Pronouncing_and_writing_"LaTeX".

09 May 2018

Dear Data Analytics companies. Seems like you've met your match

I came across ThoughtSpot on LinkedIn. While I felt it was silly of them to request users to sign up to see their video on how they add value, it was easy enough to find it on YouTube. If you are a Data Analytics company that's into Business Intelligence, do watch this. It'll give you a run for your money!

I've helped build a high volume cloud computing program for a company that needed to crunch Gigabytes of data at high speed. So I'm quite surprised that ThoughtSpot uses a relational database for data. Relational databases end up requiring quite a rigid schema, as compared to graph databases.
While the video does not explain how they do the data cleaning and segregation...which requires a huge amount of manual labour and no state-of-the-art AI can automatically do as of today...the video does introduce us to a very thoughtful search interface that allows the user to just type what they are searching for, and custom dashboards get created dynamically. That's where the money is!

As of today, data analytics companies spend months at a time, just to get the data organized and dashboards up and running. That incurs a very high opportunity cost for the client. Add to that an obvious high purchase cost for the analytics software, due to the highly skilled knowledge-workers that build it. Then comes the maintenance costs over the years for every little change and customization request.

The value-add that ThoughtSpot provides here, is just like what Google had provided to the world, when Yahoo Search was at it's primitive worst of requiring users to click through categories of data to find a web-page they were looking for.
It's not just clever, it's a huge money-saver and time-saver in the long-run for companies wanting to analyze their business data...which is what any company that is serious about business should be doing, pronto.

The only part I'm not yet convinced about is the amount of time that's lost in data cleaning and segregation. That's not something that can scale so easily. As for the UI and search capability ideas... brilliant!!!

27 April 2018

The spectacle experiment: Why spectacles are likely to be bad for your eyes

During my years of experimentation, I discovered that my eyes used to get strained quickly only when I wore spectacles. Ophthalmologists, in their ignorance, prescribed me lenses for astigmatism, they said I might have dry eyes and prescribed lenses of various powers and anti-reflective coatings which were all later proven to be wrong conclusions and didn't help me at all. On the contrary, it just made my eye strain worse.

You wouldn't notice because...
Do note that you wouldn't notice what I did, because your eye strain didn't reach a chronic level. Mine did, and I was able to notice even the slight differences which everyone goes through, but they don't notice it because their eye muscles recover from it at least partially after a night's sleep. But in cases of partial recovery (ie: if you are getting less than 8 hours sleep), the strain builds up and manifests as headaches, burning feeling in the front of the eyeballs, sharp stabbing pains behind the eyeballs, muscles all around the eye feeling sore and at the most chronic stages, even your cheek muscles and muscles near the eyebrows feel strained and sore. Don't ever let that happen to you.

So next I tried ordinary glass lenses with no extra coatings, and found that it caused much lesser strain. So less, that it was almost noticeable. I assumed this was because of the greater visual acuity provided by glass as compared to plastic, so I tried lenses like Crizal and Zeiss which were marketed as being extremely clear. Although I did notice that the lenses were high quality and did seem clearer than other brands, they were absolutely nowhere close to the kind of clarity and acuity that an ordinary glass lens provided.

A little experiment you can try
I did an experiment which even you can try out. The blue things in the image below, are spectacle lenses viewed from the top, and this is about trying to read some words with the right eye. The left eye is closed. You'll notice that when the lens is perpendicular to the words, you can see it clearly. But if you tilt your head even slightly (you don't even have to tilt it as much as shown in the image) and try to read the word, you'll see that the word is either blurred or distorted a bit. With some plastic lenses it's a blur. With some it's a slight distortion. With glass lenses it's almost negligible.
This blurring/distortion doesn't happen if you are not wearing spectacles.

Keeping your eyes fixed in one direction tires your muscles. That's a given. But I have a strong belief that the distortion created by spectacle lenses are the other major unexplored cause for eye strain and headaches. I don't know if wearing contact lenses would help (didn't try them because of the risk), but my immediate advice would be that at least when you are working at a computer, wear spectacles with a glass lens instead of plastic or polycarbonate ones and keep a journal where you record how much uninterrupted sleep you got everyday vs how bad your eye strain was when you wore spectacles with glass lenses vs plastic/polycarbonate lenses.
Keeping a journal or an Excel sheet (over a period of a few months) with such data is very revealing. When you look back at past data, you'll be surprised at how less sleep you have been getting and how it's affecting you.

Do let me know how your experiment went.

27 March 2018

Alternative to f.lux for Ubuntu is Redshift

When using the computer in dimly lit surroundings, it helps to lower the brightness of the screen. One popular application for Windows was f.lux, and although they appear to have created a version for Linux, Ubuntu users don't need to install f.lux. We have Redshift.

Redshift can be installed hassle-free directly from the Ubuntu software center, but I was disappointed when I was not connected to the internet and Redshift didn't start because it wasn't able to access my location. I felt that's a dumb way to program a software.
Some laptops don't allow the brightness to go below a certain level, and the blue light from the screen is quite bright. Redshift creates and apparent reddish colour on the screen (although the blue light is still there) which is actually a bit comfortable.

Inspite of this, I'd still recommend having ambient lighting, and not working in the dark. Even with redshift, the monitor is bright and the surroundings are dark.

ps: Reports of digital screens making us lose sleep is a myth. We lose sleep because we force ourselves to stay awake. Not because of the digital screen's blue light. When you feel sleepy, just go to sleep instead of forcing yourself to stay awake longer.

11 March 2018

Eye strain is not entirely due to digital screens

Disclaimer: I'm not a doctor. To get medical advice, please consult a doctor.

My eye strain had become chronic in 2012 and I haven't fully recovered yet. During these years of crippling strain, I've been able to note subtle details which people ignore because their strain hasn't yet become serious. Also follow the links in "Other medical conditions" below.
Some facts:

Fact 1: Yes; reading text causes more strain to the eye compared to tasks that don't require extreme analysis on tiny areas. This doesn't mean that digital screens cause more strain. Reading a book can cause just as much strain. Watching a movie is much less strenuous. Digital screens have been falsely implicated as the cause of eye strain.

Fact 2: The strain by itself is not an issue. It happening on a daily basis is not the real issue either. The real issue is that (assuming you don't have other medical problems) no matter how much you claim that you are getting enough sleep, you actually aren't. If you get sleep your eye muscles will recover while sleeping and your strain won't build up to a stage where it hampers you.

Fact 3: When your eyes are strained, washing your eyes or wearing special spectacles or looking at far away objects or exercising your eye muscles do not help AT ALL. What helps is keeping your eyes closed for 5 to 10 minutes and relaxing your neck and face muscles.

What to check for:

  • Sleep: If you are confident that you are getting enough sleep, that's your biggest mistake. Very seriously and thoroughly evaluate yourself on whether you are getting a minimum of 7 to 8 hours of continuous sleep every night. I stress on the word "continuous". Waking up at night to pee or being woken up by noise (even if you go back to sleep immediately) or sleep apnea or waking up due to stomach discomfort or waking up after 4 hours of sleep and being unable to go back to sleep etc. are signs that you aren't getting enough sleep. Keep a diary where you write the approximate time you slept and woke. You'll be surprised. Feeling sleepy many times during the daytime is a clear indication that you lost sleep at night. Lying in bed awake with your eyes closed does not count as sleep.
  • Other medical conditions: Astigmatism or deficiencies leading to dry eye (the beginning stages of eye strain can make you feel like your eyes are dry. It does not necessarily mean you have dry eye) or other medical conditions might be a problem, but verify your sleep sufficiency before blindly accepting what the doctor says. Getting second opinions is not guaranteed to give you the right diagnosis. I met thirteen ophthalmologists who didn't have a clue on what caused my eye strain and how to cure it. I have been shocked and disappointed at the lack of competence of doctors at diagnosing the actual cause of eye strain (also reported by another person, though I don't agree with his diagnosis). There are some doctors though, who actually are experienced enough to identify the problem and carefully examine your medical history and symptoms before they come to a conclusion. Find these doctors. The general physician or ophthalmologist is not knowledgeable to identify certain highly specific conditions certain people go through. Some examples are hereherehereherehereherehereherehere and here.
  • Food and water: It's medically known that stomach problems cause sleep problems and sleep problems cause stomach problems. Both of these wreck havoc on the rest of the body. I've listed what precautions to take with food in this post.
  • Plastic lenses: I'm not referring to contact lenses. I'm referring to plastic/polycarbonate lenses of spectacles. They do not provide visual acuity that is as good as a glass lens. I've tried the top world-class brands, tried lenses with special coatings...all useless when it comes to eye strain. Simply looking through a spectacle lens (glass/plastic/polycarbonate) itself is a bit strenuous for the eye. Plastic/polycarbonate lenses are very strenuous. Glass is much less strenuous. I believe it has to do with the better visual acuity it provides. Having special coatings on the lens does not help reduce eye strain. Using cheap, ordinary glass lenses without any special coatings gave me the most relief and I eventually started using the computer without wearing spectacles as much as I could. Haven't tried contact lenses and am definitely not going for Lasik inspite of the rebuttal because the focus should be on proper food, rest and sleep; not on surgery.

How to fix your fatigue-induced eye strain
  • Step 1: It'll take a while for you to verify the cause of the strain. During that time, you can use eye drops or Lacrigel (after consulting a doctor) to give you some relief. Use Lacrigel only if your strain is chronic. Remember: The eye drops or Lacrigel are only for a few weeks of use just to give you some initial relief. They won't solve your problem and they are not meant to be used forever. Make sure you close your eyes for 5 to 10 minutes every hour. 
  • Step 2: Rule out medical conditions. A dry eye specialist tried convincing me I had dry eyes and recommended a vitamin B12 test at an affiliate lab and a followup consultation, but a Schirmer's test at another hospital ruled out dry eyes. Computerized eye tests at two hospitals and three ophthalmologists said I had astigmatism because I mentioned eye strain, but those glasses caused unbearable strain and two other ophthalmologists later ruled out astigmatism. Basically, get opinions from multiple doctors to ensure that you have been diagnosed correctly and ensure you verify if you really have a medical problem or if it's just plain fatigue related strain. Ophthalmologists themselves have told me that vision correction is not an exact science and that mistakes are possible.
  • Step 3: Examine what food you eat. If you eat from an office/college canteen, bakery, stall or a restaurant, chances are very high that you are eating food that is either not fully cooked or has burnt particles in it or is of poor quality. Trust me, a majority of people in this world (including you) are very very poor judges of food quality. Drinking youghurt/curd after dinner helps give some relief and your sleep should improve with time (probably because curd has Tryptophan) as you change your food habits to eating properly cooked food. More here.
  • Step 4: Make sure you get 8 hours continuous sleep every night. Don't let people or a phone wake you unnecessarily. Don't let your job make you lose sleep. Make sure you have a quiet, dark, comfortable environment for sleeping. And please take Step 3 very seriously.
  • Step 5: Make it a point to close your eyes and relax your face muscles everytime you feel even a slight bit of strain. Don't push yourself to work harder unless you have got your rest first. No job, boss, career, pay or recognition is worth as much as health. I learnt that the hard way.
  • Step 6: Get a good amount of exercise. Exercising does not help reduce eye strain at all. It however does help in maintaining good health which could give you slightly improved sleep and general body function.

All you really have to know is that unless you have some underlying medical condition, simple fatigue-induced eye strain can be cured just by getting your eight hours of sleep and a ten minute rest when your eyes are tired.  It can take a few months/years to recover (and nothing other than rest+sleep can help speed up the recovery), but that's all there is to it. You don't have to spend a fortune on special spectacles or medication. Take care.

Remember: Your primary focus should be on getting well cooked food, rest and sleep.

11 February 2018

Do you have to wear a suit to a wedding?

Short answer: Not really necessary, but good if you can.

Long answer:
A suit comes into the picture only after the major necessities are covered. A relative once said: "Anybody can make excuses; but for the person who really wants to attend an event, they will make sure they are there, no matter what". Although his quote seemed like words of wisdom long ago, one now realizes that it is a bit too harsh on people. When dealing with randomness and emotional beings, it isn't right to apply hard rules on anyone.

The first most important thing you can do for someone's wedding, is to attend it when you have been invited. Being there for that person.

The second most important thing is not something for you to consider. It's for the hosts and the other guests to consider. Judging others. I know of people who scrutinize every tiny bit of detail about how another person dresses and grooms themselves. It's the equivalent of burying your head in your smartphone screen during an event. When at a wedding, try to help out with whatever you can and make the day special for the families of the bride and groom. At other times, socialize with others and try making them feel special by letting them talk about what they like and encouraging them to speak about events in their life which they cherish. Do try avoiding negative comments on the appearance of other guests. He who throws mud gets his own hands dirty.
When a person has shown the courtesy of attending an event, it is your duty, whether you are the guest or the host, to make that other person feel comfortable and welcome. Remember that rituals, customs and formalities are just a conjuring that are not anywhere close to being worth as much as a person's sense of self worth and respect.

That being said, if a wedding invite specifically mentions casuals, wear casuals. Else, the best bet are formals. If you have a good suit, wear it. If you don't have one or it's at the dry cleaner's, then a well groomed appearance with a formal shirt, pant and shoes will do just fine.

Remember: Mutual respect and consideration are far more important than a suit.

23 January 2018

Of cruelty mistaken as cuteness and affection

People find weird things cute. They pluck off the reproductive parts of plants, sniff it and gift it to people. They enjoy watching animals perform tricks. They keep flight-gifted creatures as pets in tiny cages.

A little digression. This isn't similar to how vegans oppose the cruelty meted out to animals. We have to eat. Even the plants are mercilessly uprooted, made to suffocate during transport, chopped, boiled and killed when still alive. The eyes of the potato watch you as you approach it with a knife :-) But basically, we have to eat. So whether you eat plants or animals, there's nothing wrong. If you still want to oppose that, then the right way to end it is by manufacturing the chemicals that constitute food, 3D printing it into food and eating it.

There is a natural order to everything. If we are meant to eat animals and plants, then so be it.
However, when it comes to gifting and pets, there are some things a sensible human can do:

1. Flowers: Gifting the dying carcass of a plant reproductive system is not a necessity.
2. Animal tricks: Unless the animal actually enjoys it (dog taught to fetch a ball), don't make animals do tricks.

3. Birds as pets: This is the main topic I was coming to. Many people, especially women and children, love the idea of keeping birds as pets. People; no matter how well you take care of your birds, I call it sadist behaviour. A pair of birds were gifted to a family member, and she wanted to breed them. So they gave rise to five more baby budgies, and she's really happy.
I've observed the behaviour of these budgies for many months now. Although they are reasonably affectionate to humans, their natural behaviour tends to finding the highest perch available and flying away from human contact as much as possible. They are independent, intelligent, curious creatures that are denied their freedom because somebody thinks it's cute to own them.

Here are some things you need to know:

  • The bait: Pet shop owners sell budgies at Rs.150 per bird. One thinks that's reasonable until one realizes that for the duration of the bird's life, one has to buy it seeds from the same shop. So each bird sold, gives them a permanent customer. Now that they know they got you hooked, they charge exorbitant prices for the seeds. In Bangalore, bird seeds that are meant for budgies and finches, are purchased by shop owners for Rs.26 per kg and sold at Rs.50 or even at Rs.100 per kg. The same people sell it at Rs.220 or Rs.300 per kg on online shopping sites. Also sold, are vitamins etc. which the birds don't really need if you simply feed them with a natural diet of greens along with the seeds. Feeling cheated already?
  • The possible scam: The pet industry in USA is worth $66 BILLION. I've known shop owners India who deliberately or unknowingly keep pet birds and fish which have parasites, so that customers who buy it would come back to buy more when the pet dies. I've also purchased plants from a local seller who said he had medicines for plants if I ever needed them. I asked what the medicines were, and he didn't know. A week after purchasing the plants, powdery mildew started growing on them and it never went away. The plants were in a constant state of death. I'd suspect they deliberately sold us diseased plants so that there would be more business via "plant medicine" sales. Would the increase in pet cancer be from something deliberately introduced into pet food? Just speculating.
  • Don't set them free: Animals and birds raised in captivity do not know where to find food and how to defend themselves. They also do not have the stamina to escape predators. They don't even know how to escape predators when pursued (I've seen it happen). If you already have a pet, keep it with you and care for it. Don't let it breed and create more of its kind that will have to live a captive life too. If you have birds, give them a larger space to fly around. Don't think you are giving them sufficient opportunity to fly if you have an aviary or allow them to fly in your room. A bird enjoys flying only when it's able to flap its wings and then glide at high speed for a long distance. Breeding a bird and keeping it caged denies it of its fundamental right to fly free.

Having a pet was an old tradition. Of a time when cruelty was considered normal. Crazy behaviour was considered a normal part of a ritualistic, egoistic society. Of a time when people were a lot less civilized and immature.

We do not have to continue those practices. Please....stop buying pets. Stop breeding them. Stop forcing them to live an unhappy, bored life in captivity. If you've rescued them and are taking care of them, it's an entirely different thing. Just don't breed more captives for your pleasure/profit.

Your imagined cuteness is a heartless cruelty.

15 January 2018

Summary: Ubuntu's 17.10 bug 1734147 which makes motherboards unusable is now fixed

The last time I tried Ubuntu 17 was on a non-Intel motherboard, so nothing happened. But there was something that I didn't like, so switched back to 16. Now I read that Ubuntu 17.10 has a bug which corrupts the BIOS and prevents USB boot.

Why it happens: This happens because Intel's SPI driver (allows the OS to rewrite firmware's flash memory) causes the firmware to become write protected. This happens only in Intel Broadwell and Haswell machines with serial flashes with SPI_NOR_HAS_LOCK set.

If your BIOS is affected: Try the fixes mentioned on this page. If it doesn't work, you may have to replace the flash memory chip or the entire motherboard, depending on how it is manufactured.

Is it fixed? Yes. This page mentions the problem, the fix and the machines affected. You can now fearlessly download Ubuntu versions higher than 17.10, and you won't have any trouble.

Lesson: Although contrary to conventional advice, it helps to not have automatic updates enabled, and to upgrade to a new version of an OS only after some time has elapsed since its release.