Writing Better English — Avoid Very

I return with a minor post after another long break. This time, it’s about writing better English. Now, this isn’t humblebragging but I cannot be considered excellent at English writing — at least not by native standards. English is not my first language and I haven’t had much formal English education. I have, however, read a lot. Even if my English is not good, I can still point out some tips shared by experts.

Here’s the first one of those shared by Amanda Patterson on Writers Write. It’s a list of 45 words you can use to put emphasis on words without using the word “very”. I found it refreshingly helpful.

Bear in mind though that you cannot just go ahead and use a word without looking up its usage examples. Some words might have negative connotations even though the dictionary meanings look positive. For example, if you use the word ‘adequate‘ to describe someone’s work, they might be offended even though the dictionary meaning is that of acceptable quality.

p.s. After writing this, I searched for the word “very” and found two instances where I had used the word myself. I replaced it with better alternatives.

Row-level Permissions in Django Admin

So you’ve started working with Django and you love the admin interface that you get for free with your models. You deploy half of your app with the admin interface and are about to release when you figure out that anyone who can modify a model can do anything with it. There is no concept of “ownership” of records!

Let me give you an example. Let’s say we’re creating a little MIS for the computer science department where each faculty member can put in his courses and record the course execution (what was done per lecture). That would be a nice application. (In fact, it’s available open source on github and that is what this tutorial is referring to.) However, the issue is that all instructors can access all the course records and there is no way of ensuring that an instructor can modify only the courses that s/he taught. This isn’t easily possible because admin doesn’t not have “row-level permissions”.

AVL Tree in Python

I’ve been teaching “Applied Algorithms and Programming Techniques” and we just reached the topic of AVL Trees. Having taught half of the AVL tree concept, I decided to code it in python — my newest adventure. Bear in mind that I have never actually coded an AVL tree before and I’m not particularly comfortable with python. I thought it would be a good idea to experiment with both of them at the same time. So, I started up my python IDE (that’s Aptana Studio, btw) and started coding.

For the newbie programmer, the code itself may not be very useful since you can find better code online. The benefit is in being able to look at the process. You can take a look at the commits I made along the way over here on github. You can take a look at how I structured the code when I began and how I added bits and pieces. This abstraction should help in solving other problems as well. The final code (along with a rigorous unit test file) can be seen here: https://github.com/recluze/python-avl-tree

Random Chemicals to Reproducible Life

Back when I first became interested in science, one of the first areas I was interested in was Biology — specifically human evolution because of the hype it gets. The whole religion versus science becomes very pronounced in the creation-or-evolution debate. I read through a lot of material and was able to understand natural selection quite easily. It’s not all that complicated as some would like to suggest. It’s simply this: whoever is the better in a particular situation survives. It’s easy to understand once you realize that that’s a tautology. Whoever survives is the “fittest” and the fittest survives. So, no problems there but there was always something that didn’t quite fit. I could never quite digest the “theory” that micro-evolution (birds changing bone shape etc.) could lead to macro evolution (going from single-strand RNA to fish).

Finally, after much thought, I realized something. The way evolution is normally explained is by half a process of induction. The proponents of evolution (by the way, in the rest of this post, “evolution” should be read as “macro-evolution”) suggest that there is a gradual change from one species to another. You get to see a lot of “minor changes” and finally, with some blanks, you can see the whole chain. The base case, however, is missing. Where does this process start?

According to Darwinian evolution, if you go back in time, you go back in complexity. From complex mammals, you get fish and from there, you get stuff like amoebas, and then very simple living material like RNA etc. The problem with that though, is that there comes a point where you can’t get any simpler. If you do, your “living thing” cannot reproduce. The reason is that reproduction is a fairly complicated process and anything that does it can’t said to be the basic organism. However, if you get any simpler, you lose the ability to reproduce and then you cannot demonstrate survival of the fittest because no matter how fit you are, you cannot pass on your traits.

Now, after a long time, I came across this article on MIT Technology Review which documents an interview with George Whitesides . George Whitesides is introduced in the article with these words:

Harvard professor George Whitesides has spent his career solving problems in science and industry—he cofounded the pharmaceutical giant Genzyme, and he’s the world’s most cited living chemist.

Please read through the brief interview. It’s very informative and though provoking. Of relevance here is the answer to the first question quoted here for the sake of completeness.

