9 Dec 2015

LMLE : How I created a compilation of "Invisible Man" notes

LMLE stands for "Linux Makes Life Easy". If you don't understand any of the commands used, please google them.

So today I was going through some websites looking for notes for "The Invisible Man" that I have to study as a part of out 12th standard syllabus. I found a good resource here http://thebestnotes.com/booknotes/Invisible_Man_Wells/The_Invisible_Man_Study_Guide01.html but realized that it had tons of different HTML pages each having distracting ads and stuff. I wanted a neat solution to read this stuff quickly without too much clicking.

Since I had 3 pre-boards left and I'd have to go through these notes at least 3 more times, I though it would be worth investing some time and get it formatted. But obviously, copy pasting 30+ times wasn't an option for me. I needed something much quicker.

So, Here goes.

I booted up Linux (sadly Windows is still my working OS), and opened up the terminal. I remembered Arjun telling me about wget a few weeks back, so I decided to give it a shot.

This is what I tried first

wget http://thebestnotes.com/booknotes/Invisible_Man_Wells/The_Invisible_Man_Study_Guide01.html"

Plain and simple, but it gave me only an offline version of the website itself. Then I tried this

wget -r

It gave me the same thing but inside a folder and it wasn't any use. Being the noob I still am, I tried man wget and tried figuring it out. But I didn't really have the time. So I consulted a programmers best friend - Stack Overflow!

I found this neat combination of options that helped me download all the files into one html file all at once.

wget -r -l1 -H -t1 -nd -N -np -A.html -erobots=off -O file.txt http://thebestnotes.com/booknotes/Invisible_Man_Wells/The_Invisible_Man_Study_Guide01.html

But guess what? It was no use because an extra "0" in "01,02,03" in the naming of the html links on the page ruined the ordering of the content in the output file.

So I just used the messy version of the previous command - download all html files separately and then parse them

wget -r -l1 -H -t1 -nd -N -np -A.html -erobots=off http://thebestnotes.com/booknotes/Invisible_Man_Wells/The_Invisible_Man_Study_Guide01.html

So now I had all the content locally. But they were all individual html files. I researched a little bit and found that there was a 3rd party utility available called "html2text" that did exactly what I wanted.

sudo apt-get install html2text

Boom. Installed. Just like that. Is it that easy on Windows? Definitely not. 

Only one step left.

html2text -utf8 -nobs -style pretty The_Invisible_Man_Study_Guide01.html > file.txt

But this gave me the output only for one file. So I just wrote a small script to automate it for all the files.

for x in 0{1,2,3,4,5,6,7,8,9} 10 11 12 13 14 15 16 17
      do
  html2text -utf8 -nobs -style pretty The_Invisible_Man_Study_Guide$x.html >> file.txt       done

After all this, I had perfectly readable content but the problem of some unnecessary text still remained. So I manually opened up the file and within 2 minutes, removed all the unnecessary stuff and it was finally perfectly formatted to my liking. (file.txt was the final output file.)

When I opened it up using gedit, the scrolling flicker was hurting my eyes, so I used a terminal based alternative.
To read it now, All I have to say is 

vi file.txt

If I'm looking for a particular section, I just use grep and read only that part. 
Works pretty well, worth spending half an hour.

Any questions? Leave a comment.

17 Sep 2015

Touchscreen-Tech

Have you ever wondered why your iPad does not respond to your finger? If you have wondered, then great, but if you have not, then, no problem. Anyways, in either case, it is worth knowing the answer!! To understand the answer to this question, we must first understand what “touchscreen technology” is, and how it works.

Technically ‘touchscreen’ is an input device layered on the visual display unit of an information processing system that enables you to operate the system using your finger, stylus or designed gloves.

In simpler words, it is the technology that helps your finger use your smartphone!

Nowadays, touchscreen technology is not limited to just tablets and smartphones but is instead creatively employed in almost everything from laptops to gaming consoles. It is used in hospitals, heavy machinery and even ATMs.

But, in order to be able to employ touchscreen technology as well as we do in the present, a lot of research and work has been done over the last five decades. And this work, can be traced down to scientist E.A. Johnson who first published his work on touchscreen technology in 1965. A decade later, at CERN the first transparent touchscreen was developed by Frank Beck and Bent Stumpe. In 1972, the University of Illinois filed a patent for the invention of an optical touchscreen, and consequently, further discoveries in the field led to what we possess today in our smartphones, tablets etc.

Now with this much of a background, we can now explore HOW touchscreen works.

