Stuff that I have been up to

December turned out to be a pretty busy month for me – here are some of the stuff I have been involved in/working on:

  • FOSS.in: As always FOSS.in ‘09 turned out to be an amazing affair. Being someone who works remotely, this event is probably one of the best opportunities for me to have “real” interactions. It’s a place where I can simply sit down, have long face to face conversations, come up with new ideas, be inspired, and most importantly, have fun. My heartfelt thanks goes out to the people behind the event for making this possible. I have some photos in this Flickr photoset.
  • Book reader: This month’s priority has been stabilizing the Sugarlabs/OLPC book-reader code, and a large number of important bugfixes landed during the last few weeks. More in this status report.
  • Arduino: At FOSS.IN, thanks to the efforts of the ever enthusiastic Kushal Das, I managed to get hold of an Arduino clone board (it is terribly difficult to get hold of one in Kolkata). I had heard of Arduino before and wanted to get one, and the session on it at FOSS.in by Russell Nelson finally served as the “kick” which made Kushal and me call up the local distributor and get a couple of boards for ourselves. I have been playing around with sensors support in Sugar for sometime (I helped make the Measure activity work on XO 1.5 hardware), and realized that this would be yet another interesting way to connect Sugar with the “real” world. So after a couple of weekends worth of work, I got Arduino support in Turtle Art.


    Turtle Art with Arduino

  • XO keyboards: There may be a new AZERTY keyboard for the XO laptops very soon. See this wikipage for details.
  • Pootle: The Pootle developers have released version 2.0, which is a vastly improved edition compared to the previous releases. I have been testing it out with plans to upgrade the Sugarlabs/OLPC translation server soon. While testing, I added a quick (and ugly) hack to implement msgfmt –check style syntax checking in Pootle. This would definitely make the process of integrating the translations with the upstream code much less painful – and here’s a screenshot (click on it for a larger version):


    Gettext syntax check in Pootle

Braindump on ebooks

The inspiration for this post comes from a talk by Alan Kay, entitled Beyond the Printing Press: Computers as Learning Environments for All Children. You can view the video recording of the talk here


The development versions of Read Activity is now shipping with Epub support. This makes me excited for quite a few reason. Of course, the most obvious reason to get excited is the fast growth and adoption of Epub as a standard for e-books. However, there is more to it…
Books, once again (after Gutenberg’s time) are changing. Gutenberg brought in the transition from hand-written books to large-scale print – and now we see yet another shift, where books are transitioning from ink, paper and the printing press to bits stored inside a variety of devices. Towards the beginning of the printing press revolution, there was a strong desire and tendency to mimic the “old” format as much as possible, in terms of look and feel. Gutenberg and his associates even hand-drew illuminated decoration on the Gutenberg Bibles, to retain the similarity to the older, handwritten copies of the Bible. In what seems to be an almost eerie repetition, today, in the ebook, we see a strong desire to mimic the traditional book as much as possible. (eg ebook readers trying to retain the older “UI” paradigm, efforts to make ebooks retain the formatting niceties of traditional books, etc). This is not unusual, or wrong. We are used to the traditional book, and it is important to make the path to transition as smooth as possible.
However, what makes me really excited at this stage is something else. It is the potential new things we could do with Ebooks, things that would not have been possible with books in the old format. This weekend, I did some changes to a Epub file, and extended the Read Activity a bit to come up with a few such things:

  • Audio-visual content inside books: This is almost obvious – with the transition to books which are read on devices having audio/video capabilities, the next logical step is to embed these into books.



    (Video from the Internet Archive, text from Wikipedia)
  • An interactive shell inside a book: An interactive Python shell inside a book teaching Python, so that small examples and snippets can be tried out inside the book, right away.



    (Text from How to Think like a Computer Scientist, Python edition)
  • A full blown, interactive environment inside books: A book on digital logic can have a small sandboxing area, where readers could connect the various virtual components together, and see what happens.



    (Text from Wikipedia and the Lorem Ipsum generator, demo from the Etoys project)

