Bangpypers PreWorkshop Setup

A guide to installing a newer version of Python is available here. We at Bangpypers conduct a lot of workshops and some steps are common for all of them. To that end, this post is meant to serve as guide for people to install Python on Ubuntu and Windows (if required), setting up virtualenv and installing the package(s) germane to the corresponding Workshop. Ubuntu Check your existing version of Python to see if you already have what’s required. ...

February 22, 2019 · 2 min · Abhiram R

Unix Commands I Use

I keep Googling commands for some of these situations regularly - General - 1) To find files one level below your current directory - I was trying to find which repos in my set of folders have a setup.py file. So, this is what I’d use. find . -maxdepth 2 -iname setup.py 2) To find what process is running on port 2181 - sudo lsof -n -i :2181 | grep LISTEN ...

December 24, 2018 · 1 min · Abhiram R

Django Filter To Shorten Naturaltime

This is a filter snippet to shorten the natural time value obtained using naturaltime function from humanize. #In templatetag file , say file_tags.py from django import template register = template.Library() @register.filter def shorten_naturaltime(naturaltime): naturaltime = naturaltime.replace(‘minutes’,’m’).replace(‘hours’,‘h’).replace(‘days’,’d’) naturaltime = naturaltime.replace(‘months’,‘mon’).replace(‘weeks’,‘w’).replace(‘week’,‘w’) return naturaltime #In Usage file {% load file_tags %} {{start_time|naturaltime|shorten_naturaltime}} #where start_time is the datetime object to be modified {% if page.comments %} Please enable JavaScript to view the comments powered by Disqus. ...

June 26, 2018 · 1 min · Abhiram R

Memory Monitor Widget Using Python

I use Ubuntu 16.04 and I’ve been searching for a good memory monitoring desktop widget to no avail. I found a couple of taskbar widgets but none that would tell me the free memory left in addition to the used/swap/cache memories. So I decided to write my own (with loads of help from the Internet of course). Component 1 — The widget I didn’t know how to do this. Thankfully Stuart Langridge had already done this for me. I tweaked the override_background_color parameter to get a red background for my widget and the size of the widget itself to be 400*20 so it would be a nice small strip rather than a big blob of a rectangle. ...

June 5, 2018 · 2 min · Abhiram R

Notes from Design of Everyday Thoughts by Don Norman - 1

This is the first design-related book I’m reading. I’ve read blogs in the past though. I picked this up because of its rave reviews and my own interest in wanting to design software and represent data better. Here I list some notes I made from the book peppered with my own thoughts during the reading. Chapter 1 : The psychopathology of everyday things In the reading of this chapter, Don Norman stresses that the 2 most important characteristics of good design are ...

2 min · Abhiram R