Nearby Wikipedia articles for the Pebble

The Nearby API from Wikipedia has always fascinated me, so when I received the Pebble Time last month, I knew I had to use it to make an app for my wrist.

In the excitement of the Kickstarter campaign I had already started dabbling with the JavaScript SDK using Cloud Pebble. It took me a while to get started with the SDK on my computer because I couldn’t find a clear way to initialize a JS project. Things went smoothly once I realized that I had to clone the pebblejs repository first, and copy my files there.

The Pebble.js environment is still in beta and it shows. While the documented features work, I kept wishing for more, especially those that let me add color. I could get a few colors using textColor, and highlightTextColor, but couldn’t find any documentation on what was actually supported. I made my peace with the lack of colors and released the app on the Pebble app store.

splash

Analytics tells me that around 400 people are using this app and that makes me happy. The people are nice too — I got two emails reporting an issue on iPhone (I am working on it), both being informative and polite. This might not mean much, but I feel its an important litmus test for the community.

I hope more APIs get exposed to Pebble.js soon, until then feel free to contribute code and bug reports on Github.

The Year Without Pants

by Scott Berkun

This book is a form of participatory journalism where the author talks about his experience of being one of the first managers at Automattic (the company that runs WordPress.com) . He gives a commentary on the culture of the company as it moves from a flat to a hierarchical structure. He often contrasts it with his experience at Microsoft.

A Year Without Pants

This contrast isn’t as clear as Cathedral and Bazaar. The author even points out instances where WordPress’ culture tends towards cathedral and Microsoft’s towards bazaar. The quality and quantity of work done amidst the chaos of the open source project amazes him, and he attributes this success to the people at the organization – who are passionate about their work, and to Matt Mullenweg – who grants these people autonomy, and encourages them to experiment. He also talks about how he manages his team which is distributed across the world and sometimes even across timezones.

This is the first time I’ve read about open source culture from a manager’s viewpoint. His critique for the communication tools used at Automattic resonated deeply with me. Reading it I was able to look at the Wikimedia Foundation, its work, and my place in it through a new lens.

lucid

/ˈluːsɪd/

  • clear, easily understood
  • mentally rational, sane, especially between periods of confusion

— A lucid moment in his madness.

Reasons why my code sucks

  • I am lazy and I use a hack
  • I don’t read documentation properly
  • I don’t understand the problem fully before approaching it
  • I don’t always uphold the contract of an API, passing a boolean where a string is expected knowing that it’ll get typecasted
  • I get invested in a solution and become stubborn
  • I don’t read code review properly and don’t do my research right

100 emails/day

The amount of email I get has increased since I joined the Wikimedia Foundation a year ago. Along with email, more written communication is expected off me on Phabricator and Gerrit. Looking at the amount of misunderstandings and arguments that happen on these channels I have developed fear and dislike for them. It might be rooted in my own insecurities of being unable to communicate well and so it needs to change.
No more flagging emails and bugs for later. I have finally gotten rid of my backlog, going through my flagged emails I found 3 month old emails that could have used my response. Starting Monday I am going to dedicate 6 hours every week responding to written communication. Rhea pointed out that deferring emails by flagging them for later is the issue. From now on I reply to email when I read it and I don’t read it as often as I do right now.

stopgap

/ˈstɒpɡap/

  • a temporary measure or short-term fix used until something better can be obtained.

— This JavaScript code is just a stopgap solution, we should change the API soon.

A Forgotten Empire: Vijayanagar

by Robert Sewell

In preperation for my Hampi visit I decided to read a historical account of the Vijayanagar empire. My last history class was seven years ago, so this was a new first lesson.

A Forgotten Empire: Vijayanagar

I was excited after reading the introduction. The city seemed grand and rich in culture but I became uninterested as the book became a chronological documentation from one war to the next. I enjoyed the few breaks that were taken to talk about the architecture and the lives of the common people and wished there were more. The academic tone didn’t bother me and was I amazed when the author himself was doubtful about the certainty of some facts. He had strung together centuries of history by interpreting the chronicles of Fernão Nunes and Abd-al-Razzāq, and the scriptures that were being discovered during the time. He was clear in his distinction between facts and speculations. In contrast, Domingo Paes’ observations were direct, he wrote of what he was shown by the King, and what he was told by his fellows. He even logged details like the prices of common fruits and vegetables. It read like an out of date WikiVoyage entry.
Reading this book made me wonder about the accuracy of my school books. Or of any history books. I can never be sure if what is being written is fact, or worse, if its tainted by personal beliefs and propaganda. Amber consoled my skepticism and suggested I read What is History? by E.H. Carr. More books on my reading list, answers to all questions of life soon!

Chasing the Moon

moonset

I remember seeing the moon set into the sea once. It happened during one of the many long bus journeys — Mumbai to Bangalore to Mangalore to Goa. I wasn’t sleeping well and woke for a minute because of a speed breaker and saw it for a second before it was hidden by a hill.

Since then I have wondered if it actually happened. It reminded me of the drunken night in college spent laughing at the fact that no one knew where the moon rises from. If only we had paid attention in school.
A bit of research revealed its relation to the lunar phase. A full moon will rise and set like the sun and a no moon will do the exact opposite. It becomes obvious after thinking about it for a while (brain cell killing alcohol!). Thus, a moon set can only happen on the west coast, on a full moon night, when there are no clouds and the sun doesn’t rise before the moon sets.

My next chance to see this is on 5th January. Its a full moon and its going to set at 5:19AM a full 2 hours before the sun rises. The monsoons are long over so I can hope to have a clear sky. The picture on the left is from the last full moon, the sun flushed the moon before it could actually set. I’d like to believe that I still have some brain cells left and what I saw was real.

A persistent Table of Contents

A recent discussion on Wikitech-l lead to the idea of having a persistent Table of Contents on Wikipedia articles. Timo had shared the Underscore.js and Asciidoctor docs as examples but I liked Bootstrap’s the best because it collapses headings and shows you where you are. I sat down to experiment and came up with this —

toc expanded wikipedia
toc expanded wikipedia

You can try it by adding the following code to your common.js

importStylesheet( 'User:Prtksxna/toc.css' );
importScript( 'User:Prtksxna/toc.js' );

The table will show up on the side once you have scrolled past the first heading. There are a few bugs and I am not collapsing headings as I am not yet sure if its necessary for Wikipedia articles. Feedback and ideas are welcome!