Skip to main content

What I liked 2016-07-10

Airtel's response to @karthikb351's write up on how they are sniffing and censoring CloudFlare's traffic in India was funny but sad, though, not totally unexpected. For instance, see @kingslyj's version of how this might end.

I loved this interview with Amanda Palmer where she talks about her stolen Ukulele, Music, her dad and her baby and her love for life comes across, like in everything else she does. 'I want to get a couple of T-shirts printed for me and the baby that say: "We are determined to enjoy ourselves"', she says.

A year old but inspiring article on Serena Williams, shared by @baali. I like how she says, she's opening the next door for the next person, like the many people who opened many doors for her. @baali also recommended this song from Neerja as background music, and I loved it!

Pierre buttin's screenshot art is amusing and gives a sense of how distracted he is, each day of the week, and how distracted we are, as a people.

We were walking through the fields and bushes in Hampi and stopped at the gate of a private property. A bearded man with a calm look on his face asked us "Do you know where you are headed?". And then let us walk across his beautiful nature home to the other side, where we found this amusing sign.

Finally, this Nike India ad on Women in Sport is great!

What I liked 2016-07-03

I really enjoyed reading the full judgement given by the Madras High Court in the Perumal Murugan case. The court said something on the lines of: not all art may be for everyone, and if you don't like a book, throw it away. The judgement also made it clear that it is the responsibility of the state to ensure that things don't go haywire using appropriate measures, and banning things left, right and center is not the way to deal with it.

This letter that a Law professor wrote in response to a student's complaint about him wearing a Black Lives Matter t-shirt is superb!

Gabriel Weinberg's post with a list of mental models that he found repeatedly useful has been great. There have also been some great comments on it! I wish to keep going back to the post.

Anaghs shared a summary of Brian Christain's Algorithms to Live By and the books seems really interesting. Added it to my reading list.

This ad by BigBazaar for Eid touched a chord.

Black Mirror's The Entire History of You totally got to my head, and if you are interested in the future of technology and human behavior, I highly recommend watching this episode, if not all the episodes. Thanks to @9 for the recommendation.

Calvin and Hobbes' Search is a fun project - search for Christmas, Life and Universe and enjoy the wisdom!

Sowmya Rajendran's post on how the menstrual cup touched her life more than anything else after the Internet, was an interesting read.

The lights in the audience truly look "amazingly beautiful" in this Coldplay video.


I'll try and post things that made me happy or touched my heart, each week.

Python reload and module dict

I was trying to play around with Nikola's code today and learnt about a documented weirdness of Python's reload.

# Work in a temporary directory
import os
import tempfile
os.chdir(tempfile.mkdtemp())

# Module content, original and updated
ORIGINAL = "# PLUGINS = []"
UPDATED = "PLUGINS = ['rss']"

def create_conf_file(content):
    """Create a conf.py module with given content."""
    with open('conf.py', 'w') as f:
	f.write(content)
create_conf_file(ORIGINAL)
import conf
# PLUGINS is not defined in the module, originally.
print(conf.PLUGINS)
AttributeError: module 'conf' has no attribute 'PLUGINS'
create_conf_file(UPDATED)
import conf
print(conf.PLUGINS)
AttributeError: module 'conf' has no attribute 'PLUGINS'

conf doesn't yet have a PLUGINS attribute, since the new module isn't imported until we reload.

import importlib
importlib.reload(conf)
print(conf.PLUGINS)
['rss']
# We write back the original file. PLUGINS should be empty!
create_conf_file(ORIGINAL)
import conf
importlib.reload(conf)
print(conf.PLUGINS, "<---Whaaaat!")
['rss'] <---Whaaaat!

The behavior is well documented, along with a reasoning of why it is the way it is, but you can trip over it if you don't know. I hit a bug and was wondering if there was a race condition somewhere, until I read the docs for reload. On reload, the module dict is updated, instead of creating a new dict. Any values not redefined in the new code for the module remain unchanged.

Assist time

I sometimes hang out on #org-mode or #nikola and answer questions. I usually am not able to answer off the top of my head and I look up docs or dig through the code. Sometimes, we find ready-made documented answers, but other times we end up contributing some documentation, filing an issue, submitting a patch or hacking up something for that super-special use-case.

Until now, I looked at this time as IRC time, which loosely translates to distraction time. But, I'm usually learning about the tools I use a little bit more. Even when I'm not, I'm helping someone do something they want to do. Sometimes empowering them to fix future problems on their own. And indirectly making the user community a wee-bit happier, and possibly the software a tiny bit better.

This isn't limited just to helping someone on IRC. Helping out a co-worker do something that they are new to, or just adding a comment or editing a Stack-overflow answer may end up in the "distraction time" bin, just because you weren't doing something on your TODO list. It needn't be.

Taking cue from scorers in Football, I decided to call this time assist time and to try to start seeing this time as (semi-)productive. Naming helps.

Effortful things

That dense book you want to read but has been lying on your desk while you procrastinate on twitter. You know you'll have to tune everything else out, and read slowly, word by word, trying to understand and make sense.

That vague blog post idea swirling in your head while you look at cat pictures, one after another. Distilling your thoughts and putting them down for general consumption is a lot of thinking and effort away.

That ${cool_programming_thing} that a talk got you excited about so long ago. But, watching talks and intending to start using it is all you do about it. You know its going to take a fair amount of reading, thinking and time, before you can really use it well.

Like all those squats and lifts you dread, these things are building your muscle. The thing about building muscle – it needs effort and feels like so much hard work.

You can't build muscles effortlessly. Go do those effortful things! Only if you care about those muscles, anyway.

