In the middle of GSoC: The Summer of Sync

14 07 2009

It’s been quite a while, truth be told, quite some time without posting updates to this blog.
My GSoC project have been going through a mix being busy, many events happening, trying to find love for new things but I am sure my project is still interesting .
Today I want just to mention the status of my GSoC project ; it’s in the mid-term evaluation and we expect Google paying for all ‘well-going’ projects .

I have a detailed wiki page about my project : OpenMRS Sync, Create a new Sync Node .Everyone is welcome to leave useful comments on this project. The source code is available under the terms of OpenMRS Public Licence and can be browsed from OpenMRS website as well as they can be ‘checked-out’(downloaded) via subversion with the command

svn checkout http://svn.openmrs.org/openmrs/branches/data-synchronization-admin-ui

Other things actually are happening in my coding environment:I have been undergoing series of switching Operating Systems between Windows, Linux and Solaris and I have some insight about what does things in the best way; I have been trying to find love for Groovy/Grails at the same time I am trying the Qt toolkit .Groovy seems to be a powerfull Jav-based agile framework, easy to configure and deploy. Touching it is like drinking milk from your grandma, and when you get satisfied you feel and find that you have more energy . Qt is a cross-platform desktop GUI framework using C++and acquired by Nokia last year, Qt is the parent of KDE Desktop environment for Linux.Trying Qt is like eating bread from your granddad tagged with honey inside; you get stronger and healthier. The reality behind things like these(trying new things) should be :”Always, there is a place where you want to go, there is a person who you want to be with, there is something you always want to see happenning, there a level you always wish to be on, the is a goal you always want to achieve ! The list doesn’t end and when you feel you don’t have neither one of these desire, you don’t enjoy your life .” .

I the past 40 days, I have seen many other things happening around us and among them as I am writing: ATRACO club from Rwanda won the East-African soccer cup(CECAFA), Rwanda has named other new born gorillas (Kwitizina<www.kwitizina.org>: this is really a new brand for the Gorilla tourism in Rwanda, and it demonstrates the efforts deployed in both tourism promotion and conservation ) , Rwanda has celebrated 15 years after National Liberation and the end of Tutsis Jenocide <www.rwanda15.org>. An other event was the departurte of MJJ , the King of Pop, to the land of peace, and I can’t say anything more personal than “In paradisum deducant te Angeli; in tuo adventu suscipiant te martyres, et perducant te in civitatem sanctam Ierusalem. Chorus angelorum te suscipiat, et cum Lazaro quondam paupere æternam habeas requiem.“.

This is not the end, please stay turned to my blog and I love to hear your comments .

svn checkout http://svn.openmrs.org/openmrs/branches/data-synchronization-admin-ui




Last week OpenMRS GSoC activities

1 06 2009

Last week was really busy forme, I was packaging everything for traveling back to Kigali . At least now, I get time to write a couple of blog posts . I am seating in WA Dulles airport,  waiting for the plane that take me to Brussels; I am waiting  almost for the whole day and I can now summarize what I’ve done on OpenMRS during last week .

My GSoC project is again about Sync: “Data synchronization is a new OpenMRS feature allowing synchronization of data amongst a set of loosely networked servers. Such ability to exchange data is essential for operation of EMR system in rural areas where connectivity amongst sites maybe unreliable yet the need for timely centralized collection and analysis of data from remote sites exists.”

The synchronization feature was designed in a parent-child hierarchical model, to allow data to flow from from remote sites to more central parent and vice versa . A parent OpenMRS server can have many child servers and child can have only one parent . At synchronization, a child server send new change-sets to its model (SYNC REQUEST) and receives all new change-sets from the server (SYNC RESPONSE) . This can be done either via the web or with a disk drive (file) that can be carried over the parent while the child is off-line and  the parent will also issue an off-line sync response to carry back to the child . The sync via file doesn’t mean that you have to move physically to the place where the the parent server is installed ; OpenMRS is a web app and any where you can access the parent app you can sync your off-line child !

There are two additional changes on the OpenMRS data model that synchronization does :

1) synchronization_* tables are added to the data model for storing sync settings & configuration and they also store the temporary sync import/export records .