There are essentially two main types of touchscreen technologies:

1.      Resistive Touchscreen Technology.
2.      Capacitive Touchscreen Technology

Resistive Touchscreen Technology:



In this technology, there are two layers separated by a very thin space. The front layer has an external hard plastic covering facing outside, and an inside conductive coating.

The layer behind, has a glass covering facing the outside, and a conductive coating on the inside of this layer.

When the front hard plastic coating is touched, the little pressure applied, causes the two internal conductive layers to touch. The device then recognizes which part of the screen the finger/stylus has touched, and accordingly performs its function. 

Capacitive Touchscreen Technology:

Here, unlike before, the pressure applied is not the determinant. Rather, it is the material with which the screen is handled with. 


There is an ITO (Indium Tin Oxide) conducting layer which is horizontally lined with electrodes and has electricity flowing through it. There is another ITO conducting layer beneath. This is vertically lined with sensing wires that monitors the flow of electric current in the first ITO layer.

The wires of these two ITO layer are now perpendicular to one another. These layers are separated only by a thin optical adhesive that helps them remain together intact.

So essentially when we touch the screen of the device with our finger, the electric field is distorted or altered from the first ITO conducting layer due to the conductivity of our finger. This alteration is sensed by the second ITO layer and then the point on the screen that our finger has touched, is identified. Accordingly the device performs its function.

So now the answer to our question is almost self-explanatory. Human nails are a poor conductor of electricity and iPads use capacitive touchscreen technology. So by nature, the nails do not alter the electric field, and so the iPad does not sense it!

I hope this article helps you understand how your tablet or phone responds to your touch!

Some of the references I have provided below can help you understand more about this subject. If you find anything interesting in the field and would like to share it, please post a comment.

References:

1. http://scienceline.org/2012/01/okay-but-how-do-touch-screens-actually-work/
2. https://www.youtube.com/watch?v=SzLoWDkBKXk
3. http://capacitive-resistive-touchscreens.articles.r-tt.com/

11 Sep 2015

International Linguistics Olympiad


Have you heard about the International Linguistics Olympiad (IOL)? If not, you’re not alone. A lot of students haven’t heard about this Olympiad, and that’s a pity — they’re missing out on an exciting opportunity.

Most people have heard about the International Olympiads in Physics, Chemistry and even Informatics (a.k.a. Programming). These are some of the the “International Science Olympiads”, and are recognized by colleges and teachers across the globe as the penultimate academic high school competitions. If you win a medal in one of these competitions, you’re considered the cream — the very highest outstanding achievement you could get.

[By the way, the olympiads that you write in school — NCO, NSO, IMO and IEO — are not truly international olympiads. They are actually competitive exams that are mostly restricted to India.]

The Linguistics Olympiad is one of the “International Science Olympiads”. Over 30 countries from across the globe send teams of their brightest high school students to solve challenging puzzles in Linguistics.

I’ve been to the Linguistics Olympiad. I went to Bulgaria in July 2015 as part of Team India. I forged new friendships, experienced new cultures, won an Honorable Mention and generally had a great time.

When I tell people about my experience, the first question I’m asked is, “How many languages do you know?”
That’s the thing: You don’t need to know multiple languages. ALL YOU NEED IS LOGIC!

That’s right. If you liked the logic puzzles posted on the Google+ site, then you’ll definitely enjoy solving Linguistics puzzles.

Here’s a sample.
And don’t be lazy. Spend some time on this and give it a try! (In fact, if you can, print this image out. At the very least, grab some rough sheets and write down your thoughts!)

Click the image to enlarge.

First off: Most of you don’t know Swahili. And that’s the point — no one’s supposed to be at an advantage here.

Let’s look at this problem analytically. If you haven’t printed it out, make sure you keep looking back at the question while reading my answer. You won’t understand it otherwise!
  • tarehe is repeating in every single Swahili date. It probably means “date” in English.

  • Disemba”, “Oktoba” and “Aprili” sound suspiciously like English months. In this case, they definitely are. You can check by counting the number of times each Swahili month appears, and comparing that with the number of times each English month appear.

  • Look at the English dates (B) and (D). They’re exactly the same, except for the number (2nd and 4th). The two Swahili translations should also be exactly identical except for those two numbers. Look at Swahili dates (3) and (5). They are identical except for the second words (“pili” and “nne”). Now we know that “Jumanne” means “Tuesday”. We also now know that the format for writing Swahili dates is:

