Tool in hand again!

So finally after a few days, I can see the ripples in the sea of my working time getting stagnant. I had a few fierce engagements which did not allow me even open the lid of my laptop(had issues with my birth certificate, passport appointment etc.). Although I managed to work everyday in tiny fragments this week yet I am encapsulating all up in this post as the work is not much.

So I began with Django which became the apple of my eye after Jasvir’s presentation(sometimes I feel I am moved too easily but this time I researched and then moved astray :P). I really hold the view that people tend to hate the things they don’t understand. So I began with the much recommended and hyped “poll app”. Today I did the following things:

    • installed Python 2.7.5+
    • installed Django version: 1.8.dev20140823121328 from GitHub as under:
git clone git:// django-trunk
sudo pip install -e django-trunk/

because I failed to download despite trying many a time.

Tomorrow I will begin with the poll app. Meanwhile I have also joined the $2500 course LinuxFoundationX: LFS101x Introduction to Linux for free on edX(search GD to hunt for more :P). Although I think I have a quite a decent acquaintance with Linux by now yet the learning, this way, is a fun indeed! I spare a little time for this course as this is self-paced and I try to go for this when I feel like course-rotating.

I have ended up with:

Welcome and Introduction

Chapter 01: The Linux Foundation

The chapter 01 consisted of the following:


  • The Linux Foundation is a nonprofit consortium dedicated to fostering the growth of Linux.
  • The Linux Foundation training is for the community and by the community. Linux training is distribution-flexible, technically advanced, and created with the leaders of the Linux development community.
  • There are three major distribution families within Linux: Fedora, SUSE and Debian. In this course we will work with representative members of all of these families throughout.


The sort of video lectures in the course make learning a thing to crave for a devoted learner. And the “tool” in the title of the post is my “laptop”. :P

Track Payment Status–Pending(Passport, India)

Applying for passport online from is quite a good practice. You may get the appointment the very next day if slots are available, sitting at your home just a click away. But you may face some minor technical problems like I faced a few but you need not worry. I faced a couple of problems while making payment online through my debit card. Firstly I forgot my password, recovering which is quite a simple task. To recover your password just click on forgot password and it will direct you to through the procedure to recover it. Go for OTP(One Time Password) it will text you a number on your mobile number. Once you recover it, I recommend you to jot it down somewhere lest you may forget again. :P

Then the second problem that I faced was that after recovering the password and making the payment through my debit card, the amount was deducted from my account(I got message on my phone) but was not reflected in the Track Payment Status link. It showed the payment status as pending despite the amount had been deducted instantly from my account.

I e-mailed at and called at Service/Helpdesk Phone No.: 011-41561114 too but you know government helpline numbers are seldom picked.

Solution: After making the payment, logout of your account on and re-login to your account. Then click on View Saved/Submitted Applications then select your application and then you will see a link Re-verify Payment. Click on this link and ENJOY! :) Although this is a sort of bug in the website but I tried to provide the instantaneous solution so that we may not run hither and thither for the solution.

The GSoC 2014 clock halted!


So a few days back the GSoC 2014 came to an end. After the midterm evaluation, I had the following tasks to be completed:

  • A Navigation bar
  • Search by Trait
  • User rights management
  • Validations
  • Update usability
  • Status flag (whether the value is approved)
  • Admin privileges
  • Data import
  • Data export

Navigation Bar: A decent adorable Navigation bar may be seen at the top making it easier to use the features of the extension.


Navigation bar

Search by Trait: A user can search for the values of traits by selecting any one of the traits from the drop-down. The drop-downs are enhanced throughout the extension as it avoids user-mistakes (typo mistakes).

Search by Trait

Search by Trait

User Rights Management: There are a certain features like delete material, delete trait etc. which should be accessible only to people having special privileges like sysops and bureaucrats so that the data / content is preserved from the tampering of malicious users.

Validations: It is again an essential part of the application as the data to be entered should be valid and consistent. In order to keep a check on this, HTML5 is brought into action to serve for proper validations.

Update: This was also an inevitable and desired feature which lets the user edit / update an attribute or a value which may require rectification or updation later on.

Status: This flag indicates whether a particular value is approved by BRL-CAD admins or not. Digit “1” denotes “approval” whereas “0” denotes “pending”.

