Monday 6 July 2015

Musical Grammer

These kind of posts will be just an attempt to publish my understanding and thoughts on the topics I read as a part of my research.
Currently I am reading the book "Generative theory of Tonal Music", In this work the writer tries to come up with the formal theory of music. According to him a musical theory will be like an algorithm which will generate new musical pieces. I like this idea. Till now not many people think that music could be purely mathematical as is the case for linguistics. In liguistics the grammar is an algorithm which generates different sentences , imagine if we can come up with such a set of rules for music which can be used to generate new sentences. It seems pretty obvious to me that for music composers these kind of rules subconsciously exist in their mind and hence it becomes very simple for them to come up with new compositions. Its like a child learning a language. Once he learns all the rules of the language he can generate new sentences on his own.
One of the most important points I read today was that how to relate the musical grammer or structure of a musical peice to the emotions of a listener. What I personally think is that a same musical piece will invoke same kind of emotions in everybody. Consider an EDM track, usually I feel pumped up after hearing such tracks, and I think everybody would feel the same. Usually fast beats make you feel excited. Again I think we can come up with some kind of mathematical theory which can map a musical piece with an emotion without the involvement of a human. If we go at a deeper level, emotions are nothing but a set of neurons being activated in our mind. Its like a billion or trillion 'or' and 'and' gates in our minds .How great it would be if a computer can listen to a song and can decide if it is sad or happy one. But this is very early to say that we can come up with such a theory or not. I am still on the first chapter of this book.


Tuesday 24 March 2015

Yes We Can...

Yes We Can...A vision to make this world a better place.
Since the last two years I have been wondering about how can we make the world a better place for women. Hearing about the 16 December Delhi rape case, shocked I was to learn , how somebody could be so cruel to that innocent women, who was somebody's love, somebody's daughter, somebody' mother, somebody's sister. Punishing the rapist was just like a medicine which will treat the symptoms but not the disease itself, although punishing the rapists was also as important as preventing rapes.
A few days after that rape case, soon Delhi was a place of multiple ongoing protests. You could actually find people in each and every locality people carrying out rallies. Seeing this , I wondered "If so many people in this world are against crime against women, then why does it even happen". We have seen in the history of the world , that finally the world will go to a state where the things are according to the majority, and majority of this world want an end to this. This led me to wonder that what was actually going wrong in our system that this time the majority was not able to establish its demand.
Years passed by and I got into an engineering college, and still that question pestered me. Then one day I got introduced to the concept of open source, where everything was open to everyone, this means everyone gets a chance to do what they desire to, to implement changes they want to. Everyone gets the power to change the world. I still remember my first contribution  to Mozilla Release Engineering which was a feature enhancement and it actually saved a lot of time of a lot of developers all around the world. That day I could actually feel the power of open source.
Then one day again I heard of rape cases, and again the same questioned bothered me. But this time i could understand the problem a little better. The crux of the problem was that the people were not getting the chance to change what they wanted to. The 10000 people who carried out rallies could never know where the crime is happening and hence they could not help the victim.
Now there was one question in my mind...
How to give power to these people to change what they want to change?
The answer was simple enough "Open Source". Although they may not seem to be even related, but again I remembered my contribution to Mozilla. Now the problem was to connect Open source the people.
Although I never really thought of this but in some part of my mind I was always brainstorming about this, and one day I found it. It was simple, just inform those 10000 people of that crime , and even if 10 of them actually reach the location of the victim , the rapist would not even think of touching the victim.Then they would actually have the power to stop that crime. And also one problem is that the victim may not be in a position to actually make a call, but yes she can always press a single button which is on her home screen.
And here the solution was and pursuing computer science enabled me to implement it. Make an App which when touched informs the police and the people who actually want to help. Now how do we collect the people who want to help? Simple, ask them to volunteer.
So basically what this project will do is connect the victim  and helpers. If the helpers want a safe society for their sisters and mothers, they will help. History has shown us that connecting the right people is what is required for anything to be successful, and this is what exactly my project will do.

Thursday 19 February 2015

Json Schema and Hyper Schema for Various Apis

There are various APIs, being used in the Release engineering of mozilla, and there is no standard way to actually document them,publishing them and generating client libraries for them. So as suggested by Pete Moore in
https://wiki.mozilla.org/Community:SummerOfCode15#Release_Engineering.
I have been looking for various ways of doing this using JSON schema and Hyperschema.
This seems to be a very simple way of documenting the API, and swagger makes it simpler for us. And also it will make very easy for the new developers and contributors to actually understand the API, by just seeing the JSON schema.