Of course, this is just a proof of concept, and probably most Epub readers will simply ignore the interactive content part. Moreover, there may be security issues with such books as well (the idea of having a Python shell inside a book will make many nervous) – but I think this is where Bitfrost, and its software implementation, Rainbow (which is essentially an isolation shell) comes in.
There is another way of “interaction” which I have not covered in the above screencasts – and this is something which is already available in traditional ink and paper books, especially text-books. Ebooks need to support “exercises” like fill-in-the-blanks, multiple-choice-questions, etc. There is an urgent need to support this, and this should be done in a standardized way. The local storage standard associated with HTML5 seems to be a possible way forward, though probably there might be better ways to do this (especially if we want the ability to have teachers remotely check and evaluate exercises done on e-textbooks).

Read and Epub and beyond

For the past few weeks, I have been spending most of my time implementing Epub support for Sugar’s Read activity. Epub is gaining increasing acceptance, and a few weeks back, Project Gutenberg started distributing many of their material in the format, and Google + Sony also seem to have started to distribute a large chunk of public domain books as Epubs.

Today I finally reached the stage where the work could be tested on an actual XO, and here’s how it looks:
Read opening a Epub file on an XO

The rendering is done using WebkitGTK (the Python bindings) and I was a bit concerned about the possible performance issues on the XO-1 (which has a relatively ancient processor, slow filesystem access, only 256 MB of RAM and no swap). The biggest worry was the loading time – since it involves pre-rendering the entire book to gather metrics for pagination (most Epub books I have come across do not have clearly defined page-breaks, so that has to be figured out), but to my surprise (and relief) the load time turned out to be quite acceptable.

Right now, the viewer supports a very limited subset of the Epub standard (and works only with XHTML based Epubs), but so far it has managed to handle all the files I have tested it with. The viewer is a standalone widget used by the , which should make it possible reuse the work to develop a Epub reader for GNOME as well.

Once the Epub support in Read reaches an acceptable state, the plan is to start working on implementing support for the draft Open Publication Distribution System specs, which allows ebook distributors to distribute e-books via XML catalogues. It makes sense to support this in Read, as well as in the school server, to ease the e-books distribution process. For example, if we have a large e-book collection for a particular deployment, it may not make sense to put all of them in individual laptops – instead allowing the user to browse/search the catalogue and download the books as and when required would probably be a better option.

ভাল আছি, ভালো থেকো

Listened to a wonderful rendition of ভাল আছি, ভালো থেকো by an old school-friend of mine, and I couldn’t resist posting the lyrics. Apologies to my non-Bengali readers.

আমার ভিতর বাহিরে অন্তরে অন্তরে
আছো তুমি হৃদয় জুড়ে।

ঢেকে রাখে যেমন কুসুম,
পাপড়ির আবডালে ফসলের ঘুম
তেমনি তোমার নিবিড় চলা
মরমের মূল পথ ধরে।

পুষে রাখে যেমন ঝিনুক,
খোলসের আবরনে মুক্তর সুখ
তেমনি তোমার গভীর ছোঁয়া
ভিতরের নীল বন্দরে।

ভাল আছি, ভালো থেকো,
আকাশের ঠিকানায় চিঠি লিখো
দিও তোমার মালাখানি,
বাউলের এই মনটা রে।

Updates

  • A global dictionary for Sugar:: While working on the bookreader capabilities of the XO, I remembered how on almost each and every birthday during my primary school years, someone would give me one of those “pocket” dictionaries. Even in college, I would see students coming from Bengali medium schools studying their engineering textbooks with a dictionary by their side. Thinking that it would be useful to have such a dictionary built into the Read Activity, I started coding, and after sometime, I had a utility which worked for not only Read, but for any random Sugar Activity. Just select some text, hit a shortcut key, and you get a model dialog with the definition of the highlighted word(s) (we are considering whether instead of only a shortcut, this should be triggerable via a persistent icon on the frame). Here is a video of the (prototype) feature in action.
  • L10n infra migration::Over the past few weeks, we migrated our Pootle based translation system to a new server. The transition seems to have succeeded without major hiccups, and I also managed to sneak in a feature which would show the status of a PO file (results of msgfmt –check, as well whether the file has been committed to the VCS or not) in the statistics view.
    New features in Pootle

