SocialTwist Tell-a-Friend

Estimating a circle using a polygon

Estimating a circle using a polygonSocialTwist Tell-a-Friend

A Circle is a very commonly required geometric when plotting/processing spatial data. But somehow most of the available spatial processing tools do not give you a ready circle geometry or provide a very crude implementation. So we generally end up estimating a circle geometry using a polygon. In short we draw a polygon with all its vertices lying on the circle you want to represent. The number of sides your polygon has depends on the accuracy you need for the circle. A 32 side polygon with correctly plotted points is considered an near perfect circle.

Here's working java code for getting the edges of such a polygon, given the radius and center of the circle.

public Coordinate[] getCircle(Double lat,Double lng, Double radius)
{

int points = 32;
Double d2r = Math.PI / 180;   // degrees to radians
Double r2d = 180 / Math.PI;   // radians to degrees
Double earthsradius = 3963.0;
Double rlat = (radius / earthsradius) * r2d;
Double rlng = rlat / Math.cos(lat * d2r);

Coordinate[] list = new Coordinate[points+1];
for(int i=0;i

   Double theta = (double)i/(double)points * 2 *Math.PI;
   Double ey = lng + (rlng * Math.cos(theta));
   Double ex = lat + (rlat * Math.sin(theta));
   list[i] = new Coordinate(ex,ey);

}
// make sure the circle is complete
list[points]=list[0];

return list;
}

Time to run

Time to runSocialTwist Tell-a-Friend

This January I will be running the Dream Run at the Mumbai Marathon for Rang De, a cause I have been supporting for some time now.

Rang De is social initiative that supports rural entrepreneurs across India by providing them with low cost loans for their businesses. Typically they run eateries, cottage industries, vegetable shops and so on. Since otherwise, their only access to capital is the local moneylender, it is anyone's guess on how their life shapes up after that.

Rang De is an innovative attempt to break this cycle of poverty. Through the online portal, individuals can make social investments by lending small sums of money to entrepreneurs of their choice. I invite you to www.rangde.org to understand more about how it works.

For the past year i have been an active volunteer with RangDe and have been involved in various activities from fund raising, publicity to some field work interacting with borrowers and field partners. In this time I have personally seen the difference Rang De is making in the rural landscape and am now a firm supporter of the cause.

Here are two ways in which you can support my initiative

1 Become a social investor on rangde. Invest any amount starting from just Rs 100. Instructions here http://bit.ly/dXxGfa .
Understand rangde this way and understand how investing is so much more effective than charity. You receive the money you invest back in a year.

2 Raise a pledge as small or large as you please. Heres my online giving page http://bit.ly/fQ2ZxY.
Since this is a donation, the money will not be returned to you, but will be invested and reinvested over and over to fund needy entrepreneurs.

Here's a list of people who've support my initiative so far. Will keep this list updated.

Kavita Gaitonde
Anil Puliyeril
Uday Shenoy
Vilas Shelar
Makarand Pundalik
Rajarshi Chanda
Vrushali Kulkarni
Leena Patki Saha
Pushpa Gaitonde

Thanks a lot everybody for the great response.

Amount raised so far
Pledges worth Rs 17500
Social Investements worth Rs 17000.
(Some people have prefered to keep info about their investments private, so thats not counted)

Rang De Conclave '10

Rang De Conclave '10SocialTwist Tell-a-Friend

I attended the Rang De Conclave '10 at Mahabalipuram, Chennai over the weekend. The conclave is the time of the year when the entire Rang De ecosystem consisting of the Rang De team, field partners & volunteers from across India come together to evaluate their plans, learn from each other and plan ahead.

The conclave featured presentations from the field partners about their work and the challenges they face. As Rang De has continued to grow over the years, it has made a conscious effort to be selective in the organisations it supports. It now partners organisations that genuinely believe in Rang De principles of honesty, transparency and a commitment to reach out to communities needing access to low cost micro credit.

As they all presented their way of reaching out and supporting the rural population, they realized that they had a lot to learn from each other. Each had a unique story to bring to the table. As the discussion veered to the current microcredit crisis in India, we concluded that there was definitely a need to regulate microcredit in India but an effort must be taken not to stifle genuine efforts in the process.

As an individual, getting an opportunity to interact with individuals from these organisations and understand their working models was a great learning experience for me.

The event also for the first time got together the Rang De Volunteer Chapters across India to a brainstorming session to identify our role in the Rang De story and how we were an important link as Rang De plans to reach out to the masses and bring in a culture of social investing.

The Rang De team followed up the discussions by showcasing the road map it has planned for the entire team for the coming years. The Rang De team has a long way to go to achieve its dream of "Making affordable micro credit a reality", but is definitely geared up for it !

The Colour of Dreams

The Colour of DreamsSocialTwist Tell-a-Friend

