Friday, January 02, 2015

Not Light

A minute bears like eons
The days pass like moments
These puzzling mazes
I lose myself
To be found by you
A few rosy thorns pressed on me
The contagion stays
The wait never ends
Demons take over a hollow shell

Sunday, August 31, 2014

Fourier Analysis Funny

Q: A girl is giving me mixed signals, what should I do?

A: Do Fourier analysis when you are getting mixed signals.

Friday, March 15, 2013

Enable "Click To Play For" Plugins in Firefox

I have a simple use case:

1. All plugins should run by default because they hog CPU and memory, and are potential security risks.

2. Flash plugin based ads are especially evil. They distract you from content and sometimes consume bandwidth by playing videos you don't want to watch. I don't block ads by default as I think they are good for web.

3. Allow plugins to run when I need them e.g. videos, games and applications.

Earlier I was using Flashblock, and I disabled Java and other plugins to achieve same goals. But with Firefox 21 (in Aurora channel) Flashblock doesn't work. Simpler and better solution is to enable click to play for plugins in Firefox. Following are the steps:

1. Enter "about:config" as address and press enter.

2. Click on "I will be careful, I promise!".



3. In the search box type "click_to_play". Toggle the value "plugins.click_to_play" to "true" by double clicking it or by pressing Enter after selecting it.


NOTE:  From Firefox 23 onwards (currently in Beta, Aurora and Nightly channels) you need to set the value of key "plugin.default.state" to 1 get the same effect.




 4. Next time plugins will not run and a placeholder will be shown instead:


You can run the corresponding plugin by clicking on it.


5. You will also see icon in Awesome bar next to address.
  • Through this you can activate plugins for which nothing is displayed on the page, e.g. music playback.
  • Add sites to whitelist so that all plugins are run by default for that site. This is similar to "Whitelist" in Flashblock.

Saturday, December 15, 2012

Dialogue between Teacher and Student from Lions For Lambs

I simply liked the movie Lions For Lambs for its simplicity and the way it touches the aspects of politics from grass roots to top brass. However the dialogue between Dr. Malley and his student Todd is something which sets the perspective for events in the movie.

Though focused on issues of society and country it makes a good lesson for other aspects of life too.

Here is the listing:







Malley: They went to these high schools in the area where they grew up, godforsaken places that bear no resemblance to the schools you went to.

The first guys to sign up to fight are the ones this country doesn't treat well.

---
Malley: On the flip side, you got kids that can take advantage of every gift this country has.

Todd: Like me?

Malley: Usually they're the first ones to take a big step back when it comes time for volunteers.

Todd: Are you recruiting me?

Malley: Recruiting you?

Todd: You sold the army to Ernest and Arian and now you're... you're trying to sell it to me.

Malley: Three guys in that photo never came home.
---

---
Malley: So I'm supposed to go implement Arian and Ernie's junior-year project, even though that thing sounds like a fairy tale to me?

Todd: You gave them an A for that?

Malley: I gave them a B plus.

Todd: What?

Malley:
B plus. They were loose on stats.

Todd: I heard. Why don't you tell me about students who got an A?

Malley: Cos I don't remember them right now.

Todd: So attendance is a prerequisite for you, but grades aren't?

Malley: You're onto the secret now, Todd. It's called potential. That's a far better signal of what you might do than getting an A in some class you might forget about in two years.                
---                                                                                                                                                                                           
                                                                                                                                                                                              
---                                                                                                                                                                                           
Malley: Todd, what good is a $90,000 Benz if there's not only not enough gas in the tank but the streets and highways are decaying to the point of becoming Third World?                            
                                                                                                                                                                                              
If all your rants about Congress and politics are true, Todd, if things are really bad, as bad as you say they are, when thousands of American troops are dead and more are dying as we speak, you tell me, how can you enjoy the good life?

Rome is burning, son, and the problem is not with the people that started this. They're past irredeemable. The problem's with us - all of us - who do nothing, who just fiddle, who try to manoeuvre around the edges of the flame.