Why should I bother ?

Warning: This is a rant. Feel free to ignore

I love coding in Python, and in spite of some of the occasional issues it can cause, I feel that it lets one accomplish whatever one wants to do with the minimal amount of magic incantations. So naturally, I have been trying to convince my friends from college to try out Python, but after a few incidents I’m not so sure if I have been doing the right thing. Couple of events will explain the situation:

Scene I – Interview for positions in one of the “big four” Indian IT companies:
Friend of mine has Python listed under the skills sections in his CV
Interviewer: ওরে বাবা তুমি তো পাইথন জানো। (TRANS:Wow (in the sarcastic sense) – you seem to know Python)
Friend: হ্যাঁ (TRANS:Yes)
Interviewer: আচ্ছা Java জানো কি ? (TRANS:So, do you know Java)
Friend: যতটুকু কলেজে পড়িয়েছে, ওইটুকু, তার থেকে বেশী জানি নাহ (TRANS:Not much, just whatever they have taught in college) (the college course covers Java as an example of a Object Oriented language, so it does not go very deep)
Interviewer: আচ্ছা, এটা বল তো… (TRANS:All right then, answer this)
Interviewer: pretty convoluted question from Java – involving complicated API stuff and such
Friend: বলতে পারবো নাহ (TRANS:Sorry, I can’t answer this)
Interviewer: যা, এইটুকুই জানো না, আর পাইথন ফাইথন কী সব শিখে ফেলেছ ? (TRANS:Bah! You don’t know such basic stuff, and on the other hand, you have learn’t Python and whatnot!!)

Needless to say – the guy did not get selected, and got rid of Python from his CV.


Scene II – Yet another interview, this time for a “research” position in academia
Friend of mine has been learning PIL, PyGTK, etc and has Python listed in his CV
Interviewer: আচ্ছা, এই পাইথনটা কি ? (everyone in interview panel make weird facial expressions) (TRANS:So, what is this Python “thing”?)
Friend: <explains>
Interviewer: আচ্ছা এটার এরকম বিচ্ছিরি নাম কেন ? (TRANS:So, why does this have such a weird sounding name?)
Friend: <explains, mentioning Monty Python, etc>
Interviewer: দেখো, আমরা তো এসব জানিনা, আমরা সাবজেক্ট জানি। তুমি বরং কি সাবজেক্ট জানো বল (TRANS:Look, we do not know these things, we know “subjects”. What “subjects do you know ?)
<..and the interview continued with some very standard (and stupid, IMHO) questions (most of which, I believe are lifted from this particular book). My friend answered all of the questions, except for one.>


Friend later tells me: ওইরকম মুখ বানালো – ওই দেখেই বুঝলাম হবে নাহ্‌ । আমি আর কোথাও পাইথন জানি বলছি নাহ্‌ । (TRANS:From their expression on hearing the word Python, I knew I was not going to crack this interview. I’m not going to mention Python in any future interview.)


When the first incident happened, I thought it was a isolated case. But after the second one, I don’t think it is (and there has been at least one other similar case as well). In fact, when the campus recruitment started for our batch in college, a very senior and respected faculty member told me that my chances of getting placed from college was very slim. I did not appear for any of the recruitment programs (and almost got fined by the college authorities for being “absent”), so I did not get the chance to test out his theory – but that’s a different story altogether.
For the second incident, one may claim that the interviewers were perhaps looking for someone who had a good “theoretical understanding” or had “strong fundamentals”, but I have my doubts (primarily due to the generic crappy questions that were asked afterwards). The first incident on the other hand, points clearly towards something being very wrong with the interviewer.
The question that arises after all this is, why should I ask people to learn Python, or for that matter anything that is not covered by the officially sanctioned syllabus ? On one hand, our “progressive” political leaders and leaders of our various industries speak about nurturing and enhancing “talent” to build a better India, and what not. In the real world on the other hand, at the very ground level, the same institutions that the leaders are supposed to be the patrons and creators of, encourage nothing but mediocrity. End result: each year, thousands of bright young students get turned into zombies. What a terrible waste… what a terrible waste…

