prtksxna — isn't sure

CategoryPost

How to add {{missing images}} on Wikisource

Coming back to Wikisource after a few months’ hiatus I have forgotten how to do common tasks like adding images to pages. Making notes here to refer back to:

Photoshop Levels dialog
  • Open the purple links (problematic pages with the {{missing image}} template).
  • Open that page on Commons and download the biggest available JPEG.
  • Open the file in Photoshop.
  • Command + Shift + U, to desaturate the image (if applicable).
  • Command + L, to bring up Levels. Use the “Sample the image to set a white point” options to get the correct colors.
  • Use the perspective crop tool if the image has a frame (lets you pick corners instead of a frame), normal crop if not.
  • Save with a naming convention, usually – Title – Page Number – Book name.
  • Use UploadWizard to upload images in bulk and copy over information like categories, date etc.
  • Remove the {{missing image}} template in pages and use pre-established convention to add the images to the page.

Also see the help section on Wikisource, specifically about making some of these changes using a command line tool. I still need to understand what kind of templates to use when uploading the images to Commons.

Goa Homebrew Website Club #2

With the help of the usual WordPress Goa group (Siddharth, Abhishek and me), we hosted the second Homebrew Website Club. Since we were expecting more people this time we needed a bigger venue, and the good folks at Diet Code were kind enough to provide one.

Work and discussion at the Homebrew Website Club. In attendance: Abhishek, Abhinav, Sidney,
Prateek, Milosha, Janosh, Rhea, Jane, Harshit, Meesha, Jitin, Salil, Siddharth, Wazid and Snehal

After some quick introductions we dove into to some deep topics:

  • Identity and anonymity on the Internet, especially in the current political climate.
  • Reliable hosting options that wont get affected by government blocking or trade sanctions.
  • Distributed web protocols like IPFS and Dat.
  • Data trails linked to our various online identities.
  • Differing Terms of Use on various Mastodon servers.
  • Customization limitations on Wix

In the peer-to-peer time I demoed WordPress to a few people who were contemplating using it. Their main concern was if they’d be able to find the right theme for their requirments and if it’ll be customizable enough to make their site look the way they want. I spent some time helping setup a travel blog. I also triaged issues for my WordPress theme—Zuari.

Sausages & Hamburgers

New Wink Docdash theme

Over the last few weeks I have been giving the WinkJS’s JSDoc theme some much needed attention. When we started using JSDoc for WinkJS packages we used the docdash theme. It was clean and simple, exactly what we needed at the time. After we update the main website though, the theme needed to look more on brand and so we forked it to add our colors and a navigation bar on top. We want to add tutorials for our packages soon and this means some more layout and design changes.

After initially adding the navigation bar, everything looked alright on desktop, but on mobile the two menus were fighting for attention—one would open a dropdown with the site-wide navigation, and the other would open a slide out with the API’s table of contents. The icons were quite close to each other and it was a mess.

hamburger and sausage menu diagram
Diagram of a few mobile menu options

So, when Siddharth showed me what sausage links were, I knew they would be perfect for this problem. I did some research and found some other documentation websites using them too. It is elegant and uses a simple horizontal scroll to show more items in the navigation. The trick is to be able to cut-off one of the menu items and show a fade on top of it so that its clear that there is something else there to see. Different screen widths mean that you can’t always control what is hidden so I decided to show a bigger fade on the left.

Demo of hamburger and sausage menus in action

🌭🍔😉

Goa Homebrew Website Club #1

After more than a year of trying to be part of the IndieWeb and working on my website alone, I thought I should try to start a Homebrew Website Club in Goa. So, with the help of the usual WordPress Goa group (Siddharth and Abhishek), we decided to host the first such meetup at the GrandWorks office on the 24th of July.

We saw a mix of people of attending—from seasoned developers, to graphic designers, and to people just thinking of making their first website.

Hampus, Mikhail, Siddharth, Abhishek, Wazid, Prateek, Nupura, Anika, Sameera, Salil, Shanon and Kimberly at the GrandWorks office for the Goa Homebrew Website Club #1
Hampus, Mikhail, Siddharth, Abhishek, Wazid, Prateek,
Nupura, Anika, Sameera, Salil, Shannon and Kimberly at the GrandWorks office
for the Goa Homebrew Website Club #1