And I'll tell you something, there are people out there fighting to make things better. You think it's better to try and fail than fail to try?

Todd: But what if you end up in the same place?

Malley: At least you did something.
---

---
Malley: Here's my last bit, so bear with me.

The decisions you make now, bud, can't be changed but with years and years of hard work to redo it. And in those years you become something different. Everybody does as time passes. You get married, you get into debt. But you're never gonna be the same person you are right now.

And promise and potential...

It's very fickle.

And it just might not be there any more.

Todd: Are you assuming I already made a decision? And also that I'll live to regret it?

Malley: All I'm saying is that you're an adult now. And the tough thing about adulthood is that it it starts before you even know it starts, when you're already a dozen decisions into it.

But what you need to know, Todd, no lifeguard's watching any more. You're on your own. You're your own man, and the decisions you make now are yours and yours alone from here until the end.

Todd: So, what, you don't want my decision?

Malley: Class meets again Tuesday at nine.

Monday, May 21, 2012

Reclaim Space for Content on Google's Pages

So I find out that I can replace Google's navbar and the search bar with the same script (previous posts: link1 and link2). So I have updated the script with few minor bugfixes and it now works on following sites (including local domains too e.g. google.co.in, google.co.au etc.):

  • Google Calendar
  • Google Reader
  • Google Groups
  • Google News
  • Google Docs
  • Google Maps
You will need Greasemonkey or Scriptish addon on Firefox for it to work. Please find the script at:

http://userscripts.org/scripts/review/133912

Next plan is to make a similar thing for Google plus.

If some content on toggle UI is out of place refreshing the page will solve the problem.  Please tell me about bugs and wishes in comments.

Google Groups Topbar Collapser

Looks like the Calendar Topbar Collapser works just fine in Google Groups as well (hardly surprising). So the script is available here:

http://userscripts.org/scripts/show/133907

Collapse Top Navbar and Searchbar from Google Calendar

In my previous post I ranted about the UI space wasted in Google's pages. So I thought to do something about it.

Here is my first attempt where I remove the top navbar and searchbar from Google Calendar's page. I hardly use them and I suppose this is same with many users as well. Instead of these a small button on top left is shown which toggles the display of these items.

This is a Greasemonkey / Scriptish script. It is available at:

http://userscripts.org/scripts/review/133900

Update 1: Sometimes the G+ profile info box may appear out of place. Refresh the page and it solves the problem.

Wednesday, March 07, 2012

Google - Y u waste so much space

Recently Google is pushing the new themes all across the products for a unified look and feel. The new UI is more AJAX-ed and provides streamed flow of the content.

But with this there is a lot of UI real estate being wasted on my 15" wide-screen laptop, for controls which I would be using once in a lifetime during my use of the site (or web-app).

Consider the following screenshot of Google Groups new UI:

Only in the area marked by the red rectangle I have got a little scrollable space for the looking through discussions. A lot of space is is just wasted as:

1. The black navigation bar which could have been mouse hover only. This is present in all Google sites and I hardly use it anytime.


2. The Google logo, search text bar and Google+ buttons. While reading the discussions I wouldn't be using this all time. Why did they just made it fixed on the screen?

3. Group name, topics unread, my membership status and other buttons. Would I really be changing these with with every post I read?


And after passing so many hurdles I actually go the content I want to read.

Similar is the case with other Google products, see below for some screenshots:

Google Books


Google Reader

Google Plus (like anyone cares)


Google Viewer


Google Maps


Obviously with new features UI goes complex but with the UI which distracts from the actual content is just unacceptable. HTML / CSS / Javascript provide a lot of options for UI which can be employed to make the interface a lot cozier.

Friday, January 13, 2012

Without The Answer



An email that bounced
A phone never got picked
A letter returned undelivered
A door that remained closed
A road sign removed
A broken bridge
A promise incomplete

