Wednesday, 8 May 2013

পঁচিশে বৈশাখ না মাথা!

অনেক হলো বাপু, এসব পঁচিশে বৈশাখ ফৈশাখে মাচা বানিয়ে বেসুরো গান টান গুলো এবারে আইন করে বন্ধ করা উচিত। শুধু তাই কেন, অনুষ্ঠান চ্যানেল গুলোতেও ক্যাবলাকান্ত সঞ্চালককে ধুতি পরিয়ে, পাউডার মাখিয়ে, স্ক্রিপ্ট ধরিয়ে বসানোটা  ঠিক না। বেচারা কথায় কথায় রবিঠাকুরের এদিক সেদিক কথার তাৎপর্য বিশ্লেষণ করতে গিয়ে ঘেমে নেয়ে একসা! ছুটির দিন, কোথায় একটু মাংসভাত খেয়ে দুপুর বেলা পাশবালিশ জড়িয়ে বিউটি স্লিপ দিয়ে, বিকেল বেলা হাপপ্যান্টু পরা আঁতেল সেজে সাউথ সিটিতে আইসক্রিম খেতে যাবে। তা না! এমনিতেই তো রবীন্দ্রনাথ ছোটবেলা থেকে কম ঝামেলা করেনি। আষাঢ মাসে 'যাসনে ঘরের বাহিরে' বলে caution-বাণী, আবার শ্রাবণেই দেখো 'মন দুলছে অকারণ হরষে' - ভাব সম্প্রসারণ লিখতে লিখতে মগজ ডিপ ফ্রাইড। এট্টু কলেজ গন্ডিতে এসে যখন প্রেমে হাবুডুবু, এদিকে ওদিক থেকে সিগনাল থেকেও নেই -  'আরে এত ভ্যানতারা করার কি আছে , তোমার কপালে আমিই নাচ্ছি' বলে ল্যাটা চোকাতে ইচ্ছে করছে, তখন আদতে sms করতে হচ্ছে 'আমার পরান যাহা চায়, তুমি তাই '। মানে, কি ন্যাকামো মাইরি! ছোটবেলা বেলা থেকে এত রোমান্টিক পদ্য শেখালো বুড়ো, এট্টু ট্রিবিউট না হইলে চলে? হতচ্ছাড়া ঢপবাজ প্রেমিক অনেক খেলা দেখিয়ে ফাইনালি বিদায় নিলে, রেগে বলার উপায় নেই - 'যাক বাবা আপদ গেছে, বাঁচা গেছে'। নাঃ ! চোখ লাল করে, সিগেরেট ধরিয়ে বলতে হবে 'তোমার লাগি অঙ্গ ভরি করব না আর সাজ, নাই বা তুমি ফিরে এলে ওগো হৃদয়রাজ!' পাশের বাড়ির মঞ্জু কাকিমার সাথে, ওর অফিসের কোন এক কলিগের কিসব চলছে, কিন্তু মন দেওয়ার যো আছে? এখনো কাদমম্বরীর দিস্তে দিস্তে গোপন চিঠি বাজারে আসছে। ঐদিকটা ছাড়া যায়? আমি এসব দিক থেকে ছোট্টবেলা থেকেই হেব্বি স্মার্ট ছিলাম। কারোর দয়ার আশায় বসে না থেকে, নিজেই রবীন্দ্রসঙ্গীত লিখতে আরম্ভ করে দিয়েছিলাম। বছর পাঁচেক বয়সে অমন খাঁটি মার্কেটিং strategy কে মাথায় ঢুকিয়েছিল কে জানে!

রবীন্দ্রনাথ কে মাঝে মাঝে ভুলে যাওয়াটা দরকার। তাই এরপর যখন ট্রেনের জানলা দিয়ে বাইরে সবুজ, ওপরে নীল  দেখতে গিয়ে চোখ আটকাবে, আর কিছু একটা বিড়বিড় করতে গিয়ে দুম করে গুনগুন করে উঠব - "নীল আকাশে কে ভাসালে, সাদা মেঘের ভেলা রে ভাই, লুকোচুরির খেলা" - কাউকে শোনানোর জন্য নয়, স্রেফ আর কিছু গাইলে এত আরাম পাওয়া যাবে না বলে, তখনই তৈরি হবে কোনো মুহূর্ত, বা অনন্তকাল। যেভাবে হারিয়ে যাওয়া কাছের মানুষকে মনে পড়ে, যেভাবে অনেকদিন না গাওয়া প্রিয় গান মনে পড়ে, সেভাবেই। সহজে। 