2) GUID indexes : to ensure data exchange between different OpenMRS systems, the ID fields are not enough to identify a record because there are from different MySql installations, so the GUID index columns are added to all data that can be sync-ed .

My actual project’s main aim is to provide an automated way of creating a new sync node(i.e.child) and provide the appropriate user interface . This was done in manual process and required much administrative knowledge. When creating a new sync node(i.e.child) you had to:

  • register newly created child with parent
  • back up parent server DB and move the backup to the new child server
  • restore parent’s DB
  • assign new server sync ID
  • change any server identifying information from parent to child (i.e. form entry server URL)
  • test sync connection between parent and child and finally establish periodic sync schedule

In order to achieve these project I have to start from the actual sync code . As last year I was commiting to the synchronization-admin-ui branch, I think I am going to commit to it even for this project . So I started by resolving few issues in the actual code and I merged the synchronization_bidirectional branch to the sync-admin-ui branch so that all sync changes after last GSoC be available to the sync-admin-ui . This was not a simple task because the sync_bidirectional branch also merges from trunk .

I just used Subclipse merge feature and I let both the old and new versions of code be there then I removed the old revisions where it was necessary and, sometimes I had to use a piece of regex in order to be fast .

For example, Subclipse should form somewhere two blocks of code with different versions and limit them with

<<<<<<< .working
//Code
=======
// Code
>>>>>>> .merge-right.r7385

Then in that case I used the following regex and replaced it with an empty space in order to keep the merger-right version of the code

(<<<<<<< \.working([\x00-\xFE]*?)=======)|(>>>>>>> \.merge-right\.r7385)

This is how I merged and it’s working perfectly .

My next step now is to find out a way of cloning the MySql database from the parent DB and apply it to the new child instllation automatically . If you have more ideas about how to achieve this, please leave your comments .





Seattle Theaters

1 06 2009

This was really amazing, I spent the last two months doing an internship with RealNetworks, Inc.

I was assigned to a challenging software engineering project and everything went well . My supervisor was always complaining because the internship was so short, and 6 months should be the best . Anyway my project was so successful and it attracted a lot of people in  my team .

Apart of the work, I get to know a lot of people and Seattle especially . This was my first trip to the US , the country where everything is possible !

Sometimes I got to hang out with friends and got to watch movies in the theaters around . Well, this was a very adductive fun and it’s the reason why the title of this post is called so . For my colleagues who like coding, I have a fun of code that always came out after watching one of the SciFi series . Guess which :

try{
energize();
}catch(UnknownUniverseException ex){
ex.printStarTrek();
}

Isn’t that fun ? The really came out once I wanted to write ex.printStackTrace and I wrote ex.printStarTrek instead .

Here is alist of the movies I enjoyed while in Seattle :

1- Fringe : a kind of new X-Files ; you know what ,  I already saw someone in Olivia’s face here in Seattle and I am applying for a Computational Bio-Chemical Engineering internship position with Massive Dinamic , WHAT CAN’T WE DO ?  (  — This is a joke )

2-Star Trek : This was awesome and I enjoyed it even before I knew it was so famous (at the time when they released the new season).

3-Angels & Demons : Oh my goodness , what a Camerlengo ? I was happy to see the movie starting in the LHC near Switzerland but I didn’t imagine it’s gonna be a Da Vinci Code of some sort . Anyway I am not a part of Illuminati ! And at the end of the movie the guy(Camarlengo) got into trouble , and I remembered my old high school latin text about Catilina: Quo usque tandem abutere, Catilina, patientia nostra?

and

4- Drag me to Hell was the Killer ! Don’t even dream of the story because it can be so harmful .
That was my fun time, tell me what you think about these movies .





DWR/AJAX/JavaScript Hacks: The secrets of JavaScript in the adress bar

1 06 2009

