Posts

Showing posts from September, 2011

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
require 'rubygems'

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 terminal. Then type…

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 develops…

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. "How much d…

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, he was l…