Tuesday, 23 April 2013

Of Sad things and Women



All cultures, I suspect, contain the seeds of violence when it comes to female sexuality, and I learned something about Draupadi's situation from Tolstoy's famous novella The Kreutzer Sonata. The novella grew out of the Russian writer's own relationship with his wife, and it describes the events that lead to her murder. The husband has violent and humiliating sex with her, and he feels miserable each time he rapes her. Since she is merely an object of bestial desire, he decides that he must kill her to put an end to his misery. After her death, she becomes 'human' in his eyes, and he even begins to have compassionate feelings for her. The murdering husband concludes that women will never be treated as full human beings as long as sexual intercourse exists. They will always be humiliated. 

-  Gurcharan Das, The Difficulty of Being Good

Brutal, but.. somewhat true.

Saturday, 13 April 2013

মোরা এই ভাষাতেই করি গান, রাজা শুনো ভরে মনপ্রাণ!

আমি চাই সাঁওতাল তার ভাষায় বলবে রাষ্ট্রপুঞ্জে,
আমি চাই মহুল ফুটবে সৌখিনতার গোলাপকুঞ্জে
আমি চাই নেপালি ছেলেটা গিটার হাতে,
আমি চাই তার ভাষাতেই গাইতে আসবে  কোলকাতাতে!

- Kabir Suman

This be the definition of Internationalization and localization. Rather, this be  the reason - why I want it. I remember being in Pune in February for the Language Summit. I remember looking at the language engineering team members putting all their efforts to make the tools happen. I remember myself realizing how they were not doing it just because they had some really good idea about the technology that is involved, also they were determined to give people the fundamental right of using the technologies they use all the time - in their own languages. Yes, it was a week before 21st February - International Mother Language Day. I kept realizing that there could not be a more meaningful way to show how much your language means to you. How much language means to you. As Amir of our Language Engineering Team has said - 'If you can't use a program in your own language as easily as in English, it's not a missing nice-to-have feature, but a bug'

There was no specific reason to write up this post - rather I was supposed to write up something totally different and relatively saner. But, this song was playing in my ears and I had to say how I felt.

Thank you.


Saturday, 6 April 2013

OPW : A beginning indeed

Time flies when you work! :-)
It is indeed very hard to believe that three months of OPW internship have passed already, and it is actually a time to write up the Final Project Report. Well, it is satisfying in some ways.

So, here goes!  

My Project: EtherEditor is the MediaWiki extension developed by Mark Holmquist, which allows collaborative editing of wiki pages via Etherpad Lite. Now, the whole idea of Free Software movement, or any other thing, which is believed to be something so meaningful like a movement - gets a little less meaningful without the very idea of collaboration. Collaborative editing is something, which I find cool enough! So, I did  on a project, which does mean something to me. :)
  
Things done: 
  
Bug Fixes:  

# Bug No.:  39441 
Description: Add tooltips to the icons for session and user list
Fix: 
  •  Added title attributes to the span elements that represent user and session lists in the UI.
  • Didn't add any messages because "User list" and "Session list" were already around from before, when we had text in the buttons. 
Gerrit Status: Merged
# Bug No.: 39424
Description: Multiple pad per page clarification
Fix: Two fields have been removed from the database, and we no longer track multiple sessions per page. 
# Bug No.: 39443
Description: Submit action in normal edit form enables collaboration. Why? No reason.
Fix: Fix for #Bug - 39424 tangentially fixes this. Had taken care of this bug in the same patch as earlier. 
 
# Bug No.: 39389
DescriptionSuggestion: tab "collaborative editor" OR "edit" (standard editor) tab in correspondence to the user preference setting.
Fix: Added a user preference to enable collaboration bu default. Useful for people who know they will be collaborating often.
Gerrit Status: Merged.
Bugs Reported: 

# Bug No. : 44122
Description: If a pad gets deleted on EPL, EtherEditor has no clue what to do.
Fix: Open for everyone. Yet to be fixed!