A couple of weeks ago a friend of mine send me a JavaScript code that I called “Balancez-Balancez” ;  it’s really fun to play with it . Just with your browser go to any website (e.g. www.baidu.com ), then  after the page is loaded copy the following code and paste it into the address bar of your browser :
javascript:R=0;x1=0.1;y1=0.05;x2=0.25;y2=0.24;x3=1.6;y3=0.24;x4=300;y4=200;x5=300;y5=200;DI=document.links;DIL=DI.length;A=function(){for(i=0;i-DIL;i++){DI[i].style.position='absolute';DI[i].style.left=Math.sin(R*x1+i*x2+x3)*x4+x5;DI[i].style.top=Math.cos(R*y1+i*y2+y3)*y4+y5}R++;};setInterval('A()',5);void(0);

What happens: all the links in the website become a beautiful CHINESE DRAGON DANCING !

The principle of this code is collecting some HTML elements(i.e. links) and animate them continuously (changing their style positions) along an elliptical line .

It was really pretty looking and it conducted me to dig deeply and find out how to go beyond  this practice of JavaScript in the address bar for just manipulating the HTML page : I thought about AJAX .

In fact if the page has an AJAX port, meaning the back end can handle some XMLHttpRequest, you can  build an out-of-page JavaScript code that runs into the address bar of the page and calls some functions in the back-end of your application .

Example: Use DWR

Consider you have exported a DWR function that gets the app logs from the server . You can just omit to put the JavaScript imports in your page header and load them dynamically with a JavaScript in the address bar ; you can also override the Ajax Callback function, you can override the callback handler and so on . Here is the example :


javascript:
script=document.createElement('script');
script.type='text/javascript';
script.src='/js/page.js';
document.getElementsByTagName('head')[0].appendChild(script);
css=document.createElement('link');css.type='text/css';
css.rel='stylesheet';
css.href='/css/page.css';
document.getElementsByTagName('head')[0].appendChild(css);
scriptA=document.createElement('script');
scriptA.type='text/javascript';
scriptA.src='/dwr/util.js';
document.getElementsByTagName('head')[0].appendChild(scriptA);
scriptB=document.createElement('script');
scriptB.type='text/javascript';
scriptB.src='/dwr/engine.js';
document.getElementsByTagName('head')[0].appendChild(scriptB);
dwr={};
dwr.engine={};
DWREngine=dwr.engine;
DWRLogsService={};
DWRLogsService._path='/dwr';
DWRLogsService.giveMeTheLogs=function(callback){
dwr.engine._execute(DWRLogsService._path,'DWRLogsService','giveMeTheLogs',callback);
};
if(DWRLogsService==null)alert('DWRLogsService=null');
void(0);
logsHandler=function(logsList){
newTable='<table cellpadding="4" cellspacing="0" width="100%" border="0">';
for(i=0;i<logsList.length;i++){
newTable+='<tr><td>'+logsList[i]+'</td></tr>';
}
newTable+='</table>';
document.getElementById('logsDiv').InnerHtml=newTable;
};
displayLogs=function(){
DWRLogsService.giveMeTheLogs(logsHandler);
};
setInterval('displayLogs();',1000);
void(0);

Since this technique is not very fair, there are three main points you have to consider when making building the Javascript code for the address bar:

1)Avoid new line (‘\n’ or ‘\r’) or space into your code : we are in the browser address bar !

2)Don’t use the name  ‘var’ for declaring your local or global variables ; this should cause a new space into your code.

4)Call void(0) at the end of your code .

I hope this can help anyone who want to try and please leave your feedback and lets share the experience .





Weekend @ Microsoft Campus

8 05 2009

I may not seem to be the biggest fan of Microsoft at KIST , but I do believe that Microsoft is a very innovative company in the software industry. Last weekend I was at the main Microsoft campus in Redmond , Seattle . They really have a kind of fresh environment you should dream to working in;  gardens,  flowers , trees it’s all welcoming. Although it’s a hard time for many companies including Microsoft , due to economic crisis ,  I am feeling late to embrace the .NET and C# world . I will enjoy to start reading my C# book left in Dusaidi Hostel . I hope there are much similarities between Java an C# .

This is my picture inside the Redmond campus, I was near the building No. 7  and  if you don’t know where the building No. 7 is in that campus, you never been there !

Nzeyi_microsoft

Antoine @ Microsoft near the building # 7





Can Africa survive without western aid ?

8 05 2009

