Monday, September 28, 2009

View and edit deleted records with acts_as_paranoid

We at intinno use acts_as_paranoid so as not to permanently remove any data from the mysql tables. This also helps in restoring deleted data, if required.

Situation:

In Naarad(our erp solution for coaching institutes) users add teaching logs, which is basically a log book of which teacher taught which subject from what to what time. However your clients employ teachers which come and go. So teachers get added and deleted all the time. But if the teachers are deleted, then the logs refering to them would throw an error , saying the record doesn't exist.

Solution:

If we dont find the record, then try find_with_deleted first. If find with deleted fails, then render nil or blank

Basically instead of using

I now used

and force_find is defined as


Situation:

Ok now I can view the deleted record. But the logs can also be edited. So now the deleted records shoould be edited. But editing a deleted record sounded wierd.

Solution:

But there was a catch. In my case, logs corresponded to dates. So if a record is deleted, then it makes sense to edit its log entries before it was deleted. So in my app subjects had teachers and i defined a new method



Now while assigning teachers to log, all the teachers present on the system at a particular day are fetched.

Note: The above method in the application helper has been extracted out into a plugin. Read the details here.

Sunday, September 27, 2009

My Desktop

My Desktop


and I intend it to keep it this way. :)

Friday, September 25, 2009

Thursday, September 17, 2009

Why I hate anything except ruby

Yes I really want to exit!!! you stupid fool.

Tuesday, September 15, 2009

Anything except rails

Its really difficult for me to do anything that doesn't involve ruby OR rails.  I have a pending work in python which has been procrastinated beyond imagination. Time to roll up the sleeves and get it done. 


Blogged with the Flock Browser

Sunday, September 13, 2009

Back after a long time

I had left this blog a long time ago and went for the wordress blog. Then I switched over to my self hosted blog. Wordpess blog was very difficult to update due to the heavy interface. The self managed blog ran really slow due to the dreamhost.com hosting.

Now Finally I'am back and I hope to post more frequently here due to the fact:

I am back to blogspot, from where I started.
Switched to flock and it should easily integrate to the blogspot.

Hope to see u here more frequently. :-)
Blogged with the Flock Browser

Wednesday, July 25, 2007

This Blog has moved!

In the light of the facts such as:
  1. Lot my relatives have discovered this blog and the not only read but also save the posts :(
  2. Also soon my parents would be stumbling upon it
So I have decided to move to a New Blog, where I can keep my personal posts personal.

New Blog Link: http://romram.wordpress.com

New Blog's RSS feed link: http://romram.wordpress.com/feed/

Bbye Bbye Blogger!

Note: I will not delete this blog, but it will remain inactive!

Sunday, July 08, 2007

Intezaar Aitbaaar - awesome song !

I seem to have suddenly fallen in love with this song:

darr yeh lagta hai kya yeh sapana hai
ab jo apana hai kal woh kaha hai
darta dil pooche baar baar - 2
intezaar aitbaar tumse pyar itna karu - 2

aansu aate the laut jaate the
lamhon pe lamhen chatpatate the
phir bhi kiya hai intezaar - 2
intezaar aitbaar tumse pyar itna karu
kya pyar hai kya hai nahi
maine nahi poocha na
ho tum mere yah ho nahi
maine nahi poocha na
poocha nahi baar baar - 2
intezaar aitbaar tumse pyar itna karu - 2

ek din aayega tanha reh jaayega - 2
dost kya dushman kya dhundh na paayega
maula ke saamne kehta reh jaayega
intezaar aitbaar tumse pyar kitna karu - 2
intezaar kitna karu
aitbaar kitna karu
intezaar aitbaar tumse pyar kitna karu

chhoti raaten hai kitni baaten hai
ab jo aaye ho ab batate hai
thaamon hamein ab ek baar - 2
intezaar aitbaar tumse pyar itna karu...




And yes, yesterday being the last saturday of my stay in Bangy, I went shopping, bought 4 tshirts and a watch. :D

Tuesday, July 03, 2007

Being here, Doing this.

It has often happened to that I am looking at an article by a famous person, say Matt Cutts, and I wonder how great these people might be at work. And then it strikes me that wait dude, he is at Google, let me check out what he is upto nowadays. This feels Awesome.

Saturday, June 30, 2007

Awesome weekend till now!

This weekend has been great so far. For a self proclaimed geek like me... going to some place outside Bangalore seems too much pain. I am very happy in my comfort zone i.e. /home/google/udit. :)
So on Friday night went to Koramangala area where I met Arpit, Dani, Shanks, Veeru and Dahiya. अपने बत्च्मतेस से मिलने मैं मज्जा ही कुछ और आ ता हैं. Then bahut mehnat and phone calls ke baad ek mast restaurant mila and had a good time there. After that went to the place where Arpit was staying i.e. Kala's house. Kala is an awesome person and learned about his various Real Life Orkut Adventures. Quite awesome man.. aisa bhi ho sakta hain kya??? And then finally after so many days watched the movies I wanted to, on Arpit's laptop.