Friday, September 23, 2011

Lokpal Is Not The Magic Wand

Anna has created the national movement which has shaken the masses to action and the government on its table.

However, the citizens of the country are shouting against the graft as if its the only problem that we have - the magic wand of the Lokpal will just solve all out problems and we will have the Ramrajya. But corruption is not the only problem we face. True, Lokapal will create transparent systems and we should aim for it. However some of the problems which we face are not due to the graft but because of the poor decision making, weak foreign policies, populist measures etc. as well. Here are some of the few:

1. Environment: This is a global issue. But we needs to put up a firm step. We are the country that will be one of the worst affected by the environment changes. We need a well thought out framework which gives us sustainable development and living.

2. Insurgency: Matters related to national security are kept under black covers and these matters cannot be scrutinized publicly. Issues of Kashmir, North East states and Naxalism cannot be solved by mere force. We need strong public opinion and political willpower to rise above petty differences and provide long term peaceful solutions.

3. Security forces atrocities: AFSPA is a menace for the people in North Eastern States and Kashmir. Even if we keep that aside it, a lot happens in the police stations as well. Section 197(2) of IPC, 1973 Code of Criminal Procedure and various state laws provide various immunities to police and security forces. Its not a surprise when they have been alleged about false encounters, forging evidence and human rights violation. We need better training, proper equipment and effective intelligence, not more of Daya Nayak's.

4. High-handedness of elected politicians and higher officers: A series of transfers follows every appointment of CM and PM. Mostly based on the loyalty and affiliations of officers than professional excellence. Also, the statues and parks constructed by UP's CM Ms. Mayawati are legal. So is the change of the Indian Railways headquarters from Delhi to Kolkata by Ms. Mamta Benarjee. From hikes in salaries of MPs and MLAs to the various amenities enjoyed by higher ups are legal, many times without justification.

5. High Population: Everyone talks about corruption, but none discusses its most prominent reason.

   '''High population and paucity of resources to satisfy them'''

With India's population set to become maximum in coming decades we will face food, water, energy and health problems unprecedented. We need more than just adverisements for population control.

6. Social inequality: Inequality in out society based on gender, caste, religion, region and ethnicity is deep rooted. Making the laws doesn't actually help. Untouchability is a crime, but it is still practiced in many parts with impunity. Reservations have become a political issue. Societal changes need altogether different movement.

Friday, August 26, 2011

Why Anna's Fast is Famous and Sharmila's Fast Still Finding the Grounds



The recent fast by Anna Hazare in Delhi at Ramlila Maidan has found the massive support. Also called second freedom struggle, August Kranti and other names by various media; the movement has gathered unprecedented momentum.

All over the country people are organizing processions, human chains and protests in whatever way they can. The so called middle class or salaried class which is considered politically dormant has come up openly to support the movement.

Any fast would be compared to the ten year plus fast by Irom Chanu Sharmila of Manipur. She is fasting for the repeal of AFSPA from North-eastern (NE) states of India. Critics have drawn flak over negligible support for Sharmila in other parts of India. Her demands are graver and her fast so long that it has passed any standard benchmarks of fasting. The debate will continue, however the reasons for little support for Sharmila's cause and massive support for Anna's need to be pondered:

Communication With Masses: She is being kept in judicial custody. This has cut her from the public contact and the media. While Anna is in continuous communication with media. Team Anna even appeared on reality and competitive shows on TV which are watched by masses.


Specific Cause: Her demand for repeal of ASFPA which is applicable NE states goes unnoticed as it hasn't affected the masses in India. Its sad but true that masses do not connect to Sharmila's cause.

Lack of Proposed Solution: Anna proposes a solution to corruption as Jan Lokpal. Repeal of AFSPA is a very legitimate demand. However Sharmila's demand doesn't put a solution about how the insurgency and extortion happening in NE states should be tackled.