Admin privileges: The super privileges of admin include delete material, delete trait and approve the values.


Admin privileges

Data import: Right now the data can be imported in one format ie JSON. This feature would be extended soon to import data in some other formats.

Data export: The data can be exported in JSON, XML and CSV.


The extension already supported the following features by the midterm :

  • Sign up / Sign in using the MediaWiki modules.
  • Add Material
  • Add Trait
  • Delete Material
  • Delete Trait
  • Search by Material
  • View all Materials
  • Keeping track of when a material/trait was added using timestamp.
  • Keeping track of the user who added material/trait.

So far this was one of my best experiences with working on live projects and that too of international stratum. I am lucky to have contributed to BRL-CAD which is the epitome of its field. I can apparently observe in myself qualities recently evolved like time management, focus, grappling-ability with deadlines and above all confidence. Talking to international developers was like unprecedented opportunity for me. All in all, GSoC 2014 taught me a plethora of things which I would not have learnt by resting in my own isolated well. I would also like to extend my latent thanks to my latent benefactors. :)

I am now looking forward to improve the Materials Database Extension so that it can be used more effectively.

MediaWiki Extension and GSoC 2014

I have been working on MediaWiki for my Google Summer of Code 2014 program. I am making an extension in MediaWiki which can store traits of materials in an organized way, display them, allow them to be searched, support import / export  and so on.  The project can be split up into two parts–Back-end and Front-end. The Back-end consists of a well structured database to store the material traits and the Front-end consists of making a web interface in MediaWiki using its special page functionality.

MediaWiki ExtensionAdd New Material - mikiwiki 2014-06-26 23-05-17

Technical details:


MediaWiki is a free and open source wiki software, used to power wiki websites such as Wikipedia, Wiktionary and Commons, developed by the Wikimedia Foundation and others. It also runs thousands of other websites. It is written in the PHP programming language and uses a backend database.

There had been some work done on this project in the previous years but that was a standalone project in PHP not in MediaWiki. I have retained the primary database design and trying to port the whole previous work into MediaWiki extension. Whole of my MediaWiki extension is mainly written in PHP but it’s been wrapped in the functions of MediaWiki which means simple PHP , HTML , SQL etc. cannot be embedded as it is.


The extension at present supports:

  • sign up and sign in using the MediaWiki modules.
  • adding a new material through a form,
  • adding  a new trait through a form,
  • adding a new trait-type through a form,
  • adding a new material-type through a form.
  • viewing all materials and their traits with values etc.
  • storing all the data in the database of MediaWiki.
  • keeping track of when a material/trait was added using timestamp.
  • keeping track of the user who added material/trait.

I have displayed the materials and their properties by storing the names of all the tables in an array-variable and then by using for loop and MediaWiki Joins, displayed the contents of all the tables. For preventing the user adding the same material or trait again and again, I have added the names of all the materials and traits in an array and then compared the value of the textfield in the form with the values at the array-indices. One of the biggest problem I faced was how to embed the code of various extensions into one extension to get all the functionalitites into a single extension. Finally I jumped over this pitfall by storing the new classes which extend SpecialPage class of MediaWiki into a single file using variables which are meant for this.

I have also deployed the extension on my college server which can be seen working here:

The code is structured into five files which have all the coding to be executed,  loading classes,  displaying messages on wiki and  internationalization of extension and  the SQL file for defining database design respectively.

The hardest part encountered till date was displaying all the contents of all the tables by using MediaWiki joins and merging the code of various extensions to make it a single extension exhibiting all the functionalities. Also executing SQL queries according to MediaWiki is a bit tough to grab at once and trying to code anything at first seems hard as the documentation of MediaWiki is quite mature.

What keeps me motivated is my mentor and the beauty of mediawiki although it appears to be sophisticated sometimes but being deployed worldwide and used by giants like WikiPedia motivates me to learn it all.

Lines of code: 700 approximately (effective). Github shows 10 commits / 2,508 ++ / 1,501 — in the main repository and 4 commits / 276 ++ / 10 — in the testing repository. I have written this extension from scratch so no refactoring.