Since this was the first such meetup I gave a quick introduction of the IndieWeb movement and technology, and encouraged everyone to join the wider community on the wiki and chat. After that, we went around the room introducing ourselves, talking about our websites and experiences in building them. Some of the topics we covered were:

  • Differences in using WordPress, and services like Wix and Squarespace.
  • Hitting certain limitations on Wix, and how in WordPress there is always a plugin for that.
  • Cost (time and money) of hosting your own server vs the price of Squarespace.
  • How one-click WordPress installs offered by hosting services aren’t really easy to use for beginners.
  • Wix’s AI in design feature.
  • How the Balance Project would like to run their own community website and not give all their data to Facebook.
  • Finding an audience on one’s own blog vs on platforms like Medium and LinkedIn.

We didn’t have a lot of peer-to-peer time left after the discussions, but I was able to show a photographer how they could design their portfolio website using Gutenberg on WordPress.com.

There was quite some interest in a group like this, the technical folks wanted to dive deeper into Webmentions and Micropub, and others expressed a need for a place to ask their questions and get their doubts clarified. So, we’re thinking of hosting another one on the 21st of August. Join the WordPress Goa meetup group to get notified when we do.

Zuari on WordPress.org

After staying in review for nearly seven weeks, my WordPress theme finally got approved and deployed on the WordPress.org theme directory. Big thanks to @rabmalin for the review 🙏🏽

The Zuari theme on latest page of WordPress.org theme directory.
The Zuari theme as seen on WordPress.org

I wanted to make a theme that supported the new Gutenberg block styles, and gave a lot of customization options to the users. I have been working on it on and off since November last year. The idea was to give it an hour everyday, but travel and life did not let me be as consistent as I’d like. By March I realized that it might be better to work on a subset of features and do a version one release first. Now that this is done, I am excited about making improvements.

Roadmap

  • Use ITCSS to better architect the CSS. It’ll also help in getting the editor styles out.
  • Add microformats support for the IndieWeb.
  • Plugin support for the IndieWeb plugins.
  • Improve animations.
  • Bug fixes.
  • More customization options.
  • Accessibility improvements.

Hopefully by the end of the year I can actually recommend the theme to people who want to join the IndieWeb 🤞🏽 If you give it a spin and run into problems do raise an issue and I’ll try to help. Pull requests are welcome too!

Migrating to Dreamhost

My websites have been hosted on WebFaction since I can I remember, but with them recently getting acquired by GoDaddy, I started to look for alternatives. Looking for a cheap shared host to keep the three WordPress sites I maintain, I decided to check WordPress.org for recommendations. They suggested Bluehost, DreamHost and SiteGround. After a week of trying, Bluehost support couldn’t convert my domain account to a hosting account so I setup a new one on DreamHost.

The migration went smoothly but it took me a while to get used to the way DreamHost manages users, sites, and apps. Now that the DNS has (hopefully) fully propagated, the website is up and running on the new server, on https (for the first time 🥳), and using the new theme I am working on. Excited to be working on my site again!

Docker Compose for local WordPress development

Docker, specifically Docker compose, has served me well in keeping a sane development environment for my WordPress projects. MAMP was too much of a black box, and having a local PHP and SQL for both MediaWiki and WordPress was going to be more maintenance than I would have time for. With compose I have little to no maintenance burden, and my system is squeaky clean.

The following docker-compose.yml file starts two services — using the mysql, and the wordpress images:

The way this is setup is that both the services share a part of their file system with the host. The mysql one shares all the database data, making it easier for me to move test data around different instances and configurations of WordPress that I might be running. And, to be able to work on plugins and themes the wordpress service shares the wp-content directory. This way, I can easily clone and work on anything directly on my local system.

With this, all I need to do now to setup a new WordPress install is — create a new directory, copy this YAML file into it, and run docker-compose up. I change the wordpress service’s port mapping when I need to run multiple instances at once. That’s it!

A Wikiseum