Architectural Changes - No more storing sessions :
  • Getting rid of the feature of having multiple pad per page needed a lot of work. I started going deep into the flow of the whole structure.  Spent a lot of time removing stuff from EtherEditorPad.php, ext.etherEdtior.js etc
  •  Cleaned the database up and updated the changes to  EtherEditorHooks.php. Removed the fields admin_user and public pad from ethereditor_pads, EtherEditorHooks.php was updated accordingly. So, by the end of the third week, I was able to get rid of the two bugs that I was talking about - and a few more ( like, the preview feature was broken too.)  
  • Alternative construction of the URLS: The shareURL did not need the padID in it anymore, as the feature of having multiple pad per page was removed. The padURL needed to be reconstructed too - Pad URLs need to be built on the server side because of the information involved. The important parts are the URL to the base of the pad directory and the group ID. We get the first from the configuration of the wiki (it's part of the stuff you configure before you can use the extension), but the group ID is brought over from the Etherpad Lite instance. Groups are the only way we can implement any authentication, so we use them for everything. They also help us by solving the problem of special characters, since hashing the page name gets rid of anything Etherpad Lite might deem inappropriate for pad URLs. We just pass in the literal string "original" as the pad name and be done with it.   
 
EtherEditor - User can enable it manually by checking the collaborate check-box
 
 
New Feature : User Preference to enable EtherEditor by default. 

Here's the checkbox added in the preference section

Client side updates :
  • Updated the Client Library in EtherEditor : Forked the etherpad-lite-client from the git-repository and cloned it to core/extensions/EtherEditor/includes/ , well more specifically updated the EtherpadLiteClient.php file with the new php file from the cloned etherpad-lite-client followed by some unit testing.
  • The issue with the Format Buttons bug was due to the client-side script in ep_ethereditor (the etherpad plugin we maintain that enables all of the formatting magic) has an incompatibility with the newest release of Etherpad Lite's API - as we suspected. So a fix there.
Documentations:  
  •  Meet the Functions! While working with a few bugs and features, finally after quite a bit of struggle with the code, I had kind of felt that a brief introduction to the functions that I am dealing with would be good to be documented. 
  • EtherEditor - How it Works! : A very important documentation of almost all the how's, you can come up with - related to this extension.

Feedback on Project: I loved it! I would not say I never got frustrated, demotivated or blocked. In fact there was something like that from February End - March Beginning. A very unfortunate and confusing bug, did block my ways. Which is why - although two of my  patches fixes the respective bugs and a few more right now, is yet to be merged - we were solving the issues with ep_ethereditor . But, I guess, this is also one of the many lessons I got to learn - to deal with situations like this and get going.
Feedback on OPW: It was special. :-) I always had my reasons to contribute to FOSS. OPW gave me the platform. It was indeed very special.

Disclaimer : This not a bye-bye post. This ain't an end to anything. I strongly believe, that after a few years in FOSS, I would come back to this post and look at it as how I started something meaningful - a journey, maybe :-)

Friday, 29 March 2013

User Preference to enable EtherEditor by default: Yay! A new Feature

So, EtherEditor is about to see a new feature. Happy News!

There is now a User Preference where users can get EtherEditor by default by just checking a checkbox in the Preference section of their own userspaces.

It was needed, as: 

Having two different entry points / interfaces for editing articles is inconsistent and will confuse users. In addition, if EtherEditor functionality is ever rolled out to a wider audience, having two tabs for edit/collaborate would be unacceptable from a design perspective for the same reas on (on a bigger scale) and we'd have to re-engineer it --> might as well do that engineering now. That said - if it's easy to simply add a checkbox and split the interfaces, it's a fine idea for the short-term. My recommendation is to stick to the "Collaboration mode" checkbox since it's just as discoverable as an extra tab in the site chrome and will do more for consistency in the long-run. It still needs UX improvements, which will happen gradually. 


Now, let's look at some code, I wrote:

Define function:  public static function getUserPreference( $user, &$preferences ) {...}

  
Attach hook: $wgHooks['GetPreferences'][] = 'EtherEditorHooks::getUserPreference';


Code: 
     /**
    * Hook: GetUserPreferences
    * @param User $user
    * @param array $preferences
    * @return bool
    */
    public static function getUserPreference( $user, &$preferences ) {
        $preferences['enableether'] = array(
            'type' => 'toggle',
            'label-message' => 'ethereditor-preference-button',
            'section' => 'editing/advancedediting',
            );
        return true;
    }

 

..this adds a checkbox in advanced section of the editing tab of Preferences, which says 'Enable EtherEditor by default'. 

Which when checked, following part gets executed: 

