Monday, 27 January 2014

latex test

A Cross Product Formula \[\mathbf{V}_1 \times \mathbf{V}_2 = \begin{vmatrix} \mathbf{i} & \mathbf{j} & \mathbf{k} \\ \frac{\partial X}{\partial u} & \frac{\partial Y}{\partial u} & 0 \\ \frac{\partial X}{\partial v} & \frac{\partial Y}{\partial v} & 0 \end{vmatrix} \] \begin{equation} x =1 \end{equation}

Sunday, 5 January 2014

Responsiblity

We are always told to be responsible and then the usual lecture from our parents continue.
However, mostly its not that we don't want to take responsibility, its mostly that we are never told why we should take responsibility.
We consider responsibility to be a burden on us, something that ties us down, something that people ask us to do so that we don't progress and all sorts of excuses. Frankly, I am not sure if i can even begin to cover the list. Its simply big.
We feel we are never free for one reason or another.
What we often fail to realize is that we wont get the freedom and power which we want if we don't take the responsibility of handling that freedom and power.  If we take up the responsibility of things we are bound to have control on things which we desire.
Lets take a simple example, we complain no one else listens to us. Well why should some one listen to us unless we start taking responsibility of what we speak. If out words don't matter to us why would they matter to someone else at all.
We keep saying we cant get up early but we never take the steps to get up early in the first place.
We know we should put an alarm five minutes prior but we never do that. Instead we blame people around us making them responsible for our short comings. Now there can be an argument that we can mistakes.
Yes we can make mistakes, I am not denying that. But when we start repeating those mistakes everyday i think there is something wrong with us.

--
Inspired by a person very close to me

Sunday, 29 December 2013

Sending Mail using PHP

Recently, I was trying to send mails using php script
I found out a couple of alternatives to get the work done.
There are a lot of good sites sharing this information. I am just sharing the steps  I took to get the job done.
I have used "Mail:factory " to send the mail. Again there a lot of options here, I have just used the most convenient one for me. Others are free to try and post
any options they can find.

Here goes nothing,

<?php
require_once "Mail.php";

 $from = "from where you want";

 $to = "send to your friend";
 $subject = "Testing No Reply! Pl. Ignore";
 $body = "Hi,\n\nTesting No Reply Functioning?";

 $host = "smtp server address";
 $port = "25"; #commonly 25 please check the port you are using

 $username = "USERNAME";
 $password = "PASSWORD";

 $headers = array ('From' => $from,
   'To' => $to,
   'Subject' => $subject);
 $smtp = Mail::factory('smtp',
   array ('host' => $host,
     'port' => $port,
     'auth' => true,
     'username' => $username,
     'password' => $password));

 $mail = $smtp->send($to, $headers, $body);

 if (PEAR::isError($mail)) {
   echo("<p>" . $mail->getMessage() . "</p>");
  } else {
   echo("<p>Message successfully sent!</p>");
  }
?>



As you might have guessed, you will have to install "mail" for this to work For this we will install "pear" The simple command is (for linux : apt or yum)
sudo apt-get install php-pear
Once we are done with pear installation we will install the mail application
pear install mail
If you get a message saying "no such package" then please check the internet connection. If you need to set the proxy for pear package then please use
pear config-set http_proxy
 http://username:password@your_proxy_server:port
Note: The whole command is a to be used in a single line. Please do not press the return key

This should pretty much to the trick.

I received a lot of help from Nitin Dalvi with regards to the script
The code block highlighting method can be found at the following link http://mateenmoosa.wordpress.com/2011/08/09/blogger-code-block/

Sunday, 25 August 2013

Growing Up -- Credit

Credit can mean  a lot of things. Most would be happy it reflected in their in bank statements but here I am referring to something called "Shabaski".

From our childhood we are trained to get credit for the things we do.
I am using the word trained because I believe no one is born with this idea. We gradually pick it up.
Let's look at this example.
A ten year old child is asked to pick up something from the floor and put it in the dustbin.
The child does this task ( Let us assume for the example the child actually listens in this case).
After successfully completing the task the gets a pat on his back.

