Archive for August, 2007

Firefox Memory Usage High

Posted in firefox, technical, windows on August 31st, 2007 by Prateek Dayal – 2 Comments

Lately I have been finding that firefox is eating up so much memory in my system. After long usage (with even few tabs open), the memory usage on my system shoots up to a crazy 500 MB + which is insane. I have seen this a couple of times now and there are other people who have reported that firefox hangs on their system too.This issue I have never seen before Firefox 2.0.0.6. I personally find it really sad and I am planning to move over to Safari in windows. The font rendering is not as exciting as firefox but otherwise i find it to be pretty neat. I would love to know if there is a patch to fix this in firefox

Popularity: 6% [?]

Firefox adblock and related debate

Posted in adblock, adsense, firefox, google on August 24th, 2007 by Prateek Dayal – Be the first to comment

I read a post today on techcrunch about Danny Carlton who has blocked all users of firefox from accessing his blog. Readers from firefox are redirected to why firefox is blocked page. The reason is that firefox is endorsing the adblock plugin which blocks the ads but does not let the website owners block users who have blocked the ads. So Danny blocks entire firefox.

I think he makes a valid point. Adsense is the only revenue source to lot of publishers. That is the reason why so many publishers are surviving or making money. I see nothing ‘wrong’ in putting ads. Some people may say that ads kill the aesthetics of the website. I feel in that case, it is your duty to let the website owner know that or if you think that the site is so despicable, not visiting it. However if you like the content but visit it and block the ads, I feel that is ethically wrong. Its like “I want things my way”.

I also find it very funny that google adsense has listed firefox as one of the referral product and firefox is supporting the adblock extension. Does someone else find it ironical too ?

Please do not block ads … let people make some revenue and focus on serving you content and not worry about making a business plan or paying the hosting bills ..

Popularity: 6% [?]

Ruby on rails learning curve!

Posted in activerecord, books, learning, muziboo, rubyonrails, technical, tutorials on August 23rd, 2007 by Prateek Dayal – 3 Comments

The post should be called my ruby on rails learning curve. I just wanted to write about what it was for a person like me to learn ruby on rails and get productive in it and make something like Muziboo.com

I was introduced to rails by a cousin of mine when I was trying to decide the technology for muziboo. I was intially inclined to use turbogears as I knew a lil bit of python. I had used zope+plone before but I could never really get a grip on that whole system. Once I saw the ruby on rails screencasts, I got really excited and went ahead and tried the book Agile Web Development with Rails.

Agile web development I found this book to be pretty good for beginners. I coded almost the entire “depot” application that they walk you through in thi book and it really gave me a good knowledge of how basically rails works. I started coding up Muziboo right after this.

After a couple of weeks when I had more specific problem or was looking for some specific information (such as implementing a forum etc), I looked at the book Beginning Ruby on Rails Ecommerce which I found to be an excellent read too.

One more thing which really helped me was the amount of tutorial available online on ruby on rails and in particular the Railscasts with Ryan series. For any non-caboose developing in rails, I feel you must subscribe to his feed and check out the videos. I think he posts twice or thrice every week.

When you actually get down to coding, the ruby on rails API is simply irreplaceable. Whatever you are doing, be it activerecords (and specially that) or controllers or anything, do take a look at this. You will find that there are so many things (as in options, methods) other than the most popular ones that you help you achieve a lot. I have never found anything better atleast when it comes to activerecords than the API.

I am currently reading Ruby for Rails on the recommendation of Illya who by the way has a great blog and is again a must subscribe to kinds. I am somehow not finding much time to read this book but so far it has been like an eye opener. If you ever wondered why Ruby ‘on’ Rails and not Ruby ‘on’ ’something-else’, you must read this book

This is what I have done to get enough knowledge to be able to code and run Muziboo.com. I will update this post with more information as and when I find something . Please do leave your comments and let me know other useful resources.

Popularity: 14% [?]

counter_cache gotcha in activerecord!

Posted in activerecord, counter_cache, rubyonrails on August 19th, 2007 by Prateek Dayal – 2 Comments

If you are using counter_cache, you must watch out for this one. I am not sure if this has been fixed in the recent version, but the version that I am using (1.15.3) has the issue

If you are using counter_cache (such as in acts_as_commentable as described here), you must make sure that after updating the counter (in after_create call in this case), you must not save your commentable object (in this case @song) without reloading it, otherwise the counter will be reset back to the value before the increment.

Took me a while to figure this out and I googled after that and found that other people have faced this issue too. You can read more about the error here

Popularity: 8% [?]

Active record validation with mongrel_upload_progress

Posted in activerecord, ajax, mongrel, rubyonrails, upload_progress on August 19th, 2007 by Prateek Dayal – Be the first to comment

The active record validation is finally working with mongrel_upload_progress … yayee. To read more about what the issue was, follow this post

I will try to explain my setup and then the solution to the problem

I am trying to watch /song/upload with mongrel_upload_progress plugin. Inside /song/upload, I save the song if the validation passes (such as file size, title present etc) otherwise I want to display some errors on the upload page. The problem is that since the page is not reloaded, the <%=error_messages_for :song %> does not work.

I employed a simple solution to fix this. I put <%= error_messages_for :song %> in a div like this

<div id="err_msg" ><%="error_messages_for"></div>

and in the song_controller/upload method, if the validation fails, I do the following


responds_to_parent do # execute the redirect in the main window
render :update do |page|
page[:err_msg].replace_html(error_messages_for("song"))
end
end

This displays the error messages for the upload even without the page being refreshed.

Popularity: 9% [?]

Startup moments!

Posted in muziboo on August 5th, 2007 by Prateek Dayal – 2 Comments

I am working on Muziboo these days and everytime I see someone use the site and upload something, thats one great moment. It made me specially happy to listen to the piece below. Its from the movie roja (tamil),

Popularity: 30% [?]