Minor update: I realize that many have mistakenly assume that the requirements in the first interview had something to do with Java. It did not. It was a fresher interview, conducted during campus placements, and the students were expected to have zero experience. Many of the students who were actually selected were either placed in testing, or in .Net (mostly building/maintaining/troubleshooting ASP.Net/C# sites)

Updates..

This blog has not seen much activity in a while, so here goes:

  • Bought a HCL touch-screen based netbook. It’s somewhat ancient hardware, but most of the stuff works out of the box (except for the webcam, which does not even show up in lshal or lsusb). The touchscreen required a binary driver – but a Free/Open Source version seems to exist, though I could not get to calibrate the screen with the FOSS driver variant
    [Update: The webcam works - I had to press Fn-F5 to enable it. It is turned off by default to conserve battery.]
  • Taught myself (this was long overdue – but at least now I can admit that I did not know what I used not to know) how to properly write Python extensions in C. I started out with bindings for Hunspell (I’m reading up a bit on morphology nowadays, and finding it to be tremendously entertaining). There was a Python extension for Hunspell already, but it did not compile for me, and that pushed me to decide to figure out how to do this myself. One thing led to another, and so, as of now, there is (in progress) extensions for handling:
    • Hunspell. Usage instructions here
    • libgettext-po. This should be faster than the existing pure Python based PO file parsers out there. (maybe at some point, I could make Pootle/Translate Toolkit use this, and make the work of OLPC/Sugarlabs translation team members somewhat less frustrating.
    • XKB. I must admit that I took a shortcut for this, and this extension is actually based on the awesome libxklavier. The final plan is to develop a Sugar extension for managing the keyboard options and layouts using this extension. The code in the main git repository, though fairly complete in terms of what is required for Sugar at the moment, is not implemented via (py)gobject. Implementing the pygobject-based wrapper is turning out to be a bit more complicated than I initially thought, but some code for that is also available in this repository (it is somewhat easier now, since I know (at least most of of) what is happening under the hood).
  • Released a newer version of the FBReader activity, which is much more improved in terms of usability (eg: response to the game keys keys while the XO-1 is in tablet mode is much more smoother, and all the keys do something useful). People seem to be happy with the new release.
  • Coming back to the present, right now, among other things, I’m working on a few interesting (and important) enhancements for the book-reader(s). Some of them include support for long keypresses (eg: pressing the “square” game key for two seconds will show the table of contents), notification of critical power events (I realized to my horror during dogfooding, that in tablet mode, while the book reader is open in full screen, there is no way to tell how much battery-charge is left), etc. The bookmark support feature that I came up with a few months back needs a bit of polish, but I think I can make this show up in the next release of Read.

16th February, 2009

  • Pootle migration: We are moving the OLPC/Sugarlabs Pootle instance to a newer dedicated server, which should speed it up considerably. This has also given me some opportunity to fine-tune and polish our l10n workflow – things should be a bit more easier and smoother (and faster) for translators. I also managed to gather some interesting data from the log and user registration files. It turns out that we have more than 1000 translators registered with the system, among whom about half have actively contributed translations in the past one year. I’m not sure what the user statistics for other Pootle installations are like, but it seems that we are one of the larger users of Pootle out there.
  • Read hacking: I have been also spending some time hacking on Read. While Mr Super Awesome Tomeu has been pushing our Evince patches upstream, I have been working on a few interesting features for Read (we have moved to Gitorious, which is so cool):
    • Support for books from the Universal Library: Many of the scanned childrens’ book from the Universal Library Project are too graphics heavy for the XO hardware to be handled in PDF form. However, it looks like the project also stores the book as zip files with each scanned page archived inside the zip file as individual jpegs – which in other words, is very similar to the comic book archive format which Evince (Read’s backend) supports quite nicely. More importantly, this format seems to have lesser performance issues on the XO hardware (compared to graphics heavy PDF files). So I have been making sure that Read also handles this format gracefully.
      Book from the Universal Library in Read
    • Bookmarks support:This has been one of the oft requested features for Read, apart from annotations. The original design specs for Read already provided me with ideas on how the UI should look like, so with some amount of coding, I have bookmark support which mostly works :-) . I am also trying to do the implementation in such a way so that it would be easy to add support for sharing of bookmarks later on in the future. If anyone is interested in doing a project, contact me (hint.. hint ;-) )
      Bookmarks in Read

    Code for the above lives in the sayamindu-sandbox branch of Read’s Git repository. I plan to take a stab at annotations during the next few weeks – I have some ideas which, with some luck, may work. I also have some plans about a saner full-screen/ebook mode for Read – let’s see if I get the time to implement those as well.

  • This came up in one of the mailing lists a few days back. Serves as a reminder as to why the work we all do is so relevant and so important.