There are 5 APIs which are planned to be covered under this project.
1.Build-API: https://wiki.mozilla.org/ReleaseEngineering/Applications/BuildAPI
2.Clobberer: https://api.pub.build.mozilla.org/docs/usage/clobberer/#endpoints
3.Mapper: https://wiki.mozilla.org/ReleaseEngineering/Applications/Mapper
4.Mozpool: http://hg.mozilla.org/build/mozpool/file/tip/API.txt
5.Slave API: http://mozilla-slaveapi.readthedocs.org/en/latest/api/#slaves-slave-actions-disable

What is Swagger?
Swagger basically allows us to document our API using JSON schema, giving us various plugins so that this JSON schema can be used to do various things regarding the documentation for easy understanding of the API.
https://github.com/swagger-api/swagger-core

How to use Swagger?
The step one is to write a swagger specification. Swagger specification is a format of writing the JSON schema , so that various plugins can use that schema for further use. This can be done using the swagger editor (a plugin which facilitates us to write swagger specification). So here we go , this was all the manual part.
https://github.com/swagger-api/swagger-editor

The second step will be to have a GUI for this specification. For this we will be using swagger UI plugin , which basically takes in the swagger specification and gives a nice interactive user interface which can be used to learn the functionality of these APIs. This will be a really unconventional way for documenting an API and it would really facilitate our new contributors to know about the APIs very quickly.
https://github.com/swagger-api/swagger-ui

The third part will be auto-generating the client libraries for these APIs. Again swagger comes to rescue. We will use the swagger codogen plugin for this purpose. Again we simply have to give the swagger specification as the input and we get client libraries as the output.
The last part will be to write scripts that publish the documentation to a central
location.
https://github.com/swagger-api/swagger-codegen

The main strength of using swagger is the swagger UI , which will allow developers to understand the functionality and the potential of the API without actually looking at the code.


Monday 26 January 2015

Jump across time and Newtonian God

Recently i had an assignment where we had to write about the jump across time and newtonian god. Here jump acrosss time means to think of past or future, and not a time travel kind of thing ( Something on time travel later someday).
So this is what i wrote...

"Jump across time is something we all do and each of the living organism does that day and night.
First we need to think what actually is a time jump. Time jump is something which allows us to think of a moment except for the present moment. What i believe is that the state of our mind during a time jump is very different of the usual thinking. All the neurons in our brain are acting as if they were present in that moment, thats why we get happy when we think of a nice moment (and also the harmones related to happiness are released) , we also get angry when we think of a moment when somebody did wrong to us (and then also harmones related to anger are released in our body) simply by thinking of that moment. So this proves that every neuron acts like it is acting in that particular moment during the time jump. Basically our mind has shifted from one state to all together a different state , the state which was present in that moment(in case of past) or the state which we expect to be there (in case of future).
If we say that our brain is nothing but a turing machine with somewhere around 100 billion neurons, each of which represent a variable. Each neuron can take only two values that is 1 or 0 (on or off).
So now we have a turing machine with 100 billion machine state variables. So the possible number for the number of states our brain can take is 2^100 billion. We can say that time jump is a program on that turing machine which takes that machine from one state to the another, as any other program does.
Having explain the model of the brain , now the question arises , what is the program which leads to time jump, who writes this program of time jump, and under which conditions is it run. I guess this is where the concept of god comes into play, as newton denied the existence of god in every being as the soul, so we know for sure that god does not load this program for sure. So we can conclude that we have the power to load that program. But who wrote that program, here newtonian god allows us to give this credits to him. The newtonian god has already written the program for time jump, he has also compiled it , what we need to do is to run it and give the input that which moment we want to jump to, and there we are , the state of mind changes to that paticular moment.
If we see like this , then yes the concept of newtonian god allows for time jump."

Saturday 17 January 2015

A Machine Smarter than Humans...

Recently i saw the movie "The Imitation Game", and it really inspired me to read a bit more about Alan M. Turing and artificial intelligence. While reading all that suddenly a question popped out into my mind, can a machine be ever be smarter than humans?.
And as usual my first action was to google it. And What i mainly found was that people comparing the speeds of our minds and that of the best computer with us. They say that  the human brain has a processing capacity of 0.1 quadrillion instructions per second whereas the capacity for the best super computer is 1.026 quadrillion instructions.
Is the really the best way to get the answer to that question. Is being faster a proof of being smarter. I dont think so. The person finishing the exam before you may not obviously smarter than you. Rather the question should be that can a machine think whatever we can do??can a computer attain all those states that a human brain can???.
I say if it can than yes machines can be smarter than humans. Because according to Alan Turing , every possible problem for which a solution exist can be represented as a sequence of state, and if it can be solved by a human that means those states can be attained by the human brain , and if the computer has more states than the human brain that computer can also attain all those possible states, and hence computer can be smarte than us. It can basically do whatever our brain can do.
I really could not find the maximum number of states attainable by the best super computer in this world, but i could find the number of states attainable by our brain and that was 10^700000000.