Dr_Moyo_lectureWow, that’s a kind of interesting subject ! This evening I got a chance to attend a public lecture at the University of Washington (UW) . Dr. Dambisa Moyo was talking about her recent book entitledDead Aid: Why Aid Is Not Working and How There Is a Better Way for Africa ” . Before the lecture I was thinking, wow she’s gonna be one of those “Experts on Africa” !  I saw she really got an extremendous academic background and a lot of people were there to listen to her and ask questions . The only problem I have is that I didn’t read that book yet and I should comment only according to what I heard from the lady at the lecture .

I don’t think she is the first to talk about the subject and I know some African figures who talk a lot about being self-relevant and efficient . What I agree with Dr. Moyo is that obiously corruption was, is or will be the worst barrier to the use of aid , but I have to say that corruption is a general barrier to development regardless the fact that there is aid or not . Few people should disagree if I say that there are some places where The Aid really saved lives and contributed to the establishment of infrastructure and public institutions in Africa . I think the aid contributed somehow to my education. I was surprised that in her talk she emphasized more on the wrong side of things with Africans not efficiently using The Aid during the last 60 years , but I was also shocked by the fact that she didn’t mention the way those western ” Aid Providers ” should use or have been using The Aid to manipulate Africans  and that’s a worse case for me . She also said that Chinese have a better approach to Africa . I was in Beijing in October 2006 when they hada  The China-Africa Summit, and I used to sein the Beijing subway some writings  like ” 爱上了非洲 ” . That was fun and we still have to see wht comes next !

Here is a copy of the summary from the lecture .

world_affairs_council





Why don’t many people in Africa understand and benefit of Open-Source

4 05 2009

It seems to be true that “dev people”, spending most of their time on coding, debugging, …, do not have a lot of time for “blogging” but when you work on open-source projects, it should be almost a requirement to write blogs and let the world know what you are working on .

So here I get time to talk about few points and the main issue I am asking myself is about Open-Source and Africa . Few days ago I was accepted to work with OpenMRS , an open source project which is deployed in Africa to fight against HIV/AIDS mainly . This my second time to work on the project through the Google Summer of Code ™ program . So, I started counting how many African students were involved in the Google Summer of Code(tm) since its birth Date in 2005 and I don’t find 20 yet in “Africa” (I mean the sub-saharan/black one).

I don’t know what people in “The West” think of “Africa”, but I am sure some think it’s place for wars, diseases and still counting bad things; and they don’t expect much stuff like technology in Africa . It’s also sad to see people in Africa not benefiting from the open-technology which is all around . Internet itself is not perfectly open but it’ an open world of all kind of information .

Last year I got an opportunity to attend the Intego Awards which is the Rwandan Annual Award for the best companies in the ICT (Information and Communication Technology) business there . There is a man who said that Africa was sleep when The West was revolutionizing the machinery and mechanization industry and that Africa should not be sleep again with this new revolution in ICT . This is really a great thinking but there still much a lot to change for achieving this kind of dream .It’s true that people can benefit from much information available on the internet now for free and especially when they use well that information .The only problem is when people try to exaggerate using that information, I am afraid that Internet couldn’t replace the typical classic learning methodologies; a very sad example I knew is about a college teacher who was trying to “google” the title of the subject he was assigned to and the first PDF to come in the google results would be his textbook . It sounds really funny for these students to learn by this kind of FIFO methodology .But behind this information accessible on the Internet, there are really much more things that people can benefit from : That is FLOSS . I am not sure you can be heard when you tell that kind of teacher : “Hello teacher, I am writing open-source code, can we spread it and benefit from it ?” – ” That’s not my business ? ” should be the most probable answer.This really sucks .

I always believe that open-source can save Africa in the sectors like education or health care but a lot of new understanding should be adopted . When I asked someone why people don’t care about open-source , he said “it’s because we don’t even feel the proprietary guy’s pressure, here you can download anything you are able to access, no body will come from The West to say that the video , PDF book or cracked software I downloaded from rapidshare is illegal “;  “An other thing is that we download this digital stuff because we can’t download food or beer”, he added .This not the definitive answer but I should keep you updated when I get new reasons .