Christmas in Mumbai

From my friend Shamashis’s blog:

We took the route down Colaba Causeway, across Metro Plaza, Food Inn, Café Leopold and then turned once again towards Gateway. It was the same scene everywhere. Santa poured out gifts to toddlers, infants, teenagers, the policemen on the street, the security guards of Taj and the shopkeepers on the pavement. Santa went to the kid who sold vada pav and gave him his share. Everyone smiled, everyone was happy. We had achieved our goal. Every moment was turning out to be priceless.

His entire experience is narrated in two parts (1, 2).

FOSS.in 2008

Last week, I attended FOSS.in, and in short, it was awesome. The organisation was superb, the weather was fine (well, maybe not for people who do not like a drizzle or two), and the food was excellent. Many people had doubts regarding the efficacy of the workouts, and in the end, almost all of the workouts had some concrete results to show, which, I would say is a major achievement, considering that each workout lasted for only around 3 hours. There was occasional problems with the bandwidth, but with an event of this size, minor glitches are bound to happen.
Workout in progress
My Sugar/OLPC talk went OK-ish, though it did seem to generate a lot of enthusiastic queries and discussions. It was quite a pleasant surprise on the next day, when a few guys came up to me, asking me to help them with their Sugar installation in Ubuntu and Fedora. Moreover, on the penultimate day, Nirbheek, Piyush and I stayed up till late in the night, excitedly discussing possible Sugar activities that can be developed/adopted. The XO-s, as usual were crowd pullers, and since there were three of them (I was carrying two, Kushal one), we also ran stock Fedora 10 with GNOME on one of them (booting off a SD card). At a certain point, we also ran the Fedora KDE spin on one of the XOs, much to the delight of Pradeepto-da and the rest of the gang in the KDE stall.
Pradeepto Bhattacharya with KDE running on an XOFedora table, taken by Kushal Das
I spent most of the time in the Fedora stall, and it’s really awesome to see the enthusiasm of the Fedora guys. The most common query seemed to be “Do you guys have a copy of F-10?”, and unfortunately, initially, we did not have that. Afterward though, thanks to t3rmin4t0r, we had ISOs available, and quite a few enthusiastic visitors copied them into their portable hard drives/usb sticks. Kushal was slightly over-enthusiastic with his camera (both the still and motion varieties), though he did come up with some totally amazing stuff. Going by the number of DSLR carrying shutterbugs at the event (including yours truly), some have proposed renaming the event to Camera.in for 2009. While talking with the rest of the Fedora guys, I also discovered Kobold, which can be quite useful for distributing Sugar based live images to interested people at events.
The Fedora Table
KarunakarCamera.in ??Kushal
I also had some interesting discussions on various Indic related stuff (going back to my roots ;-) with Gora, Santhosh, Rahul and Pravin. It was mostly comparing notes, and I figured out that this bug in glibc affects all Indic scripts, and not just Bengali. Gora’s session on collation and spell-checking was also pretty interesting, especially since doing affix support in Aspell for Bengali has been on my TODO list for a long time.
In the end, Foss.in is one of those few conferences, which reinforce the feeling of belonging to a community in you. It turns IRC nicks into real human beings, and takes your sense involvement in the community to a new level altogether. Free/Open Source is about more than sharing a common set of beliefs, or a common set of ideas, or having a common set of skills. Free Software brings people having similar passions together, and then creates a bond of friendship between them. It’s about enjoying something together, having fun together, and personally to me, that is perhaps the most important thing. Thanks to FOSS.in, and the Fedora project for letting me have this wonderful opportunity.
Rehearsing the KDE song
My only disappointment during the conference was Karunakar. This was the first time in nearly five years, where both of us have been to the same conference, and I have not been able to take a picture of him dozing off. However, Kushal did manage to get an awesome picture of his teeth, and unknown to him, this picture was the subject of a headline in the first page of the Indlinux wiki, for around an hour or so. :-D

