Saturday, January 31, 2009

Will you call this evolution ? switched to ubuntu linux


Hi guys,

am back again and guess what writing it form the firefox running in ubuntu.. and this time no escape please.. i made very much mandatory that i should not have any door that i can look back a way to windows xyz... no i am not getting harsh on it just a bit more infatuated towards my new hardy.... yippee its running and running fine if not perfectly fine.. but who said i am looking in for perfectness after if i am believer of 80:20 rule i am very happy really very satisfied with it.

Last night was chatting to one of my friend(pravesh) and when he got to know about it he said he still remember those MCA college days where i use to favour windows and he was one of few who use to be on Linux side.. at those time we use to have system but almost zero Internet connectivity (as if, Internet world has no open doors for us at those time :)) )

and still i am backing those thoughts(adial tattu sort of stuff) because whatever i have evolved in today it is all because windows was there and it helped understand me the words like 'os' and 'system' to me(it is said that it is the first step which is toughest to achieve after that evolution will take you on) and it happens with almost all of us here in India.

so ending the flashback.. current scene is that i am running my work on

hardy ubuntu 8.04 and it is running fine dear.

installing running ruby,mysql,subversion, rails and many other application was quite a breeze through 'apt get'. also installed picasa for ubuntu and netbeans. one issue is running with netbeans, it is somehow interfering or getting interfered with the glossy effect so have to swicth the effects in appearance(thats what i found for the issue with netabens when no controls was visible in interface)

rest is all good it has just been about 5 days on to ubuntu and as there is no windows in my system now so any problem and issue will be tackled in ubuntu way only.

a system which gets installed in about 30mins time and with all office software installed and which looks good and is simple to use, obvious stuff is available and one needs not worry about anything as there is plenty full of support and help on net(unless for you doors are not shut yet) this Linux from ubuntu is good and if planning to switch to ubuntu but is/was doubtful about its driver compatibility and all and its response to you i will say mark my words you will not feel the pane in fact you will learn a lot.

post is really grown very long.. but koi issue nahin hai ji sometimes even i can write right???

Thursday, January 22, 2009

Group controllers/views in RubyonRails

Hi guys,

It has really been a long time since i blogged about something from ruby on rails corner.. and so here is one.

Recently, have been asked to merge to rails application in one. Meaning to merge the code base so that they can become an single application but to maintain the readability i thought of keeping the code base some how segregated. So initially the idea was of making a plugin of application which is to be merged with main application and with the use of rails-engine plugin that would have been easy(at least that i thought of) but see the dilemma i was not even able to run the demo plugin(with the use of rails-engine) and as time was constraint too i thought of dropping the idea and doing some thing easy which can do the work and also in less time.

Then came the idea of grouping controller, views, helpers, layout, model etc... all in different folders and i was able to segregate controller, views but not models(anyone with solution/thought on it please comment).

Static view of segregated 'controllers'


Static view of segregated 'helpers'


Static view of segregated 'views'


Now that i have shown you the file positions.. what is the code which does the trick!! The answer is, when one creates a folder inside controller's folder in rails application, it makes a module of it and one should make the controllers belong to this module other wise those controllers will not be available.

class AuditTool::BaseController < ApplicationController

end

this acts as application controller(which is derived for the main application-controller) to the segregated controllers and other controllers could be derived from this base controller, like this


class AuditTool::BatchesController < AuditTool::BaseController
layout "/audit_tool/layouts/main"
def index
# line(s) of code.................
end
def list
# line(s) of code ...............
end
end


and helpers looks like this

module AuditTool::BatchesHelper
def function1(processed_on,label = "earlier")
# line(s) of code ...............
end
def function2(processed_on,label = "earlier")
# line(s) of code ...............
end
end


and getting spoon feeding the head section of layout goes like this

<%=stylesheet_link_tag("audit_tool/style")-%>
<%=stylesheet_link_tag("audit_tool/style_new")-%>
<%=javascript_include_tag :defaults-%>
<%=javascript_include_tag "audit_tool/slider.js"-%>
<%=javascript_include_tag "audit_tool/custom_1.js"-%>

link to controller/action of segregated controller is written like this

<%=link_to "Report Audit", {:controller => "audit_tool/reports" , :action=> "index"} -%>

link to main controller/action from inside of segregated views is written like this

<%=link_to "Got to main app", {:controller => '/admin', :action => 'dashboard' }%>


the post has started looking long, i thing i should stop it here only....
anybody with thoughts on this with any prospective do comment ( after all knowledge is sharable)

Monday, January 12, 2009

Whenever i am getting the scolding, its not me its you

Hi guys,

Recently hear ed this compliment :)) (I am referring to the heading of course) and i took it as compliment. Anyhow jokes apart.. last week it has been happening time... got to know and personally meet people who read my blog(for whatever reason) and you know what they liked it!!! and the complement factor was ,they asked it to also mention in my r****e .

Also signed in for twitter and i personally had no plans to do so but so many times people asked me have you used it??? i told to myself what is that people are talking about it so much.. and how i felt after it is in next line but i personally know guys who made some thing similar to this called kwippy( and the time when they introduced it to me i said is it really a need) and still the question remains the same is it really in need (to twitter people), but the truth is that now i am on it :)

A very Happy Lohri readers.. I kept this post in draft fridge for a day and now its LOHRI and next it is going to be Makar Sankarnti.. back to back festivals (really a delight for a foodie like me) :)


And one more thing.. was going in to gurgaon at an evening from my place and saw this beautiful sunset(mark me sorry for not carrying a good camera.. i have a phone and it can only solve this much of the problem) but believe me it was very nice than what you are getting in here in this snapshot above.

Friday, January 2, 2009

Too much thinking 'can make you fat'

No wonder i am getting my bear belly growing king size :)) 
Recently stumbled on this site and now i know, whom to blame and what for!!

Honda Civic & A/C problems.

Hello Friends, Got a post again on to Honda Civic (The good old favorite commuter of mine). This car has been doing great except for so...