My next steps would include implementing features like:

  • editing the added data,
  • importing/exporting in CSV, JSON formats,
  • advanced search,
  • making the number of edits viewable for both
  • and a few other things like better search filters etc.

Assortment of Technologies and Tasks

Today I reached TCC at 9:10 am ,will reach tomorrow by 9:00 am  exact. Straightaway went out and opened LUA second day consecutively. Today me , Kamalpreet and Gurjot tried to make a bit sophisticated model in librecadv3 using LUA.

TODAY’S tasks:

1. After exercising adequately  how to make lines, circles etc. in librecadv3 through Lua Script, we ended up making a “limp stick man”. It was quite appealing to see but wasn’t that tough. :P

2. Explored object oriented PHP which I wish to deploy in GD-CAD materials database.

3. Helped colleagues with their problems esp. the one’s who couldn’t fathom compiling librecad3 even after reading the mail. I think that is just because they are totally laymen for Linux.

4. Looked for how to locate the points of our  choice on Google maps with the help of longitudes and latitudes.

5. Thoroughly enjoyed the presentation of Hitesh Sofat, got to learn many a new thing about frameworks, MVC, bootstrap and so on. Looking forward not to miss any of such presentations. :)

6. Honestly after reading Sir’s mail in brlcad mailing list, I really feel need to manage time so so judiciously because I feel the time after coming from TCC is not sufficient to complete my GSoC project in time as I am still a novice in programming. Need to do things wisely esp. time management.

The Dawn of Training

Today was the second day my training officially and I wish the dusk of my training does not  follow the dawn. I had been waiting for this period from so long with all my eagerness. I have been assigned to work on the GUI of GD-CAD throughout my 6 months training and not merely only this. CAD is the area of my interest I think as I am an admirer of maths, a lover infact. So today I did the following:

1. Learnt many a new things from Gagan’s presentation. Got a feeling that everything is tough till we get over it with our hard-work. We need to be consistent in our hard-work and devotion. And I personally feel I need to rebuild the self destructed castles. :) Got a very decent view of how all CAD softwares work.

2. Walked further on the road of LUA, pretty pleasant language which itself endeavours to be understood.

3. Enjoyed various other presentations of other GD members. Got to learn many a new thing.  Rejoicing the CAD-fest. :)

4. Felt elated to be of help to all my GD family members. In a way I feel challenged to answer the things and queries of my fellow-mates. I am persuaded to learn the things or concepts I might have skipped.

5. Installed linux OS on various systems. It’s a two way learning. Felt good that even a new junior GD member taught me how to make a bootable pendrive from ubuntu startup disk creator. There is no shame in learning from juniors. Knowledge gaining is irrespective of seniority or juniority. :)

“Awesome” Mediawiki Extension

I have been studying about how to make an extension in MediaWiki. Recently I came across an extension called “Awesome”. What it does is that is simply boldens all the words which have the occurrence of the word-pattern “awesome”.

Procedure to install an extension in MediaWiki

Generally, at the end of the LocalSettings.php file (but above the PHP end-of-code delimiter, “?>“, if present), the following line should be added:
require_once "$IP/extensions/extension_name/extension_name.php";
(Here $IP is the absolute path where your MediaWiki is installed).
This line-code forces the PHP interpreter to read the extension file, and thereby make it accessible to MediaWiki.
Some extensions can conflict with maintenance scripts, for example if they directly access $_SERVER (not recommended).
In this case they can be wrapped in the conditional so maintenance scripts can still run.
if (!$wgCommandLineMode) {
   require_once "$IP/extensions/extension_name/extension_name.php";


Ensure that required permissions are set for extensions!
While this installation procedure is sufficient for most extensions, some require a different installation procedure. Check your extension’s documentation for details.
If you want to alter configuration variables in LocalSettings.php, you have to do this typically after including the extension. Otherwise defaults defined in the extension will overwrite your settings.
Caution! Caution: While extension declaration can be placed in other places within the LocalSettings.php file, never place extensions before the require_once "includes/DefaultSettings.php"; line for MediaWiki versions below 1.17 . Doing so will blank the extension setup function arrays, causing no extensions to be installed, and probably will make your wiki inaccessible until you fix it!

We can see the extension working via the following images, see the “awesome” word being boldened: