isn't sure

Hey 👋🏽 I am Prateek Saxena. I am a UX designer at the Wikimedia Foundation during the day, and work on open source & open data projects in the evenings.

MediaWiki API errors in FileAnnotations

I am working on FileAnnotations’ error handling. When I started writing the patch I wasn’t aware of all the cases we’ll have to tackle, Mark was nice enough to guide. Below is a list of errors that could occur and how to handle them.

AbuseFilter
AbuseFilter does not reject the mw.Api promise, but returns an object that has a warning.

Use the abusefilter-disallowed message here.

No edit permission
This one rejects the promise and the function has the error code as a string and an object literal that has details. It has the same object again as the third argument, I wonder what that is about.

Should probably not show the add annotation interface if the user does not have permissions in the first place. In case we do, use the permissionserror message from core.

Session expired
Tested a few cases for this. If the user is logged out in the middle of adding an annotation they’d get a permissiondenied error. But if one logs out and logs into a different account in another tab, the new edit is correctly attributed to the newly logged in account.

Unreachable server
I found the api-error-http error message but haven’t been able to figure out how or when it triggers. Have filed a separate task for now.

Block
This rejects the promise with error messages too. Could show api-error-blocked here, but it doesn’t show some of the useful information that is returned.

Protected page
Should protecting a File page automatically protect the Annotations page too? This is the same as some of the other errors, and core already has a protectedpage message.

Looking at all the api-error-* messages in core, these might show up too.

  • autoblock
  • badtoken
  • http (timeout error?)
  • timeout
  • unclassified

Here is the updated patch.

Rhythm of prime numbers

I had been reading about music theory on Wikipedia and was fascinated with the amount of mathematics involved in it. After going into the rabbit hole of the circle of fifths, the duodecimal number system, and this crazy clock face, I finally decided to go to bed. Having read so much (and understood so little), I started to wonder where prime numbers fit in.

As I understand rhythm better than harmony and melody, I decided to map the first few prime numbers to a beat. Since most prime numbers below fifty are either one more, or one less than a multiple of six, I knew it’ll lead to interesting results.

Rock

The rock beat has a hi-hat on every eighth note, and I am counting every eighth note for mapping the prime numbers. There is a snare and the bass drum on 1 and 3, and 2 and 4 respectively to make a basic rock beat, a clap for every prime number, and a cow bell for multiples of six.

The accentuation is on the 6th eighth note of the first bar, the 4th eighth note of the second bar and so on, because of prime numbers lying adjacent to multiples of six. I feel this gives the beat some swing.

Jazz

Because of Jazz’s triplet beat structure, it lends itself better to multiples of six. I counted every triplet to map the prime numbers. Its the most basic jazz beat with the low tom playing for prime numbers.

Both beats sound alright and not as random as prime numbers are, mostly because we stuck to those below fifty. If you want to count along with the beat, here are slowed down versions of both:

The band Tool is known to have used the Fibonacci sequence in Lateralus, I wonder if they or someone else used prime numbers too.

To dwell

There are but two choices —
To follow the heart,
Clockwork you never understood.
Or to follow the world,
Why dream, even if you could?
No bread playing Soul out on the streets,
No soul spending days balancing sheets.
Earn the bread first, the heart can wait,
Play Soul today, the bread will come late.
Follow the heart and the world cries,
Follow the world and the heart dies.
The heart is dead,
The world moved ahead.
But the decision is simple —
Where do you often dwell?
The world or the heart.
Where do you go for solace?
Your wallet or your art?

Reboot the World

It’s much easier to load my thoughts into someone else’s little box and hit “Submit” (perhaps the most well-chosen interface word of all time). But submission comes at a price. My personal information, my finances, my family connections, my ideas—all are now in the hands of those to whom I have submitted.

From Reboot the World by Paul Ford

Make Firefox fast

Recently, I have been trying to untangle myself from closed software, and move to open source and free (as in speech) alternatives. The first switch I made was from Chrome to Firefox. I was always a Firefox fan, but after college, when the only computer I had was a borrowed 8 year old MacBook Pro, I had no choice but to switch to Chrome for it’s speed.

Even though I have a fast computer now, I was a bit skeptical about Firefox’s performance. I use it often for testing and the speed did not compare favorably with Chrome. Upon a friend’s suggestion I installed the Developer Edition and was pleasantly surprised to see the improvement that Electrolysis brought! After a few days of using it, I decided to do some more research and stumbled upon a config that lets each tab run it’s own process. I set the process count limit to 128 and since then it has been smooth sailing.

These features exist in the normal versions of Firefox too, but are hidden behind config flags. To set them, go to about:config and set the following:


browser.tabs.remote.autostart true
dom.ipc.processCount 128

Restart, and see multiple browser processes (Activity Manager on Mac OS). Enjoy your new 128 Foxpower browser, yes foxes are better than horses.

Update: Based on when you’re reading this, you might need the Developer Edition or the Beta version of Firefox for this to work.

A man may be so much of everything that he is nothing of anything.

Samuel Johnson

Contentless RSS feeds

I’ve been using Feedly regularly now and am loving it. Being able to stay up to date with the websites I like without having to follow them on Twitter or Facebook has made me more of a follower than I was.

There are however certain feeds that make it hard for anyone to like them. The Dilbert Daily Strip for example, apart from its weekend comic, the feed only has the following content:

Dilbert readers – Please visit Dilbert.com to read this feature. Due to changes with our feeds, we are now making this RSS feed a link to Dilbert.com.

This is what shows up in my reader everyday. Thankfully, Feedly has an option to open the linked web page directly, which is what I have now done for this feed.

Why do publishers do this? To get more ad impressions? Are ads not allowed on feeds? I’d really love to know the reasons behind this strategy.

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.