tarehe” <number> <month> <day>


  • With this new information, compare (1) and (F). “tatu” is the number ‘3’. Make a list of all the Swahili number names, and try to find other correspondences. For instance, from (2), (4), (6) and (A), (C), (E), you can translate “tano” as the number ‘5’.

  • Did you notice that the day names in Swahili also appear to have the names for numbers? “Jumatatu”, “Jumatano”, “Jumapili”, “Jumanne”.
    We can guess that in Swahili, the days of the week are numbered (Day 1, Day 2… etc).

  • We know “tatu” means ‘3’. That means “Jumatatu” is “Day 3”. Look at sentence (4). “Day 3” could be either “Monday”, “Wednesday” or “Sunday”. (Those are the days in the English dates containing “October”.)
    Let’s assume that “Day 3” in (4) is “Wednesday”. Then, from sentence (6), “Jumatano” means “Day 5”, which should be “Friday”. However, none of (A), (C) and (E) contain the day “Friday”. That means the assumption is wrong.
    Try assuming “Sunday” as “Day 3”. Can you find out where this assumption goes wrong?
    Now try assuming “Monday” as “Day 3”. Does it work?

  •  If “Day 3” is “Monday”, then “Day 1” is “Saturday”. This means that the Swahili week begins on Saturday. (In contrast, we generally think of Sunday as the beginning of the week.)

  • From the translations of days and numbers you can work out all the other translations, match the dates, and complete the question.

To be fair, these problems aren’t exactly easy to solve. This problem, for example, would take anywhere between 10 minutes and an hour to solve.

However, no one said an International Olympiad was going to be easy. The actual IOL consists of 5 questions to be solved in 6 hours. Yes, 6 hours.

Interested in giving it a try? I strongly recommend that you do. To get selected, here’s what you have to do.
  • Write the Panini Linguistics Olympiad. It’s the national round of the Olympiad.
  • Be one of the 30 or so students from all over the country selected from that exam to attend a Training Camp. It’s sponsored by Microsoft and Xerox!
  • Be one of the top 8 (or 12) students in the camp!
For information about the IOL and past contests, visit: http://ioling.org/

The only way to get better at this is with some practice. If you’d like to solve some more questions on your own, start here: https://sites.google.com/site/paninilinguisticsolympiad/Resources/the-panini-junior-linguistics-olympiad

Do you dare to try some of the most challenging Linguistics puzzles ever designed? Choose from the past IOL problems over here: http://www.ioling.org/problems/

If you ever have any questions, or would like me to explain how to go about solving some question, feel free to email me, or post on Google+. I’ll make sure that all my answers are made available to everyone.

Finally, whether you plan to pursue this Olympiad or not, don’t keep this post to yourself. At the very least, let your friends know that something called the “Linguistics Olympiad” really exists, and send them the link to this blog post.


21 May 2015

Nanotechnology: An Introduction


Nanotechnology! Nowadays, almost any student claims to have an interest in becoming a scientist, working in laboratories, playing with atoms, fiddling with molecules, and on and on. Well, let me tell you one thing. If you fall in that 'almost any kid' category, then you might just end up finding nanotechnology exciting.

Nowadays in nanotechnology, things that were only “dreamt of”, are turning into a reality. But before we delve into the science of nanotechnology, let me point to you some exciting ways in which nanotechnology is being used today.

Have you ever “dreamt of” an invisibility cloak? Well if you have, then I suggest you stop dreaming because now invisibility cloaks have become a reality.

One other recent cutting edge invention is the “Ultra Ever Dry” product. And what this does, is that it does not allow any liquid irrespective of its viscosity to stain a substance on which the product has been sprayed on. The “Ultra Ever Dry” coating, creates a thin barrier of air at the nano scale, which prevents the coated substance from getting wet or dirty. And to see this mind-boggling product in action, you can take a look at:



Apart from this, there is also some interesting work going on in the field of medicine involving nanotechnology, where medical researchers are on the verge of creating an almost harmless cancer therapy which could possibly become a substitute to the standard chemotherapy.

There has been a quantum leap in the development of nanotechnology in the last five years. And from here, things only get better.

So let's get started with nanotechnology.

What is nanotechnology?

At a very high level, I would take nanotechnology as the science, engineering and technology practiced at the atomic or molecular level.

But going slightly deeper, it is a branch of science, which involves the manipulation of at least one dimension of a substance within the nano scale range of 1 to 100 nanometers (1 nanometer = 10-9 meters).

What is unique about nanotechnology?

