Computers for kids

If you have any spare computer peripherals and live in Hyderabad in India, there is one organization who might be interested in using those peripherals for furthering computer literacy for kids. C4K-India is an organization which will assemble computers and donate them to schools that need them. I found out about them on NGOPost and contacted them recently (as I was in Hyderabad). They responded and were courteous to come by and pick up the peripherals. I chatted with their secretary Balaji and he told me that they are using the computers to donate them to an orphanage. They had already assembled some machines for a school near hi-tech city in Hyderabad and the orphanage is the second recipient.

One of the practical problems he mentioned, was the screening of potential recipients. If the members of C4K were to impart computer courses to the kids in a school, how do they find out that the school is not charging the kids for the courses without the knowledge of C4K ? He also mentioned of a case where they rejected a potential recipient as they felt that they were not genuine enough.

This initiative by the youngsters (some of them are IT professionals in Hyderabad and volunteering for C4K) apart from being very specific in its mission also seems to have a group of enthusiastic volunteers. I shall be following their progress in the days to come. One of the suggestions I gave them was to write more about their progress on their blog. An active blog would indicate to the donors that the organization is doing fine, thereby fuelling more interest. Another thing I asked them to do is to create banners which people might have on their sites. When you are a NGO, there is a tight budget and viral marketing is possibly the best bet. When I asked Balaji about financial donations he said that they were not taking any money as that would mean more management of reserves (they are a registered society, which means there is even more onus on financial management). So, for now it is computers and peripherals which they are interested in.

So, if you are in Hyderabad and have spare computer peripherals please get in touch with C4K. The peripherals might end up in helping a few kids.  And also, if you relate to their cause, please check with them to volunteer to do the groundwork in evaluating the potential recipient. And do spread the word in your organization

JSON support to Kiva .NET toolkit

JSON support for the Kiva .NET library

If you are interested in microfinance, then it is very likely that you’d know about Kiva. And if you know about Kiva, then it is possible that you might know that they have provided public access to their data via web-services. And once they did it, there were toolkits available in most of the languages.

One of the implementation that caught my interest was the Kiva .NET. I never worked on C# earlier, so I thought this might be a good project to start with. The reasons

  1. It’s a toolkit – so it is compact
  2. There is already an implementation for XML that was done by the original author
  3. I wanted to write some code using LINQ, even if it was not working off DB data sets

So, given the above, I added support for JSON data in the Kiva.NET library (can’t locate the link where the Kiva folks mentioned that they would release the JSON format first and then the XML for the API). Nevertheless, the JSON format support has been added.

Most importantly – this code is seriously beta. The reasons are

  1. The code is not backward compatible with the existing Kiva.NET implementation. Almost all the objects have changed with
    1. Attribute names (members of the class) have changed to make it possible to deserialize the JSON data (more on this further)
    2. For some objects, as the data returned by Kiva has changed, the object layout also had to change
  2. Exception handling is not done
  3. I did not check all the APIs to see if the XML implementation is full-featured as the JSON one
  4. Productizing the API is not done i.e.
    1. Versioning of the library
    2. Proper comments and documentation
    3. Test suite for the toolkit

But the code does work :). In the zip file attached, the KivaTest project has a very simple main() to test each of the APIs. Also, this requires atleast JSON.NET 3.5R5 as it has support for non-public default constructors. Thanks to James for adding this (you can follow the discussion here).

Coming to the point about the attribute names being changed. The reason this was needed because I was deserializing the JSON object using and the library tries to match the attribute names with the JSON data. As mentioned in the Kiva API specifications, the variable names are separated with an underscore. The initial implementation of the Kiva .NET library didn’t use underscores for the attribute names. That is why my changes are not backward compatible. I did check the resolver interface in, but that is used to piddle with the attribute names of the objects but not with the JSON data. What I am looking for is to modify the JSON attributes so that I can remove the underscores for the attribute names before deseralizing them into Kiva objects. I am certain it must be possible, just that I am a n00b when it comes to C#, so will dig more and find out.

Will have more updates in the coming days based on how the owner of the library reviews my changes ! The patch file and the zip file for the changes are here

The patch file and the source zip with the test client are uploaded as part of the post.