Posts

Ruby Postgres script

Swami Nikhilaananda said: " Ruby is a gem of a language " There was a very simple requirement that I had - I wanted to write a script to update a postgres table. On looking up quite a few resources also, I was unable to solve the issue that I was facing. Let me put down the completely stripped down version of the script here first... #!/usr/bin/ruby require 'postgres' conn = PGconn.connect("localhost", 5432, '', '', "tblName", "username", "password") puts conn This script is the typical script that you will find on looking up any site. However, the error that you will face on running this is the following: ... `require': no such file to load -- postgres (LoadError) ... This was quite annoying... Finally I discovered the required solution. So, I thought that this needs to be shared. Though it appears to be trivial, it is definitely not something that I could find with ease :) #!/usr/bin/ruby ...

Installing Gnome3 and a couple of tweaks

Image
Baba Gyani Triviani said: " Life is always a trade off - You get something, at the cost of something else " Ubuntu is probably the most commonly used Linux distribution. Ubuntu used to be shipping with Gnome for quite some time; however the latest version had Unity. While Unity appeared to look quite fancy in the beginning, a couple of sessions later, I found it incredibly annoying. There are several annoying features that one can find by running a simple Google search. However, there is an alternative - Gnome3. Some people may prefer KDE for the beautiful environment considering it is quite familiar, being similar to Windows; Gnome though was my personal favourite (Though Linus Torvalds hates it) for being minimalistic and doing the job right. So, I decided to install Gnome, and found they have a new version Gnome 3. [Note: From what I understand, you will lose Unity for good - Point of no return] How to install Gnome 3: To install Gnome 3, first launch your termi...

The Feedback system

Image
Swami Gulagulaananda observed: " Control theory says positive feedback results in unstable systems, psychologists say positive feedback results in emotionally stable systems " People are different, and different people think differently. It is a well known thing about the two people seeing the same glass as half empty and half full. That being said, different people have different ways of leading lives, and they believe in principles of their own, formulate their own philosophies or sometimes follow those set by others and/or by God. The ability to formulate their own philosophies and principles, is developed after some experiences were had. Like, a man lied to his wife, said that he was with his friend, while instead he was dining with his secretary. Later, he got a bump on his head after the wife discovered the lie on interrogating the friend (sans the overhead glaring lights)  She subsequently relayed the illumination gained to him through her rolling pin. This man d...

Environment and effects

Swami Gulagulaananda said: " The environment has profound influence on you - Evolution happens, not just as metamorphosis of the body, but also of mind " I would like to narrate a couple of incidents, using my favourite character Raj again. So here goes: Raj was done with his exams, and had got his results. He had scored quite good marks, distinction, in fact. Raj was studying in the best college in the state. People around him were some of the best guys in the entire state, and he just sat wondering about his marks. He found that when compared with his classmates, he was exactly in the middle. There were as many people above him, as below him. As he was thinking about this, his phone rang. He picked it up, and saw that it was his school friend with whom he had not spoken for a long time. " Hey, how have you been? Long time, huh? "  They spoke for quite some time, and then the topic about exams had come. The exams being state level, was a common topic. ...

Yes Man

Swami Nikhilaananda said: " Say Yes " There is a movie called Yes Man which has Jim Carrey, a loser who is totally depressed in life attending a workshop where the guy there asks him to say Yes to everything, so that he can embrace the positive energy. It's a really nice movie, that shows him getting into trouble in the beginning, but then all the creases get ironed out by the end of the movie. I have had quite a few experiences that are similar. So, I thought I should share a couple of anecdotes just to show you how things are... The following is part real, part fiction, but you will get the message. Raj was working in a very large company, but as time passed, he was beginning to feel stagnated. He looked back over the past one year and tried to assess what he had done. He found that he had not learned anything significant in the past year, well, nothing that required a year to learn. He felt that he was learning a lot more in college, amidst the fun, while here,...

The Smitten Kitten

Swami Nikhilaananda wondered: " You either pick a girl at a really cool bar, Or pick her from anywhere with a really fancy car The problem is not where you pick her up my friend, Starting to talk is the issue, simple is the end " Very often, when watching any one of the typical American shows, one sees that a guy liked a girl while sitting in a bar, and then decides to send over a drink to her. She accepts it, the waiter says " A drink from the gentleman over there " and the guy smiles looking at her. If she smiles back, then he walks over to her, engages her in a conversation, and if they hit it off, exchange numbers and start dating. Sounds so simple, right? Well, here in India, things are not all the time as simple and smooth. If you are a guy who drinks, and the girl also drinks, perhaps you can employ similar tactics. But what if you actually come across a girl you like in some other place? Maybe a bus stop, or your college, or maybe a movie theatre, a rest...

Causes and Effects

Swami Gulagulaananda said: " Sometimes people's struggles for causes have unwanted effects " People are really interesting. One very interesting thing that I notice among people is how they get all excited when it comes to supporting causes. Many people want to do something - And I am sure, that most of the times, they don't know why they are doing what they are doing, and some know why they are doing but that's not the cause, for sure! Today I saw a dumbass techie standing on the median at the heavily crowded Bellandur junction, holding a cardboard that read "Honk if you support Anna Hazare" and the guy next to him holding both hands up giving the thumbs up symbol like he was a football fan... That's it, four guys were standing amidst thousands of vehicles. Does this serve any purpose? Is this how you support causes? Do you feel that " Hey, they are at least doing SOMETHING, and that my friend, is better than nothing.... " or do you...