tag:blogger.com,1999:blog-69154054150036667022018-02-16T21:00:53.411+05:30N Recursions... a consciousness sojourning the void ...Navin Ipehttp://www.blogger.com/profile/01320006785676088076noreply@blogger.comBlogger183125tag:blogger.com,1999:blog-6915405415003666702.post-48690802082155978162018-02-11T11:07:00.000+05:302018-02-16T21:00:53.479+05:30Do you have to wear a suit to a wedding?<div dir="ltr" style="text-align: left;" trbidi="on"><b>Short answer: </b>Not really necessary, but good if you can.<br /><br /><b>Long answer:</b><br />A suit comes into the picture only after the major necessities are covered. A relative once said: "<i>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</i>". 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.<br /><br />The first most important thing you can do for someone's wedding, is to attend it when you have been invited. <b>Being there for that person</b>.<br /><br />The second most important thing is not something for you to consider. It's for the hosts and the other guests to consider. <b>Judging others</b>. 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.<br />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.<br /><br />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.<br /><br /><br /><b>Remember: Mutual respect and consideration are far more important than a suit.</b></div>Navin Ipehttp://www.blogger.com/profile/01320006785676088076noreply@blogger.com0tag:blogger.com,1999:blog-6915405415003666702.post-33433780061579262652018-01-23T14:28:00.000+05:302018-02-15T00:36:03.120+05:30Of cruelty mistaken as cuteness and affection<div dir="ltr" style="text-align: left;" trbidi="on">People find weird things cute. They pluck off the <a href="https://en.wikipedia.org/wiki/Plant_reproduction#Flowering_plants">reproductive parts of plants</a>, sniff it and gift it to people. They enjoy watching&nbsp;<a href="https://en.wikipedia.org/wiki/Cruelty_to_animals#Circuses">animals perform tricks</a>. They keep flight-gifted creatures as pets in tiny cages.<br /><br />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.<br /><br />There is a natural order to everything. If we are meant to eat animals and plants, then so be it.<br />However, when it comes to gifting and pets, there are some things a sensible human can do:<br /><br /><b>1. Flowers:</b> Gifting the dying carcass of a plant reproductive system is not a necessity.<br /><b>2. Animal tricks:</b> Unless the animal actually enjoys it (dog taught to fetch a ball), don't make animals do tricks.<br /><b><br /></b><b><span style="font-size: large;">3. Birds as pets:</span></b> 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.<br />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.<br /><b><br /></b><b>Here are some things you need to know:</b><br /><br /><ul style="text-align: left;"><li><b>The bait:</b> 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?</li><li><b>The possible scam: </b>The pet industry in USA is worth<a href="http://www.americanpetproducts.org/press_industrytrends.asp"> $66 BILLION</a>. 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 <a href="https://timesofindia.indiatimes.com/india/cancer-among-dogs-doubles-in-a-decade/articleshow/62227145.cms">increase in pet cancer</a> be from something deliberately introduced into pet food? Just speculating.</li><li><b>Don't set them free:</b>&nbsp;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 <a href="http://www.livelaw.in/all-birds-have-fundamental-right-to-fly-in-the-sky-and-not-be-caged-delhi-high-court/">fundamental right to fly</a> free.</li></ul><br /><br />Having a pet was an old tradition. Of a time when cruelty was considered normal. <a href="https://en.wikipedia.org/wiki/Sati_(practice)">Crazy behaviour</a> was considered a normal part of a ritualistic, egoistic society. Of a time when people were a lot less civilized and immature.<br /><br />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.<br /><br /><div style="text-align: center;"><b>Your imagined cuteness is a heartless cruelty.</b></div><br /><br /><br /></div>Navin Ipehttp://www.blogger.com/profile/01320006785676088076noreply@blogger.com0tag:blogger.com,1999:blog-6915405415003666702.post-13697616982736894412018-01-15T15:59:00.003+05:302018-01-15T15:59:35.326+05:30Summary: Ubuntu's 17.10 bug 1734147 which makes motherboards unusable is now fixed<div dir="ltr" style="text-align: left;" trbidi="on">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.<br /><br /><b>Why it happens:</b> 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.<br /><br /><span style="color: #990000;"><b>If your BIOS is affected:</b> </span>Try the fixes mentioned <a href="https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1734147">on this page</a>. If it doesn't work, you may have to replace the flash memory chip or the entire motherboard, depending on how it is manufactured.<br /><br /><span style="color: lime;"><b>Is it fixed?</b></span> Yes. <a href="https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1734147">This page</a> 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.<br /><b><br /></b><span style="color: #3d85c6;"><b>Lesson:</b></span> 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.</div>Navin Ipehttp://www.blogger.com/profile/01320006785676088076noreply@blogger.com0tag:blogger.com,1999:blog-6915405415003666702.post-32237144511285425132017-12-13T20:13:00.002+05:302018-01-03T02:53:36.926+05:30An open letter to hospitals that make patients relatives run around to get blood<div dir="ltr" style="text-align: left;" trbidi="on"><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-k1JXEP1fLhk/WjE5e1mtLSI/AAAAAAAABmQ/Nh3G5g_7IxA_XyJiBH-aj5o0HnWW2hcoACLcBGAs/s1600/BloodDonation.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="501" data-original-width="650" height="246" src="https://1.bp.blogspot.com/-k1JXEP1fLhk/WjE5e1mtLSI/AAAAAAAABmQ/Nh3G5g_7IxA_XyJiBH-aj5o0HnWW2hcoACLcBGAs/s320/BloodDonation.jpg" width="320" /></a></div><br />A relative of mine was being treated at a hospital, and I heard the hospital was making his friends and relatives run around, to arrange for replacement blood donors. Since he was undergoing plasmapheresis and dialysis, there was a huge demand for blood. Moreover, even though they brought blood donors and paid the donors, they still had to pay extra for blood units that the hospital gave. That was a shame. Especially for a hospital that claimed to treat its patients well. <br /><br />I wrote a letter to them. The links in the letter are important. They will take you to a whole new level of knowledge.<br /><blockquote class="tr_bq"><br />Hello,<br /><br />I know there's no point in taking you on a guilt-trip of making relatives of patients running around trying to find blood donors, so let's get down to some facts:<br /><br /><ul style="text-align: left;"><li>At least in Mumbai, hospitals who arm-twist relatives of patients <a href="https://timesofindia.indiatimes.com/city/mumbai/hosp-blood-banks-cant-seek-replacement-donors-state/articleshow/59553019.cms">can lose their NOC</a>.</li><li>Blood obtained from relatives/friends or coercion <a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3353625/">is unreliable</a>. It is the duty of the hospital to organize for safe blood by conducting frequent blood donation camps. <a href="http://www.sankalpindia.net/book/should-donor-be-promised-blood-free-case-need">Don't promise free blood though</a>.</li><li>Since April this year, all registered blood banks can organize blood donation camps and <a href="https://yourstory.com/2017/06/replacement-blood-donation/">inter-blood bank transfer is permitted</a>.</li><li>By forcing people, <a href="http://www.sankalpindia.net/news/rampant-demand-replacement-undermining-voluntary-blood-donation-movement">you undermine voluntary blood donors</a>. "Why should we donate?" they ask, "when <a href="https://www.change.org/p/national-blood-transfusion-councila-india-stop-the-harassment-in-the-name-of-replacement-blood-by-hospitals">we will be forced by the hospital</a> anyway".</li></ul><br />I understand hospitals have their own logistics to worry about, but when you have a marketing term that claims to treat people well, the hospital's word-of-mouth advertising will definitely improve when people know that this is one hospital that does not inconvenience people. Apart from the blood donation aspect, I really appreciate other procedures that are followed well in the hospital.<br /><br />Kindly forward this to the person who can take decisions on organizing blood donation drives. Meanwhile, I hope your hospital could immediately stop inconveniencing people and instead organize for processed blood units to be brought to the hospital from other blood banks (which follow strict guidelines). You could of course charge a premium on it.<br /><br />Regards,<br />Navin</blockquote><br />For the reader: If you can organize for donors, then please do. There is indeed a shortage of blood. <b>But be aware that you are not obligated to</b>.<br />Bangalore itself needs an average of 800 units of blood everyday!!! Do encourage and participate in blood donation drives. It's the best way to ensure there is safe blood available for everyone in need. Encourage hospitals to organize frequent blood donation camps instead of just complacently indulging them with replacement donors.<br /><br /><br /><br /><div style="text-align: center;">----------------------------------------------</div><br /><b>Some points from the links above:</b><br /><ul style="text-align: left;"><li>With no official complaints raised by the public, corporate blood banks have no incentive to walk away from replacement blood. “<b>Grievances can be filed at the PM’s portal</b>,” Centralised Public Grievance Redress and Monitoring System (<a href="http://pgportal.gov.in/" rel="noopener noreferrer" target="_blank">CPGRAMS</a>), “which collates grievances from multiple sources and forwards them to the state government, nodal officer, or blood bank concerned,” <a href="https://yourstory.com/2017/06/replacement-blood-donation/">says Dr Shobini</a>.</li><li>Shobini Rajan, assistant director general, National Aids Control Organisation (NACO), said the blood policy doesn't say it is illegal for hospitals to ask for donors but it is undesirable.</li></ul><br /><br />More on blood donation: <a href="http://nrecursions.blogspot.in/2015/02/blood-donation-what-went-right.html">http://nrecursions.blogspot.in/2015/02/blood-donation-what-went-right.html</a><br />And volunteering: <a href="http://nrecursions.blogspot.in/2015/07/how-to-start-volunteering-or-how-to.html">http://nrecursions.blogspot.in/2015/07/how-to-start-volunteering-or-how-to.html</a><br /><br /><br /></div>Navin Ipehttp://www.blogger.com/profile/01320006785676088076noreply@blogger.com0tag:blogger.com,1999:blog-6915405415003666702.post-75049000606994963752017-12-09T21:36:00.000+05:302017-12-09T21:39:34.787+05:30Forgot BIOS password and removing CMOS battery does not work?<div dir="ltr" style="text-align: left;" trbidi="on">In the "good old days", if you forgot your BIOS password, all you had to do was open up the computer, remove the CMOS battery or remove the jumper near the battery and your CMOS password would get reset to no password.<br /><br />That's changed now. I recently reset my laptop to CMOS factory default settings, saved and exited, and it asked for a password the next time I wanted to enter the CMOS settings. I had not even set a password!!!<br /><br />Opening up the laptop and finding the CMOS battery was an interesting proposition, so I did just that. Removed the battery, replaced it after 30 seconds, put back all components, started the laptop and it still asked for a password. Darn! Going through the laptop manual showed that the battery had to be removed and kept aside for at least an hour.<br />Ok good. So I did that. Waited for more than an hour, put back all components, started the laptop and bang. There was the password prompt again!<br />Turns out that there was a person who even kept the battery aside for three months and yet the password didn't reset. It's likely to be stored in a more permanent location in memory in today's computers.<br /><br /><b>The solution:</b><br />After a lot of anxious searching, I found this website. <a href="https://www.online-tech-tips.com/cool-websites/reset-bios-password/">The ultimate guide to resetting the BIOS password</a>.<br />Turns out that when you take your computer to the official service people, they don't need to know your BIOS password or hack into it with brute force techniques.<br />They simply use a default password that the manufacturer programs into the motherboard. These are called backdoor codes.<br /><br />So all you have to do is try out some of the openly available backdoor codes on the website, and if that doesn't work, then try entering some random password three times and your BIOS password prompt will show you a number. Enter that number into this website&nbsp;<a href="https://bios-pw.org/">https://bios-pw.org/</a> and it'll show you the backdoor password for your BIOS.<br /><br />That's it! I was able to access my CMOS settings screen again and this time I set my own password.<br />Do try this before you take your laptop to some service person who'd use the same simple technique and then charge you a bomb because you'd think they used some super secret hacking technique to elegantly solve your problem for you.<br /><br /></div>Navin Ipehttp://www.blogger.com/profile/01320006785676088076noreply@blogger.com0tag:blogger.com,1999:blog-6915405415003666702.post-40653717457327450372017-10-30T20:35:00.000+05:302017-10-30T20:35:01.614+05:30You can check your voter details online<div dir="ltr" style="text-align: left;" trbidi="on">The <a href="https://timesofindia.indiatimes.com/city/bengaluru/draft-electoral-rolls-for-bluru-to-be-out-tomorrow/articleshow/61312444.cms">draft electoral rolls</a> for Bangalore are out already, and voters can now check/edit their details online.<br /><br />There is a <a href="http://voterreg.kar.nic.in/Login.aspx">regional website</a> where the backend didn't function properly, so I'd recommend going to the <a href="http://www.ceokarnataka.kar.nic.in/">other regional website</a> which takes you to the <a href="http://electoralsearch.in/">national website</a>. Sadly, none of the websites have https, so anything you enter there could be viewed by someone else. Your browser will inform you about this the moment the webpage opens.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-kqpAAXdwGfI/Wfc_gaAk9cI/AAAAAAAABl8/OAFGUV-IiBYQ1U-qauSOxkYKUZSh23rvQCLcBGAs/s1600/epic.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="486" data-original-width="640" src="https://4.bp.blogspot.com/-kqpAAXdwGfI/Wfc_gaAk9cI/AAAAAAAABl8/OAFGUV-IiBYQ1U-qauSOxkYKUZSh23rvQCLcBGAs/s1600/epic.png" /></a></div><br /><br />Once on the national website, you can search for your existing voter information. I typed in my details and it didn't find anything, but on clicking the Search by EPIC number tab, I entered my voter ID and was shown my details which were exactly what I had entered earlier, and the backend didn't even return an exact name search match. Since the websites were powered by C-DAC, I wrote to them and hope they'd introduce HTTPS.<br /><br />Still, as long as you are ok with not using https, you can use the website to <a href="http://www.nvsp.in/forms/">submit forms online</a> and track your application status online.<br />Forms are available for:<br /><ul style="text-align: left;"><li>Inclusion of names for residents electors&nbsp;&nbsp;&nbsp;&nbsp;</li><li>Inclusion of names for overseas electors&nbsp;&nbsp;&nbsp;&nbsp;</li><li>Any objection on inclusion of names&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li><li>Correction of entries in the Electoral Rolls&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li><li>Transposition within Assembly </li></ul><br />Some thoughtful person has also created a <a href="http://ceokarnataka.kar.nic.in/PDFS/sweep/General%20Voters.pdf">nice caricature document</a> explaining general voter information. Do go through it and show it to kids.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-8UZY8PqdtGg/Wfc8rac6UAI/AAAAAAAABls/vYzdbQWZzn0Jt0oL3afKgB35oPIQ3Zs3gCLcBGAs/s1600/votingInfo.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="669" data-original-width="397" src="https://3.bp.blogspot.com/-8UZY8PqdtGg/Wfc8rac6UAI/AAAAAAAABls/vYzdbQWZzn0Jt0oL3afKgB35oPIQ3Zs3gCLcBGAs/s1600/votingInfo.png" /></a></div><br /></div>Navin Ipehttp://www.blogger.com/profile/01320006785676088076noreply@blogger.com0tag:blogger.com,1999:blog-6915405415003666702.post-55523115465336146772017-10-22T14:39:00.000+05:302017-10-22T14:39:04.153+05:30Do a 'Google Trends' on Google Books<div dir="ltr" style="text-align: left;" trbidi="on">This may actually be quite a good incentives for scholars and literature enthusiasts, for uploading more books online.<br />Similar to how Google Trends gives you graphs to compare various Google search terms used over the years, Google Ngram viewer allows you to search and compare the usage of words and phrases used in books over the years. You can even add wildcard characters like the asterisk, and even specify if what you are searching for is a noun or an adjective etc. Two researchers, Sparavinga and R.Marazzato even <a href="https://arxiv.org/pdf/1512.01364.pdf">wrote a paper on it</a>.<br /><br />For example, searching for "how are you" vs "how do you do" shows that "how do you do" was used more in the 1700's, but slowly the usage declined. On a side note: the reply to "how do you do" is "how do you do", and not "I'm fine".<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-wpK7Uu_a1Oc/WexezERThII/AAAAAAAABlY/FjZ85UPZzxAs1FOpxVnx-x_7r03bAxDiwCLcBGAs/s1600/ngram.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="555" data-original-width="798" height="444" src="https://3.bp.blogspot.com/-wpK7Uu_a1Oc/WexezERThII/AAAAAAAABlY/FjZ85UPZzxAs1FOpxVnx-x_7r03bAxDiwCLcBGAs/s640/ngram.png" width="640" /></a></div><br />More on how Ngram works: https://books.google.com/ngrams/info#<br /><br />If your work is primarily on Google Scholar, there are <a href="https://scholar.google.co.in/intl/en/scholar/help.html">good search tools</a> (including advanced search) and<a href="https://scholar.google.co.in/intl/en/scholar/metrics.html"> metrics information</a> available to gauge the visibility and influence of articles published. Useful tools.<br /><br /><br /></div>Navin Ipehttp://www.blogger.com/profile/01320006785676088076noreply@blogger.com0tag:blogger.com,1999:blog-6915405415003666702.post-8884112913377481742017-10-21T21:17:00.004+05:302017-12-17T19:10:51.279+05:30Mostly, time spent online is time well spent<div dir="ltr" style="text-align: left;" trbidi="on">Which is better? Finding a bunch of intellectuals online, who love discussing your favourite topics on artificial intelligence, general knowledge, TED talks, research efforts worldwide or switching off your phone and computer and spending time with relatives who gossip about their neighbours, discuss cricket runs scored and discuss religious rituals? *yawn*<br /><br />Have a look at <a href="http://wumo.com/wumo/2017/08/27">this toon from Wumo</a>.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-WIuUAybJsBc/WetqvqcBMgI/AAAAAAAABlI/Clcts0HpSUoQmfOTbp3EEThVCCqZH4iewCLcBGAs/s1600/wumo_smartPhoneGirl.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="358" data-original-width="760" height="299" src="https://1.bp.blogspot.com/-WIuUAybJsBc/WetqvqcBMgI/AAAAAAAABlI/Clcts0HpSUoQmfOTbp3EEThVCCqZH4iewCLcBGAs/s640/wumo_smartPhoneGirl.jpg" width="640" /></a></div><br />Interacting online has the advantage of filtering out a HUGE amount of irrelevant data, awkwardness and annoyances. If you like it, there's nothing wrong with liking it. Time is precious to all of us. Let's spend it doing what we like, and with the people we like. Whether the people are online or physically present with you is irrelevant.<br />It's the genuineness of your connection with them that matters.<br /><br />That being said, physical meetings have a flavour of their own, and should be encouraged at the comfort level that people would like it to be encouraged.<br /><br />As for Simon Sinek's narrow observation...<br /><div style="text-align: center;"><br /></div><div style="text-align: center;"><iframe allow="encrypted-media" allowfullscreen="" frameborder="0" gesture="media" height="315" src="https://www.youtube.com/embed/hER0Qp6QJNU" width="560"></iframe></div><div style="text-align: center;"><br /></div>...it's easy to use the pointing finger to highlight "what's wrong with this generation", but one has to know that this is what every generation has been saying about the next generation for the past millenia.<br /><br />The truth is, there's nothing ever wrong with a generation. There's nothing ever wrong with how people do things. Some people build good relationships, some don't. Some people adopt and use technology in specific ways, some don't. Some people will always be less confident and unhappy, some won't. That's how we are meant to be as a population. There's nothing wrong in that.<br /><br />Every single species on this planet was not meant to live and behave in a certain way forever. We evolve. We are meant to evolve. When you see someone doing something different, it's because that's what they are meant to do. We as a generation, have better access to information. We know and understand relationships better. We know whom to connect with and when to run away from toxic people. We've even researched and spread awareness about addiction to social media. We learn from people all around the world.<br /><br />Accept change for the good it brings. For as someone once said: There is only one constant: "Change". Rather than point fingers at a generation of people, see how these well informed, intelligent people can help you and you'll be surprised!<br /><br /></div>Navin Ipehttp://www.blogger.com/profile/01320006785676088076noreply@blogger.com0tag:blogger.com,1999:blog-6915405415003666702.post-54124280213043331102017-09-12T00:39:00.002+05:302017-09-15T00:18:10.140+05:30A tutorial on Differential Evolution and Otsu's method for image thresholding<div dir="ltr" style="text-align: left;" trbidi="on">The first thing you need to know before your foray into computational intelligence (CI), is that the creators of these algorithms themselves don't know how it works. CI algorithms are inherently analytical techniques that depend on randomness to give solutions that are close to optimal, but not necessarily the best solution. It's like finding a lovely house in a city and choosing it as your home, but you have not actually found out if it is the best house that you could find in the city, because you just did not have the time to explore. The fact that people come up with naming these algorithms after animals (bat algorithm), insects (ant colony, bee colony, glowworm algorithms) and bacteria (bacterial foraging algorithm) is an amusing practice because the lack of theoretical backing makes the creation and optimization of the algorithm more of an art than a science.<br /><br />Still, the way these algorithms improve over the generations is very impressive. <a href="https://www.youtube.com/watch?v=FKbarpAlBkw">This video </a>shows you how:<br /><br /><div style="text-align: center;"><br /></div><div style="text-align: center;"><br /></div><div style="text-align: center;"><br /></div><br />This tutorial covers the topic of finding thresholds for a grayscale image using a CI algorithm named Differential Evolution (DE). We check if the thresholds are good enough by using the Otsu criterion. The best references for DE and Otsu criterion are the original papers presented <a href="http://ieeexplore.ieee.org/document/4310076/">here</a> and <a href="https://link.springer.com/article/10.1023/A:1008202821328">here</a>.<br /><br /><b>What is image thresholding?</b><br />Consider <a href="https://en.wikipedia.org/wiki/Lenna">Lena's image</a>. When you convert the red, blue and green pixels to gray colours, you end up with colours ranging from 0 to 255. Zero is black. 255 is white and the numbers in between are shades of gray (I'm not talking of <a href="https://en.wikipedia.org/wiki/Fifty_Shades_of_Grey">Fifty shades of gray</a>). Now if you decide that all pixels below the shade 118 are going to be converted to black and all pixels above or equal to 118 are going to be white, you end up with an image like this:<br /><br /><div style="text-align: left;"></div><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-65Bg9teCaJo/WbbOZWOlluI/AAAAAAAABkg/7nFvIglh3qEm62PRgUddtSkBKpoapOobgCLcBGAs/s1600/oneThresholdLena.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://3.bp.blogspot.com/-65Bg9teCaJo/WbbOZWOlluI/AAAAAAAABkg/7nFvIglh3qEm62PRgUddtSkBKpoapOobgCLcBGAs/s1600/oneThresholdLena.png" /></a></div><br />This is called "image thresholding" or "image segmentation". There are more complex ways of doing image segmentation though. The basic idea is to try and separate the image into distinct segments based on our interest. Sometimes we want to distinguish between foreground and background. Sometimes, to distinguish between parts of objects or multiple objects. If the threshold were closer to 50 or 10, the image would appear too dark. So we have to figure out which threshold will give us an optimum image. An image where the pixels are shaded in such a way that the objects in the image are well distinguished from other objects. An "<i>optimal threshold</i>".<br /><br /><b>So how did we find this threshold at 118?</b><br />We used the "Otsu" technique. A person named Otsu figured out that a simple and nice way to segment images was to first create a histogram of the pixels and then statistically analyze the histogram.<br />This is what Lena's histogram looks like:<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-0bewAJ71fHo/WbbQepyeAxI/AAAAAAAABks/GQnSwRo4NqwZ3g9qCKTv6Iy92Bk2IthcwCLcBGAs/s1600/LenaHistogramGrayscale.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="197" data-original-width="414" src="https://4.bp.blogspot.com/-0bewAJ71fHo/WbbQepyeAxI/AAAAAAAABks/GQnSwRo4NqwZ3g9qCKTv6Iy92Bk2IthcwCLcBGAs/s1600/LenaHistogramGrayscale.png" /></a></div><br />The vertical columns are the count of the pixels of a particular shade of gray. Notice the bottom of the graph showing the shades of gray. At shade 100, the vertical column just crosses 2000. It means that the Lena image has a little more than 2000 pixels which have the gray shade of 100.&nbsp; These vertical columns are called "<i>bins</i>".<br /><br />In statistics, there is a concept of "<a href="http://mathworld.wolfram.com/Class.html">class</a>", which is a group of objects with a similar property. So in the above histogram, we want to find a threshold which would separate the pixels into two classes. Black pixels and white pixels.<br />Otsu figured out that he could statistically find the best combination of classes (and hence the location of the best threshold), by examining the mean and variances of the classes. He created a formula and called it "finding the between class variance". This between class variance will be used as a value that gives us the "fitness" of the image. Higher the value, better the threshold.<br />If there are two thresholds, there would be three classes. As shown in the image below, the image would be eventually shown with all pixels below grayscale 32, as white. Anything equal to or above 32 and below 106, as gray colour 32 and any pixel equal to or above 106 as white.<br /><br />The calculation goes like this:<br /><style type="text/css">p { margin-bottom: 0.25cm; direction: ltr; line-height: 120%; text-align: left; }a:link { color: rgb(0, 0, 255); }</style> <br /><div align="justify" style="line-height: 100%; margin-bottom: 0cm;"><span style="font-family: &quot;calibri&quot; , serif;">The gray histogram is first normalized. Each of the 0 to 255</span><span style="font-family: &quot;calibri&quot; , serif;"><b>bins</b></span><span style="font-family: &quot;calibri&quot; , serif;"> of the histogram are iterated as </span><span style="font-family: &quot;calibri&quot; , serif;"><b>i</b></span><span style="font-family: &quot;calibri&quot; , serif;">.</span></div><div align="justify" style="line-height: 100%; margin-bottom: 0cm;"><br /></div><i></i><br /><div style="line-height: 100%; margin-bottom: 0cm; text-align: center;"></div><i></i><br /><div style="line-height: 100%; margin-bottom: 0cm; text-align: center;"><i><span style="font-size: x-small;">probability of <b>i</b> = number of pixels in bin <b>i</b> / total number of pixels in image</span></i></div><div style="line-height: 100%; margin-bottom: 0cm; text-align: center;"><i><span style="font-size: x-small;">total <b>mean</b> = sum of probability of <b>i</b> of all bins </span></i></div><div style="line-height: 100%; margin-bottom: 0cm; text-align: center;"></div><br /><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-BFWS9gGk_Fs/WbbUYeM1CPI/AAAAAAAABk4/yKA0_VQwIhc7MaQ8WcSReajCkVxXT1DJgCLcBGAs/s1600/threeThreshold.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="500" src="https://1.bp.blogspot.com/-BFWS9gGk_Fs/WbbUYeM1CPI/AAAAAAAABk4/yKA0_VQwIhc7MaQ8WcSReajCkVxXT1DJgCLcBGAs/s1600/threeThreshold.png" /></a></div><style type="text/css">p { margin-bottom: 0.25cm; direction: ltr; line-height: 120%; text-align: left; }a:link { color: rgb(0, 0, 255); }</style> <br /><div align="justify" style="line-height: 100%; margin-bottom: 0cm;"><br /></div><div align="justify" style="line-height: 100%; margin-bottom: 0cm;"><span style="font-family: &quot;calibri&quot; , serif;">If there are </span><span style="font-family: &quot;calibri&quot; , serif;"><b>t</b></span><span style="font-family: &quot;calibri&quot; , serif;">thresholds, then there will be </span><span style="font-family: &quot;calibri&quot; , serif;"><b>t</b></span><span style="font-family: &quot;calibri&quot; , serif;">+1 number of classes </span><span style="font-family: &quot;calibri&quot; , serif;"><b>c</b></span><span style="font-family: &quot;calibri&quot; , serif;">the image can be segmented into. So with a threshold of t=1, there would be classes c1 and c2. Class mean values would also be computed as mean1 and mean2. Or, as shown in Figure 2.1, if there are two thresholds t1 and t2, there would be three classes and therefore three mean values calculated.</span></div><div style="line-height: 100%; margin-bottom: 0cm;"><br /></div><div style="line-height: 100%; margin-bottom: 0cm; text-align: center;"></div><div style="line-height: 100%; margin-bottom: 0cm; text-align: center;"><span style="font-size: x-small;"><b>pc</b> = probability of class occurrence <b>c</b> = sum of probability of i of all bins in <b>c</b></span></div><div style="line-height: 100%; margin-bottom: 0cm; text-align: center;"><span style="font-size: x-small;"><b>&nbsp;</b></span> </div><div style="text-align: center;"><span style="font-size: x-small;"></span></div><div style="line-height: 100%; margin-bottom: 0cm; text-align: center;"></div><div style="text-align: center;"><span style="font-size: x-small;"></span></div><div style="line-height: 100%; margin-bottom: 0cm; text-align: center;"><span style="font-size: x-small;">class <b>mean</b> = sum of (<b>i</b> * probability of <b>i</b> of all bins in <b>c</b>) / class occurrence <b>c</b></span></div><div style="line-height: 100%; margin-bottom: 0cm;"><br /></div><div style="line-height: 100%; margin-bottom: 0cm;"><span style="font-family: &quot;calibri&quot; , serif;">Class variances of each class </span><span style="font-family: &quot;calibri&quot; , serif;"><b>c</b></span><span style="font-family: &quot;calibri&quot; , serif;">are calculated as:</span></div><div style="line-height: 100%; margin-bottom: 0cm; text-align: center;"><br /></div><div style="line-height: 100%; margin-bottom: 0cm; text-align: center;"><span style="font-size: x-small;">class <b>variance</b> = sum of ((<b>i</b> - class <b>mean</b>)<sup>2</sup> * probability of <b>i</b> / probability of class occurrence <b>c</b>)</span></div><div style="line-height: 100%; margin-bottom: 0cm; text-align: center;"></div><div style="line-height: 100%; margin-bottom: 0cm;"><br /></div><div style="line-height: 100%; margin-bottom: 0cm;"><span style="font-family: &quot;calibri&quot; , serif;">The variance between the classes gives the fitness of the threshold.&nbsp;</span></div><div style="line-height: 100%; margin-bottom: 0cm;"><br /></div><div style="line-height: 100%; margin-bottom: 0cm; text-align: center;"><span style="font-family: &quot;calibri&quot; , serif; font-size: x-small;"><b>between class variance</b> = sum for all bins(<b>pc</b> * (class <b>mean</b> - total <b>mean</b>)<sup>2</sup>)&nbsp;</span></div><div style="line-height: 100%; margin-bottom: 0cm;"><br /></div><div style="line-height: 100%; margin-bottom: 0cm;">Note that the between class variance (BCV) is one single value. You don't calculate between class variances for each threshold and sum them up. You use the one formula given above to calculate it.</div><div style="line-height: 100%; margin-bottom: 0cm;"><br /></div><div style="line-height: 100%; margin-bottom: 0cm;"><br /></div><div style="line-height: 100%; margin-bottom: 0cm;">Ok, so now we know how to calculate the fitness of a threshold, we can write a simple for loop that places the threshold at the zero'th position in the histogram and calculates the BCV. Then move the threshold to position 1 of the histogram and find the BCV and keep going on for values 2, 3, 4 ... till 255. The threshold with the highest BCV will be the optimal threshold. For a single threshold of the Lena image, it is at 118.</div><div style="line-height: 100%; margin-bottom: 0cm;"><br /></div><div style="line-height: 100%; margin-bottom: 0cm;">Now you'd say. Hey, that's it? We just have a search space of 0 to 255? Then why do we need a computational intelligence algorithm? Couldn't we just use normal for loops?</div><div style="line-height: 100%; margin-bottom: 0cm;"><br /></div><div style="line-height: 100%; margin-bottom: 0cm;">Well, for one threshold you can do an exhaustive search from 0 to 255. For two thresholds, you'd have to run two loops nested. So that's 255<sup>2</sup>. For four thresholds, the number of iterations are 4294967296. It would take 95 days to compute on Matlab.</div><div style="line-height: 100%; margin-bottom: 0cm;"><br /></div><div style="line-height: 100%; margin-bottom: 0cm;"><br /></div><div style="line-height: 100%; margin-bottom: 0cm;"><b>Enter the saviour: Computational Intelligence algorithm: Differential Evolution:</b></div><div style="line-height: 100%; margin-bottom: 0cm;"><br /></div><div style="line-height: 100%; margin-bottom: 0cm;">The basic idea of DE is to place thresholds randomly within 0 and 255, and keep evaluating the BCV. With some luck, you will get good thresholds which won't be the best, but will be good enough.</div><div style="line-height: 100%; margin-bottom: 0cm;"><br /></div><div style="line-height: 100%; margin-bottom: 0cm;">The secret weapon of DE is "mutation" and "crossover". Similar to how we have a population of humans and our genes undergo mutations and crossover of traits, the DE algorithm initializes a 'population' of vectors. If we are solving a problem of finding two optimal thresholds, then each vector will contain two random thresholds. During the DE algorithm, these vectors will be combined randomly with other vectors in the population to provide some variety to the result, and somehow, we end up finding near-optimal thresholds. Nobody knows how, but it works. Magic.</div><div style="line-height: 100%; margin-bottom: 0cm;"><br /></div>If there are 4 thresholds and a population of 3 vectors, the vectors would look like this:<br />X1 = [t1; t2; t3; t4];<br />X2 = [t1; t2; t3; t4];<br />X3 = [t1; t2; t3; t4];<br />Where, the t1 of X1 does not have to be the same as the t1 in X2 and so on.<br /><div style="line-height: 100%; margin-bottom: 0cm;"><br /></div><div style="line-height: 100%; margin-bottom: 0cm;"><br /></div><div style="line-height: 100%; margin-bottom: 0cm;">This is the pseudocode for my DE algorithm:</div><div style="line-height: 100%; margin-bottom: 0cm;"><br /></div><div style="line-height: 100%; margin-bottom: 0cm;"><style type="text/css">p { margin-bottom: 0.25cm; direction: ltr; line-height: 120%; text-align: left; }p.western { font-family: "Times New Roman",serif; font-size: 12pt; }p.cjk { font-family: "Times New Roman"; font-size: 12pt; }p.ctl { font-size: 12pt; }a:link { color: rgb(0, 0, 255); }</style> </div><ul style="text-align: left;"><li><span style="font-family: &quot;calibri&quot; , serif;"><span style="font-size: x-small;"><i>Load image and convert to 8 bit grayscale</i></span></span></li><li><span style="font-family: &quot;calibri&quot; , serif;"><span style="font-size: x-small;"><i>Generate histogram from image. </i></span></span><span style="font-family: &quot;calibri&quot; , serif;"><span style="font-size: x-small;"><i><b>Bins</b></i></span></span><span style="font-family: &quot;calibri&quot; , serif;"><span style="font-size: x-small;"><i>ranging from 0 to 255</i></span></span></li><li><span style="font-family: &quot;calibri&quot; , serif;"><span style="font-size: x-small;"><i>Initialize DE parameters: </i></span></span><span style="font-family: &quot;calibri&quot; , serif;"><span style="font-size: x-small;"><i><b>PopulationSize</b></i></span></span><span style="font-family: &quot;calibri&quot; , serif;"><span style="font-size: x-small;"><i>, </i></span></span><span style="font-family: &quot;calibri&quot; , serif;"><span style="font-size: x-small;"><i><b>thresh</b></i></span></span><span style="font-family: &quot;calibri&quot; , serif;"><span style="font-size: x-small;"><i>, crossover probability (</i></span></span><span style="font-family: &quot;calibri&quot; , serif;"><span style="font-size: x-small;"><i><b>cr</b></i></span></span><span style="font-family: &quot;calibri&quot; , serif;"><span style="font-size: x-small;"><i>),</i></span></span><span style="font-family: &quot;calibri&quot; , serif;"><span style="font-size: x-small;"><i><b>beta</b></i></span></span><span style="font-family: &quot;calibri&quot; , serif;"><span style="font-size: x-small;"><i>.</i></span></span></li><li><span style="font-family: &quot;calibri&quot; , serif;"><span style="font-size: x-small;"><i>Set thresh number of thresholds each, randomly within bin space for each population entity </i></span></span><span style="font-family: &quot;calibri&quot; , serif;"><span style="font-size: x-small;"><i><b>X</b></i></span></span><span style="font-family: &quot;calibri&quot; , serif;"><span style="font-size: x-small;"><i>.</i></span></span></li><li><span style="font-family: &quot;calibri&quot; , serif;"><span style="font-size: x-small;"><i>Evaluate initial fitness of X</i></span></span></li><li><span style="font-family: &quot;calibri&quot; , serif;"><span style="font-size: x-small;"><i>forEach generation for a defined number of iterations</i></span></span></li><li><span style="font-family: &quot;calibri&quot; , serif;"><span style="font-size: x-small;"><i>forEach population p for PopulationSize</i></span></span></li><li><span style="font-family: &quot;calibri&quot; , serif;"><span style="font-size: x-small;"><i> Select population entity p from X.</i></span></span></li><li><span style="font-family: &quot;calibri&quot; , serif;"><span style="font-size: x-small;"><i> Select 3 distinct populations from X. The thresholds should not be equal to p.</i></span></span></li><li><span style="font-family: &quot;calibri&quot; , serif;"><span style="font-size: x-small;"><i> Generate mutant U</i></span></span><sub><span style="font-family: &quot;calibri&quot; , serif;"><span style="font-size: x-small;"><i>p</i></span></span></sub><span style="font-family: &quot;calibri&quot; , serif;"><span style="font-size: x-small;"><i>= X1 + beta * (X2 – X3)</i></span></span></li><li><span style="font-family: &quot;calibri&quot; , serif;"><span style="font-size: x-small;"><i> If U</i></span></span><sub><span style="font-family: &quot;calibri&quot; , serif;"><span style="font-size: x-small;"><i>p</i></span></span></sub><span style="font-family: &quot;calibri&quot; , serif;"><span style="font-size: x-small;"><i>== X</i></span></span><sub><span style="font-family: &quot;calibri&quot; , serif;"><span style="font-size: x-small;"><i>p</i></span></span></sub><span style="font-family: &quot;calibri&quot; , serif;"><span style="font-size: x-small;"><i>, regenerate threshold at random position for U</i></span></span><sub><span style="font-family: &quot;calibri&quot; , serif;"><span style="font-size: x-small;"><i>p</i></span></span></sub><span style="font-family: &quot;calibri&quot; , serif;"><span style="font-size: x-small;"><i>and continue;</i></span></span></li><li><span style="font-family: &quot;calibri&quot; , serif;"><span style="font-size: x-small;"><i> Crossover at least one threshold from X to U and other thresholds if generated rnd &lt;= cr</i></span></span></li><li><span style="font-family: &quot;calibri&quot; , serif;"><span style="font-size: x-small;"><i> If mutant thresholds are outside histogram range, regenerate threshold at random position</i></span></span></li><li><span style="font-family: &quot;calibri&quot; , serif;"><span style="font-size: x-small;"><i>end for population</i></span></span></li><li><span style="font-family: &quot;calibri&quot; , serif;"><span style="font-size: x-small;"><i>Evaluate fitness of U</i></span></span><sub><span style="font-family: &quot;calibri&quot; , serif;"><span style="font-size: x-small;"><i>p</i></span></span></sub></li><li><span style="font-family: &quot;calibri&quot; , serif;"><span style="font-size: x-small;"><i>forEach population p for PopulationSize</i></span></span></li><li><span style="font-family: &quot;calibri&quot; , serif;"><span style="font-size: x-small;"><i> If fittest mutants in U</i></span></span><sub><span style="font-family: &quot;calibri&quot; , serif;"><span style="font-size: x-small;"><i>p</i></span></span></sub><span style="font-family: &quot;calibri&quot; , serif;"><span style="font-size: x-small;"><i>are fitter than fittest X</i></span></span><sub><span style="font-family: &quot;calibri&quot; , serif;"><span style="font-size: x-small;"><i>p</i></span></span></sub><span style="font-family: &quot;calibri&quot; , serif;"><span style="font-size: x-small;"><i>, replace X</i></span></span><sub><span style="font-family: &quot;calibri&quot; , serif;"><span style="font-size: x-small;"><i>p</i></span></span></sub><span style="font-family: &quot;calibri&quot; , serif;"><span style="font-size: x-small;"><i>with fittest U</i></span></span><sub><span style="font-family: &quot;calibri&quot; , serif;"><span style="font-size: x-small;"><i>p</i></span></span></sub></li><li><span style="font-family: &quot;calibri&quot; , serif;"><span style="font-size: x-small;"><i>end for population</i></span></span></li><li><span style="font-family: &quot;calibri&quot; , serif;"><span style="font-size: x-small;"><i> decrease beta by 40</i></span></span><sup><span style="font-family: &quot;calibri&quot; , serif;"><span style="font-size: x-small;"><i>-1</i></span></span></sup></li><li><span style="font-family: &quot;calibri&quot; , serif;"><span style="font-size: x-small;"><i>end for generation</i></span></span></li></ul><br /><b>Beta value:</b> Ranges from 0 to 2. A high beta value ensures that the mixing of vector values have a much larger variation, so the mutated vector will end up far from the existing vectors. This is called "exploration", and helps visiting many other threshold positions within the 0 to 255 values. Smaller values of beta keep the variations of threshold values closer to the existing thresholds. This is called "exploitation", as you have found a good threshold already and are trying to exploit that area to find better thresholds in the area. Beta is also called the constant of differentiation.<br /><b>The crossover probability:</b> Ranges from 0 to 1. Having a low crossover probability like 0.2 was found to help reach an optimal threshold faster, but it does not necessarily reach the most optimal threshold. A higher value like 0.8 helps reach a more optimal threshold, but it can take three times more number of generations to do so. Setting cr=0.3 appeared to help reach an optimal threshold with a slightly higher number of generations than cr=0.2. Allows exploitation of symmetry and separability of a function.<br /><br />That's all there is to it. You can have multiple thresholds and the time of execution is just around a minute or two in Matlab even for 6 or eight thresholds. This is a major advantage of CI algorithms. You could achieve the same results with genetic algorithms, particle swarm optimization, bee colony algorithm or bacterial foraging algorithms.<br /><br />The code for the DE algorithm and Otsu method, I've listed here: https://github.com/nav9/differentialEvolution<br /><br /><br /></div>Navin Ipehttp://www.blogger.com/profile/01320006785676088076noreply@blogger.com0tag:blogger.com,1999:blog-6915405415003666702.post-78239772546264384822017-07-31T22:58:00.002+05:302017-07-31T22:58:23.836+05:30Creating a dual boot with Windows and Ubuntu when you have UEFI<div dir="ltr" style="text-align: left;" trbidi="on">People on many blogs say that you have to disable secure boot when you have <a href="https://en.wikipedia.org/wiki/Unified_Extensible_Firmware_Interface">UEFI</a> and want to install Ubuntu alongside Windows 8 or 10.<br />Not necessary. You don't even have to switch to Legacy boot.<br /><br />The basic concept to understand is, that if you have <a href="https://www.howtogeek.com/56958/htg-explains-how-uefi-will-replace-the-bios/">UEFI</a>, you'll have to tell the boot manager where to find your boot file. That's all.<br /><br />After a lot of searching and ending up at all the wrong blogs and posts, I finally found <a href="https://askubuntu.com/a/630662/148011">this post</a>. Worked perfectly!<br /><br />The steps are:<br /><ul style="text-align: left;"><li>Install Windows, leaving a separate partition for Ubuntu</li><li>Install Ubuntu on that partition</li><li>Reboot and enter BIOS screen</li><li>Follow the steps <a href="https://askubuntu.com/a/630662/148011">here</a> about selecting grubx64.efi</li><li>Save and exit BIOS</li></ul><br />That's it! You've got a dual boot system. Grub will show you the options for booting into either Windows or Ubuntu.<br />If anything goes wrong, you can always press F12 when starting your computer to see the boot options.<br /><br />Oh btw, don't disable secure boot. It's a very important feature that prevents your system from getting infected at boot time, by malware that might be in an external drive that's connected to your PC at boot time. <br /><br /></div>Navin Ipehttp://www.blogger.com/profile/01320006785676088076noreply@blogger.com0tag:blogger.com,1999:blog-6915405415003666702.post-6745769725090071122017-07-27T11:09:00.003+05:302017-07-27T11:09:42.824+05:30Our Income Tax department has a strange maintenance message<div dir="ltr" style="text-align: left;" trbidi="on">I logged into my income tax e-filing account yesterday, and saw this message: "<i>You are not authorized to view this page because either your bank details of your PAN and profile details are incorrect or these details have not been passed onto e-Filing. Please contact the owner of the information for details</i>".<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-XHdjZ1L0YIg/WXl7d_RMrxI/AAAAAAAABkI/35D3HL8kYLoxtQ8Uqb1KNI2Q0Ix8yBLQQCLcBGAs/s1600/afterLoggingInViaBank.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="228" data-original-width="1029" height="141" src="https://4.bp.blogspot.com/-XHdjZ1L0YIg/WXl7d_RMrxI/AAAAAAAABkI/35D3HL8kYLoxtQ8Uqb1KNI2Q0Ix8yBLQQCLcBGAs/s640/afterLoggingInViaBank.png" width="640" /></a></div><br />Needless to say, I was completely perplexed. I had filed my taxes correctly and mentioned my bank details correctly. My profile and PAN details were correct too. Why this message? Moreover, because of this message, I couldn't even access my dashboard or file a grievance.<br /><br />A bit of Googling revealed that few other people had faced the same issue since 2014. One of the answers on a forum said that this message shows up when the website is undergoing some routine maintenance, and we should check back after six to twelve hours.<br /><br />I logged back in the next day and sure enough, everything was back to normal.<br /><br />Phew!<br /><br />I do hope our e-filing department changes that message to something like "<i>Routine website maintenance ongoing. Please check back after few hours</i>".<br /><br />This is for all of you who were perplexed by this message and didn't know whom to ask. Hope it helped. </div>Navin Ipehttp://www.blogger.com/profile/01320006785676088076noreply@blogger.com0tag:blogger.com,1999:blog-6915405415003666702.post-8964061623692485632017-06-18T15:16:00.002+05:302017-08-06T18:52:34.584+05:30How to download files or an entire folder from Google Drive?<div dir="ltr" style="text-align: left;" trbidi="on">I've found it very strange that a product of Google didn't have a straightforward way to download files or an entire folder in one shot.<br /><br />There is a way though:<br /><ul style="text-align: left;"><li>As shown in the image below, click the folder or file you want to download</li><li>Then click the menu button to open the menu.</li><li>Then if you don't see a download option in the menu, just click the empty area at the bottom of the menu.</li></ul><br />You'll get your folder in zipped format.<br /><br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-Kq4ICrHyrP8/WUZLGAmpbbI/AAAAAAAABj4/qaC71-pVu-k0mAwCxnWqpXpg_In_xzkiwCLcBGAs/s1600/GoogleDriveDownloadHack.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="328" data-original-width="1141" height="182" src="https://1.bp.blogspot.com/-Kq4ICrHyrP8/WUZLGAmpbbI/AAAAAAAABj4/qaC71-pVu-k0mAwCxnWqpXpg_In_xzkiwCLcBGAs/s640/GoogleDriveDownloadHack.png" width="640" /></a></div><br /><br />I assume it's just a bug that the download icon isn't visible.<br />Another way to download is to double click the file to open it and on the top right corner of the screen you'll see the download icon.<br /><br /><br /><b>UPDATE:</b> I wrote to Google support about this issue, and as of August,&nbsp; the CSS issue with the hidden download button is fixed. There also was another issue of people using Chrome being unable to download files. Google told me they are working on fixing that too. Until then, you could just use incognito mode to download.</div>Navin Ipehttp://www.blogger.com/profile/01320006785676088076noreply@blogger.com0tag:blogger.com,1999:blog-6915405415003666702.post-12361228179086265982017-06-14T19:45:00.000+05:302017-06-18T15:19:15.958+05:30Wear that helmet. It's actually worth it<div dir="ltr" style="text-align: left;" trbidi="on">Few years ago when taking my friend back home on my bike, he noticed me taking my helmet and asked "<i>You wear a helmet for short distances too?</i>".<br /><br />I couldn't really believe what I was hearing. Still, there is a large number of people who hate helmets because it's claustrophobic, because they think it causes hair loss (<a href="https://skeptics.stackexchange.com/questions/10003/does-wearing-a-helmet-cause-aggravate-hair-loss/10017">it does not</a>), because they actually feel they'd never get into an accident and sometimes simply because they can't afford one.<br /><br />The safety lectures are not the only reason to wear them:<br /><br /><b>Stones, insects, tree branches:</b> Even when riding a bike at 40kmph, these objects can hit your face at high speeds. Have a full face helmet with a visor. I've encountered these projectiles at least once a month. The stones that get half under a vehicle tyre and shoot out at you are particularly dangerous. A colleague's car windshield looks like as though a bullet hit against bulletproof glass and left a dent there. It was hit by one such stone.<br /><br /><b>Wind, dust, sunlight and rain:</b> Very useful to be protected with a helmet.<br />And of course...safety: The visor protects your nose and the front of your face from getting damaged too much. A full face helmet protects the sides of your face (which are most probable for damage during an accident).<br /><br /><br />Look at <a href="https://www.quora.com/Is-it-unwise-to-ride-a-motorcycle-with-an-open-face-helmet">all the pics here</a>.<br /><br />Get a helmet. Wear it.<br /><br /><div style="text-align: center;"><br /></div><div style="text-align: center;"><iframe allowfullscreen="" frameborder="0" height="315" src="https://www.youtube.com/embed/HhOlSB2qMWk" width="560"></iframe></div><br /></div>Navin Ipehttp://www.blogger.com/profile/01320006785676088076noreply@blogger.com0tag:blogger.com,1999:blog-6915405415003666702.post-2220325305378306352017-05-21T21:43:00.001+05:302017-06-02T22:46:01.153+05:30Writing GATE exam of another branch<div dir="ltr" style="text-align: left;" trbidi="on">I've written about how I was <a href="http://nrecursions.blogspot.in/2014/03/my-creations.html">forced into doing Mechanical engineering</a> even though what really clicked with me was computer science. Ever since then there was a desire to pursue an education in CS.<br /><br />So what can a Mechanical Engineer do to get a degree in Computer Science? Either write GATE or PGCET. The PGCET people were obstinate about not allowing a Mech engineer to write a CS paper, but the GATE organizers (bless them) agreed.<br />With five months of preparation time and a work schedule which many-a-time required me to work on weekends, I started preparing. Even though a week before the exam I couldn't study due to work deadlines, I wrote GATE and waited...remembering the amusing moment when the examiners at the centre, double-checked my photo ID with my face, wondering if I was a genuine candidate (others who wrote the exam were much younger).<br /><br />Results were declared and I was among the top 11% of candidates across India. To me it initially didn't seem a big deal that I qualified. It was only later that a friend from IISc told me that qualifying in GATE itself is a big deal. On top of that, I cleared GATE from a different branch than what I studied in my bachelors. This was accentuated by my meeting some CS graduates who told me that they couldn't clear GATE when they wrote it.<br /><br />Even more surprising:&nbsp; Only 16% of the students had qualified. Articles from <a href="http://www.hindustantimes.com/education/gate-2017-just-16-candidates-qualify-numbers-not-good-this-year-too-says-organising-chairman/story-UknXVa8EcYZDC8K839FNXK.html">HindustanTimes</a> and <a href="http://indiatoday.intoday.in/education/story/gate-2017/1/914673.html">IndiaToday</a>.<br /><br />I also wrote back to the GATE organizers thanking them for the opportunity and the organizing chairman Prof.G.J.Chakrapani replied back with his best wishes. <br /><br /><br /><b>What helps with preparing for GATE?</b><br /><br />The wonderful people who created <a href="https://gateoverflow.in/">GateOverflow</a>. The single best resource on the internet. There's <a href="http://gatecse.in/gate-overflow-book-qa-only-previous-gate-tifr/">a PDF</a> you can download which contains questions from previous years, segregated subject-wise.<br />They also have a stackoverflow-style forum where you can ask your doubts. <br />This is a very useful piece of knowledge, because it lets you know how you have to study the concept, in order to be prepared for the exam.<br /><br />Now I'm finally doing my masters in Computer Science. A bunch of mind boggling mathematics as part of the syllabus, but I'm glad I got here.<br /><br /><br /><b>And to the socially conscious parents...</b><br /><br />I still meet people who have newly become parents, who are already planning to send their child to college to become a doctor or engineer. I ask them if they'd be willing to consider what their child's interests are, and they don't really care.<br />I feel sad for their kids.<br />A bunch of lovely dreams squashed by the perception of social status and bullying.<br /><br />As long as the education system and the industry allows people to switch to what they like doing, I feel our people and our nation will have a bright future. Better still, might be the concept shown in <a href="https://en.wikipedia.org/wiki/Man_of_Steel_%28film%29">Man of Steel</a>, where the genetic makeup of a child is determined at birth and they are trained from childhood to become the best at whatever career they are genetically and mentally most inclined to like and perform.<br /><br /><br /><blockquote class="tr_bq"><div style="text-align: center;"><i>"Knowledge is most precious to the one who truly seeks and respects it"</i></div><div style="text-align: center;"><i>- Navin Ipe</i></div></blockquote><br /><br /></div>Navin Ipehttp://www.blogger.com/profile/01320006785676088076noreply@blogger.com0tag:blogger.com,1999:blog-6915405415003666702.post-76275206926959880172017-04-28T19:28:00.003+05:302017-04-30T00:45:36.081+05:30What exactly is the "mothers love" part of home cooked food?<div dir="ltr" style="text-align: left;" trbidi="on">One of my seniors in college always loved saying (whenever we were at a restaurant) that mother's food is always the best food because it is sprinkled with a necessary ingredient: Love.<br /><br />I mentioned the same thing to a pragmatic uncle of mine, and his immediate response was "<i>Bull***t!</i>" :-)<br />At least he wasn't of the opinion that the taste of food comes from an emotion.<br /><br />So what exactly is the "mothers love in home-cooked food" or to ask it differently, what makes home cooked food more healthy? What makes outside food bad?<br /><br /><b>Outside food answers you are familiar with:</b><br /><ul style="text-align: left;"><li>Artificial ingredients</li><li>Too many spices</li><li>Reused oil</li></ul><br />But that's not all. There are some things you've never noticed because your stomach was either resilient enough to handle it or you just didn't know:<br /><ul style="text-align: left;"><li>The food was not cooked fully (many cooks aren't really cooks. They were just looking for a job and someone taught them the basics and they have too many customers to serve. Who has the time to cook food fully?)</li><li>The food has burnt particles in it (I know there are a lot of silly people who have told you that the <a href="https://health.stackexchange.com/questions/5017/eating-burned-food">black portions</a> of rotis and parathas are ok. They <a href="https://cooking.stackexchange.com/questions/77195/do-parathas-naan-and-roti-have-to-be-burnt-a-little">are not</a>)</li><li>The ingredients used were of low quality</li><li>The food contains<a href="https://en.wikipedia.org/wiki/Helicobacter_pylori"> H Pylori</a>. Causes horribly painful stomach aches. </li></ul><br /><b>So the "Love" in the food is...</b><br /><br />The love is the care with which the food is cooked. Not every mother can do that though. Many of them hate being in the kitchen and many aren't very knowledgeable about cooking. But the more access to knowledge the mother or father or any family member has, the better their cooking will be and the more healthy it will be for you.<br />There's one other thing: Certain foods get associated with memories of one's mother or family. For example, there are friends of mine who love <a href="https://www.google.co.in/search?client=ubuntu&amp;hs=8fF&amp;channel=fs&amp;q=ragi+mudde&amp;spell=1&amp;sa=X&amp;ved=0ahUKEwjrpe3dr8rTAhWKvY8KHS_vCxIQvwUIIygA&amp;biw=1568&amp;bih=811">Ragi Mudde</a> (plenty of childhood memories associated with it). Others can't even stand the taste of it.<br /><br />If you don't have access to healthy home cooked food, buy a stove (even if it's an electric induction stove) and learn to cook your own food. Trust me, it'll be entirely worth it. If you live in a place that does not allow you to cook, then leave that place and find a place where you can cook.<br />Invest in your health and you will reap benefits. Ignore the food part of health and<a href="http://nrecursions.blogspot.in/2016/12/able-to-sleep-only-for-four-hours-at.html"> every other part of your body will suffer</a>.<br /><br /><br />ps: On a side note, if you've heard of people saying that eating with the fingers is tastier than eating with a spoon but were never able to explain why; I have the answer for you. I asked this question on skeptics.stackexchange.com and <a href="https://skeptics.stackexchange.com/questions/31481/is-eating-food-with-your-bare-hands-more-tasty">here's the answer</a>:<br /><br /><div style="text-align: center;"><blockquote class="tr_bq"><i>There is scientific research which says that touching (tactile sensations) itself, not just the changes in the diffusion of taste and odor compounds with different textures, can adjust the perception of taste and smell. The studies don't specifically say that the taste is always improved, but tactile sensations affect the perceived taste.</i>&nbsp;</blockquote></div><br /><br /><br /></div>Navin Ipehttp://www.blogger.com/profile/01320006785676088076noreply@blogger.com0tag:blogger.com,1999:blog-6915405415003666702.post-50333256186350934982017-03-18T22:28:00.002+05:302017-03-18T22:31:27.182+05:30Getting a quick summary of table sizes and rows in MySQL<div dir="ltr" style="text-align: left;" trbidi="on">Just a quick post to show you a technique my colleague showed me on how to get the sizes of tables and an approximate number of rows it has, without having to wait long for a <i>select count(*) from table</i>.<br /><br />Use this command:<br /><br /><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SELECT<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; table_schema as `Database`,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; table_name AS `Table`,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; table_rows AS "Quant of Rows",<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; round(((data_length + index_length) / 1024 / 1024/ 1024), 2) `Size in GB`<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FROM information_schema.TABLES<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WHERE table_schema = 'ballast'<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ORDER BY (data_length + index_length) DESC;</b><br /><br />This will show you a result like this:<br /><br />-------------------------------------------------------------------------------------------<br />| Database &nbsp; &nbsp; Table&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Quant of Rows&nbsp; Size in GB <br />-------------------------------------------------------------------------------------------<br />| ball &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; TableHosp2015&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 110654400&nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; 11.05 <br />| ball&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; TableHosp2016&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 115890383&nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; 10.30 <br />| ball &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; Table2016_temp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp; 87027666&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; 6.49 <br />| ball&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; Table2014_temp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp; 73765370&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; 5.78 <br />| ball&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; Table2015&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; 62064795&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; 4.86 <br />| ball &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; Distances&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; 158372&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; 0.02 <br />-------------------------------------------------------------------------------------------</div>Navin Ipehttp://www.blogger.com/profile/01320006785676088076noreply@blogger.com0tag:blogger.com,1999:blog-6915405415003666702.post-20010980456380064972017-03-13T23:06:00.000+05:302017-03-29T19:49:50.690+05:30The Indian Education System inadvertently trains you to deal with customers<div dir="ltr" style="text-align: left;" trbidi="on">The first part of this blog post is anecdotal.<br /><br />As Indians, we tend to complain a lot about our education system. About how it focuses only on securing marks and does not spark interest in students.<br /><br />A neighbour recently asked me for my book on C++, saying she wanted a few theory concepts to write as part of an assignment her teacher gave.<br /><br />As the book was an old one, I told her the best place to get her info was on the internet.<br />Her answer surprised me. <i>She said she wanted to refer the theoretical concepts in the book and write those for her assignments because that's what the teacher would expect. Scoring the marks was of a higher priority than learning the theory.</i><br /><br /><br /><b>Two ways of looking at it:</b><br /><br /><b>Way One:</b> Here's where you start cursing the Indian education system which designed assignments only for the purpose of scoring marks. Pull your hair out and ask for the system to be changed so that kids would have better practical programming knowledge.<br /><br /><b>Way Two:</b> Our Indian education system had just given birth to another little girl who saw the problem from the customer's perspective. This is exactly what every CEO wants their sales people to understand.<br /><br /><div style="text-align: center;"><blockquote class="tr_bq">Find out what the customer wants and tailor your response and product to that. You make the sale!!!</blockquote></div><br />My little neighbour learnt how to anticipate what the teacher wanted and gave the teacher exactly that. Marks scored!!! <br />You see students all over India finding such shortcuts which get the job done. Finding innovative ways of impressing the teacher, pretending to be extra humble for some leniency or marks, pulling strings to get hold of the studious guy/girl's notes...and so many more...<br /><br />Rings a bell? <a href="http://quoteinvestigator.com/2014/02/26/lazy-job/">Somebody's</a> famous quote of "<i>I will always choose a lazy person to do a difficult job because a lazy person will find an easy way to do it</i>".<br /><br />We are expected to do this as engineers too. If there's a solution already available, just use it instead of spending time doing things from scratch and allowing the competition to gain an advantage over us.<br /><br /><br /><b>The customer focus:</b><br /><br />As a person who designs the Architecture of software, my primary goal is to ensure that the customer's requirements are fulfilled, instead of choosing an architecture and technology that would look good on my resume/CV.<br />If the customer's work can be done with a simple technology, it is better to use that, than to choose a different, more complex, more time consuming technology that would add a lot of punch to your portfolio, but would be of little or no value to the customer.<br /><br />When you do find people who care about what the customer wants, treat them like a precious gem. You have a valuable find.<br /><br /><br /><div style="text-align: center;"><span style="font-size: x-small;">ps: This is not to misunderstand those genuine people who spend time understanding concepts and improving on the theoretical understanding. This is also expected of good engineers. To be well informed, educated and at the top of the game. These engineers are a league apart. Inventors. Scientists. People who create value for the world.</span></div><div style="text-align: center;"></div></div>Navin Ipehttp://www.blogger.com/profile/01320006785676088076noreply@blogger.com0tag:blogger.com,1999:blog-6915405415003666702.post-54850301368875985422017-02-27T20:22:00.001+05:302017-02-27T20:24:21.841+05:30Aha!<div dir="ltr" style="text-align: left;" trbidi="on"><div style="text-align: center;"><br /></div><div style="text-align: center;">Continued from the <a href="http://nrecursions.blogspot.in/2017/01/aha.html">previous Aha!</a></div><div style="text-align: center;"><br /></div><div style="text-align: center;"><br /></div><div style="text-align: center;"><br /></div><div style="text-align: center;"><span style="color: #999999;"><span style="font-family: serif;"><b id="vendorspeak">Vendors</b></span></span></div><div style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20.7900009155273px; text-align: center;"><span style="font-size: xx-small;">Share with&nbsp;<a href="http://nrecursions.blogspot.in/2017/02/aha.html#vendorspeak">this link</a></span></div><br /><div class="separator" style="clear: both; text-align: center;"></div><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-Le19cwpdEuI/WLQ83GZO5II/AAAAAAAABjI/GNGPJgOG0k4i_LKxTn8PfSQaZ8ZilJkigCLcB/s1600/vendorSpeak.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://4.bp.blogspot.com/-Le19cwpdEuI/WLQ83GZO5II/AAAAAAAABjI/GNGPJgOG0k4i_LKxTn8PfSQaZ8ZilJkigCLcB/s1600/vendorSpeak.png" /></a></div><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-3LUM220wQ8w/WI9j_IFz2eI/AAAAAAAABik/n4K03rjVEAMpoua3Dh4XfhKVTG2jVUtvwCLcB/s1600/packaging.png" style="margin-left: 1em; margin-right: 1em;"><br /></a></div><br /><br /><div style="text-align: center;">To be continued...<br /><br /></div></div>Navin Ipehttp://www.blogger.com/profile/01320006785676088076noreply@blogger.com0tag:blogger.com,1999:blog-6915405415003666702.post-8874971871318157242017-02-12T18:48:00.000+05:302017-02-12T18:48:18.782+05:30How to speed up MySQL inserts<div dir="ltr" style="text-align: left;" trbidi="on">One would assume that if an application had two threads, and while one thread inserted data into one table and the other thread inserted data into another table, the inserts would be faster than if both threads inserted into the same table? No. It isn't faster.<br />The various threads that MySQL has, are to manage the <a href="https://dev.mysql.com/doc/refman/5.7/en/mysql-threads.html">other different operations</a>.<br /><br />There however is a technique that can improve insert speed further.<br /><br />Smart programmers already know that<a href="http://stackoverflow.com/questions/4355046/java-insert-multiple-rows-into-mysql-with-preparedstatement"> using a batch insert</a> is more efficient and faster than calling INSERT multiple times from their program.<br /><br />What you perhaps do not know, is that after you send the batch of insert statements to MySQL, they are executed internally as separate inserts.<br /><br /><b>INSERT INTO Table1 VALUES (1,2,3)&nbsp;</b><br /><b>INSERT INTO Table1 VALUES (4,5,6)</b><br /><br />What if you could combine it into a single insert statement like this:<br /><br /><b>INSERT INTO X VALUES (1,2,3),(4,5,6)</b><br /><br />It'll actually execute faster! Some people report a 2x increase in write speed. Others, report a 40x increase.<br /><br /><br /><b>How to do it?&nbsp;</b><br /><br />Just <a href="http://stackoverflow.com/questions/2993251/jdbc-batch-insert-performance">set</a> the <b>rewriteBatchedStatements=true</b> value in the connection string.<br /><br />So if you normally connect to MySQL like this...<br /><br /><i>Connection conn = DriverManager.getConnection("jdbc:mysql://"+ domainName +"/"+configRef.getBallastDatabaseNameOfSQL()+"?" + "user=" + username + "&amp;password=" + password);</i><br /><br />...you just have to change it to:<br /><br /><i>Connection conn = DriverManager.getConnection("jdbc:mysql://"+ domainName +"/"+configRef.getBallastDatabaseNameOfSQL()+"?" + "user=" + username + "&amp;password=" + password <b>+ "&amp;rewriteBatchedStatements=true"</b>); </i><br /><br /><br />In my opinion, MySQL should have kept this as default behaviour and the user should have had to disable it only if they were doing very large batch inserts.<br /><br />Do try this out even if you don't execute too many inserts. In applications dealing with a lot of data though, this option can come as a life saver! You save a humongous amount of time with these super fast inserts.<br /><br /></div>Navin Ipehttp://www.blogger.com/profile/01320006785676088076noreply@blogger.com0tag:blogger.com,1999:blog-6915405415003666702.post-19769894173543007882017-02-12T18:26:00.001+05:302017-02-12T18:26:31.864+05:30Avoiding memory problems when working with huge amounts of data<div dir="ltr" style="text-align: left;" trbidi="on">There would be times when you run applications with libraries like Apache Storm or similar programs, and you'd be surprised when these applications crash and restart with no apparent reason.<br /><br />The reason in many cases (as you'll infer from the error logs) is that the application ran <a href="https://greencircle.vmturbo.com/community/products/blog/2016/02/12/understanding-gc-allocation-failure-messages-in-the-logs">out of memory</a>. You just didn't have enough RAM.<br /><br /><b>Why this happens:</b><br />If you specify (using -Xmx2g) that your application can use a maximum of 2GB memory, you have to remember that there are other applications running that might also be free to use that much memory.<br /><br />Let's say you have 4GB RAM.<br />App1 takes up 2GB.<br />App2 takes up 2GB.<br /><br />App1 deletes some large datastructures that it's using, before creating a new datastructure.<br /><br />The request for creation of a new datastructure makes the Garbage Collector try to allocate more memory. Sometimes, operations happen so quickly that the GC has no time to remove the unused memory before allocating new memory.<br /><br />Since you've run out of RAM space, the OS would typically allow your application to use virtual memory. To do that, you need a <b>swap space</b>. If you don't have one, your application might crash with the message that there was insufficient memory. Your application might not even catch this exception and yet crash.<br /><br />In many managed servers like <a href="https://en.wikipedia.org/wiki/Amazon_Web_Services">AWS</a>, the nodes don't have a default swap space.&nbsp; You have to create one. It's very simple and completely worth it.<br /><br /><b>How much swap space to create?</b><br />Go for double the size of your existing RAM. I know that sounds like a lot, but believe me; I've seen how a system with 4GB RAM has used more than 4GB of swap space when I had allocated it 10GB of swap space. Hardware is cheap, and we now have disks with plenty of space, so create large swap partitions/files.<br /><br /><b>How to create the swap space?</b><br />First check if it's already there with <br /><br /><b>free -m</b><br /><br />and check for how much disk space is available with<br /><br /><b>df -h </b><br /><br />On an Ubuntu 14.04 system, just run these commands:<br /><br /><b>sudo fallocate -l 6G /swapfile </b>(the "6G" means 6GB of disk space)<b><br /></b><br /><b>sudo chmod 600 /swapfile</b><br /><b>sudo mkswap /swapfile</b><br /><b>sudo swapon /swapfile</b><br /><br />To make the swap file permanent:<br /><br /><b>sudo vi /etc/fstab</b><br /><br />and at the bottom of the fstab file, add this line (press tab instead of a space wherever you see a space in the line below):<br /><b>/swapfile&nbsp;&nbsp; none&nbsp;&nbsp;&nbsp; swap&nbsp;&nbsp;&nbsp; sw&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp; 0</b><br /><br />If you like tweaking things more, you can also tweak the <a href="https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04">swappiness setting</a> which determines how often the OS will transfer data from the RAM to swap space.<br /><br /><br /></div>Navin Ipehttp://www.blogger.com/profile/01320006785676088076noreply@blogger.com0tag:blogger.com,1999:blog-6915405415003666702.post-62679210638380054622017-01-30T21:35:00.002+05:302017-02-27T20:23:10.725+05:30Aha!<div dir="ltr" style="text-align: left;" trbidi="on"><div style="text-align: center;"><br /></div><div style="text-align: center;">Continued from the <a href="http://nrecursions.blogspot.in/2016/11/aha.html">previous Aha!</a></div><div style="text-align: center;"><br /></div><div style="text-align: center;"><br /></div><div style="text-align: center;"><br /></div><div style="text-align: center;"><span style="color: #999999;"><span style="font-family: serif;"><b id="packaging">Packaging</b></span></span></div><div style="background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20.7900009155273px; text-align: center;"><span style="font-size: xx-small;">Share with&nbsp;<a href="http://nrecursions.blogspot.in/2017/01/aha.html#packaging">this link</a></span></div><br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-3LUM220wQ8w/WI9j_IFz2eI/AAAAAAAABik/n4K03rjVEAMpoua3Dh4XfhKVTG2jVUtvwCLcB/s1600/packaging.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://2.bp.blogspot.com/-3LUM220wQ8w/WI9j_IFz2eI/AAAAAAAABik/n4K03rjVEAMpoua3Dh4XfhKVTG2jVUtvwCLcB/s1600/packaging.png" /></a></div><br /><br /><div style="text-align: center;">Continued in the <a href="http://nrecursions.blogspot.in/2017/02/aha.html">next Aha...</a><br /><br /></div></div>Navin Ipehttp://www.blogger.com/profile/01320006785676088076noreply@blogger.com0tag:blogger.com,1999:blog-6915405415003666702.post-62778795625588849402017-01-22T22:22:00.000+05:302017-01-22T22:22:11.183+05:30USB tethering. Use internet on your Desktop PC via mobile phone internet<div dir="ltr" style="text-align: left;" trbidi="on">Whenever I've used internet via a mobile phone's WiFi Hotspot, I've always wondered if it was transmitting extra data just for the sake of being in sync with the laptop. Or perhaps adding extra bits to the packets when transferring data.<br />Turns out it is true. Using mobile hotspot actually <a href="https://www.google.co.in/search?client=ubuntu&amp;channel=fs&amp;q=using+mobile+hotspot+uses+more+data&amp;ie=utf-8&amp;oe=utf-8&amp;gfe_rd=cr&amp;ei=kdiEWPTtN8uL8Qezs5C4Cg">takes up more data</a>.<br /><br />While some people have suggested tethering your mobile with the laptop using Bluetooth tethering, which is said to (but I haven't verified it) use lesser data, I feel a wired connection would be much better.<br /><br />That alternative I found in <b>USB tethering</b>.<br /><br />All this while I was actually considering buying a WiFi network card for my desktop PC, and I came across USB tethering which solved my problem elegantly and with no additional cost.<br /><br /><br /><b>How to do it?</b><br /><ol style="text-align: left;"><li>Just take the cable you usually connect your mobile phone and desktop PC or laptop with, for transferring data via USB.</li><li>Go to your mobile phone settings and activate USB tethering.</li><li>Switch on your mobile phone internet.</li></ol><br />That's it. Your phone is now a modem. You can use internet on your desktop PC or laptop. Best tethering option because your phone is connected to the PC, and it even gets charged in the process.<br /><br />Kudos to those who came up with these brilliant solutions!</div>Navin Ipehttp://www.blogger.com/profile/01320006785676088076noreply@blogger.com0tag:blogger.com,1999:blog-6915405415003666702.post-62277787167826460562017-01-21T19:59:00.001+05:302018-01-12T02:30:52.979+05:30Mobile wallets have disappointed<div dir="ltr" style="text-align: left;" trbidi="on">Although India returns to cash normalcy now, it has been a mystery, why Rs.2000 notes were printed instead of smaller denomination notes which would have saved a lot of trouble to citizens.<br />The past few months have seen a rise in advertising and promotions of digital wallets like Paytm, Freecharge and Mobikwik.<br /><br />I tried a Paytm and Mobikwik and skipped Freecharge due to the large number of reviews saying they don't honour cashbacks and a load of other complaints.<br /><br /><br /><br /><span style="color: #3d85c6;"><span style="font-size: large;"><b>Paytm</b></span></span><br /><br /><ul style="text-align: left;"><li><b>Registration problems: </b>For what is cited as the most popular e-wallet in India, and with even tiny shops in Delhi putting up <i>"Paytm accepted here"</i> posters, I was surprised that I wasn't even able to register with Paytm. The textfield in the registration page wasn't accepting any keystrokes! A few refreshes and tries later, it still didn't work. Wrote to Paytm about it and they fixed it.</li><li><b>Godnose what problems: </b>After creating my account, at a critical time when I needed to make a payment to someone a few hours later, I logged in to transfer money into the Paytm wallet, and Paytm pops up a dialog box asking for my date of birth. Oddly, no year option is provided below 2010. Even after manually typing the correct date of birth, the dialog box just wouldn't disappear!</li><li><b>Payment problems: </b>A friend tried paying at KFC with his Paytm account. We waited more than 4 minutes for the transfer to happen, tried again with other customers waiting behind us and finally just did a cash payment. </li></ul><br />I had it with Paytm. Logged out and didn't bother with it again.<br /><br /><br /><br /><span style="color: #674ea7;"><span style="font-size: large;"><b>Mobikwik</b></span></span><br /><br />Mobikwik was in the news when people were posting comments on Facebook about PayTm offering poor service, and somebody from Mobikwik was busy posting comments inviting people to use Mobikwik instead. Such an action in itself shows a lack of class. More...<br /><br /><br /><span style="color: #6aa84f;"><b>Good parts:&nbsp;</b></span><br /><br /><ul style="text-align: left;"><li><b>Account creation:</b> No trouble with account creation.&nbsp;</li><li><b>Money transfer:</b> Transferred money to the wallet from my bank easily. Transferred money to another bank (after some initial hassles) easily (you can't transfer any amount that you got via a purported cashback though). This is one function that is performed by mobile wallets very well. Bank to wallet to bank transfers. No extra charges involved. [<b>EDIT</b>: As of Feb 2017, when I tried doing a transfer, I was charged a processing fee of Rs.84 for transferring Rs.2000. Feeling cheated, I tried transferring the remaining amount from the Mobikwik wallet to my bank account, and I got an error saying "you have exceeded the daily number of transfers limit". Sad.]</li></ul><br /><br /><span style="color: #990000;"><b>Bad parts:</b></span> <br /><br /><ul style="text-align: left;"><li><b>Silly name entry error: </b>I typed in the bank account number and the IFSC code of the bank of the person I needed to urgently transfer money to, and Mobikwik does not process the request. It shows an error message for two seconds after which the message disappears. Couldn't even read it. Tried again and saw the error <span class="ng-binding">"oops. Sender name is a mandatory field". Much later, the Mobikwik team replies to my complaint saying it was because I didn't enter my name in my profile. This is such a dumb way to create a software!</span></li><li><span class="ng-binding"><b>Responses to complaints:</b> You can't call up. You have to write them a complaint which it seems gets answered by an AI program that gives you some standardized reply. You then have to reopen the ticket and then a human responds. Nice way to delay resolutions and annoy customers.</span></li><li><span class="ng-binding"><b>Bloated bus booking costs:</b> Mobikwik says they offer 50% and 100% cashback on bus bookings. But the cashbacks are only until a limit of a few hundred rupees. So if you book a bus for Rs.1500, you won't get Rs.1500 credited back to your account. Moreover, the bus prices listed for my trip were shown as starting from Rs.1148. On redbus.in, the same buses were listed for Rs.200 lesser, and there were also many other buses listed at half the price. Mobikwik cashbacks are a farce.</span></li><li><span class="ng-binding"><b>Bloated electricity bill payment costs:</b> If one tries to pay their electricity bill via a government website, the website charges an additional 50 paisa over the bill. Mobikwik charges Rs.8 extra, and then pretends to give you a Rs.4 cashback. So basically you end up paying Rs.3.5 more than required. If it wasn't for the extra cost and cashback pretence, it would have actually been convenient paying through an e-wallet.</span></li><li><span class="ng-binding"><b>Nonexistent water bill payment: </b>Clicking the "view bill" button does not even show the bill amount. Complaining, results in a standard AI reply. Reopening the ticket results in "<i>We would like to inform you that it was due to an up-gradation. In such cases your Wallet balance is not deducted. Please try again</i>". They didn't bother to fix it anyway. This bill payment was probably just a gimmick.</span></li><li><span class="ng-binding"><b>Free petrol farce:</b> I receive an SMS about being able to get free petrol; 100% cashback, from designated petrol bunks from 6pm to 9pm on 3 days. The rider is that the limit is Rs.100 cashback although it says 100% cashback. I look at the list of petrol bunks, go to one of them and ask how I can pay via Mobikwik. They tell me they haven't even heard of any such offer and that they accept only card payments.&nbsp;</span></li></ul><span class="ng-binding"><br /></span><span class="ng-binding">Mobikwik; you have sorely disappointed.</span><br /><br /><br /><br /><span style="font-size: large;"><b>UPI</b></span><br /><br />The government's Unified Payment Interface. This would actually be good if only more people adopted it. Sadly, everywhere I have asked, people haven't even heard of it.<br /><br /><br /><br /><span style="font-size: large;"><b>Privacy</b></span><br /><br />While digital payments and tracking are nice and it would lead to a better economy, some people have told me how data is used and misused. You certainly don't want some private company or even a government organization knowing how many underwears, fruits or other items you purchased at what time of the year. You don't want them analyzing that information, making predictions of what you would buy next and sending you targeted advertisements or making conclusions about your life based on your purchases.<br /><br />The idea of a cashless society is good, but is not really practical or likeable in practice. E-wallets have a very long way to go in terms of service, and a great deal to buck up in re-gaining the trust of people.<br /><br /><br /></div>Navin Ipehttp://www.blogger.com/profile/01320006785676088076noreply@blogger.com0tag:blogger.com,1999:blog-6915405415003666702.post-12527967876393836912017-01-20T19:16:00.001+05:302017-10-02T19:21:26.532+05:30Viruses in Indian cybercafe's<div dir="ltr" style="text-align: left;" trbidi="on"><div dir="ltr" style="text-align: left;" trbidi="on">Happens all the time. Take a pen drive with a word file to get a printout at a cyber cafe or a shop where they do printouts, and you come back with a virus infected pen drive.<br />At least this used to be ok as long as the virus didn't do anything to the file. You could still take the printout. Now-a-days, there's a bigger problem: The virus copies all the files into a hidden, unnamed folder and all you see is an empty pen drive. How are we to take a printout now?<br /><br />Sadly, the popularity of Microsoft Windows and the availability of pirated copies is one factor that contributes to the spread of these viruses. What's worse, the cyber cafe owners refuse to believe that their computer has a virus!<br />I wonder when people will realize that pirated operating systems are very likely to have <a href="https://www.google.co.in/search?client=ubuntu&amp;channel=fs&amp;q=pirated+operating+system+backdoor&amp;ie=utf-8&amp;oe=utf-8&amp;gfe_rd=cr&amp;ei=dw2CWLPOEuXI8Ae-qrHoBQ">backdoors and more malware</a>? Something you have to be very aware of when you type your passwords in cyber cafe's.<br /><br />Having an antivirus is not enough. I've seen numerous cases where antiviruses are unable to detect viruses and worms. An antivirus detects virus signatures (a certain pattern of characters that a virus file contains). When the creators realized this, they started creating viruses that would alter their signature whenever they copied themselves to another disk, using an encryptor and decryptor. Then came polymorphic viruses which could change the signature of the encryptor and decryptor too. Antiviruses also use heuristics (virus behaviour like replication, overwriting files etc) to find viruses.<br /><br /><br /><span style="font-size: large;"><b>The alternative</b></span><br /><br />The better way to stay safe, is to use an operating system which is heavily monitored by a community of voluntary software programmers all across the world. People who are dedicated to maintaining security and privacy.<br /><br />One such operating system is Linux. Although some of the other variants of Linux were good earlier, I now dislike the interfaces of Fedora and CentOS.<br />One good Linux operating system you could use is Ubuntu. It's as good as Windows, it is safe and it is free of cost. Ten years ago, you could email the Ubuntu community and they would send you an Ubuntu CD for free by post. They've stopped that now of course, but you can still <a href="https://www.ubuntu.com/download/desktop">download Ubuntu</a> and either burn it onto a CD or <a href="https://www.google.co.in/search?client=ubuntu&amp;channel=fs&amp;q=ubuntu+create+bootable+pen+drive&amp;ie=utf-8&amp;oe=utf-8&amp;gfe_rd=cr&amp;ei=iBCCWPbCNvTx8AeBzKPADg">create a bootable pen drive</a> from which you can either try Ubuntu or install it into your computer.<br /><br />The best part is, that you don't even have to install Ubuntu to try it out. Just create a liveCD or do the same in a USB stick and you can run it to see if you like it.<br /><br />Do note that if you have an old computer that cannot boot from a pen drive, then you will have to burn Ubuntu onto a CD or a DVD to create a bootable disk which can be used to try or install Ubuntu.<br /><br /><br /><span style="font-size: large;"><b>A message for Cyber Cafe owners in India</b></span><br /><br />Enough of viruses and malware. Please install Linux on all computers you have.<br />If your users still want to use Windows, then you can install Linux and have a free <a href="https://www.google.co.in/search?client=ubuntu&amp;channel=fs&amp;q=virtual+box+with+windows+inside+linux&amp;ie=utf-8&amp;oe=utf-8&amp;gfe_rd=cr&amp;ei=MBGCWLO-KPTx8AeBzKPADg">Virtual Box in Linux inside which you can install Windows</a>.<br /><br />Some users would want to use Microsoft Word and Excel on the computer. Linux has an alternative named Libre office which comes pre installed with Linux.<br />If you don't like Libre office, you can always use the awesome Google <a href="https://www.google.co.in/docs/about/">Docs</a>, Google <a href="https://www.google.co.in/sheets/about/">Sheets</a> etc.<br /><br />One thing I would advise you should check though, is the compatibility of your printers and scanners with Linux. Do this before you install Linux, by trying out Linux with the <a href="https://www.google.co.in/search?client=ubuntu&amp;channel=fs&amp;q=ubuntu+create+live+cd&amp;ie=utf-8&amp;oe=utf-8&amp;gfe_rd=cr&amp;ei=ChKCWOGTIPTx8AeBzKPADg">Live CD</a> option. Take a few sample printouts and scans and see if everything works fine. If any old printers need drivers to be installed, you could either contact the vendor and ask about linux drivers or search the internet using the device model number and I'm very sure you would find free drivers which you can download and install for Linux. The modern printers I think would work without any extra drivers. Do try it out.<br /><br /><span style="font-size: large;"><b><br /></b></span><span style="font-size: large;"><b>Why I'm writing this</b></span><br /><br />I went to a cyber cafe to take a printout and ended up with a virus that messed up the pen drive's partition table (and also hid the files, so I couldn't take the printout). Came home and had a hard time restoring the partition table.<br />For anyone who encounters this error:<br /><br />"The driver descriptor says the physical block size is 2048 bytes, but Linux says it is 512 bytes."<br /><br />Use this <a href="http://flux.ninja/2016/03/fixing-usb-drive-block-size.html">command</a> to fix the blocks on your pen drive:<br /><br /><pre>sudo dd <span class="k">if</span><span class="o">=</span>/dev/zero <span class="nv">of</span><span class="o">=</span>/dev/<b>id_of_your_device</b> <span class="nv">bs</span><span class="o">=</span>2048<span class="p">;</span> sync</pre><br />Most likely, the id_of_your_device would be "<b>sdb</b>". Make sure you confirm that, because if you choose "<b>sda</b>" and it happens to be your hard disk, all the data on it will get permanently erased.&nbsp;</div><br />The <a href="https://en.wikipedia.org/wiki/Dd_%28Unix%29">dd command</a> is used to: <i>Convert and copy a file, write disk headers, boot records, create a boot floppy. dd can make an exact clone of an (unmounted) disk, this will include all blank space so the output destination must be at least as large as the input. In this specific case, <a href="https://unix.stackexchange.com/questions/275243/what-does-dd-if-dev-zero-of-dev-sda-do">these posts</a> will help you understand the meaning of the bs and 2048.</i><br /><br />Did that, and the disk is as good as new!<br /><br /><br /></div>Navin Ipehttp://www.blogger.com/profile/01320006785676088076noreply@blogger.com0tag:blogger.com,1999:blog-6915405415003666702.post-49462050960880656732017-01-15T14:14:00.000+05:302018-01-12T02:28:12.482+05:30Visits to some North Indian tourist spots [Part 2]<div dir="ltr" style="text-align: left;" trbidi="on"><div style="text-align: center;">Continued from <a href="http://nrecursions.blogspot.in/2017/01/visits-to-some-north-indian-tourist.html">Part 1</a></div><i><br /></i><br /><div style="text-align: center;"><br /></div><div style="text-align: center;"><i><span style="font-size: x-small;"><b>Disclaimer:</b> Views expressed here are based on a single visit, so would be lacking a complete perspective. Advice from locals are also included. </span></i></div><br /><br />When in North India, have a plan for food. Especially if it's tough for you to handle poorly cooked food or food with burnt particles in it.<br />Most people in the north are accustomed to eating chapathis, rotis, naans and parathas which have black burnt spots on them. They feel it is normal because it is so prevalent there. Burnt spots are actually not a part of the recipe.<br /><a href="http://cooking.stackexchange.com/questions/77195/do-parathas-naan-and-roti-have-to-be-burnt-a-little/77358#77358">See this</a>.<br />Eating <a href="https://www.google.co.in/search?client=ubuntu&amp;channel=fs&amp;q=acrylamide+burnt+food&amp;ie=utf-8&amp;oe=utf-8&amp;gfe_rd=cr&amp;ei=exh7WKzRMZPy8Afe4b_YBA">burnt food causes cancer</a>, and other <a href="http://nrecursions.blogspot.in/2016/12/able-to-sleep-only-for-four-hours-at.html">health complications</a>.<br />Try searching for South Indian restaurants where they take care to cook food properly (Saravana bhavan was one example). Idli's and dosa's early in the morning are a safe bet. Try not to eat from restaurants where the chutney is too watery. You can actually check that by walking up to the kitchen and asking them to show a sample, before you sit at the table.<br /><br />Your body produces heat via the muscles (which is why you shiver), and having a good amount of nutrition is essential for your muscles. In cold weather, make sure you have full meals which are well cooked and do not have burnt particles in them. Even if you have to eat at an expensive restaurant, it is worth it. Buy fruits too, but only after verifying that they are sufficiently ripe.<br />You'll notice that it's very tough to find bakeries there. It's always handy to have some bread with you, and if your stomach suffers from having eaten restaurant food, drinking some curd will give relief. You could also buy some steamed rice, buy the curd separately, mix them and have curd rice. <br />Also, drink water constantly whenever you feel a bit thirsty. Hydration is important during travel. <br />You'll get 1L mineral water bottles of reputed brands for Rs.20 even from chemist shops. The 2L bottles cost Rs.30, so it's better to buy those. Refuse to pay more than the MRP. Even for soft drinks kept in cold storage. It's illegal and there are shops where you can find it at MRP too. Both in Delhi and Agra. Even at the bus stands.<br /><br /><br /><br /><span style="font-size: large;"><b>Shimla and Kufri</b></span><br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-XJ3Sg7GGYAk/WHsxSIOA_II/AAAAAAAABg4/7QA-lNSjwUccDMOcIMgzeH2uHUoI6T67wCLcB/s1600/Kufri.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://3.bp.blogspot.com/-XJ3Sg7GGYAk/WHsxSIOA_II/AAAAAAAABg4/7QA-lNSjwUccDMOcIMgzeH2uHUoI6T67wCLcB/s1600/Kufri.jpg" /></a></div><br /><b>Note:</b> I haven't traveled much in Shimla, so these views may be very biased. There would be a lot of other people who would appreciate these places for their beauty, heritage and resources. For a rational mind though, it's the experience that counts, and I didn't like it. These opinions are geared toward the precautions and realities. <br /><ul style="text-align: left;"></ul>These are also two overrated places. Perhaps they were good in the past, but now both places are worth avoiding because:<br /><ul style="text-align: left;"><li>Tourist operators have taken tourism for granted. They will actually insult you and speak to you rudely if you do not accept their services or are not willing to pay the exorbitant amount of money they demand. Lies are also part of the package. You'll be charged Rs.2000+ for a little taxi drive of 12km to around 4 tourist spots. We traveled double the distance for a lesser price at Manali.</li><li>A friend tells me that people throw stones at people who bring their own vehicles for touring the place. I don't know how far this is true, but given what I saw about the nature of the tourist operators, I would be inclined to believe it.</li><li>The buildings and alleys are narrow and steep. One hotel area we went to was infested with monkeys.</li><li>A friend says it isn't worth visiting Shimla for the snow because the crowd is so great that all you see it boot snow. ie: Snow that has been walked upon so much that it's black.</li><li>Snow also means power cuts and no water supply. See the article from Times of India below. </li></ul><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody><tr><td style="text-align: center;"><a href="https://1.bp.blogspot.com/-yVxlIFtgPrQ/WLYglDSIGdI/AAAAAAAABjc/b9Im2socn-c_pFDQHJo_MBl0wUI5knxgwCLcB/s1600/ShimlaElectricityWaterProblems.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="170" src="https://1.bp.blogspot.com/-yVxlIFtgPrQ/WLYglDSIGdI/AAAAAAAABjc/b9Im2socn-c_pFDQHJo_MBl0wUI5knxgwCLcB/s400/ShimlaElectricityWaterProblems.jpg" width="400" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;"><span style="font-family: &quot;arial&quot; , &quot;helvetica&quot; , sans-serif;">Click image to see clearly</span></td></tr></tbody></table><br />Perhaps some reasons to visit Shimla would be for the apples, the view, the snow at Kufri and the toy train ride. But given that you can get all of these at other places in India, it might actually be worth skipping Shimla and Kufri altogether. These places are overpriced and the tourist operators just bring a bad name to the place.<br /><br /><b>Why you could skip the tour operators at Kufri:</b><br />If you can get a bus or app based cab or a local friend or a bike which can take you to Kufri, then no problem. Go ahead. Enjoy the view and the snow during winter.<br />But. There are these few things you have to be aware of:<br /><ul style="text-align: left;"><li>At Kufri, the tourist operators get a commission when you spend a lot of money at certain places, and they take you there for exactly that. Our guide made sure we went out of our route to take us to an ATM where we had the opportunity to withdraw enough of money. While we initially thought of him as an angel, we later realized it was so that he'd get his commission.</li><li><b><a href="http://nrecursions.blogspot.in/2016/12/able-to-sleep-only-for-four-hours-at.html">Hip Hip Hurray</a>:</b> The tourist guide had so highly recommended this place that we thought it would be a large area full of adventure activities, like Wonderla. It turned out to be an extremely extremely extremely tiny place with a few cramped up amusement activities. You can take part in each of those only once, unlike Wonderla where it is unlimited. And yet, they charge Rs.700 per head. What's worse, if you choose to skip it, they will actually start insulting you. Try avoiding the place altogether.</li><li><b>Skip the horse ride at the Kufri hill top:</b> This is another place where the tourist guide gets a commission from the horse ride organizers. They'll tell you you have to climb up for 4km and 11k feet height to reach the top, and you won't be able to do so unless you take the horse ride for Rs.500. That seemed dumb to me. If a horse could climb, then so could I. For 10 minutes, we walked up a 45 degree incline huffing and puffing and after that the route was easily walkable at a 20 degree incline. The people walking down congratulated us on not taking the horse ride, as they said the hill top was just 1.5km of a walkable distance away and the organizers had cheated them by offering the ride for Rs.600 per head. They said even Rs.500 was not worth it because the amount you pay is only for the ride up. To ride down, you have to pay more. People who took the horse ride were even complaining they didn't enjoy it. One woman got off the horse out of fear because the hooves of the horse were slipping on the smooth rocks along the path. It didn't seem safe to ride a horse on a sharp incline.</li></ul><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-KHGftnz0AJc/WHsooTT61WI/AAAAAAAABgY/M3annGODDlocECjO8_1wwyWCe_qDAGCmgCLcB/s1600/KufriYakOnHillTop.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://2.bp.blogspot.com/-KHGftnz0AJc/WHsooTT61WI/AAAAAAAABgY/M3annGODDlocECjO8_1wwyWCe_qDAGCmgCLcB/s1600/KufriYakOnHillTop.jpg" /></a></div><br />Once on top of the hill, you'll have to pay an additional Rs.10 to enter an area where you pay Rs.50 if you want to get photographed with a Yak. Rs.50 for 5 shots with an air gun with which you shoot plastic bottles 20 feet away. You get to dress up in traditional attire and get photographed for a fee. You get some less than impressive mountain views and some makeshift stalls where you get cooked Maggi for Rs.60 (price for a packet is actually Rs.10).<br /><br />Since we decided to skip the expensive Hip Hip Hurray and horse rides because we could see we were being cheated, our tour guide actually had the cheek to ask us "<i>If you didn't have money to spend, why did you come here</i>".<br /><br />This is the reality of Shimla and Kufri.<br />You'll find snow and adventure for less than half the price and with zero insults and plenty of hospitality at other places in India. Go there instead.<br /><br /><br /><br /><b><span style="font-size: large;">Manali</span></b><br /><br />The experience of being to Manali was better than Shimla, Kufri and Mussourie. Although at this time of the year many of the trees had shed their leaves, the people of Manali had not shed their hospitality. Everyone we met were warm, hospitable and very helpful.<br /><br /><b>Freshening up:</b> If you haven't booked a hotel, you can freshen up at one of the government latrines. It's maintained reasonably clean, and you can get hot water from a geyser. It's Rs.10 for number1, Rs.20 for number2 and Rs.20 for bath. There's a separate wash basin with freezing water during winters. For women, the costs are lesser, and the caretaker there is polite and helpful.<br /><br /><b>Food at Manali:</b> Unfortunately this sucks even in Manali. Restaurants; even the posh one I went to (hotel Kunzum) had food that wasn't cooked fully. The waiter there was however kind enough to seat me near a room heater which was a huge relief from the freezing cold.<br /><br /><b>Entertainment: </b>New year sees a stage being setup at the main chowk at Manali, near the bus stand where drama, magic shows, songs and street plays are hosted. They also provide a public fire source near the stage where you can warm your hands.<br /><br /><b>Market:</b> The goods here are reasonably priced (woolen clothing though is priced a bit more than Mussourie, but you can bargain), and you can get fruits, shoes, jackets etc. of good quality for a reasonable price. But make sure you bargain and are ready to walk off if you feel the price isn't right.<br /><br /><b>Tours: </b>Taxi operators are willing to take you around for Rs.1500 with no receipt (which was far cheaper than Shimla, because in Manali they take you much farther distances). The operators were very polite and gave us a generous helping of whatever other information we needed to know about the place. You can visit places like Solang valley etc. A visit to the friendship peak though, needs more preparation and more than one day.<br /><br /><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody><tr><td style="text-align: center;"><a href="https://3.bp.blogspot.com/-7D4Et5_MmOk/WHswOwiHTrI/AAAAAAAABgw/YuCK71xbH3UbuhcvrQjr2-y9-qgredT7QCLcB/s1600/ViewManali.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://3.bp.blogspot.com/-7D4Et5_MmOk/WHswOwiHTrI/AAAAAAAABgw/YuCK71xbH3UbuhcvrQjr2-y9-qgredT7QCLcB/s1600/ViewManali.jpg" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">Solang</td></tr></tbody></table><br /><b>Food at Solang:</b> At the adventure spot where paragliding is held, try to eat only the Maggi served there. I ordered rice and rajma and had to return it because it was full of large burnt pieces. The cook was cheeky enough to tell me it was tadka. They don't really care about the food they cook because they know you'll eat bad food anyway.<br /><br /><b>Paragliding:</b> Rs.700 for the short and safer version. Rs.3000 for the one which launches you from much higher up. You use the cable car ride to reach the top of a hill where your paragliding guide and his friends hurriedly lay the parachute on the ground and within a few minutes, without any apparent safety checks, they ask you to run and the guide and you get launched into the air. For some people the ride is smooth. For others they oscillate in the air at such angles that we thought they would fall to the ground. We heard of a case where the parachute got caught onto something during launch and both the guide and the tourist got very badly injured. A colleague told me (of his experience, where) the string of the parachute got cut before they started, and the guide simply tied the cut strings into a knot and proceeded with the paragliding. Dangerous and a complete disregard for safety. We skipped it.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-QpkefmZjeKQ/WHswJyqLe1I/AAAAAAAABgs/En2dMoX9S9MfW_nFC00jukRsXCUoQfVYACLcB/s1600/ParaglidingManali.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://3.bp.blogspot.com/-QpkefmZjeKQ/WHswJyqLe1I/AAAAAAAABgs/En2dMoX9S9MfW_nFC00jukRsXCUoQfVYACLcB/s1600/ParaglidingManali.jpg" /></a></div><br /><br /><b>Cable car ride:</b> At Rs.650 per head this is a tad expensive, but is a world class product and is a nice experience. You get to go up and come back down with that one ticket (unlike Kufri where the horse ride of Rs.600 was just for the way up). You might find the seats a bit dusty. We inferred it was from the paragliders who land on their bottom on the mud and then use the cable car to go up.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-t-FfM2DnIFI/WHswC5YUcWI/AAAAAAAABgo/ZZri-_fWZyk9R2erCo0F0zCuH_ckEKxtwCLcB/s1600/CableCarManali.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://2.bp.blogspot.com/-t-FfM2DnIFI/WHswC5YUcWI/AAAAAAAABgo/ZZri-_fWZyk9R2erCo0F0zCuH_ckEKxtwCLcB/s1600/CableCarManali.jpg" /></a></div><br /><br /><b>Skiing: </b>After it snows, there is also skiing available at Manali, but I think you have to get trained for a few days before you actually attempt it.<br /><br /><b>Spring water:</b> There was a place we were taken to where people said they got fresh spring water which they drank directly. Never drink water from such sources. The places where this water flows from can be infested with rodents and insects which do all their stuff in the water.<br /><br /><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody><tr><td style="text-align: center;"><a href="http://i.imgur.com/ZaI2R.gif" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://i.imgur.com/ZaI2R.gif" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">From Wulffmorgenthaler (now Wumo)</td></tr></tbody></table><br /><b>I'd recommend Manali.</b> Nice adventure activities, good people. Reasonable rates. The food can improve though. Try to go during the season when you can get apples for very cheap prices.<br /><br /><br /><br /><br /><b><span style="font-size: large;">Rishikesh</span></b><br /><br /><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody><tr><td style="text-align: center;"><a href="https://4.bp.blogspot.com/-yVpgXK2LfH4/WHtJ44iGFOI/AAAAAAAABhw/KQF1CoP3j3wyuPVV39zxzuUl5cWZXSyCgCLcB/s1600/GangaTriveniGhatRishikesh.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://4.bp.blogspot.com/-yVpgXK2LfH4/WHtJ44iGFOI/AAAAAAAABhw/KQF1CoP3j3wyuPVV39zxzuUl5cWZXSyCgCLcB/s1600/GangaTriveniGhatRishikesh.jpg" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">Triveni ghat (Ganga, Yammuna and Saraswati rivers meet here)</td></tr></tbody></table><br />Honestly, this is a boring place for people who aren't into religion. There's a small tempo style bus that'll take you to Rishikesh in 1.5 hours from Dehradun ISBT (Inter State Bus Terminal). Once you reach the bus stand, you could approach an auto rickshaw terminal where they give you a bill for a tourist ride to spots in Rishikesh. We were charged Rs.520 which we felt was too much.<br />Anyway, the auto driver loyally took us to spots like the Lakshman jhula etc. and my co travellers got to dip their feet in the Ganga river and bring back some Ganga jal which they had been taught was holy water. You also get to see the temple which was the founding center for Rishikesh as a religious pilgrimage spot. There's also a Banyan tree there which is actually 3 trees joined together.<br />The auto driver takes you to a place, and promises to come back in some time, once you are done visiting the spot. In one case he took so long to come back, we thought he cheated us. He came soon enough though. Turns out he didn't expect us to return so early and had gone for lunch. Many of the other temples looked like apartments that were converted into a temple.<br /><br />Rishikesh is apparently not a good spot for shopping. The auto driver told us everything is priced 3 or 4 times more than usual because of being a tourist spot.<br /><br />Everyone we met, recommended doing water rafting in Rishikesh, and I even overheard a girl saying <i>"Bahut maza aaya water rafting karke"</i> (she had a lot of fun rafting). Might have been nice to do it, though later a colleague mentioned how his raft turned upside down, all of them ended up in the water and were luckily saved. Apparently you have to sign a declaration stating that you know what danger you are getting into. All it would take is for you to slam your head onto a rock or get impaled by an underwater piece of wood wedged between rocks. There's also<a href="https://www.google.co.in/search?client=ubuntu&amp;channel=fs&amp;q=dangers+of+bungee+jumping&amp;ie=utf-8&amp;oe=utf-8&amp;gfe_rd=cr&amp;ei=A1mPWN4Rqf3zB-KIoYAO"> bungee jumping</a> at Rishikesh.<br /><br />Rishikesh as a place was crowded and narrow. A bit suffocating. Some places have a lot of monkeys, but the monkeys didn't harm us. Plenty of foreigners. Plenty of police around. Still, it didn't feel like a safe place to be in.<br /><br /><br /><br /><b><span style="font-size: large;">Chandigarh</span></b><br /><br />This was one beautiful city. Neat, wide roads, plenty of trees all around and plenty of open space. You get excellent quality curd there. The food wasn't very impressive though, and a tad expensive for what it was.<br /><br />Auto rickshaws don't have a meter, and charge a reasonable fixed rate. The locals are aware of the rate and the rickshaw driver didn't charge us extra even though he knew we were not locals. He was willing to stop at multiple places when we wanted to buy things in between and gave us a cartload of information about whatever we wanted to know about the city. Very hospitable. <br /><br />Make sure you visit the market at Sector 19. You'll get branded clothing for 1/3rd of the MRP, because they are manufactured just a little distance away in Ludhiana. A classmate of mine with his own clothing manufacturing business says that you can bargain even at the fixed price shops in this market, and you are actually expected to bargain. When you start walking away they'll come to you with a lower price. Buy as much as you can from Chandigarh. Woolens, jeans, pyjamas, shoes...whatever clothing items you need. Also note that there are different quality of woolen clothing available. Learn to identify it.<br /><br />It's worth visiting Chandigarh to buy clothing before you go to the colder places like Manali and Shimla. It's also a good place to do some shopping to buy things for taking back home. <br /><br /><b>The International airport: </b>You need to make sure you aren't taken to the old airport at Chandigarh. Go to the Chandigarh International Airport, which the elderly Ola taxi driver told us is<a href="https://www.google.co.in/maps/place/Chandigarh+International+Airport/@30.6683747,76.7862475,15z/data=!4m5!3m4!1s0x0:0xa2ef507af52c470e!8m2!3d30.6683747!4d76.7862475"> not actually in Chandigarh, but in Mohali</a>. Throughout the ride he told us about the Sikh religion, the generosity of Gurudwaras, the culture in Punjab where if there's an accident on the road, no vehicle would go forward until the accident victim was helped. He also recommended we try the Makkey di roti, Sarson da saag, lassi and the parathas of Punjab. To which I mentioned that I developed stomach problems after eating burnt parathas and roti's for the past few days. To this he said that parathas will be well cooked and not burnt if they are cooked properly.<br />This is what inspired my question on Seasoned Advice where I<a href="http://cooking.stackexchange.com/questions/77195/do-parathas-naan-and-roti-have-to-be-burnt-a-little"> got it confirmed</a>.<br /><br />Be aware though, that Chandigarh airport sees a few flight cancellations during winter because of the fog. As of 2017, they <a href="http://travel.stackexchange.com/a/83365/40882">haven't yet upgraded to CAT III</a>. Might be better to book a flight from Delhi.<br /><br /><br /><b>Accommodation:</b> When booking a hotel, make sure you get a place in one of the sectors, which are the well planned, neat areas. If you get a room in an industrial phase instead, you'll end up in what our taxi driver referred to as a 'third class area' with potholes and filth. This is one of the problems of booking a budget hotel with Oyo. I've written to Oyo about also mentioning the locality type along with pictures of the room.<br /><br /><br /><span style="font-size: large;"><b>Misc</b></span><br /><br />You could also try a trip to Dhanaulti, Chopta or Auli. Nice places with a lesser crowd and plenty of clean snow during winter. If springtime, visit the valley of flowers.<br /><br />Wishing you a good trip to North India. Hospitable people, nice places (but recently, horrible food). Hope my bunch of tips and info would be of help. Do let me know in the comments.<br /><br /></div>Navin Ipehttp://www.blogger.com/profile/01320006785676088076noreply@blogger.com0