This small thing develops in a habit. As the child grows this behaviour is repeated quite a few times.
Now the child is accustomed to this and every time he does something he looks into the eyes of the parents expecting a pat or may be a chocolate or may be pocket money depending on the age of the child.

Instead as he grows the pat's on his back tend to decrease. Something that was once considered very good suddenly seems to have lost its value.
Then he starts rationalizing in the wrong way (as we often do).

He first thinks, his task was not seen and may be if he repeats he will get the expected result.
Sometimes it works sometimes it doesn't. As time goes by this approach also changes.
Then he begins to wonder why the significance of his work is not being taken into account.
The task may be actually quite small and routine but for him it is the biggest thing there is.
Then he starts thinking if he is undervalued and so on and so forth.

The problem is we all think this way. Everyone wants appreciation for the work they do and there is nothing wrong in getting some appreciation. But as we grow we should realize we are doing certain things because we want to do them. So appreciation by others surely feels good but in no way does it help in enhancing or degrading the value of the work.
Rather should I say when we realize such things we start growing up.

Saturday, 6 July 2013

RSSI and Throughput for MIMO

Throughput and RSSI are two of the most mysterious entities of the AP measurement world.
For Throughput measurement is an issue and for RSSI the interpretation of the measured value is a cause of concern. They vary from device to device and from one environment to other. This makes it almost impossible to define a standard set of values. For you define a standard then a room where the measurements are taken, the devices with which the measurements are taken including the wifi adapters and drivers and the exact same conditions have to be replicated.
The hardware can be duplicated but the environmental conditions, how do we create a mirror of these ?

If this was not complex for SISO systems we now have MIMO,  where complex ascends to a totally different level.
As per my understanding RSSI values are generally scaled values not raw power at the antenna. The way these values get scaled depends on the manufacturer of the card and varies with different manufacturers. For e.g. some may choose 10 levels to scale the received power, some may choose 100 levels to scale the received power. Based on the scaling the same number can mean a different value for each manufacturer. There's no specific standard for this. One reason is because RSSI is mostly used for internal calibration. So different scales imply different calibration, which is fine.

A general trend suggests with increasing distance, RSSI decreases and so does the throughput. However, this is not linear. In MIMO systems, RSSI determines whether a client (any laptop or phone) can connect to the AP in consideration. If the RSSI is so low that no signal is detected then it doesn't matter what technology we use, we don't get anything. The noise floor is generally considered to be around -96 dbm. Now, depending on your client's sensitivity the minimum RSSI level will be decided.

It would be our first guess that plotting RSSI vs Throughput will give a straight line. It holds if we have a SISO system and in MIMO if we have very few obstacles. But here comes the troublesome part. In MIMO if we go in the shadow zone of an obstacle the RSSI will most likely drop but the throughput might increase or decrease depending on the processing gains obtained by various paths.
So now how do we measure the actual throughput in an office like environment with different cubicles. If we try to plot the RSSI vs Throughput graph now we will see points all over the place. This does not give a very good picture as to how these quantities behave.

Now lets make things even more complicated. Let the environment change as  a function of time. Lets measure the RSSI and throughput at some fixed places. What we now expect(and if we are lucky we might get to see)  is a band of values. I shall leave the interpretation to a keen observer.

 

Sunday, 3 February 2013

Why does a cat close its eyes when drinking milk?

We have a heard a lot of saying referring to a cat closing its eyes and drinking milk.
We compare it to people who feel the world stops looking just because they can not see
who is looking.
We also refer it to short sightedness.

But do we really think why the cat closes it's eyes when drinking food?

It is vulnerable when snacking to other creatures of  bigger size.
Mostly kids throwing stones or playing cricket, sometimes dogs and
sometimes adults when the cats sneaking into the house to have a drink.

Even so, the eyes are closed

There can be a simple explanation to it.

If the eyes were open the cat might get a squint.

It's face is so close to the bowl and the tongue is also small.
Trying to look at such close distances will be like trying to look at our nose to figure out how big it is.

In all fairness, even we don't look at out morsels when we are eating
We are too busy looking at the opposite person and pointing mistakes or too lost in out thoughts to notice our hands going to our mouth and food in our tummies.

