“What still puzzles us?”

A screenshot from the etherpad used for last week’s WMF Mobile Team retrospective meeting. I could (and should!) fill in several volumes about how awesome working for (and with) the WMF Mobile team is, but that screenshot is a start in explaining the general fun and silliness of the place :)

What do you do when only 0.3% of School Teachers pass the Eligibility Exam for Teaching?

You increase the time from 1.5 hours to 3 hours and give them another chance, of course!

Keeping in mind the welfare of children and the need for teachers to fill vacancies, the government directed TRB to conduct re-examination for candidates who failed to obtain 60 per cent marks.

The government has directed TRB to increase the duration of the test time from one-and-a-half hours to three hours with additional 30 minutes for blind candidates.

(from the Deccan Chronicle)

What wonderful concern for the future of our country/humanity. I also wonder if there is such a test for College Lecturers, and how the pass percentage for that would be.

**Update: **Teachers now protesting against ‘difficulty’ of test, asking for “Grace Marks”. Oh well.

(via PavadaNada)

 

My .vimrc

I’ve gotten rid of my Vim repo from GitHub, and switched to using Vundle + DropBox to keep my vim environment safely backed up.

You can find my .vimrc file here. With just this and Vundle setup, I find it much easier to port my settings elsewhere instead of using git.

Hat tip to tecoholic for pushing me to switch to Vundle :)

I’m not a college drop out

I’m just on a one year break from college doing Interesting Things and growing up. Going great on both counts.

I will go back to college next year and finish. I understand that it will not be easy and that many people would consider it a pointless waste of time. That’s OK.

Passing Headers along while Proxying with nginx

When you’re proxying requests via nginx, you might assume after reading [the documentation][1] that every header is forwarded, except for the Host and Connection headers.

You’d also be wrong.

nginx drops all headers with an underscore in them.

This is a configurable settings. You can turn it on with a simple

underscores_in_headers on

I’m still baffled as to *why* this is [a configuration parameter][2]. And why it is turned off by default. And why there is no mention of it in the proxy docs.

Thanks to kolbyjack on #nginx for helping me figure this out.

[1]: http://wiki.nginx.org/HttpProxyModule" data-mce-href= [2]: http://wiki.nginx.org/HttpCoreModule#underscores_in_headers

My First Program

Note: These are almost a decade old. Reproduced as close to memory as possible

My first memories of programming aren’t actually C. They were GW-BASIC, and later on, LOGO. I don’t remember any of my BASIC – but I do remember the look on my computer science teacher’s face in 5th grade when I managed to draw a flower with LOGO when everyone else was doing rectangles and lines. I vividly remember it – you draw an arc for a certain length, then stop, draw another arc in the reverse direction for the same length – and you have a petal. Then you just offset your next arc by a few degrees, repeat the previous thing, and you have another petal. Do this a few times such that offset-degreese * count = 360 and you have a flower. That I could just modify the variables length and offset-degree to draw flowers as big, and with as many petals as you want – it blew my mind. This was in 5th grade – and I immediately started pestering my parents to put me in a programming language class outside (I had already gone to classes for cough_MS Office_cough and DOS back then). And the SSI nearby happened to be teaching a reasonably cheap Unix/C/C++ class.

The first thing I remember still is someone telling me “you don’t need to type out clearscreen(); – clrscr() would do”. This was TurboC, and to me, at that point of time, a ‘good program’ was one that had a getch() call at the end and a clrscr() in the beginning :)

The Unix/C/C++ course – I don’t remember any Unix in it. And the C++ was disinteresting to me, because I saw no point in inheriting mammal from animal or car from vehicle. So I went about writing ‘C++’, which was basically C but with cout and cin instead of printf() and scanf() (I wouldn’t understand classes and how/why they were useful until I read Hardcore Visual Basic 5 and saw the ways classes are useful and how much it sucks that VB doesn’t have them).

I had written a program called DOSTutor then (end of 5th grade, I guess?). It had screens and screens of text that ‘taught’ you DOS commands, and then ones that made you type them in and ‘checked’ it. Initially I had written it as a long series of printf() and scanf() statements. Suddenly some bulb went on and I realized I could cut my program size by about 90% if I separated code and data, and put the data (screen text and responses) into arrays. The feeling you get when you can reduce code drastically with no reduction in functionality (+ easier to make ‘fixes’) is quite incredible :)