Anyway I should keep to interest my classmates about open-source , I want them to migrate from IE to FireFox, from Windows Media Player to VLC, from XP to Ubuntu, from the proprietary chains to THE WORLD OF OPENNESS AND FREEDOM !

If you feel like there is a concern in this post, please leave me a comment .

Antoine

Today’s interesting thing I found : Bridge2Rwanda





Rwanda to adopt mobile applications to support public health

2 05 2009

This is actually an article I got from today’s The New Times .

My thinking is that I believe open-source is the most profitable technology solution for Africa especially in the areas of Education and Health Care . So I am hanging up my eyes to se what open-source should play in that or how Rwandan technologists will have a chance to be involv ed in it .

This is the article :

Saturday, 2nd May 2009


Gov’t adopts phones for health initiative

Health Minister Richard Sezibera (R) consults with MTN COO Andrew Rugege during the meeting at Prime Holdings on Thursday. (Photo J Mbanda).
BY SAM NKURUNZIZA
KIGALI - The Ministry of Health has unveiled a new technology of using mobile phones to support public health, starting with support for Community Health Workers in mother and child health interventions.

The Phones for Health initiative is a unique public-private partnership which uses computers and mobile phones to establish a national electronic reporting system that eases delivery of public health care at the village level.

All health workers subscribed to this technology will be able to send monthly reports and emergency calls at no cost as a national method of harmonising health services.

Speaking at a one day workshop to discuss and provide input on the architectural plan and integration of mobile enabled applications in Rwanda’s National Health Information system, Health Minister Dr Richard Sezibera commended the development.

“This will help meet the broader information needs of the country’s health sector by improving coordination and communication. It’s an effective force multiplier against communicable and non communicable diseases,” he said Thursday, at his offices at Prime Holdings.

Sezibera admitted that combining biology and engineering will turn the health business into a communication institution which renders medication and healthcare delivery timely, precise, portable and personal.

He revealed that in most cases all that Community Health Workers demand during consultative meetings is transport and communication and that the initiative could never have come at a better time.

“We will do everything in our reach to avail computers and any other services where we operate,” Sezibera pledged.

Phones for Health partners include leading mobile phone operators like the MTN group, Accenture, Motorola and Voxiva.

Andrew Rugege, the Chief Operations Officer of MTN Rwanda challenged the public to quickly adapt to this new way of improving the working conditions of health workers across the country.

“As MTN we shall also go as far as it is necessary to build human capacity in Rwanda to make these strategies possible and successful because our best customer is a healthy one,” Rugege said.

Ends





This is How We Live

26 04 2009

2 years ago my scholarship in China was cancelled and I got a chance to continue studies at KIST, just on a loan from The Student Financing Agency for Rwanda ( SFAR – www.sfar.gov.rw ) . The Rwandan Education system has improved much a lot in last 15 years after the terrible events of 1994, but sometimes you can still find some problems in schools .

Beyond the quality of  ” technical stuff ” we learn at KIST ( as Engineering students ) , students still facing some living issues and more . The following is an article I get from The New Times following an issue in late disbursment of students loan .  I am feeling sorry for those in dilemma .

” KIST students still in dilemma
BY CHARLES KWIZERA
Students risk failing exams for lack of allowances

Students at the Kigali Institute of Science Technology (KIST) are facing welfare hurdles to the extent that some have been expelled from their residences due to arrears accumulated in rent.

Early last month this paper disclosed the financial constraints that KIST students were facing caused mainly by the delay in the disbursement of their allowances which are given to all government-sponsored students. But according to reports, the problem looks to be far from over.

KIST, which has a population of over 2,600 students, can accommodate only 200 on campus leaving the rest to seek accommodation elsewhere: These are the ones facing challenges with unpaid rent.

The Rwf 25,000 per month given to every student through the Students Financing Agency (SFAR) in all public universities in the country covers accommodation, feeding and facilitation expenses.

Speaking to The New Times, some students who have been evicted by their land lords confirmed that they are spending their nights in the campus hall watching movies.

“I am spending my nights in front of the television at the campus hall because I have been kicked out of the house by my land lord,” said Fabrice Mugisha one of the students.

This comes at a time when students are preparing to sit for their end of semester exams which, according to the students’ representatives, may lead to poor performance.

