Monday, July 06, 2009

Sisterhood and brotherhood in the age of globalization

A priceless image on which no comment can be added

Sunday, June 21, 2009

Jana told me (June 20th, 2009)

She came back from Lebanon full of energy and enthusiasm. She is still missing her grand parents and looking for my mother around the house from time to time.

Today she started yelling: "Ya Bila..." around the house. We are happy to see her recognizing some words and some language structures as well. Her mother is not happy though to see our daughters calling us with our names instead of "Mama" and "Papa".

Jana called me more than 100 times "Ya Bila..." and I was always answering her "Na3am" (yes in Arabic). This issue reminded me of this clip:


I am not sure whether she would, when she gets older, that I call her by her name more than 100 times in one hour !!!

Monday, May 18, 2009

Dealing with Zotero collections

Zotero offers some nice API functions for collection management.

  • Zotero.Collections() return an array to all the collections in the current library. I am not sure how this will handle shared collections but it is worth investigation.
  • Zotero.Collection is an object that will handle everything related to a Zotero collection. 
To add a new collection, one can:
  • Add the row directly to the DB. A dirty solution that used to work for version 1.* until 1.5 beta. However, it stopped working with version 2.* (the beta version at least) because the key field in collections table can not be empty anymore.
  • Use Zotero.Collections.Add(__collection_name__) and reference the new object 
//
// Create a Zotero collection object
//
newCollection = new Zotero.Collection();

To add items to a collection, the direct DB query is still working but I would not advise you to use it as it will break the stability of the DB sometimes. So the better approch is to use Collection.addItem() or Collection.addItems() methods.
newCollection.addItem(duplicateItemID);

Saturday, May 16, 2009

Javascript Date Format

Just a small note, Javascript has two functions for the Date.Year. I needed to use the Full year function but unintentionally I have used getYear() function.

The correct method is getFullYear()

Zotero Database Abstraction

It should be noted that the database abstraction layer for Zotero is still not complete. The authors noted that
            // Until the native dataset methods work (or at least exist),
            // we build a multi-dimensional associative array manually


It took me a while to understand how I can get query results from Zotero.DB. It was mentioned in one of the functions comments but was not clarified in a document file. The query returns varies depending on the query type as per the following comments on the Zotero.DB.query() function
  * Run an SQL query
 *
 *  Optional _params_ is an array of bind parameters in the form
 *        [1,"hello",3] or [{'int':2},{'string':'foobar'}]
 *
 *     Returns:
 *       - Associative array (similar to mysql_fetch_assoc) for SELECT's
 *     - lastInsertId for INSERT's
 *     - TRUE for other successful queries
 *     - FALSE on error
You should notice in the first comment that the SELECT Query would return an associative array that is built by Zotero coders and not a native multidimentional javascript array.

The easiest way to parse such an array is to use a For Each loop or a while loop.
            for (duplicateItems in potentialDuplicateItems)
                {
                //
                // Get each row now
                //
                var oneRow = potentialDuplicateItems[duplicateItems];
                idsArray[duplicateItems] = oneRow['ID'];
                }

Make sure you use the correct index to read from each row or you might get a lot of undefined errors. Errors are not bad but when you are developing for a firefox extention and you have to restart your browser for each test or correction, it might become a hassle.

Zotero Extension Development

I beleive that Zotero is the future of Reference Management. This tool is free, nice, simple, and powerful.
I am developing some simple extenstions for it and I wanted to share this experience with other readers who might be interested in that.

The documentation on extension development for Zotero is still not adequare and I would love to help anyone who is looking for help.

Wednesday, April 22, 2009

iAWN (International Assistance and Welfare Network)

This was my first serious community based international relief project but I could not realize it. Now, eight years later, there are many crowdfunding projects (islamic and non islamic). They still suffer the same original issues. However, they are trying to provide a service.  



iAWN (International Assistance and Welfare Network)


iAWN aims to be the first Islamic micro-lending network to empower donors in assisting and financing micro entrepreneurs in developing countries. iAWN would be an online charitable organization dealing mainly with collecting online donations to fund posted projects. It focuses on the following fundamentals:
  • Interest free lending 
  • Accessibility 
  • Security 
  • Privacy 
  • Fairness 
  • Creating value for both the donor and the entrepreneur 
iAWN offers a free, simple, and accessible web portal to link micro-entrepreneurs in sub-developed or developing countries with donors and investors in developed countries for the sake of raising funds for new or proven initiatives in the education, health, youth, woman, and other social sectors. At one end, the iAWN portal would allow people to donate online securely and with full privacy and contribute directly to any posted project. At the other end, project managers with the help of a local field partner would post a project that needs funding.

To read more:
https://drive.google.com/file/d/0B_kFWLJYXE9_Y3c1M3FaUDRnMjA/view?usp=sharing