"Its time for scheduling a field trip", was the subject of the mail, that made me quickly drop my work and take notice . It was Diksha from the Rang De Chennai office, planning the an evaluation field trips to one of the Rang De field partners. I always look forward to Rang De field trips as an opportunity to interact with small entrepreneurs bringing about a change in rural India, their unending enthusiasm and the difference a small social investment can make.

It was my second field trip with Rang De , this time to Pusad where the Rang De field partner SAGRAS is based. After a long and delayed train journey 7 of us fieldtrippers reached Akola on friday afternoon, only to take on another bumpy but enjoyable bus ride to Pusad. As we reached the SAGRAS office late evening, 7 hours later than we were expected, we were surprised to find their entire team patiently waiting to welcome us. Over a cup of tea the entire team introduced themselves and gave us all the latest updates on their work and the various projects they work on.

Early next morning we were all excited as we set off to visit each of the borrowers individually. We would enquire about their business, get updates on how the loan was utilized and also get their feedback on the entire loan process. Each of the borrowers has an interesting story to tell.

As we saw the working of a cycle shop, I couldn't stop doing some calculations in my mind. With a loan of a mere 3000 Rs, the woman bought two new cycles that she now rents out, getting a fixed income of 50 a day. And i don't think twice before spending 3000 Rs on a single dinner at a fancy restaurant !

The next lady we met runs a tailoring business. She had not only expanded her business with the loan but now manages to support her daughter in doing a diploma is fashion technology. And you'd think only people in cities dream big !!

Another family just managing to make ends meet with their small income distributing milk, has now started a business of making paneer and selling it to the local hotels for a decent profit.

As we went on with these visits we were struck by the optimism of the women folk. Each one had big dreams for their families and their business, and surprisingly educating their kids was the foremost on their agenda. It is only when they get stuck in the cycle of debt and in the fight to make ends meet that they lose track of their priorities. They just need a hand in kick starting their journey, someone who would trust them and guide them.

Mentoring is another area where Rang De's field partner SAGRAS is making a huge difference. At the core of SAGRAS are people who have been working in the area for more than 20 years and have a very good reputation with the local people. Apart from arranging funds for the businesses with help from Rang De, SAGRAS also arranges mentoring sessions that train the women in business basics.

Now thats a real change from all the controversial micro credit firms that have recently been in the spotlight. It great to know that Rang De associates itself with organisations like SAGRAS.

As we started our long journey back home, we had a lot of thoughts to discuss & experiences to share. I seemed to have met more entrepreneurs in a day than in my entire life !

This field trip had once again reminded us how a small gesture from our side can make a world of a difference to someones life. And Rang De was doing the job of connecting us to these deserving folk. Keep it up Rang De.

Adding custom LocatorBuilders to selenium ide

Adding custom LocatorBuilders to selenium ideSocialTwist Tell-a-Friend

Background : Selenium is an open source tool for web application testing.
Selenium IDE is a Firefox plugin allows you to record tests in browser and run them from the browser or as a java test ( or any other languages ) using Selenium Remote Control libraries.
You can extend functionality of Selenium IDE by writing Event Handlers, Locator Builders, Command Builders, Custom Format all in JavaScript.
For more about that http://wiki.openqa.org/display/SIDE/Writing+extensions.

More on Locator Builders
Locator Builders decide how HTML elements in a page are identified.
eg id attribute is a default locator builder.
So while recording a test an html element attribute selenium using the id attribute to recognize the element you changed, clicked etc.

Writing a new locator builder

You can instruct selenium to use a custom attribute to identify the elements in your page. Default Locator builders can be found at chrome://selenium-ide/content/locatorBuilders.js

Here's the js code to add a location builder for an attribute myattr

LocatorBuilders.add('myattr', function(e) {
if (e.hasAttribute('myattr')) {
if (e.getAttribute("myattr")) {
return '//' + e.nodeName + '[@myattr=\'' +
e.getAttribute("myattr") + '\']';
}
}
return null;
});


Since there are plenty of existing location builders, you need to specify the order in which they are invoked. This is how its done

LocatorBuilders.order = ['myattr','id', 'link', 'name', 'dom:name',
'xpath:link','xpath:img', 'xpath:attributes', 'xpath:href',
'dom:index', 'xpath:position'];

Complete code:
mylocator.js

LocatorBuilders.add('myattr', function(e) {
if (e.hasAttribute('myattr')) {
if (e.getAttribute("myattr")) {
return '//' + e.nodeName + '[@myattr=\'' +
e.getAttribute("myattr") + '\']';
}
}
return null;
});


LocatorBuilders.order = ['myattr','id', 'link', 'name', 'dom:name',
'xpath:link','xpath:img', 'xpath:attributes', 'xpath:href',
'dom:index', 'xpath:position'];

Steps to add the extension code to selenium IDE

  • Write locator code in a new .js file
  • Specify the path in "Selenium IDE extensions" field in Selenium IDE > Options and restart selenium IDE


BlogCatalog

Travel Blogs - BlogCatalog Blog Directory