On Saturday morning the HR guys had planned a movie for us, Shreck 3 to be more precise. Actually I don't watch Cartoon Movies but I liked this one. Then I headed back to my comfort zone i.e. /home/google/udit and spent the remaining day understanding things that had confused me since 1985. I Also took someone's Ipod, copied all the songs on my hard disk and then configured a player to play mp3. All this on Ubuntu. Ubuntu actually Rocks!

So now comes Sunday morning and I suddenly want to buy Jeans. Living in Kgp makes you wear the same two pair of jeans you have for your entire life. But now I decided that it was time to get some new ones. So I went to Bangalore Central as suggested by Reddy hunting for some cheap Jeans. Now begins the best part of the weekend. So I reached the third floor, where the jeans corner is and started looking at stuff. Then a Girl came, and said, "Hi, I am a Fashion Analyst[Not sure about the analyst part :)] and can I help you in selecting jeans". She was good looking, but not those bitchy types. She looked as though she was from a middle class family. But She was too Beautiful man. She was one of those shaadi karne layak kudi mannn... and then I started taking all her suggestions... looking at her... or rather staring at her... she smiled and then me too.... the jeans were also good and the fashion analyst was also good and there was a offer of buying two and getting one free and each costs around 900... MAN what more do you need in life... I went looking there for Jeans....got 3 for 2000 bucks... talked with an awesome girl... yaar bahut acchi thi vo... Arpit Jain kahan hain tu... chal tu bhi aaja Jeans khareedte hain... tu try karte rehna and main usse dobara baat kar lunga... so Please kisi ko agara Jeans khareedni hian tu contact me... :D :D

Now back @ /home/google/udit and writing this post, waiting for the pizzas to come and then will start some actual work.

I can still feel her around me man.
YES what a weekend!

Monday, June 25, 2007

Bol na halke halke

This song is very romantic and definitely deserves a space on this page :).

Dhaage tod laao chandani se noor ke
Ghoonghat hi banalo roshini se noor ke
Sharma gai to aagosh mein lo
ho Saaaso se uljhi rahi meri saasein
[Bol Na Halke Halke 2
hooth se halke halke
bol na halke ]2

Aa neend ka sauda karein
Ek khwaab de ek khwaab le
Ek khwaab to aankhon mein hai
Ek chand ke takiye tale
Kitne dino se yeh asmaan bhi
soya nahi hai
Isko sula de...
[Bol Na Halke Halke 2
hooth se halke halke
bol na halke ]2

Umrein lagi kehte hue
do lafaj the ek baat thi
Woh ek din sau saal ka
Sau saal ki woh raat thi
Kaise lage jo chupchap dono
Palpal mein puri sadiyan beetadein