Wednesday, 26 December 2012

Solution to Android connectivity problems

A few posts ago,  there was post mentioning the process of converting the laptop to a WIFI  hotspot.
Well, all the efforts and then the android phone refuses to connect.

As though possessing a will of its own.
It connects once in  a blue moon and shows who the boss is .

After spend quite some time in frustration and surfing online
The problem I faced was as follows

Phone connects to wifi
But does not get a valid IP address
then it disconnects
Scans after some time and repeats the procedure again and again and again.


I got a few workarounds

I will mention them so that others wont have the feeling of throwing their phone out of the window
and onto a  busy street where the probability of the phone being crushed is certain.


A simple method is to install WIFI FIXER  app

It resets the phone's wifi and enables you to connect.
It also monitors the phone's wifi status which is a neat feature.


Another method is to use a static ip
The process is as follows

Before switching on the wifi

Go in wifi settings
click on advanced
check the use static ip address box

enter the following settings
ip address:- 192.168.1.253
gateway:-192.168.1.1
mask:- 255.255.255.0
dns:-4.4.8.8

Once this is completed enable your wifi

The phone should immediately connect to the wifi network
wait for some time just to make sure it stays connected.

Once you are assured that your phone is connected to wifi.
Again go in wifi settings
advanced tab
and uncheck the use static ip address box

At this time you should the ip address in use in the box above the static ip address box

Once you un check your use static ip address box

Your phone will still remain connected and you will be able to browse on your phone

cheerrsss
wishing everyone a merry christmas


 

Friday, 16 November 2012

A Wintry Morning with a Splash of Spring

Opening eyes in  a wintry morning,
Looking beyond the bed and
into the field of swirling daffodils
with amber bathed skies,
the sun hovering like a hot ball of fire
yet the heat of those flames is surprisingly soothing.
Walking into the fields for routine chores
expecting a cold hair raising gust
Instead being welcomed by the energy
in swaying flowers
The breeze acting a like a partner
in the marvellous dance of nature.
A day shall come soon when the flowers are dried
but they show no signs
 enjoying the breeze.
A splash of white on the otherwise golden land,
may we all see this beauty as the skies can.
 

Sunday, 11 November 2012

WIndows 7 wifi hot spot

There are a lot of resources to convert your windows 7 machine to a wifi hot spot on the internet.
I am just trying to summarize some of the problems I faced and some of the things I tried in order to
make it into a hot spot.
I hope it can be of use to some one.

There are some applications that convert your laptop to a hot spot. One such application is the  virtual router software. Its pretty simple with a gui, few steps and we have a hot spot.
Heres a link for the same http://virtualrouter.codeplex.com/


The second method is through the terminal or command prompt
For that we need to create a virtual miniport adapter.
Once the  adapter is done a  few commands and the laptop is a wifi hot spot.

Go to  the command prompt.
Make sure you run it with administrator privileges or else it will not work.

Type the command
netsh wlan set hostednetwork mode=allow ssid=urname key=password

This should make the adapter.

Make sure that the adapter is enabled if you have disabled it previously

Make sure to enable wireless networking in the laptop before the next command

type in
netsh wlan start hostednetwork

this should give a message saying "the hostednetwork has started" in the command prompt.


To stop the hostednetwork type in
netsh wlan stop hostednetwork

and you should get a message saying the "the hostednetwork has stopped"


To share internet connection with the network that you set you, perform the following steps.

Open the networking control panel
Go to the adapter currently connected to the internet.
Go in properties open sharing tabs
once the sharing tab is opened .
select the microsoft virutal adapter from the drop down menu.

If sharing is enabled on some other adapter you will get a warning and on accepting the sharing properties should change to your current network

Walla you have a wifi hotspot

cheers




 

Thursday, 25 October 2012

Growing Up

When do some people get maturity or rather do people get maturity at all, is one of the questions I have wondered about for quite some time.
When I was a kid a felt or heard from my parents that maturity came out of a need.  It was the situation in which the person had been which was responsible for the maturity in that person.

