Archive for January, 2009
Rmagick on Ubuntu
Posted on January 21, 2009, under Miscellaneous.
Hey, Rmagick is a big pain installing it. I was really lazy and tired to install it. Previously in windows version, you need to do lot of configurations for it and it was really time consuming one and also hectic.
But to my surprise installing it in Ubuntu (8.10) was really really a breeze and was so cool and here’s the 2 gracious command to install Rmagick in Ubuntu.
sudo apt-get install libmagick9-dev ruby1.8-dev sudo gem install rmagick
Using a partial form with form_for
I just wanted to use partial form for CRUD using Rails 2.2.2 and when i had created a form i got the following error:
undefined local variable or method `f’ for #
Old Code
<% form_for(@project) do |f| %> <%= f.error_messages %> <%= render :partial => 'form' %> <% end %>
New Code
<% form_for(@project) do |f| %>
<%= f.error_messages %>
<%= render :partial => 'form', :locals => { :f => f } %>
<% end %>
Delete .svn files from a local repository
# the following command will list all the .svn files
find ./ -name .svn
# the following command will list the SVN files and delete it
find ./ -name ?.svn? -exec rm -rf {} \;
Cleaning some untidyness
Posted on January 18, 2009, under Miscellaneous.
After a long time, I found time to clean my room and some other general works and in deed it was good to then there clean it.
Also today, I started off with my profile work in the rails, which was my long dream and also the Railscast helped me a lot in designing the app in a simple and efficient way, the right way!
So all together the day was quite with mix-up of activities including walking for a while with my mom.
So its keep me going for the next week busy schedule.
Catch you up later!
Dining @ Sachin ka Dhaba
Posted on January 17, 2009, under Miscellaneous.
After a very long time, we(Perumal, Rajha Prabhu & myself) met and as usually discussed few things (which is of no use, but a chit chatting)and it was really really good nice meeting though!
After the initial meetup, we went had a tea in a tea stall and we went back to Rajha’s house and discussed few things and time was flying like anything. Finally the clock ticked to 9′O clock and we all buzzed each other to decide where to have the dinner and on the way, Perumal catched up Sachin Ka Dabba, which is on the main road to the kodambakkam.
We went there and to our surprise, the waiters gave the newpaper. We all thought it was a news paper and inside the page, the 2nd page, it was the menu and it was quite unique i.e. the menu designed on the news paper stuff.
We order the following and it was good:
1. Tandoori Naan
2. Tomato Soup
3. Veg Makkanwala
4. Veg Kadai
5. Gobi Manchurian Dry
6. Veg Pulao
and finally 2 Gulfi Ice.
And to all, it was a nice feast and we all were full. Will visit again to this place, shortly.
Rails with mysql database
As we all knew, recent rails version 2.2.2 supports sqllite3 as a default database and when you create a new app the “database.yml” would have been configured with sqllite3.
As I am used to mysql so much, I am not prepared to migrate to sqllite and still preferred to have mysql as the default database and to do this, you need to specify another parameter -d to the rails. Here a example
rails-d mysql
This would create a new app with mysql as its database.
Hope this helps!
getopt: invalid option — ‘v’
Posted on January 15, 2009, under Rails, Shell Scripts.
Recently, I tried to install rails and it seems it all got installed successfully and in the terminal when i type
$ rails -v getopt: invalid option -- 'v' Terminating... $ sudo apt-get remove --purge rails $ sudo gem install rails Successfully installed rails-2.2.2 1 gem installed $ sudo ln -s /var/lib/gems/1.8/bin/rails /usr/bin/rails $ rails -v Rails 2.2.2
Listing Duplicate Records
SELECT id, name from names GROUP BY name having COUNT(name) > 1
Joins Introduction
Hello All,
Welcome to this MySQL Join tutorial. Joins sometimes seems to very difficult for the newbie. Earlier, when I started it was a nightmare for me and i was sounding difficult on this and later as you work with this, it becomes so simple. Ok lets get into the topic:
What is Joins?
Joins is a keyword in MySQL which is used to join one or more tables (atleast 2 tables) to retrieve the records based on the conditions like how you used to write a simple where condition.
Types of Joins?
There are different types of Joins in MySQL:
Join/Inner Join: Return rows when there is at least one match in both tables i.e where the condition matches on both the tables:
Self Join: It is joining a table to itself.
Left Join: Return all rows from the left table, even if there are no matches in the right table.
Right Join: Return all rows from the right table, even if there are no matches in the left table.
Outer Join: It does not require each record in the two joined tables to have a matching record. The joined table retains each record, even if no other matching record exists.
There are two types of Outer Join: Left Outer Join (Left Join) and Right Outer Join (Right Join)
Now lets see each types of Joins with a illustrated example.
Ghanjini (Hindi) Review
Posted on January 1, 2009, under Miscellaneous.
I had been to Ghanjini movie, the remake of the Tamil version Ghanjini starred by Surya and Asin in Tamil. The Hindi version has created a much of hype by the media and as well by the producers. These hype created a enthu to watch this movie. Usually I’ll not watch hindi as I am not good in Hindi and i can’t catch up with the dialogues. Ok getting into the movie.
Its a typical remake of the tamil version with the exact screenplay, scenes and instead of Surya (Tamil), the hero is Amir Khan. I haven’t watched Amir’s movie earlier and this was the first one.
According to me, the Surya’s handsome and the feel good of the character DIDN’T suit Amir’s role. Hats off to Surya’s Performance and his stylishness in that movie. It can’t be compared with Amir. Sorry Amir!
All the characterisation and the screenplay, makes it look artifical and it was not “lively” like in the tamil version. I felt tamil version was too good compared to the Hindi Version. They have changed the climax in hindi and the way, the villan was beaten up was good and i liked it. Only the climax was better than the Original Tamil Version.
Verdict: Not that good and looks like a artificial one.