[Bol Na Halke Halke 2
hooth se halke halke
bol na halke ]2

Dhaage tod aalo chandani se noor ke
Ghoonghat hi banalo roshini se noor ke
Sharma gai to aagosh mein lo
ho Saaaso se uljhi rahi meri saasein
[Bol Na Halke Halke 2
hooth se halke halke
bol na halke ]2


The lines in bold are my favorite. This song makes you feel you should be in love.

Music By Shankar-Ehsaan-Loy.
Lyrics By Gulzar.
Performed By Rahat Fateh Ali Khan, Mahalaxmi Iyer.
Loved by Many!

Friday, June 01, 2007

Life!

Life is too short
Grudges are a perfect waste of happiness
Laugh when you can
Apologize when you should
and let go off what you can't change.

Love deeply and forgive quickly
Take chances and give it everything
and have no regrets
Life is too short to be unhappy
you have to take the good with the bad

Love what you got
and always remember what you had
Always forgive but never forget
Learn from your mistakes
but never regret

People change and things go wrong,
but always remember
Life goes On!

Sunday, May 27, 2007

Doorie........

Often I have started to write a post.... written a bit... but then finally discarded it. But today Ive decided that I will go ahead and press that damm publish button... no matter what crap I write. Man I need to log my life... these are important days yaar....

Flashing back a little the eighth sem was kinda cool... did many things.... took what I wanted to study and attended whatever I thought was worth waking upto..... wrote brilliant proposals for Google Summer of Code, got selected and then had to actually leave it.. :( ..... gave 3 interviews for internship in Google Bangalore and god knows how I got selected... have I become intelligent....?? cool man :). and then when all was going smoothly it happened.... a truck came... on the wrong side of road... with its lights off... and hit Arpit Jain.... it seemed like the end of life.. for both him and me... but as dark clouds come and go... this event also passed by.... with Arpit Jain not even breaking one bone.... damm man.... !!! :D Anyways thats kinda good... it is becuz Arpit Jain is my only hope to get a girl... this is how it will work... Arpit Jain claims to have seen Vivah 5-10 times... and cried atleast 50 times... ok I may be exaggerating but the number is quite close.... ok so he says that he likes this whole idea of going to a girl's house and seeing her.... and plans to visit atleast 10 girls before settling on the one he has already decided... :)... so I seem to like marwari girls.... and thus have decided to go along with Arpit on his 10 adventures... and atleast I will like 1 out of the 10 girls(or may be atleast one of them will like me)... it doesn't matter until it works out... so long live Arpit Jain... hehe.

But there is one truth.... I have fallen in love with Atif Aslam's songs.... I feel this man is a genius.... he writes... so beautiful.... he sings... too much man.... you are my god....

So after all those hectic/sweaty days in kgp I finally landed in Bangy.... awesome place to be in if you have a girlfriend.... but otherwise its just a waste of the resources around... and ya Google is an awesome place to work in. They made office more comfortable.. than your home.... TV, CCD, free food and that too good food... cab to pick u up and drop you off when ever you want.... and if you like me don't have a girl friend to look after then probably you will end up living in the office itself as I do. Anyways after a long effort I've finally joined a Gym here becuz when you eat so much all throughout the day... then it becomes very important to exercise too.... and it is today that I went to a place where I enjoyed rock music... don't ask me where and why... :)

And then when I came back home those thoughts from the summers 2 years back started flashing... started thinking whether remaining quite for the last 2 years..... even though my heart was against it .... was it the right step or not???.......

Dooorie sahi jaayyye na.......
har rah main tu aaye nazar..... kat ta nahin ab akele tanha safar....
Adhora hooon mein abb.....tere bina........Adhoori meri zindagani reh jayegii
Doorie sahi jaye na......


press that button... yes I am going to this time... so here it goes...........

Monday, May 07, 2007

Coming Back to LIFE

If Music is my religion, Atfi Aslam is my God!!!
:D
:D

