On Freedom

This is more like making a transcript of two very interesting conversations – one over phone call and the other over Google chat. The one over Google chat happened earlier – musician friend who’s doing his music studies in Berklee, (the very royal Music School we all know of) suddenly starts an argument asking ‘Why this insistence on Open Source, at all’. My usual instincts naturally turned it into a conflict, where I was putting much effort in explaining how it is much important to provide people with the four basic freedoms Free Software is concerned about. At one point he said, “Yes, but isn’t it a bit insane? It’s like saying that Clapton is an evil musician if he doesn’t, with all his cds, give separate tracks for everyone to mix and listen the way they want!” Well, it would actually be a little insane if he did so. We left the conversation there – I had to run to catch my flight back to India. A week later I was talking to my other friend over phone and we somehow came to the same argument in a slightly different mode – this friend of mine has been an Open Source contributor/ enthusiast for a long time now, currently doing quite a bit of very cool things in MIT (apparently getting a PhD degree there). If you are wondering, yes I am blessed with many cool friends. He quoted his colleague Brian, whose view is – ‘You can write a software in two ways. You can write it as a piece of work or you can write it as a piece of art.’ If you are writing it as a piece of art, you might want to have your identity protected. Here’s where I was reminded of my conversation with Salil. An artiste might not want his creation to lose the identity of his own self that is obviously very attached with that particular piece of art. So, that sort of saves us from the sin of calling the great Clapton evil. (I love him!) But what I would still be believing is – every individual should  have the right to study the source and also to share it. Modifying a software in some random ways or even sometimes in some apparent organized way might be for no good. The creator has the right to protect it if he has to, I believe. Even if it does involve taking away the freedom to modify, from the users. It does not make the developer evil. It makes him an individual who wants his identity to be preserved in his piece of art, for good.

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.

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

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

– 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.


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. 

    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 🙂

    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