AFSPA: This is a vicious circle. People cannot come out in support of Sharmila like they have come out for Anna. Forces can simply disrupt any protest without the need of a reason.

Team Anna: Anna is surrounded by able and experienced people who are capable of handling various aspects of mass protest. Kiran Bedi, Arvind Kejriwal, Prashant Bhusan, Shanti Bhushan, Santosh Hegde etc. have managed the various aspects of the movement like [see this]. Their insight and knowledge about working of government, police, media and law kept the authorities at bay . The protest went like clockwork as if all steps were already well planned and considered heavily. Remember how  protest by Baba Ramdev went haywire.


Friday, July 22, 2011

Found the distant tower at last

You can see the tower in the red circle below, visible from IIT Guwahati:


 And here I found it:



And it tool me these broken stairs to reach to it:


Similarities between IIT Guwahati and Hogwarts

1. Both have lakes, hills and variety of flora and fauna, making the walks in the campus pleasurable.

2. The headmaster in Hogwarts and the director in IIT are revered by many and also hated by many. Both are kind to students.

3. The ministry in the magical world and MHRD in India both interfere in the respective institutes a lot, sometimes with comments in newspapers and sometimes with policy changes.

4. Students in Hogwarts searched for secrets passages to get out of the castle. Students at IIT fish for loopholes in computer network to download movies and do other stuff.

5. Hogwarts has houses. IIT has hostels  much to similar effect. Competition in high during annual festivals in both.

6. The best one -- while the outside world thinks that students are doing magic or making up cool stuff, they are just scrapping through the syllabus to get the grades.

Wednesday, May 18, 2011

the Boy With the Lamp




 Once a wise man wandering in the jungle saw a boy carrying a lamp. The wise man stopped the boy and asked, "Do you know where the light is coming from?"

The boy blew away the lamp and asked the wise man, "Do you know where the light has gone?"

Monday, March 14, 2011

Flattening abitrarily nested lists in Python

Lists are one of the three most important data structures in Python, other being dict and str, (tuple is the younger cousin  of list). The lists can be arbitrarily nested with any kind of data inside them, e.g.

['a', [1, 2], (3, 4, 5, [7, 8, ['gnu', 'linux']]), ['a', 'b', 'c'], [['d', 'e', 'f'], 12, [13, [14, [15,]]]]]


The objective is flatten nested lists of this kind to a single list. It can be simply stated as to remove all square brackets (and parenthesis) and retain only square brackets at the end, while maintaining the order of the items as they appear in the nested list. One of the simple solution can be:

def flatten(l):
    '''Flatten a arbitrarily nested lists and return the result as a single list.
    '''
    ret = []
    for i in l:
        if isinstance(i, list) or isinstance(i, tuple):
            ret.extend(flatten(i))
        else:
            ret.append(i)
    return ret


Run this on the example and you get:

['a', 1, 2, 3, 4, 5, 7, 8, 'gnu', 'linux', 'a', 'b', 'c', 'd', 'e', 'f', 12, 13, 14, 15]


Can this be made more Pythonic and efficient. Any ides?

Tuesday, December 14, 2010

mplayer: volume trick

When you want to view a movie or listen to a song which has a squeaky audio the easy option is to use VLC player to set the volume to the max of 400%.

MPlayer by default gives no option for the volume boost. However you can simply make the volume go to any level you want. You just need to set the following options in the ~/.mplayer/config file or the config file in the mplayer install directory on Windows:

softvol=yes
softvol-max=400

Here 400 signifies that maximum volume can be 400%. You can specify any value for this so have custom control over maximum value of the volume.

Monday, November 22, 2010

A Better Education System

Right now our education system is a class/standard based education system. Means for for the given year a student has to study the given number of subjects and if he/she doesn't pass one of the subjects he/she has to repeat the year. Also the students are graded on the basis of the cumulative percentage of the marks they get.