Thursday, April 12, 2007

यह मेरी पहली हिंदी post का शीर्षक hai

गूगल सही मई परमात्मा हैं यारों। इं के द्वारा एक नयी सुविधा शुरू करी गयी हैं, जिसमे कि आपको हिंदी लिखने के लिए कोई चरक्टेर मैपिंग कि जरोरत नहीं हैं, बल्कि बस हिंदी के वर्ड अपने अनुसार इंग्लिश मैं लिखिए। उद्धरण के लिए मन लो कि आपको हिंदी मैं लिखना हैं "गूगल परमात्मा हैं", तू आक्को बस यह बटन दबाने होंगे - 'g'->o->o->g->l->e->->p->a->r->m->a->t->a->m->a->h->a->i - और बस आपका काम हो गया। यह सही मैं एक क्रन्तिकारी काम हैं और मुझे विश्वास हैं कि किसी भार्तिये इंजीनियर का ही आईडिया होगा। और हाँ एक और बात, क्यूंकि हर आदमी का इंग्लिश मैं हिंदी लिखने का तरीका अलग होता हैं इसलिये इसमे एक लीर्निंग अल्गोरिथ्म भी है जो आपके लिखने के तरीके को सीखता रहता हैं और अपने आप को सुधरता रहता हैं। और एक और बात, यह सब काम रियल टिम हो रह हैं, जिसका मतलब हैं कि आक्पके द्वारा अंग्रेजी मैं लिखा हुआ कोई भी हिंदी शब्द उसी समय हिंदी मैं बदल दिया जात हैं।


गूगल सही मैं परमात्मा हैं. जय हो.

Tuesday, January 09, 2007

Main khush hoon khamakhan......

Last morning I woke up well in time before the class and can you guess what I did in the extra time... I danced... :D.... Dancing in morning sets the dude... try it sometime... then again in the night... I was virtually droozing off... I still wanted to dance.... but didn't had the tempo to get up.... but still the feeling was the same.....

I think sleeping on the right time and waking early gives you the right attitude... anyways I am enjoying my new found life.. do you too?

Current Music: Aap Close Up kyun nahin karte hain??? :D:D

Sunday, December 31, 2006

Just Another Day

A few hours back I wrote a post reflecting back on my previous year. Some moments back while having dinner I realized that I didn't have any new year resolutions to take. But the blog is not about that. Today I have been listening to Kuchh Is Tarah by Atif Aslam.... Incredible song, sung so sweetly, meaningful lyrics must hear song... and I am sure I am going to listen it for days now..... but becuz of this song I am in a senti mood right now and was thinking why is that we celebrate 31st .

Obviously the first answer is that man is a social animal and needs to party. Very true. But I by nature am not that out going and like to sit back , watch things happen, observe. From the day I have returned to Kgp, I have done nothing worthwhile, just sitting and watching time pass by. Seems C-314 RK gives the comfort, the coziness that one seeks at home. Its not that I am uncomfortable at home, but its juat that I feel more satiated here. It might be due to the addiction to computers/internet, but thats the way it is.

Coming back to where I started this post. New Year brings nothing special. Neither does the sun rise from west nor does Ayesha Takia decides to marry me. So why is it so special. I think there's one reason. This appears to be the time when we look back at our lives. I really like the comparison that Robin Sharma presented in his book The greatness Guide. Life's like a car that you are driving. You need to know before hand where you are going otherwise you'll get lost. But how many of us actully reflect back on life to check where's it heading to. Is this where I had positioned my self 5 years ago. Or have I got myself into compulsions that I cant break free from. Self Introspection is very important. Its just like the fuel you need to run your car. But often most of us dont have the time to sit back and think about life. We have too busy lives these days. This is dangerous. Imagine yourself as the driver of car, in hurry to reach the destination, not having enough time to fill the tank. A time will come when you will be stranded in the middle with no where to go. Awesome thought.