There are many things that are unique to nanotechnology, though I feel the truly convincing answer to this, lies in the unusual behavioral-changes of substances at the nano scale.

What I mean by this is that substances show rather abnormal properties at the nano scale, which violate the norms of the Physics that we know so well as Classical Physics. We will understand and discuss this in greater detail a bit later.

Interesting concepts in nanotechnology

With this much of a background, I think we all are quite ready to take a look at some of the interesting concepts of nanotechnology!

Two main concepts are:
• Simple to Complex
• Larger to Smaller

Simple to Complex--

One of the most mind blowing concepts in which extensive research is being carried out is the ‘Simple to Complex’ also known as the ‘bottom-up approach’ concept. This concept involves molecular self assembly. In other words, scientists are trying to make molecules automatically arrange themselves into a desirable system.

Some of the fields where this is trying to be developed, is in the field of synthetic chemistry where scientists are trying to achieve self assembly of molecules into substances such as polymers, micro-computing where scientists are almost at the brink of having self assembled microcomputers and biology where substances like enzymes have already been self created!

Two main advantages of developing this Simple to Complex concept are:
• Production will become faster and more efficient.
• Both the purchasers as well as manufacturers will incur less cost.

Larger to Smaller--

As we had discussed earlier, the physical properties of substances begin to be different as the size of these substances start to enter the nano scale. These include differences in mechanical, thermal, electronic and catalytic properties of the substances. These changes, which occur in substances as their sizes are brought down from the macroscopic to the nano scale, constitute the major part of the ‘Larger to Smaller’ concept.

Some examples to give you a flavour of these ‘abnormal phenomena’, which occur among substances at the nano scale are:
• Plastic at the nano scale conducts electricity,
• Gold particles begin to appear red and purple,
• Particles of certain substances turn spontaneously from solid to liquid,
• Copper turns transparent,
• Platinum and Gold become catalysts, and so much more.

Why do substances begin to show these aberrant properties?

This can be explained by the drastic increase in the surface area to volume ratio, which exists at the nano scale. For example let us take a cube of side 8 units, which we will reduce thrice consecutively to an edge length of 6, 4 and then 2 units, and then observe the surface area to volume ratio. Then—

Edge length Surface Area Volume S.A. to V ratio
8 units 384 units2 512 units3 3/4 = 0.75 units-1
6 units 216 units2 216 units3 3/3 = 1 units-1
4 units 96 units2 64 units3 3/2 = 1.5 units-1
2 units 24 units2 8 units3 3/1 = 3 units-1

Now we can clearly see, that by reducing the dimensions of the cube, the surface area to volume ratio is increasing. This is also the case with any other three dimensional object. May it be a sphere, cylinder or cone. But, the more relevant question is how does the surface area to volume ratio cause an alteration in the behaviour of particles at the nano scale?

To understand this, let us continue with the example of a cube. If we take two identical sugar cubes of side = 10 units, and divide one of them into a 1000 equal blocks of 1 unit3 each, and leave the other one untouched, then the volume of the uncut and cut sugar cubes will remain the same. But, the surface area of the cut cube will be clearly larger than the surface area of the uncut cube. Now, if we were to dissolve both the cut and uncut sugar cubes, then the cut cubes will definitely dissolve quicker, as they share a greater contact area with the water as compared to the uncut cube.

It is this same kind of change that takes place in nanoparticles too, but the changes are much more drastic as the surface area to volume ratio in nanoparticles is much larger. Just for example’s sake, let us take a cube of side = 10-9metres or 1 nanometer. Then—

Surface Area = (10-9)2 x 6
=> (6 x 10-18)nm2

Volume = (10-9)3
=> 10-27nm3

Therefore the surface area to volume ratio = 6 x (10(-18)/10(-27))
=> 6 x 10(-18+27)
=> 6 x 109
=> 6,000,000,000 or Six billion nm-1!

And it is this huge surface to volume ratio, which causes abnormal properties in nanoparticles.

All of this is just the beginning of our understanding of the fast evolving field of nanotechnology. Some of the references I have provided below can help you understand more about this exciting field. If you have found anything interesting in the space and would like to share it, post a comment!

References:
1. http://www.nano.gov/nanotech-101/what/definition
2. http://science.howstuffworks.com/nanotechnology.htm
3. http://www.livescience.com/33816-quantum-mechanics- explanation.html
4. http://www.gizmag.com/invisibility-cloak-hides-macroscopic-objects/37542/
5. http://www.nano.gov/nanotech-101/special