Thursday, October 7, 2010

MTNL broadband not opening certain websites

:) then what to do.. i just got one MTNL TriBand broadband unlimited connection for my home in Palam Colony, New Delhi. Everything was great except that it was not opening certain web links like linkedin.com, assembla.com, cricketnirvana.com most of the time and within two days of installation, frustration was so severe that i looked up for google for any help(mind you MTNL,Delhi people they are awesome at NOT resolving any issues like this)
On a random look out for solution i found two things..
1. Change PrimaryDNS and SecondaryDNS to 208.67.222.222 and 208.67.220.220 respectively
and
2. Change TCP MTU Option(in interface page of ADSL router) to 1400

and Final step, Do a restart (one of the option in 'Maintenance' page)
and see if it works for you.. it worked for me :)

Just for information i am having a ADSL router of Sterlite(Firmware Version :2.11.38.0(UE0.C2)3.9.9.5)(provided by MTNL) and am using my own netgear wifi router on top of it,

Monday, October 4, 2010

How to Stop an Ajax request in prototype.js

Question is what will you do if you are using prototype.js(which is not having any abort method) for making a Ajax request and due to some circumstance you want to abort the ajax request raised. Well one can think that this is a narrow requirement, why will anybody need to do this because in the meantime request will be done and one might be having the response in return from server.

I hit this corner case where page content was loading from an Ajax request and which after rendering was firing another Ajax request to update the paginate-r(which is also self firing the request on response completion), but to my surprise i was not able to control the "Ajax request to update paginate-r" and hence i am creating the self firing request but am not able to destroy them.

And i don;t know for what reason there is no "ajaxRequest.abort()" method. And i found the answer from a narrow corner of http://blog.pothoven.net/2007/12/aborting-ajax-requests-for-prototypejs.html and it worked and just to increase the find-ability of this solution am re-writing the post.

introduce a method abort like this for prototype.js
Ajax.Request.prototype.abort = function(){
this.transport.onreadystatechange = Prototype.emptyFunction(); //prevent state change callbacks from being issues
this.transport.abort(); //abort the XHR
Ajax.activeRequestCount--; //updates the request counter
};

and then in your code
write it somewhere so that it is executed only once
<script>
var cw_paginator_request = null;
</script>

and then to assign the request if null else abort the request and fire a new request, like this
<script>
if(cw_paginator_request != null){
cw_paginator_request.abort();
}
cw_paginator_request = <%=remote_function(:url => {:controller => "some_controller", :action => "update_paginator", :id => @selected_id }) -%>;
</script>

Hopefully it might help somebody in need :)

Tuesday, July 13, 2010

Now what will you interpret from this?


This is from the showcase of a bookstore in CP, Delhi. What you(hindi reading) all can interpret from this?
Posted by Picasa

Monday, May 24, 2010

3 step Memcache install in ubuntu with rails binding

#To Install memecache
sudo apt-get install memcached
#To restart memcahce
/etc/init.d/memcached restart
#To install ruby binding gem to memecache
sudo gem install memcached




and to start memcache automatically on system startup
sudo gedit /etc/default/memcached
# Set this to yes to enable memcached.
ENABLE_MEMCACHED=yes

Saturday, May 22, 2010

3 step RMagick install in rail/ubuntu

sudo apt-get install imagemagick
sudo apt-get install libmagick9-dev
sudo apt-get install libmagickwand-dev
sudo gem install rmagick

yes thats it :)

Tuesday, May 4, 2010

Mirrored text is fine but why upside down

It has been really a while now.. have posted something here :) but its better late than never..
This post is about one of the head turning material that i got while i was going in for tea break on the other side of road (we do so because its small fun break even though we have very good pantry)





And i was wondering this is to seek attention of viewers and will act as publicity stunt or some more un-understandable logic behind it!! what you say??

Tuesday, October 20, 2009

Released BrokenCompass

So finally after much of ifs and buts and all hesitation have released a version of BrokenCompass.. Full text search engine built using ruby on rails and serving ruby on rails app.

Some of the features which are available as of now in this first release are..
  1. Able to work with all databases for which ruby in rails have no issues(examples shown in links uses mysql)
  2. Availability of extended_mode which allows to search in any particular attribute(from set of attributes which is used while in index creation)
  3. In extended_mode queries can have logical "&"(pronounced as 'and') and "|"(pronounced as 'or') between them(Not operator is not available still, but working out to release in next version).
  4. One can assign weight to set of attributes depending upon requirements and in response get weighted result and also sorted in descending order of weight of record.
  5. By default 20 records are returned as query response(which can be altered)
  6. look_in_brokencompass static method is attached to rails model to get inference of instantaneous parameter set. And to find using brokencompass static method is find_with_brokencompass("searchterm", :brokencompass = {}) and many other..

Here are few links(if interested, will be helpfull)
BrokenCompass: How to go about it
BrokenCompass - Install instructions

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...