But now, as I go about life, I see different examples where the situations expects the individual to show maturity, however there's not even a glimpse of maturity seen. Its more like a black hole where
you atleast hope that some light might escape but alas there's no light after all.

If it's not the situation, then when do people get mature?
Then I though of another question do people mature after a certain period of time. More properly put
is there a time frame after which people do not mature. Not being mature might become inertia.
Once it becomes natural, it becomes very easy to justify the actions taken. Sadly, the rational mind does develop, so reasons are provided a galore.
And if nothing else works then there's temper tantrums like a small child.

It is fun to be childish but if we become childish only to protect our faults its no longer fun.
Then its only protective instinct that leads to our actions or justifications or emotions or whatever may be manifested at that time depending on our social protocol or the relation with the individuals involved in the process.

This leads me to believing that maturity has to be forced on a individual. I am not sure how one can forced to be mature but if one doesn't understand then there is no point waiting.
After some time, the time to understand has already gone and the only time left is to not understand.
That can also be fun, however living in society can be some sort of a problem in that case

 

Wednesday, 25 July 2012

DESTINY

Sometimes things happen and sometimes we make things happen, but most importantly things happen. So will things happen irrespective of what we think or do or rather want may be for those on a higher level of thinking and gifted vision attributes perceive.
Some say keep thinking of the thing and it will happen some say think start doing and it will happen, some also say that things will happen only when they are supposed to so we should keep doing what we are and like Charlie Sheen puts it 'something will turn up'.
That brings me destiny or des tiny, considering des in french would just be some one name tiny. But is it really tiny or makes up a big part in our life may be our reason for existence.
In India, since ancient times destiny has assumed quite a big role.
In some contexts it has been used to humble the doer(directly taken as 'karta').
In a sense that he is responsible for the events and consequences but its not only him but also some other things greater than him or rather which are beyond his control which are contributing to the end result. So in failure its not the absolute failure of the doer and in success its not the absolute success of the doer, rather a combination of all these elements which have given the results. May not have been favourable.
If we do nothing we don't get anything is what is said atleast. But is it necessarily true ?

Friday, 1 June 2012

Lloyd-max alogrithm again


The lloyd-max algorithm for scalar quantization chooses points randomly in the begining which causes the problem of local minima and global minima
possibily giving a non optimal solution
So
instead of choosing points randomly in the begining
can we choose them in this way

consider the pdf the r.v.
integrate the pdf till we get 0.5
consider this point as the first boundary point b1
then divide the intervals so obtained further again
in the first interval integrate till cdf is  0.25
consider this to be the second boundary point b2
thus we can acquire as many points as required considering the probabilistic behaviour of the rv

once sufficient number of boundary points are obtained we can the apply the lloyd max algo considering this boundary points
taking the mse and finding the approximation points a1 to an
then working on a1 to an to find the boundary points

the added part would take care that areas which have more probability will have the approximation points closer reducing the mse
hence the drawback mentioned in your notes where points choosen randomly may not be best if probability distributions are considered
can be resolved

Saturday, 26 May 2012

Simple application of Pressure imbalance

Mostly everyone has seen or been to a magic show at least once during the natural course of lifetimes.
I have also been to few  when I was kid.
The magic trick showed then was ' the magician filled a bottle of water with small holes in the cap
for the water to drain out. he then called me on to the stage asked me to look at the bottles and to tell the audience if the holes were authentic or if they were sealed with some transparent glue.
After conformation he gave me the bottle and asked me to turn it upside down and well obviously
water fell out thanks to gravity.
He then took to the bottle in his hands, whispered a few chants, gave the bottle a few shakes and walla
the drizzling water stopped as though gravity wasn't working.'
The trick ended and i have been thinking about it for a quite some time and finally
it dawned
it wasn't the absence of gravity but the mere pressure of air and water which was stopping the water from falling out.
The mumbo-jumbo was just for the amazement of the audience the real trick was in the shakes and wobbles he squeezed the plastic bottle while shaking
And as we very well know squeezing causing pressure and the pressure was sufficient to create an imbalance between air inside and outside the bottle.
Thus stopping the flow of water from the bottle.
Knowing is way more fun then the trick itself.....

Sunday, 13 May 2012