Most of us when we look back on the past year are able to picturize the good moments that this had brought us. I imagine myself as dancing at the weddings, going home on Diwali, standing on the edge at Grand Canyon, enjoying the long walk at Terminal 4, Heathrow Airport, listening to Atif's songs..... yes this is why I am happy. Also the fact I will be wishing everybody at home fills me with enthusiasm. But its important to learn from the time that has past. Not to repeat the mistakes that were made. This promts us to think about the future too, to plan for it, set goals. Here comes resolutions. This where the specialty of the day lies in. Its 11:25 pm and yet I have not fixed upon my list of new year resolutions. But soon I will be making them. The important thing is that this time I am going to make a reasonable list and will make sure that the next time I write such a post, I boast about achieving my goals.

Chalo its time now, Once again Happy New Year!!

An Year that has been......... Simply great!!

Only a few moments are kept before the year comes to an end. Traversing this last remaining seconds we are bound to think about the amazing times this year has brought us. For me it has been an incredible year.

- It was the year when two of my cousin brothers got married and one of my cousin sister got engaged. I being one of the youngest in the family was pampered at the weddings. Wedding, this word rings bells in me. Its the only time when the whole family is together, enjoying, smiles all around everyone's looking great ...... Simply awesome. This year there were a couple of them and were the best family experiences of my short lifetime till now.

- It was an year when I traveled. Seriously. In January I was at Mumbai for a tech-fest. Then March I went to Vaishno-devi. Come May and I was sitting in USA. August saw a wedding a Chandigarh and finally visited Kota in December.

- This year again made that American dream come true. I was in Texas for 10 weeks and enjoyed/learned a lot. Awesome. Also I got to see Heathrow Airport( thanx British Airways), the one where a part of movie Love Actually was shot. And I seriously love this place. You got to be there to feel the love.

- This was the year when I went home 6 times the whole year. That is twice the expected number of times. Not to mention that it takes me about 26 hours to reach home. :)

- Academically this year was good too. Got nine pointers in both the semesters. But the important point was that I learnt quite a lot. but the main highlight of the year was getting an Ex in Grid computing. That restored back some confidence in me telling me I can still do it. Also I attened the first ever conference of my life. Finally did some research work and have written a paper too. Hope to get it published soon.


And then there's a bad side to everything too.

- This year too I wasn't able to find love. Matters of heart went vacant. Aaakir family tradition ko bhi tu aage badhana hain na... :D

- I should have said NO to a few things that I involved myself in. Saying NO is very important as it saves your time to do the more important things.


Summing it up, it was great year all round. It would be a bookmark year in the diary of my life. 2007 has a lot hopes associated with it right now. If they come true, this year will bite the dust. :D


Have A great 2007. Happy New Year!!


=============================================================================
Note: Totally off the topic, I want to mention something. Last night I registered myself to a university project at University of Minnesota, Movielens, rated 30 odd movies, just to get the right recommendation for a movie. Ya I know this is what geeks do... Finally watched Wedding Crashers.

Wednesday, November 29, 2006

Celebration

Got this forward and really loved it....


CELEBRATIONS MEANS......

A winter evening.
Four friends.
One barsaat.
Four glasses of chai.

(OR)

Hundred bucks of gas.
A rusty old bike.
And an open road.

(OR)

Maggi noodles.
A hostel room.
4.25 a.m.

(OR)

3 old friends.
3 separate cities.
3 coffee mugs.
1 internet messenger.

(OR)

Rain on a hot tin roof.
Pakoras deep-frying.
Neighbours dropping in.
A party.

(OR)

You and mom.
A summer night.
A bottle of coconut oil.
A head massage.
Gossiping about absent family members.


You can spend
Hundreds on birthdays,
Thousands on festivals,
Lakhs on weddings,

but to celebrate
all you have to do is spend your Time .

KEEP IN TOUCH WITH UR LOVED ONES..