Better styling bookmarklet

Some sites that I like a lot for their content, have zero styling on them. I find it pretty hard to read when the lines are long and I have to read all the way on my screen.

I had a simple bookmarklet until now that just changed the width of the page.

document.getElementsByTagName('body')[0].setAttribute('style', 'width: 600px')

Kamal shared with me a recommendation for 7 simple styling rules that will make pages easier to read. I liked them, and modified my bookmarklet to use these rules now.

better-websites.gif

Drag and drop the link below onto your bookmarks bar if you want to use it.

Better website

The code in a readable format is below.

// Create new stylesheet

(function() {
    // Create the <style> tag
    var style = document.createElement("style");

    // Add the <style> element to the page
    document.head.appendChild(style);

    // Add rules from bettermotherfuckingwebsite.com
    var sheet = style.sheet;
    sheet.insertRule("body{ margin:40px auto; max-width:650px; line-height:1.6; font-size:18px; color:#444; padding:0 10px; }");
    sheet.insertRule("h1,h2,h3{ line-height:1.2 }");

})();

Update [2016-06-07]: baali pointed me to Firefox's Reader View which works well too.

Reading-time based scheduling

I had posted a link to an poem written on Medium on a Slack channel that I use with friends. A friend said that she liked the fact that the Slack article preview had the reading time from Medium in it. She could decide whether or not she wanted to read the poem or any other article at that moment.

This gave me the idea for a reading time extension for my browser, or my feed reader or my bookmarks – my reading list. The first version should be able to compute or extract the reading time for an article or a tab in my browser, and index them. I want to be able to specify the amount of time I will be able to spend reading, and be presented with something from my reading list. I think this would help with scheduling the reading of longer articles, and also to actually help me get through my reading list.

Reading time estimates that use heuristics based on word-count may not really work, and may do more harm than good. But, it may still be worth a try to see if it helps my reading habits in any way. A quick search pointed me to this extension, that can give the reading time for any page but doesn't really do what I want.

Stepping AFK

In the past few weeks, I noticed three instances where I was forced to take a break exactly when I was ready to jump in and write some code to fix a bug or add a small feature. I had to step out of the house and take a walk to meet someone, etc.

I ended up getting ideas during the walks, which significantly changed and simplified how I would've implemented things, if not for those breaks. Even if I did end up zeroing down to those solutions, I am pretty sure it would've taken a couple of not-so-good attempts and much longer than it did.

Context switches are usually considered to be expensive for programmers, but taking a break at the exact time when I had all the required context loaded into my head seemed to help. It was also probably helpful that I was taking a walk, and there wasn't really any other inputs or outputs competing for the space in my head.

This got me thinking about doing this more deliberately – I'd love to hear about any experiences or any experiments any of you have done with this. Also, I'm reminded of Rich Hickey's Hammock Driven Development talk and I wonder if this is a smaller/different version of it, and makes me want to try out the things he suggests more deliberately. If any of you has thoughts and suggestions, I'd love to hear from you!

PyCon India 2016 - Propose a talk

CFP for PyCon 2016 is open and you should propose a talk!

There has been a lot of discussion on trying to improve the talk quality at the events. As my bit of contribution to this, below is a re-hash of some good advice from the internet on why you should give a talk, and how to submit a good proposal.

Why?

  • You needn't be an expert on a topic. If you have enough experience about something to help make the next person's experience with it better, you are good.
  • Its a great way to find people who are interested in the same things as you are and to get to talk to them. If you are an introvert, you should definitely be speaking!
  • Proposing and giving a talk is about thinking about something hard enough to refine your thoughts, and being able to explain it to others. Its a useful skill to hone.

How?

  • Talks are entertainment. Pick a topic that you are excited about and fascinated by. Let it be a general topic that will have a significant number of people interested in it.
  • What you want the attendees to be telling their friends about your talk, after they go back. Make it the objective of your talk.
  • Submit a complete, clear and compelling proposal. Show the reviewers that you are willing to put in the effort to prepare for and to give a great talk. Here are a bunch of proposals to see and learn from.
  • Submit an outline along with your talk. Show the talk can be delivered in the given time and will be interesting. Include an indication of how much time you intend to spend on each part of your talk.
  • Choose a good title. The title is what catches the attention of your audience when they are trying to pick a talk. Avoid buzz words.
  • Get feedback. Like any writing, feedback can be helpful at all stages – brainstorm while choosing topics to getting critique on the full abstract.
  • Convince the reviewers that you can give a well-rehearsed and entertaining – link to previous talks you've given, include links to any testimonials you've received from your audience, etc. If you don't have a previously recorded talk, give a small talk to your friends or colleagues and have it recorded.

References

  • PyCon US has some good advice on how to submit a proposal and most of it is generic enough for you to use for PyCon India, or any other conference.
  • These posts (1 2 and more) by Jesse Davis are so so good!
  • I also liked "The Talk on Talks" by Zach Holman.

Save the Map -- Please respond

The Ministry of Home Affairs put out a draft and an RFC for a Geo-spatial bill

To regulate the acquisition, dissemination, publication and distribution of geospatial information of India which is likely to affect the security, sovereignty and integrity of India.

Even if you put aside questions about how a vetting process, for "dealing with" any geospatial information, would help with the said goals, the bill defines geospatial information so broadly that even taking a geo-tagged picture at the Taj mahal or sharing the location of your house for a meal delivery would have you breaking the law.

A group of volunteers made Save the map which has more information on this, along with a draft response that you can send to the Ministry. Please respond before June 2nd, 2016.