Karunakar's teeth

Karunakar's teeth


And, here’s a picture of yet another amazing thing done by the conference organisers, this one specially for the speakers… a T-shirt with your IRC nick printed on it:
unmadindu, taken by Kushal das

G1G1 2.0

  • G1G1 is back (and we are shipping to Europe as well for this edition). This time, with Amazon around, the delivery issues would hopefully be a lot better.
  • It looks like the XO is topping the Amazon bestsellers list in the computer category today.
  • The laptops can also run GNOME with Fedora as an option (put in an SD card, and it will boot Fedora, pull the card out, and you’ll get Sugar). Someone is already selling Fedora pre-installed SD cards for the XO on Amazon. (of course, you can always create an image, and put it on a SD card yourself)
  • Apparently there is still confusion about OLPC and Microsoft – Greg’s post should clear things up.
  • Among the G1G1 related marketing efforts, there’s a pretty awesome video (I’m trying to find out if there is a Ogg version somewhere), and a cool (though flash based…) “equations to change the world” website, equation.laptop.org.




Just booked the flight tickets for….

Sundarbans

Last week I took a mini vacation and went to a trip to the Sundarbans (the largest Mangrove forest in the world, formed on the delta of the Ganga and the Bramhaputra). I hadn’t realized that it was so close – Gosaba, which is the gateway to the forests is only around 2 and a half hours drive from my house. (we took a “package tour”, which minimized the hassles as we got a car taking us from Kolkata to Gosaba, and at Gosaba a launch was waiting to take us into the forest)

We arrived on a day when Cyclone Reshmi was approaching the region, and the first night in the forest was to put it mildly… interesting :-) . Fortunately the skies cleared up on the second day, and for the next two days, we had an awesome experience, including one of the most beautiful sunsets I’ve ever seen in my life.

Painted boats on a painted river

Sunset

Neel Kantha

Dragonfly

Fishermen

Water Monitor

Stork

Mangrove forests

More photos in this Flickr set.

..and no – I did not see any tigers – we were busy hopping around from one watchtower to another.

XO Software Release 8.2.0

After many months of hard work, OLPC XO Software Release 8.2.0 has been unleashed. This release includes a much improved Sugar 0.82, a transition to Fedora 9, and many more changes and fixes under the hood to increase reliability and security.

Upgrade instructions are available here.

14th October, 2008

  • There might be a Barcamp Kolkata soon:
    Barcamp Kolkata Logo
  • Got Table of Content support working in Read Activity
    ToC Support in Read
  • Wrote a small PDF viewer tool with support for the Journal which is then used by mozplugger to show PDF files within Browse. (You can put the file in your journal if you like it)
    PDF inside Browse
  • Infoslicer is awesome. Here’s a Youtube video demo of it.