Max-Lloyd algorithm

Here I am talking about the algorithm used for finding the regions in which we are to quantize the given set of values and the values themselves.
As per the Max-Lloyd algo
1) we choose a given set of points as the quantization points
2) we then proceed to find out the region boundary points as perpendicular bisectors so as to minimize the error from the respective set of points
3) we then find the expected value of the point chosen to lie in the interval of interest and call this the new quantization value and so on reiterate the algo
what this basically does is we chose some points and move onto a better approximation of the points, however the algo by itself does not have any clue of the shape of the region so achieved considering two or more dimensional vector space for the points chosen ie group pairs of points.
Hence, even if better MSE(mean square error) can be achieved by changing some of the parameters of the shape of the particular area in consideration then may be the MSE can be reduced further more
For eg if we consider a two dimensional vector space then the algo would most likely settle on a square grid as the best value for MSE. However, a circle would have the least MSE but that will cause problems of coverage and hence hexagons would be the next best option.
So taking all this into account why not modify one the steps of the Lloyd-Max algo
It can be as follows:
Steps 1) , 2) and 3) remain the same during the 1st iteration.
During the next iteration add one more step after step 2) in the algo
Step 3) would now become
Find the MSE on the bisectors at fixed distances. The fixed distance would depend on the spacing of the two dimensional vectors. So when we obtain this we can realize how the MSE changes and modify the shape of the area.

But this would lead to a circle and some areas will remain untouched.
To solve this problem
I have asked to take measurements at fixed distance and not extremely close

Now the previous step 3 will become step 4
And the reiteration can take place

If increasing the quantization levels is permitted then
We can assign  a few levels for the spaces that will be left considering that circles would leave some areas untouched.
However the probability that those spaces are actually utilised by the points will be very less due to the very nature in which the algo works

Thursday, 10 May 2012

LZ-77

LZ-77
I am not talking of a car model or something.
Its the dictionary based coding scheme in digital communications designed by lempel and ziv in 1977
They had an amazingly cool idea. The whole problem prior to this was that when we assume a source having certain distribution say Markov process but then  the source does not produce anything even near that particular process or does not produce states that agree with the general concepts of a Markov process.
Then the whole model goes for a toss. And sometimes instead of coding we end up with something that's even more sad as compared to the original source data stream.
So these guys said, Owell lets not assume what the source distribution instead lets build it up based on statistical model as when the source generates the output.
Hence, when an infinite sequence of source symbols have occurred and the source stabilises to some distribution without major changes, we have the statistics collected so far,  and then we can model based on those statistics itself generating one hell of a code.
The only problem is the fact that we are not assuming anything in the beginning. This is the source of one problem or another. In this case more specifically, we have no clue of the distribution till a lot of statistics have been collected. So, we transmit everything till that is available which kind of is clumsy
when the source changes its statistics or when we start something.
So, how can we overcome this problem??
Solutions may already exist which I am unaware of at this point.
But i feel why not just assume some model and code that way till we generate sufficient data
and then let the LZ algo kick in.
The model we chose might not be an exact representation but even if it does a decent job of coding
a lot is achieved in this bandwidth needy world.
I haven't quite thought of which models we can assume in the beginning.
More on that next time when i have some more idea of what we are exactly dealing with

Saturday, 28 April 2012

Minority By Thought


The most difficult part is to pretend to do what everyone thinks is right. Or rather should I say what is socially right when there is no interest to do it. Its not so simple as I thought, I guess it is a complicated mess after all. Only if being non social was also socially acceptable option. Sadly or merely for most of the lot its quite simple to just be with people. Only if life was simpler then this and just do what we feel like irrespective of what others think. But then again being in minority has its own disadvantages. Doesn’t really matter why we are in minority. Sadly conformity is the only rule that has to be followed irrespective of what happens. Sometimes there is no choice no matter what we intend to do what happens in the end is the only thing that matters. Almost as if we were martyrs saying conformity rules. Only if this could be different. There would be some real understanding beyond words where no one has to say anything but still everything is understood. This could be our Ethiopia. The perfect legacy. Something that ought to be passed on. Thoughts are perceived cherished and then finally passed on unlike other material objects which just perish.