The brain has a processing capacity of 0.1 quadrillion instructions per second. The fastest super computer in the world, called Roadrunner is capable of handling 1.026 quadrillion calculations per second - See more at: http://www.disabled-world.com/artman/publish/brain-facts.shtml#sthash.z0cPUXvj.dpuf
Is a computer smarter than a human brain?
The brain has a processing capacity of 0.1 quadrillion instructions per second. The fastest super computer in the world, called Roadrunner is capable of handling 1.026 quadrillion calculations per second. However the computational power of the human brain is difficult to ascertain, as the human brain is not easily paralleled to the binary number processing of computers. For while the human brain is calculating a math problem, it is subconsciously processing data from millions of nerve cells that handle the visual input of the paper and surrounding area, the aural input from both ears, and the sensory input of millions of cells throughout the body. The brain is also regulating the heartbeat, monitoring oxygen levels, hunger and thirst requirements, breathing patterns and hundreds of other essential factors throughout the body. It is simultaneously comparing data from the eyes and the sensory cells in the arms and hands to keep track of the position of the pen and paper as the calculation is being performed.
- See more at: http://www.disabled-world.com/artman/publish/brain-facts.shtml#sthash.z0cPUXvj.dpu
Is a computer smarter than a human brain?
The brain has a processing capacity of 0.1 quadrillion instructions per second. The fastest super computer in the world, called Roadrunner is capable of handling 1.026 quadrillion calculations per second. However the computational power of the human brain is difficult to ascertain, as the human brain is not easily paralleled to the binary number processing of computers. For while the human brain is calculating a math problem, it is subconsciously processing data from millions of nerve cells that handle the visual input of the paper and surrounding area, the aural input from both ears, and the sensory input of millions of cells throughout the body. The brain is also regulating the heartbeat, monitoring oxygen levels, hunger and thirst requirements, breathing patterns and hundreds of other essential factors throughout the body. It is simultaneously comparing data from the eyes and the sensory cells in the arms and hands to keep track of the position of the pen and paper as the calculation is being performed.
- See more at: http://www.disabled-world.com/artman/publish/brain-facts.shtml#sthash.z0cPUXvj.dpuf
Is a computer smarter than a human brain?
The brain has a processing capacity of 0.1 quadrillion instructions per second. The fastest super computer in the world, called Roadrunner is capable of handling 1.026 quadrillion calculations per second. However the computational power of the human brain is difficult to ascertain, as the human brain is not easily paralleled to the binary number processing of computers. For while the human brain is calculating a math problem, it is subconsciously processing data from millions of nerve cells that handle the visual input of the paper and surrounding area, the aural input from both ears, and the sensory input of millions of cells throughout the body. The brain is also regulating the heartbeat, monitoring oxygen levels, hunger and thirst requirements, breathing patterns and hundreds of other essential factors throughout the body. It is simultaneously comparing data from the eyes and the sensory cells in the arms and hands to keep track of the position of the pen and paper as the calculation is being performed.
- See more at: http://www.disabled-world.com/artman/publish/brain-facts.shtml#sthash.z0cPUXvj.dpuf

Tuesday 30 December 2014

The Fake music...

The fake music, yes this is the word which is often used by many of our old age musicians and even listeners to describe our new age music. The only things i can say to these kind of comments is that maybe they just forgot the definition of music and want to state their work and choice superior to ours whereas we continue to respect and love their music. This shows how narrow we become while judging somebody else's work.
What makes them say these kind of comments. They say that these days they don't create the real music the young musicians just play with some machines and as a result some noise is created which today's generation think to be music.
I think this attitude to call our music fake and noise is absolutely very narrow minded. This is not a real artist's attitude. The artist respects the art because of the quality of the art but not the source of the art. I agree that most of the music created these days is created using sophisticated machinery but yeah the art is still the same. These sophisticated machines can not create new compositions on their own. The main reason for which we like any track ie: the composition of that track is still a work of an artist. Similarly these machines cant create their own lyrics , its still the work of an artist.
I think there is really no reason that we should call today's music as fake because still a lot of effort and skill is required by an artist to create a song. And yeah  until people stop liking what is being created we have no reason to disrespect what is being created.