“We are about to begin our exams and students are facing financial constraints which may lead to their failure in the coming exams,” said Guild president Martin Ruvugabigwi.

The vice Rector in charge for Finance and Administration (VRAF), Thomas Gatabazi, had last time attributed the delays to changes in the system in which the money was being disbursed.

Gatabazi had also promised that the problem was going to be solved at once since SFAR had released money for January and February, but students got money for January only.

In a phone interview, the head of SFAR, Emmanuel Muvunyi, said that the agency had already sent  money to cover the period up to March, but said that Gatabazi had told him that there were some issues they were still trying to solve.

When contacted last evening, Gatabazi said that he had been trying to solve some errors that had occurred in the processing system at National Bank of Rwanda (BNR) and Bank of Kigali (BK) where the students have accounts.

“I have been trying to solve some errors that occurred in the students’ lists with BNR and also looking for a way with BK in which we can smoothly give out the money,” he stressed.

“The problem has been solved and the people at BK told me that they were going to start giving out the money to the students today at 4.00pm.”

However, by press time the students had not received the money.

Ends – THE NEW TIMES . “

If you feel like there is a concern in this post, please leave me a comment .

Antoine





Pushing it forward, The Summer of Love !

23 04 2009

A couple of weeks ago, I definitely started using Ubuntu “officially”  on my new laptop, and I realized that it’s really SUPER-COOL . This is one of the most successful Desktop Linux distros .The reasons are so many : I was obviously tired of windows and most of my colleague coders are using Unix-based O.S. This was also one of my great goals of 2009 and it may be a reason to say “GanBei” in Chinese for those who knows . I will no more rely on Cygwin or MinGwin for coding C/C++ or Qt with Eclipse .

The are really big efforts deployed in open-source world to produce for free those SUPER-COOL tools like Linux or other tools we use in our everyday life or others used by institutions and organizations . Open-source is a kind of “green business” whose model is not understood by many people, vulnerable to failure but very remarkable for their success . There isn’t a single development on this world which is not aware of this kind of revolution . It should be the change we wish to see !

2009socwithlogoOne of the greatest programs in contribution to open-sourrce is the  Google Summer of Code(TM) ,“Since its inception in 2005, the program has brought together nearly 2500 successful student participants and 2500 mentors from 98 countries worldwide , all for the love of open source coding – Google . I am happy to be accepted again for the 2009 version of GSoC . I will be working with OpenMRS an open source medical record platform for developing countries . I will be working on the Data Synchronization feature of OpenMRS and my primary mentor Maros is also a kind of super-cool ; I met him last year in Kigali .

OpenMRS has been deployed in different african countries especially as EMR system for fighting against AIDS, Malaria and Tuberculosis , ” Our world continues to be ravaged by a pandemic of epic proportions, as over 40 million people are infected with or dying from HIV/AIDS — most (up to 95%) in developing countries. Prevention and treatment of HIV/AIDS on this scale requires efficient information management, which is critical as HIV/AIDS care must increasingly be entrusted to less skilled providers. Whether for lack of time, developers, or money, most HIV/AIDS programs in developing countries manage their information with simple spreadsheets or small, poorly designed databases…if anything at all. To help them, we need to find a way not only to improve management tools, but also to reduce unnecessary, duplicative efforts. As a response to these challenges, Open Medical Record System (OpenMRS®) formed in 2004 as a open source medical record system framework for developing countries — a tide which rises all ships. OpenMRS is a multi-institution, nonprofit collaborative led by Regenstrief Institute, Inc. (http://regenstrief.org), a world-renowned leader in medical informatics research, and Partners In Health (http://pih.org), a Boston-based philanthropic organization with a focus on improving the lives of underprivileged people worldwide through health care service and advocacy.     – OpenMRS “

There are many special things in this Summer of Code : I have a neighbour summer of code student, Mugisha in Kampala (Makerere University student), who is working with the same OpernMRS project, so we should even have our meet-up in East Africa . This is the fifth anniversary of Google Summer of Code, I hope we will make it the best summer of code, yet the Summer of Love, love for coding . I love coding on my Ubuntu Laptop !