After I understood how Wikidata worked and had begun contributing to it, I thought it was the solution to everything. It made complete sense — a federated, linked, semantic database of everything. What else would anyone need? It would be the hammer for every nail.

Excited, I began showing it to my friends and family. With each demo, I realized that Wikidata is a difficult hammer to use. A friend pointed out the obvious, “Interesting… but how will people use it? No one is going to learn SPARQL”. Even changing the name of the painter in the “show me paintings of Amrita Sher-Gil query” isn’t trivial. And working with Wikidata’s Q-id isn’t straightforward either.

Wikidata query results showing paintings of Amrita Sher-Gil.

The only other way to query this immense dataset is to wait for the big tech companies to eat up all this CC-O data. Siri, Alexa, and Google Assistant will become smarter with it, but they’ll remain a closed ecosystem that often harm the projects they benefit from. On the other hand however, the Google Art Project has helped Commons. Still, it too remains a system of closed collection and curation, with no room for correction or contribution.

While we wait for an open source Virtual Interactive Kinetic Intelligence (VIKI), I wonder what an open virtual museum would be like — a Wikiseum! A VR experience on the open web using open data. Paintings from museums across the world, and a museum guide who speaks your language.

All this is technologically already possible — Wikidata has numerous statements on paintings and museums which is only going to increase with structured data on Commons. Commons itself has scans of many paintings, and Wikipedia has detailed information about paintings, their artists, and the museums they are in.

All that is left to do is some plumbing and a UI.

Silence of dusk — broken,
the pao wala reminds us:
we must eat tomorrow,
like we did yesterday.
Silence of noon — broken,
the kabari wala reminds us:
we’ve been hoarding trash,
like we did last week.
Silent. We are the same.

Writing about reading about writing

Lately, I’ve been reading a lot about writing, and so, just to make this clever sentence, I must do some writing about my reading.

It must’ve been something I saw on television in my childhood that made me think that writing is done when inspiration strikes and words just flow. The image in my head was of an author writing an entire story, in longhand, in one sitting. This has never been the case with me.

Words, for me, have never flowed. They have never even accidentally leaked. Even when I invited them they didn’t come. In my head they all responded yes, but on paper, they didn’t show. I called them up and reminded them of the great time we had last weekend (we didn’t); they made excuses. I promised to make food they like; they pretended to have tummy issues. After a few tries, I thought to myself that they just don’t want to be friends, and left it at that.

But now, after constant advice from Pooja, Rhea, Amber and reading a few books, I am happy to realize that this isn’t the case. Making an outline, writing a rough draft, re-writing, editing, and endlessly repeating, is what writing is about. That, and tricking you into reading about writing about my reading.

WordPress meet-up, December 2017

Siddharth has been organizing WordPress meet-ups in Goa for the last three years. Unfortunately, I am often not in the city to attend them. So, this time, to ensure that I am there, I offered to help him organize it.
Both of us have recently joined a co-working place, 91Springboard, and they offered to host the event. Hampus made us a logo, complete with coconut trees, a Portuguese style house, and a fish thali! Sid wanted circular transparent stickers which we got printed from Midway.

Wordpress Goa sticker on a laptop

Along with the informal meeting, we decided to have two short talks. The first by Abhishek about Open Source, and the second by me about Gutenberg. This was really an excuse for me to explore WordPress’ new editor.

On the day of the meet-up, we were a bit disappointed with the turnout. Of the 40 people who RSVP’d on meetup.com, only 15 came. We started the talks at 6:15 pm and in an hour both were done. What followed was a lively discussion about the future of WordPress, the nuances of theme licensing, and the standard of government websites. Later, everyone went to Joseph’s to get a drink, but I got sleepy soon after and left for home. What had started with disappointment turned into the realization that the people who did come were the perfect ones.

WordPress Goa, Prateek talking

For next time, we need to remember to start a little late, 5:00 pm on a Friday is too early. We also need to try and get the word out to students. If you would like to attend, talk, or have any suggestions, do get in touch.

Organizing Wikidata WikiProjects

TL;DR: Notes on how I’ve been organizing pages for my Wikidata WikiProjects. These are for my future self but could benefit others too. Suggestions welcome!

NOTE: This is about topic related projects, community WikiProjects like WikiProject India would have different needs.

In the last six months, I have created three Wikidata Wikiprojects with different sizes, depth, and completeness. After rounds of trial and error, I have learned of useful Templates and ways of organizing these pages. Having a good WikiProject page is like having good code documentation, it helps me remember what I wanted to do even when I come back after a month of being inactive. Here are my building blocks:

Introduction

Explain the domain of the project using the P and Q templates. If there are sub-pages with tables (more on this later) I try to list them here, but I am not yet sure if this is a good idea. See the intro section of the CJI project for an example.

Queries

Hoping the reader scrolls at least to the second section, I put up queries and visualizations to create some interest. Using the SPARQL template I show the main query of the project, collecting all the entities of the project’s domain. I use Cot and Cob for all subsequent queries so that they don’t take up too much vertical space.
I try to set an interesting defaultView for the queries so that people can visualize the data, but I haven’t used images, screenshots, or interactive charts yet. Those would surely get more attention, but images will go out of date, and I still haven’t learned Vega. Should explore SparqlCharts too.

Properties

While the first two sections are for people visiting your project, the next sections are for those doing the work. The properties section should define all the details you want to add to the entities. If there are too many, you might want to break them down to Core and Extras to ease the workload.
It took me a while to learn and understand the features of List of Properties/Row. Customize the table using description, example-subject, example-property arguments. I used the contextualized-qualifier for the first time in the core properties of the CJI project.

Data table and sub-page

A table of all the entities and properties of the project is useful in doing and monitoring the work. I prefer to keep it on a sub-page as its usually too large for the project page. See Delhi Metro/Stations for an example.
The Wikidata list template gives you a table based on a SPARQL query that gets updated by a bot every day. This has been very helpful for me, I watchlist the page with this table and I get an update if any property of any object that I care about has changed, whether or not it was direct, and whether or not that object itself is on my watchlist. The template also lets you see labels in multiple languages, but unfortunately not descriptions.

Resources, scratchpad & questions

At the end, I have miscellaneous sections to document helpful resources, questions, ideas, or anything else that doesn’t have a place. Often bullet points here become properties to be added, or citations used on the objects.


In the case of WikiProject Delhi Metro, which is the largest WikiProject out of the three I also have a section to help get contributors started, and a userbox too.

For both Delhi Metro and ISRO I have sections for broad topics like launch vehicles or stations, and sections for queries, properties, and resources within them.

He came by bus from Margao,
no he isn’t from Margao.
Someone on a bike
dropped him from Quepem.
He came by bus from Margao.
Just for this?
When I was younger,
maybe I would have too.
He came by bus from Margao,
I dropped him to Porvorim.
Someone on a bike
came to pick him up.
He said his aunt used to live
near where I live now.

Remember to Breathe

During a long chat with Nick, I discovered a solution to one of my long standing problems. I had a list of advice to myself on Google Keep. Not wanting to set it as my browser homepage I tried to make a habit of going to that page everyday. This obviously did not last very long, and soon, there was an item on my todo list that said, “Figure out what do to with advice to yourself”. This stupid, and funnily worded todo item remained on my list for almost a year.

Until of course Nick showed me his homepage. Yes, he had built a homepage for himself, long before the flood of “start page” browser plugins. Among the links to commonly visited pages, and the nine different search fields, what intrigued me most was the word “breathe” randomly written in the middle column. Refresh the page and the word changed to “simplify”. He had programmed it to pseudo-randomly choose from a list of words that he had selected. Jackpot!

breatho logo

Not being as old-school as he is, I decided to make a “start page” browser plugin. This was around the time of the bittersweet Mozilla announcement:

By the end of 2017, and with the release of Firefox 57, we’ll move to WebExtensions exclusively, and will stop loading any other extension types on desktop.

breathe screenshot

With support being added for chrome_url_overrides in Firefox 54, I started work on Breathe. A WebExtension that shows you a message from your pre-decided list every time you open a new tab.

You can download the extension from AMO right now, I am still working on getting it published on the Chrome Web Store (Update: Published!). If you don’t like waiting (for the Chrome version, or for updates) you can install it directly from the source.

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?