But nobody ever used that program, so I wouldn’t consider that my first ‘program’. I spent the next year or so messing around with random sound() and nosound() calls producing ‘music’ (including a few times when my code hit the sound() call, but crashed before the nosound() call – thus making the PC Speaker whine constantly, without any apparent way to turn it off. I used to just reset the computer then – until I learnt what exactly a DOS System Call meant. Then I wrote another small program that just called nosound()). I also remember messing around with BGI Graphics, mostly taking the example programs for graphics.h and modifying them to make somewhat-pretty figures.

My first ‘real’ program was an implementation of a variant of Book Cricket. It even had a stored High Scores file. It was my stint at a ‘programming center’ (SSI, for those who remember), and I kept it in a Network Drive that I accessed using ‘Map Network Drive’. The amount of fun that was had when I discovered rand() was quite something. It even beeped when you got out!

I lost it all in a server crash. Just do ‘Map Network Drive’ once and it was no longer there. I think I came home and cried :(

What was your first program?

DevLog: December 26, 2011 – Jan 3rd, 2012

Back in Chennai

  1. Moving yuvi.in to my prgmr server. I want wordpress for my blog, but I don’t want to run MySQL. Solution? Keep blog where it is (with the awesome webfaction people!) and use nginx to proxy requests to blog/. Seems to work, so yay!
  2. Rewrote tawp.in to use python/flask/memcached. Available on github. Replaced older node.js version
  3. Reading through The Art of Unix Programming on kindle. Amazing book so far.
  4. Fixed a few more bugs on Wikipedia App. I think I’ll keep ‘official’ Wiki related stuff off this, unless it’s big?
  5. Partied along new year’s. Yay. Not particularly ‘dev’, but still :)

Devlog: December 23, 2011

Worked the day first from Domlur bus terminus, and then from Exotel’s office (with @vijaysw).

  • Incorporated search results (rather than just suggestions) into the Wikipedia app. Was a slight bitch to get right, but after that have made a bunch of variants that the others are testing out to see which one feels good (Suggestion if exists, else search, or search alone). Took up most of my time.
  • We put out a dud as RC3 for the Wikipedia app. A missing defaults statement. Lesson learnt: Test the entire process (uninstall -> install -> run -> test) before passing off RCs
  • HyperJuice battery has arrived. Commence working out of random public places.

DevLog: December 21 2011

  1. livetrains work. Trying to move (minimal) build system to waf. Somewhat complicated, not as fluid as I’d like. Go to rake. Feel weird about starting from scratch, come back to waf. Not get anything done Another rake diversion. Final Makefile editing desperation. I give up – I need to spend atleast a day to get back on proper build tools. That day is not today.
  2. Added feature to change font size to wikipedia app. That took almost a couple of days and ended up being less than 20 lines of code. First was trying to enable pinch and zoom, but only for an iframe – proved impossible. And then a long time of headwalling about how I’m not able to manipulate the DOM inside the iframe (despite code in other places being able to do it just fine (no crossdomain issues here)), I had given up and moved elsewhere. Finally brion suggested I try inserting a into , which actually did work. So much for the browser being sane
  3. ‘Refined’ the search behavior of the wikipedia app a bit more. Also got bit by a difference between zepto (that we use) and jQuery (whose docs I have to read, since zepto by itself seems to have no docs). Had to read through the code to fix it, and managed to.
  4. Closed a *lot* of bugs. BOY THAT FEELS GREAT!

DevLog: December 11, 2011

  1. Added UI for AssessmentLog [SelectionSifter]
  2. Removed lots of dead code in SelectionSifter.
  3. Went to Bangalore Wikipedia Meetup. Was nice meeting people I knew online face to face. Talked about yenWikipedia, and learnt a lot about how article selection for offline wikipedia is done.
  4. Shot myself in the foot multiple times (over use of empty(), incomplete commit summaries and a tab/spaces issue). I’m rusty and it is showing. Shouldn’t be a problem anymore, though – because of you-know-what.
  5. Built myself a local copy of mediawiki docs. No more annoying huge-images.
  6. Got myself the solarized theme. And increased font size to normal levels (13pt). My eyes thank me.
  7. Fixed timestamp related bugs in SelectionSifter.