Technology Review: What’s the problem you have most wanted to solve and haven’t been able to?
Whitesides: There’s an intellectual problem, which is the origin of life. The origin of life has the characteristic that there’s something in there as a chemist, which I just don’t understand. I don’t understand how you go from a system that’s random chemicals to something that becomes, in a sense, a Darwinian set of reactions that are getting more complicated spontaneously. I just don’t understand how that works. So that’s a scientific problem.

That’s a concise and succinct way of explaining the problem that I just introduced. If you get simpler beyond a certain point, you cannot obey Darwinian set of reactions (i.e. survival of the fittest). So, the question is: why aren’t we told about this problem in the Darwinian theory when we’re all taught evolution in school? It’s not that hard to explain.

A No-nonsense OpenERP Installation Guide

This is a no-nonsense guide to the installation of OpenERP — the popular open source and customizable ERP solution — aimed at the complete newbie. Of course, there has to just a little bit of “nonsense” to get you started. So, here it is: (a) You need to have PostgreSQL installed as the database backend for OpenERP. (b) OpenERP is written in python so you’ll need some packages for that part. (c) There is a server and a client. The server is important — client can be both a desktop client or a web client. (d) We’ll cover all of this except the web client. You don’t need that to get started. (e) We’re using OpenERP on Ubuntu 11.10 but an older version should also work.

Agent Mobility with JADE and JIPMS

A friend and I have been working on Java Agent DEvelopment Framework (JADE) for a while now. The idea is to enhance security mechanisms in the open source agent-deployment platform. The first step we decided to address was the actual mobility of an agent from one platform (in the sense of a dedicated machine running the JADE middleware) to another one. Turned out that it was much harder than one would imagine — especially given the fact that these agents are supposed to be mobile. Anyway, after around two months of part-time efforts, we got the agent working. Since the whole ordeal involved a lot of missing documentation and bad support, I decided to document the process through this tutorial. So, here it is. Read on to see how you can create an agent on one platform, migrate it to another platform, have it do some computation there and come back to the source. 

Creating UML Sequence Diagrams with TikZ in LaTeX

Update: If you are interested in getting a concise intro to LaTeX along with my tips on best practices, checkout my course (for just $12.99) on Udemy here.

I’ve been working on my LaTeX skills for some time. The goal is to move towards an all-latex solution for writing research papers, slide sets and other documents. I’m almost there. An important goal was to be able to create all sorts of figures within LaTeX. (Well, originally, the goal was to use open source softwares to create them but it turns out that LaTeX is really good at this stuff.) The package that I’m using for graphics creation is TikZ. Here we’ll cover how we can create sequence diagrams using TikZ and a plugin package.

Here’s what we’re planning on creating.

Sequence Diagram using TikZ (click to enlarge)

How to Create a Beamer Template — A Newbie’s Tutorial

Update: If you are interested in getting a concise intro to LaTeX along with my tips on best practices, checkout my course (for just $12.99) on Udemy here.

I started switching full-time to Ubuntu (once again) a couple of weeks ago. Turns out, it’s in much better condition than when I last tried it. Anyway, one of the problems was finding a replacement for Powerpoint. I hate creating presentations for classes — in fact, I think they’re counter-productive — but I have no choice for the moment. So, I decided to give LibreOffice Impress a chance. That was an hour of my life down the drain. Finally, I returned to beamer. Of course, I had to write my own theme because I couldn’t use the same theme used by all the rest of the world. To cut this long and boring story short, I tried very hard to find a tutorial on writing beamer themes, couldn’t do so, learned it through experiment and decided to write the tutorial myself. Here is that tutorial.

LaTeX Screencasts

I’ve started putting together a couple of screencasts for those who want to start working with LaTeX. These are aimed at the extreme newbie who wants to learn the basics and get up to speed with the typesetting tool. I’ll be updating this post as I put more videos online inshallah. For now, see the videos below or on Youtube. For best results, view in HD at full screen.

Part I: Introduction


Part II: Creating your first document
Download the files mentioned in the video from here: latex-seminar-files-demo-1.zip

Part III: Bibliographies, Class Files for Conference Styles
Download the files mentioned in the video from here: latex-seminar-files-demo-2.zip

F11, CS314 Lab Interim Results

Below you can find the individual scores for assignments and quizzes set in CS314 Computer Networks Lab for Fall 2011. Note that the course instructor will decide at the end of the semester how these get incorporated in the final assessment.