In this big range of figures what is hidden is that a student might not be interested/weak/slow-learner for a given subject. This takes toll from other subjects which he is good at. Its better that he gives exams when he thinks he is ready. Rather giving it at fixed time of the year.

Another opposite of the above is that a given student is good/strong/fast-learner at a given subject and still he has to stick with rest of the class and wait for the final exams. 

Why not students have a choice to give the exams when they are ready. This might look like a havoc on the system. But if we consider that not all students will be giving the exams at the same time, for a given time it will be some fraction, (consider GRE, TOEFL etc.)

Consider another option students have to stick with the class/standard based system even if he is good enough to solve the problems of a given subject from higher classes/standard. Rather than having some subjects required to pass to move to the next class/standard its better if we have class/standard associated with each subject and a student has to clear the exams of that subject to be awarded certificate of learning that subject.

Consider the case of colleges asking for the students to have passed class 10+2 with some subjects. Presently students has to pass the whole 10+2. Why not simply the college asking for certificate of 10+2 for the required subjects.

Here is an infographic:
Subjects in pipeline

Friday, July 09, 2010

Zoho: Beyond Google Apps

For those of you using Google apps (with Gmail account or as a Google App user), Google may be the best in search but not in all spheres.

If you are the one who is constantly using the web apps for daily purposes and want something better than the basic feature set take a look at the website:


www.zoho.com

 It provides the complete suite. All the applications complementary to the Google docs, spreadsheets, forms and presentation are available. They are packed with a lot more features. And the good thing about it is you can login nto it using the Google account.

Give it a try and you won't be disappointed.

Zoho services

Saturday, March 13, 2010

One More Step To Prevent Your Privacy

We generate large amount of data while we are connected to the Internet. It not only records with whom we talk, chat or share content but also about the habits we have. The data about us being put into the corporate use.

For those who are uninitiated, its worthwhile to note that your login account is not the only thing by which you are being tracked. The advertisement serving websites also put up cookies on your computer to identify you. To record your clicking habits and serve you the advertisements that recognize what are the things that you are more inclined to buy.

One option to get away from this to install AdBlock in Firefox (and similar addon or plugin in other browsers) to turn off the ads alltogether but this hurts the websites that give you the free content.


Google with the option to opt-out of the profiling of the user habits and serve the independent ads only (link). However, this has not been so much publicised and very small percentage of people have done so. Additionally a plugin is also available to install with your browser to make the opt out permanent.

The best option is to visit National Advertising Initiative and opt-out of the target advertising from all kinds of ads serving services.

Wednesday, January 20, 2010

Ads: Don't Block

Most of us hate advertisements. Be it in newspaper, television or the Internet. One of the most popular add-ons for Firefox is Adblock Plus, which regularly update the list of the advertisers and block them before they get loaded. The other popular browsers like IE, Opera and Chrome also provide the way to block ads in some or the other way. Of course, nothing can't be done about newspapers and TV.

We do not like ads because they take space, waste our time (and badwidth too) and for those with limited data plans the precious bytes. However we forget that advertisements has made it possible for the masses to get free access to the information for free or at very low cost. We get news, articles and the very important Google (all tools with search included) for free because they draw their money heavily from the ads.
Many people are self employed due to online ads.


I feel that ads are necessary. Ad-blockers are good, but in the end it may happen that we might have to pay for monthly search on Google (ugly huh!)


But the ads on the websites today have gone frenzy. There should be at least some minimum ethics so that it doesn't hit the end user heavily. These might be:

1. Ads placed so that they do not obstruct the content. Ads placed in between downgrade the original purpose of the visit to the site.

2. Ads should be clearly mentioned as ads, not the part of the article whereever they appear. Some companies pay for putting ads and links without the disclamer from the advertiser. It reduces the credibilty of the website, if your reader is cheated by the company (even if he isn't, because you are putting things you don't know about)

3. Text ads and images are fine, but the ads with heavy flash content and recently which automatically stream audio and/or video are very annoying. They consume too much bandwith.