_this.initializeControls( function () {
            if ( _this.uri.query.collaborate || mw.user.options.get( 'enableether' ) ) {
                $( '#ethereditor-collab-switch' ).prop( 'checked' , true );
                    _this.enableEther();
                }
                if ( _this.uri.query.padId ) {
                    var thepad = false;
                    for ( var px in _this.pads ) {
                        if ( _this.pads[px].pad_id == _this.uri.query.padId ) {
                            thepad = _this.pads[px];
                            break;
                        }
                    }
                    if ( thepad ) {
                        _this.dbId = thepad.pad_id;
                        _this.padId = thepad.ep_pad_id;
                    }
                }
                _this.authenticateUser( function () {
                    $( '#ethereditor-collab-switch' ).prop( 'checked', true );
                    _this.enableEther();
                } );
            }

        } ); 


Which obviously enables the EtherEditor. And thus, user gets the extension enabled by default. :-)

For a better look at the code, visit my gerrit repository  
 

Curious Case of Format Buttons in EtherEditor

I do realize that I should have written this update some weeks back. But it is still not too late, I guess. :(

Well, the exact problem with the format buttons in our extension was : It was not working.
And the confusion was, if any of the changes that I had made in past has made it stop working. Although it should not have been that way. So, yes. It was pretty confusing. And I was kind of blocked.

All we found out was:

  • The server-side database issues that could not be debugged for some reason (maybe because the database doesn't have what we were looking for).
  • The client-side script in ep_ethereditor (the etherpad plugin we maintain that enables all of the formatting magic) has an incompatibility with the newest release of Etherpad Lite's API.

The fix in that ep_ethereditor solves the format buttons bug. But, it still needs to be taken care of a little.

Tuesday, 12 March 2013

On 11th March : The Report

Wikipedia at Avenir took place on 11th of March at Netaji Subhash Engineering College, Kolkata.

The event was basically a 4 hours Wikipedia Event - 1 hour of an Edit-a-thon with Kolkata based Wikipedians, followed by 3 hours of MediaWiki coding session on Wikipedia Gadgets and UserSrcipts. 

We had a  form that people filled up with a few simple questions — and picked out 21 from the 40 that signed up. But I met up with most of the people that had registered a couple of times before, informally. We discussed about JavaScript, Wikipedia, Wikimedia, MediaWiki, Free Software and OpenSource, as I personally like people to know why the would like to contribute to FOSS. And the fact that they would actually be contributing, its not always just about knowing a technology and doing a project. Yuvi and I met up with 15 of the people who had registered, two days before the actual event for an informal discussion - We talked about, why at all, we would have this event. This was quite useful. 

Event started with Indranil Das Gupta - giving a brief introduction of the whole idea of the event, and beyond. We were ready for the edit-a-thon already. Rangan Datta, along with Jayanta Nath conducted a nice session of editing. We created the Article 'Laskar Memorial, Kolkata,' together on English Wikipedia! This was important - not only because we need more Wikipedia Editors, but also we need developers for Wikipedia, who would understand the problem users face. So, I feel, an experience of editing is also much needed for a developer who is going to code for Wikipedia.
Editing Infobox on the page we were creating - Laskar Memorial, Kolkata''

 Yuvi, Harsh and I got started with MediaWiki coding session, after a break of 15 minutes. It was a plan, (after the last day's meetup) that Yuvi would start with the basics of HTML, CSS and JavaScript , as people were not much familiar with it. Almost two hours were spent on making them learn the basics of HTML, CSS and JavaScript, with people being quizzed on CSS Selectors (and doing very well!). We then started off explaining how to customize the look and feel of Wikipedia with stylesheets, and how to share your customizations with other people. We then spent some time drilling on Javascript basics, and how to learn more about javascript - pointing out the wonderful (and free) Eloquent Javascript interactive textbook. Some people expressed interest in having a deeper dive into Javascript / CSS, and we planned to meet again the next day for a more intense tutorial.


We, the people

The next day, about 8 of us met in the labs again at 11:00 AM and had an intense Javascript session lasting until 06:00 PM. People learnt Javascript basics, practiced using jsfiddle.net and then made small customizations to their wiki experience by writing scripts. A fair number of the students had gone from not knowing any HTML at all to being able to write Javascript in the space of two days, which I think is a pretty good achievement!

Everyone subscribed to the mediawiki-india mailing list before leaving, to make it easier to get in touch / get help with Javascript / CSS.