Saturday, 14 April 2012

MYOPIA

Have you ever wondered why cricket fielders or for that matter goal keepers jump irrespective of their distance from their respective balls.....
It’s the effort they make even though they are seemingly very far away from their respective targets. And people see them diving around trying to catch a ball they applaud the effort even if it fails in achieving the required output.
What would happen if they did not jump after that and instead just stood still allowing the ball to go past them. I am pretty sure that the people shout at them or rather boo in this case for not even attempting to make an effort to stop the ball. The people are in no condition really to judge what’s happening out there but they still do determine a lot of things for the club as well as the players. Most importantly it’s the fan base that I guess matters to any sportsperson.
Some how I feel people don’t really care much about whether those people can do something or not.
Its more like are they trying for that. Sometimes it just turns to a game of can u act to do that particular thing or not.
It’s whether people seeing that they have done something. It’s secondary that only those particular players know whether they are actually doing it or not.
Sometimes I feel that people should, may be for a second think about spot that particular person is and that no one wants to lose their position or something or want to lose the game but it’s just that it can’t be helped. He has done all that he can and yet the results remains unchanged so why not at least so the people that we are making an effort.
The thing is we forget about the circumstances and get so involved that never realize what we end up commenting on, mostly without thinking about the actual person’s ideas or involvement or for that matter his state.
Such bias, such narrow vision. That we take things to be the way we want them to look instead seeing the whole picture......
This is myopia of perfect vision......

Thursday, 29 March 2012

Light and Heat

Wen light falls on something that particular object becomes hot.
So does light and heat exhibit in the same form. Well may be it does but i feel that they can be treated as two separate entities though linked. Light is just what enables us to see. Whereas heat must be some transfer of energy.
Light can also be said as a transfer of energy. Consider this light is electron rotating causing certain wavelengths in the visible spectrum to be emitted. When this electron collides with some other object
it will transfer all of its energy elastically to the object. Since it does not have infinite energy it should to stop or at least slow down in the rotatory motion. This should cause a change in the wavelength emitted by that electron. Now if it is in the visible spectrum we see it. If it isn't we cant
The object to which it collided should now acquire the energy transferred by the electron. This should cause the electron in the object to revolve faster than before causing hindrance to the opposing forces in the material of which the electron is a part.
This friction can be responsible for the heat liberated.
Now again if that electron is rotating and emitting in the visible region we see the a particular colour
if it stops we see a change in the colour of the object when light falls on it.
most interestingly if all the energy from the colliding electron is transferred to the object that particular electron should stop rotating and also if the electron that it collided with wastes all of its energy as heat in opposition to the material forces of bonding then we should not be able to see anything
May be this is how black holes are. Light doesn't come out well because there is no energy left
all of it just gets spent in overcoming the nuclear forces in the material making that up.

Tuesday, 20 March 2012

Tennis Court lines are more Wet ??

As compared to the court the  lines generally become more wet even if the amount of rain falling is less.
That's mainly because the lines are made of some form of vinyl compound. By its very nature it does not absorb water. Hence the lines remain more wet as compared to the court where more amount of water is absorbed.

Freedom From Expectations

We think failure is the reason for us to not to try out things which are different when compared to the regular flow of things. I don't feel this may be the only reason. More prominently i feel that its the expectation to succeed or fail that's what is the reason for us not trying. We are afraid of what we expect and more prominently we are afraid of what others expect from us and how we would actually live up to what they expect from us. If we were free from these expectations i think we would have much better chance of doing things in a different way and may be a better way.
Generally, its a tendency for any sports person, destined for greatness as per others, to take a lot of time to win the first cup or tournament at the highest level. But once the first one is done everything else just becomes simple and comes so very fast.
We definitely cant say that the particular person is afraid of losing or is not playing at his best because of the pressure in those situations. They may be applicable to some extent but more prominently i feel its the price to pay when someone becomes too great too early as per the general perception of people.
Anyway if there was some way in which we could get rid of this expectation factor then it may just show us what we think we are capable, what others think we are capable of and most importantly what we actually are capable of .
cheers